パイプラインで Checkmarx スキャンを構成する
Azure DevOps、Jenkins、GitHub、GitLab、または Harness パイプラインで Checkmarx スキャンを構成します。
パイプラインの任意のステージで Checkmarx スキャンを構成でき、スキャンの詳細は対応するステージから DevOps 変更速度管理に取得されます。Azure DevOps または GitHub Actions オーケストレーション ツールを使用している場合は、パイプラインにカスタム アクション コードを常に追加する必要があります。Jenkins を使用していて、パイプラインに Checkmarx One セキュリティスキャン (checkmarxASTScanner) ステップがすでに含まれている場合は、パイプラインにカスタムアクションコードを追加する必要はありません。Checkmarx SASTの場合、セキュリティ・スキャン・ステップ(checkmarxASTScanner)がある場合でも、カスタム・アクション・コードをパイプラインに追加する必要があります。
GitLab ツール用に Checkmarx を構成する場合は、汎用 Docker コンテナーイメージを使用して Checkmarx セキュリティステップを追加するか、 セキュリティツールとのデータ連携 GitLab トピックで指定されたステップを実行できます。
ハーネスパイプラインの場合、Checkmarx スキャンは汎用 Docker コンテナイメージでのみ設定できます。詳細については、「汎用 Docker コンテナイメージを使用したパイプラインのカスタムアクションの実装」を参照してください。
- パイプラインのステップに移動し、カスタムアクションを追加します。
Azure DevOps - パイプライン.ymlファイルに移動します。
- 右側の [ タスク ] セクションで、 ServiceNow DevOps セキュリティ結果 拡張タスクを検索します。
- ServiceNow エンドポイントを入力します。
- セキュリティ結果属性を次のように入力します。
- Checkmarx SAST
- task: ServiceNow-DevOps-Build-Security-Results@1 inputs: connectedServiceName: "" # ServiceNow DevOps Change Velocity Service Connection securityResultAttributes: | {"scanner": "Checkmarx SAST", "projectId": "", "securityToolId": ""} # scanner: Scanning tool and is required e.g. Checkmarx SAST. # projectId: Id of your Checkmarx SAST project and is required. This attribute is applicable only for Checkmarx SAST. # securityToolId: Security tool onboarded in ServiceNow (sys_id of the onboarded security tool) and is optional. - Checkmarx One(チェックマルクス・ワン)
- task: ServiceNow-DevOps-Build-Security-Results@1 inputs: connectedServiceName: "" # ServiceNow DevOps Change Velocity Service Connection securityResultAttributes: | {"scanner": "Checkmarx One", "projectName": "", "projectId": "", "scanId": "", "securityToolId": ""} # scanner: Scanning tool and is required e.g. Checkmarx One. # projectName: Name of your Checkmarx One project and is required. This attribute is applicable only for Checkmarx One. # projectId: Id of your Checkmarx One project and can be used instead of projectName field. This attribute is applicable only for Checkmarx One. # scanId: Checkmarx One scan id and is optional. This attribute is applicable only for Checkmarx One. # securityToolId: Security tool onboarded in ServiceNow (sys_id of the onboarded security tool) and is optional.
- Checkmarx SAST
- [ 追加 ] を選択して、カスタム アクション コードをパイプラインに追加します。
Jenkins - 構成されたパイプラインからパイプライン構文に移動します。
- [サンプルステップ] リストから snDevOpsSecurityResult ステップを選択し、ステップのセキュリティスキャン属性の値を更新します。
- [ パイプラインスクリプトを生成] を選択してスニペットを作成します。スニペットをコピーしてパイプラインに貼り付けることができます。
- Checkmarx SAST
snDevOpsSecurityResult securityResultAttributes: '{"scanner": "Checkmarx SAST", "projectId": "", "securityToolId": ""}' // scanner: Scanning tool and is required e.g. Checkmarx SAST. // projectId: Id of your Checkmarx SAST project and is required. This attribute is applicable only for Checkmarx SAST. // securityToolId: Security tool onboarded in ServiceNow (sys_id of the onboarded security tool) and is optional. - Checkmarx One(チェックマルクス・ワン)
snDevOpsSecurityResult securityResultAttributes: '{"scanner": "Checkmarx One", "projectName": "", "projectId": "", "scanId": "", "securityToolId": ""}' // scanner: Scanning tool and is required e.g. Checkmarx One. // projectName/projectId: Name/Id of your Checkmarx One project and is required. This attribute is applicable only for Checkmarx One. // scanId: Checkmarx One scan id and is optional. This attribute is applicable only for Checkmarx One. // securityToolId: Security tool onboarded in ServiceNow (sys_id of the onboarded security tool) and is optional.
- Checkmarx SAST
GitHub Actions - ワークフロー.ymlファイルに移動します。
- 右側の [マーケットプレイス ] セクションで、[ ServiceNow DevOps セキュリティ結果 ] カスタムアクションを検索します。
- 次のスニペットを.ymlファイルに追加します。
- Checkmarx SAST
ServiceNowSecurityScanResults: # jobs that must complete successfully before this job will run needs: build # type of machine to run the job on runs-on: ubuntu-latest name: ServiceNow Security Scan Results steps: - name: ServiceNow DevOps Security Results uses: ServiceNow/servicenow-devops-security-result@v3.0.0 with: # Devops Integration User Name devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }} # Devops Integration User Password devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }} # ServiceNow Instance URL instance-url: ${{ secrets.SN_INSTANCE_URL }} # Orchestration Tool Id tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} # GitHub Context context-github: ${{ toJSON(github) }} # Display Name of the Job job-name: 'ServiceNow Security Scan Results' security-result-attributes: '{"scanner": "Checkmarx SAST", "projectId": "", "securityToolId": ""}' # scanner: Scanning tool and is required e.g. Checkmarx SAST. # projectId: Id of your Checkmarx SAST project and is required. This attribute is applicable only for Checkmarx SAST. # securityToolId: Security tool onboarded in ServiceNow (sys_id of the onboarded security tool) and is optional. - Checkmarx One(チェックマルクス・ワン)
ServiceNowSecurityScanResults: # jobs that must complete successfully before this job will run needs: build # type of machine to run the job on runs-on: ubuntu-latest name: ServiceNow Security Scan Results steps: - name: ServiceNow DevOps Security Results uses: ServiceNow/servicenow-devops-security-result@v3.0.0 with: # Devops Integration User Name devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }} # Devops Integration User Password devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }} # ServiceNow Instance URL instance-url: ${{ secrets.SN_INSTANCE_URL }} # Orchestration Tool Id tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} # GitHub Context context-github: ${{ toJSON(github) }} # Display Name of the Job job-name: 'ServiceNow Security Scan Results' security-result-attributes: '{"scanner": "Checkmarx One", "projectName": "", "projectId": "", "scanId": "", "securityToolId": ""}' # scanner: Scanning tool and is required e.g. Checkmarx One. # projectName/projectId: Name/Id of your Checkmarx One project and is required. This attribute is applicable only for Checkmarx One. # scanId: Checkmarx One scan id and is optional. This attribute is applicable only for Checkmarx One. # securityToolId: Security tool onboarded in ServiceNow (sys_id of the onboarded security tool) and is optional.
- Checkmarx SAST
馬具 汎用 Docker コンテナイメージを実行して、次のスクリプトを使用します。詳細については、「汎用 Docker コンテナイメージを使用したパイプラインのカスタムアクションの実装」を参照してください。 - stage: name: ServiceNow DevOps Security Result identifier: Security description: "" type: Custom spec: execution: steps: - stepGroup: name: Security identifier: Security steps: - step: type: Run name: ServiceNow DevOps Security Result identifier: ServiceNow_DevOps_Security_Result spec: connectorRef: docker_hub_connector_for_harness image: servicenowdocker/sndevops:5.0.0 shell: Sh command: |- sndevopscli create securityScan -p "{"pipelineInfo":{ "buildNumber":"<+stage.nodeExecutionId>", "taskExecutionUrl":"<+pipeline.executionUrl>?stage=<+stage.nodeExecutionId>", "orchestrationPipeline":"<+org.identifier>/<+project.identifier>/<+pipeline.name>" }, "securityResultAttributes":{ "scanner":"Veracode", "applicationName":"", "buildVersion":"", "securityToolId":"" } }" envVariables: SNOW_URL: <+variable.SNOW_URL> SNOW_TOOLID: <+variable.SNOW_TOOLID> SNOW_TOKEN: <+variable.SNOW_TOKEN> stepGroupInfra: type: KubernetesDirect spec: connectorRef: kubernates_connector namespace: harness-delegate-ng tags: {} - パイプラインを実行してセキュリティスキャン結果を取得します。