代码之家  ›  专栏  ›  技术社区  ›  Dante

有没有办法使用DSL groovy脚本勾选“使用全局Veracode用户凭据”复选框?

  •  0
  • Dante  · 技术社区  · 6 年前

    我正在用DSL Groovy脚本创建Jenkins作业来添加Veracode插件。我正在寻找一种方法来勾选“使用全局Veracode用户凭据”复选框。

    它可以很好地与我的代码,并添加复选框,但不检查它为我,并正在寻找凭据。我想使用全球凭据。我把它加在了出版商的版块下。正如您在我的代码中看到的,在凭据部分下,我将凭据留空,因为我不想指定任何凭据。单击“使用全局Veracode用户凭据”复选框,省略这些参数并使用manage jenkins下指定的全局参数。

        publishers {
                //extendedEmail Utilities.getExtendedEmail("Scan_Services", false, false)
                extendedEmail Utilities.getExtendedEmailRequester("Scan_Services", false, false)
    
                veracodeNotifier {
                    // Enter the name of the application.
                    appname("xDistributor")
                    // Enter the business criticality for the application.
                    criticality("Very High")
                    // Enter a name for the static scan you want to submit to the Veracode Platform for this application.
                    version("$BUILD_TIMESTAMP" + " Services_Scan")
                    // Enter the filepaths of the files to upload for scanning, represented as a comma-separated list of    ant-style include patterns relative to the job's workspace root directory.
                    uploadincludespattern("**/Services/webapps/services.war")
                    createprofile(false)
                    sandboxname("")
                    createsandbox(false)
                    filenamepattern("")
                    replacementpattern("")
                    uploadexcludespattern("")
                    scanincludespattern("")
                    scanexcludespattern("")
                    waitForScan(false)
                    timeout("")
                    credentials {
                        vapicredential("")
                        vuser("")
                        vpassword("")
                    }
    
                }
            }
    
    0 回复  |  直到 6 年前
        1
  •  2
  •   kgengler    5 年前

    我无法从Veracode中找到任何关于这个的文档,所以我不得不反编译这个插件。这可以通过将credentials对象设置为空值来实现。

    job('job-name') {
        publishers {
            veracodeNotifier {
                credentials(null)
            }
        }
    }
    

    其工作方式是Veracode插件的配置设置不是检查字段的值,而是检查credentials对象是否为null,以及是否设置了全局凭据。