在 SonarQube 的项目上自动设置 Checkmarx 配置

Automatically set Checkmarx configuration on project in SonarQube

尊敬的 Whosebug 社区;

我使用:带有 Checkmarx 插件的 SonarQube 6.7.6:8.60.0

我需要在安全分析期间使用 Checkmarx 信息在 SonarQube 中配置我的项目,以便在 SonarQube 分析步骤中,它可以检索它们并使用所有 Checkmarx 分析数据填充项目。

Configuring a Project for the Checkmarx SonarQube Plugin 所述。

我可以手动完成,但我的管道最好自动完成。 例如,我如何通过 Rest Api 在 SonarQube 分析(服务器 Url、用户名、密码等)或一些分析属性之前设置此项目配置,以便自动获取它们。

我在 SonarQube 上找不到 Rest Api 来做到这一点。

谁能帮帮我?

非常感谢。 沃格宁

可以通过多次 post 调用在 SonarQube 中配置 Checkmarx 设置

POST /api/settings/set?component=${sonarProjectKey}

component=${sonarProjectKey}
key=checkmarx.server.credentials.secured
value={
  cxServerUrl: ${cxServerUrl},
  cxUsername: ${cxUser},
  cxPassword: ${cxPassword}
}
component=${sonarProjectKey}
key=checkmarx.server.project_name.secured
value=${projectName}
component=${sonarProjectKey}
key=checkmarx.server.remediation
value=${minutes}

获取对应的key&value

获取/api/settings/values?keys=checkmarx.server.remediation&component=${sonarProjectKey}