在Jenkins文本查找器中,如何忽略正则表达式?

时间:2018-03-27 19:24:18

标签: jenkins jenkins-plugins

我们在安装中使用Text-finder Plugin。我创建了一个运行testssh.sh脚本的作业,该脚本测试SSL漏洞并生成类似......

的输出
###########################################################
    testssl.sh       2.9dev from https://testssl.sh/dev/
    (653827c 2018-03-27 09:10:55 -- )

      This program is free software. Distribution and
             modification under GPLv2 permitted.
      USAGE w/o ANY WARRANTY. USE IT AT YOUR OWN RISK!

       Please file bugs @ https://testssl.sh/bugs/

###########################################################

 Using "OpenSSL 1.0.2-chacha (1.0.2i-dev)" [~183 ciphers]
 on rtp-scm-lnx27:./bin/openssl.Linux.x86_64
 (built: "Jun 22 19:32:29 2016", platform: "linux-x86_64")


 Start 2018-03-27 19:13:14        -->> 171.xx.xx.xx:443 (server) <<--

 rDNS (171.xx.xx.xx):   server.company.xom.
 Service detected:       HTTP


 Testing vulnerabilities 

 Heartbleed (CVE-2014-0160)                not vulnerable (OK), timed out
 CCS (CVE-2014-0224)                       not vulnerable (OK)
 Ticketbleed (CVE-2016-9244), experiment.  not vulnerable (OK), no session ticket extension
 ROBOT                                     Server does not support any cipher suites that use RSA key transport
 Secure Renegotiation (CVE-2009-3555)      not vulnerable (OK)
 Secure Client-Initiated Renegotiation     not vulnerable (OK)
 CRIME, TLS (CVE-2012-4929)                not vulnerable (OK)
 BREACH (CVE-2013-3587)                    no HTTP compression (OK)  - only supplied "/" tested
 POODLE, SSL (CVE-2014-3566)               not vulnerable (OK)
 TLS_FALLBACK_SCSV (RFC 7507)              No fallback possible, no protocol below TLS 1.2 offered (OK)
 SWEET32 (CVE-2016-2183, CVE-2016-6329)    not vulnerable (OK)
 FREAK (CVE-2015-0204)                     not vulnerable (OK)
 DROWN (CVE-2016-0800, CVE-2016-0703)      not vulnerable on this host and port (OK)
                                           make sure you don't use this certificate elsewhere with SSLv2 enabled services
                                           https://censys.io/ipv4?q=B61548F40207FBEE731E439051A01514103AA14EDA907CF9E38FE735C89491EA could help you to find out
 LOGJAM (CVE-2015-4000), experimental      Common prime with 2048 bits detected: RFC3526/Oakley Group 14,
                                           but no DH EXPORT ciphers
 BEAST (CVE-2011-3389)                     no SSL3 or TLS1 (OK)
 LUCKY13 (CVE-2013-0169), experimental     potentially VULNERABLE, uses cipher block chaining (CBC) ciphers with TLS. Check patches
 RC4 (CVE-2013-2566, CVE-2015-2808)        no RC4 ciphers detected (OK)


 Done 2018-03-27 19:13:59 [  46s] -->>

 171.xx.xx.xx:443 (server) <<--

如果它看到“VULNERABLE”而不是“潜在的弱势”,我怎么能让它失败呢,我希望上面的输出能够通过作业,但是现在它失败了,因为我告诉它在控制台中搜索“VULNERABLE”当然它出现在“潜在的脆弱”一词中

谢谢!

1 个答案:

答案 0 :(得分:0)

使用negative lookbehind指示正则表达式仅在VULNERABLE之前可能匹配时匹配,即以下正则表达式应仅匹配VULNERABLE而不是potentially VOLNERABLE }

(?<!potentially )VULNERABLE