パイプラインでの Checkmarx スキャンの構成

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:13分
  • 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 と統合する トピックで指定されている手順を実行します。

    ハーネスパイプラインの場合、汎用の Docker コンテナイメージを介してのみ Checkmarx スキャンを構成できます。詳細については、「汎用 Docker コンテナイメージを使用したパイプラインのカスタムアクションの実装」を参照してください。

    1. パイプラインのステップに移動し、カスタムアクションを追加します。
      Azure DevOps
      1. パイプライン .yml ファイルに移動します。
      2. 右側の [タスク] セクションで、[ServiceNow DevOps セキュリティ結果 (ServiceNow DevOps Security Results)] 拡張タスクを検索します。
      3. ServiceNow エンドポイントを入力します。
      4. セキュリティ結果属性を次のように入力します。
        • 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.
      5. [追加] を選択して、カスタムアクションコードをパイプラインに追加します。
      Jenkins
      1. 構成されたパイプラインからパイプライン構文に移動します。
      2. [サンプルステップ (Sample Step)] リストから snDevOpsSecurityResult ステップを選択し、ステップのセキュリティスキャン属性の値を更新します。
      3. [パイプラインスクリプトを生成 (Generate Pipeline Script)] を選択してスニペットを作成します。スニペットをコピーしてパイプラインに貼り付けることができます。
        • 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.
      GitHub Actions
      1. ワークフロー .yml ファイルに移動します。
      2. 右側の [マーケットプレイス] セクションで、[ServiceNow DevOps セキュリティ結果 (ServiceNow DevOps Security Results)] カスタムアクションを検索します。
      3. 次のスニペットを .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.
      詳細については、「GitHub マーケットプレイス」を参照してください。
      Harness 次のスクリプトを使用するには、汎用 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: {}
    2. パイプラインを実行して、セキュリティスキャン結果を取得します。