首页 > 解决方案 > 在 SonarQube 中的项目上自动设置 Checkmarx 配置

问题描述

亲爱的 stackoverflow 社区;

我使用:SonarQube 6.7.6 和 Checkmarx 插件:8.60.0

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

为 Checkmarx SonarQube 插件配置项目中所述

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

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

谁能帮我 ?

非常感谢。沃宁

标签: sonarqubecheckmarx

解决方案


Checkmarx 设置可以通过多次发布调用在 SonarQube 中进行配置

邮政/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}

获取相应的键和值

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


推荐阅读