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

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:7分
  • Azure DevOps、Jenkins、GitHub、GitLab、または Harness パイプラインで Veracode スキャンを構成します。

    パイプラインの任意のステージで Veracode スキャンを構成でき、スキャンの詳細は対応するステージから DevOps 変更速度管理に取得されます。Azure DevOps または GitHub Actions オーケストレーションツールを使用している場合は、パイプラインにカスタムアクションコードを常に追加する必要があります。Jenkins を使用していて、パイプラインに Veracode セキュリティスキャンステップが既に含まれている場合は、パイプラインにカスタムアクションコードを追加する必要はありません。Veracode セキュリティスキャンステップに waitForScan: true があることを確認します。これは、システムがスキャン情報を取得するために必要です。

    GitLab ツール用に Veracode を構成する場合は、汎用 Docker コンテナイメージを使用して Veracode セキュリティステップを追加するか、「セキュリティツールを GitLab と統合する」トピックで指定された手順を実行できます。

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

    1. パイプラインのステップに移動し、カスタムアクションを追加します。
      Azure DevOps
      1. パイプライン .yml ファイルに移動します。
      2. 右側の [タスク] セクションで、[ServiceNow DevOps セキュリティ結果 (ServiceNow DevOps Security Results)] 拡張タスクを検索します。
      3. ServiceNow エンドポイントを入力します。
      4. セキュリティ結果属性を次のように入力します。
        
            {
                "scanner": "Veracode", "applicationName": "", "buildVersion": "", "securityToolId": "" 
            }

        scanner:スキャンツールであり、Veracode などが必要です。

        applicationName:Veracode アプリケーションの名前で、必須です。この属性は Veracode にのみ適用されます。

        buildVersion:Veracode スキャン名/ビルドバージョンで、オプションです。この属性は Veracode にのみ適用されます。

        securityToolId:ServiceNow にオンボーディングされたセキュリティツール (オンボーディングされたセキュリティツールのsys_id)で、オプションです。

      5. [追加] を選択して、カスタムアクションコードをパイプラインに追加します。
      Jenkins
      1. 構成されたパイプラインからパイプライン構文に移動します。
      2. [サンプルステップ (Sample Step)] リストから snDevOpsSecurityResult ステップを選択し、ステップのセキュリティスキャン属性の値を更新します。
      3. [パイプラインスクリプトを生成 (Generate Pipeline Script)] を選択してスニペットを作成します。スニペットをコピーしてパイプラインに貼り付けることができます。
        snDevOpsSecurityResult { 
        securityResultAttributes:{"scanner":"Veracode", "applicationName": "", "buildVersion": "", "securityToolId": ""}}

        scanner:スキャンツールであり、Veracode などが必要です。

        applicationName:Veracode アプリケーションの名前で、必須です。この属性は Veracode にのみ適用されます。

        buildVersion:Veracode スキャン名/ビルドバージョンで、オプションです。この属性は Veracode にのみ適用されます。

        securityToolId:ServiceNow にオンボーディングされたセキュリティツール (オンボーディングされたセキュリティツールのsys_id)で、オプションです。

      GitHub Actions
      1. ワークフロー .yml ファイルに移動します。
      2. 右側の [マーケットプレイス] セクションで、[ServiceNow DevOps セキュリティ結果 (ServiceNow DevOps Security Results)] カスタムアクションを検索します。
      3. 次のスニペットを .yml ファイルに追加します。
        
            SecurityScanResults:
                needs: build
                runs-on: ubuntu-latest
                name: Servicenow Security Scan Results
        
            steps:
              - name: ServiceNow DevOps Security Results
                uses: ServiceNow/servicenow-devops-security-result@v1.39.0
                with:
                    devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }}
                    devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }}
                    instance-url: ${{ secrets.SN_INSTANCE_URL }}
                    tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }}
                    context-github: ${{ toJSON(github) }}
                    job-name: 'Servicenow Security Scan Results'
                    security-result-attributes: '{ "scanner": "Veracode", "applicationName": "", "buildVersion": "", "securityToolId": ""}

        scanner:スキャンツールであり、Veracode などが必要です。

        applicationName:Veracode アプリケーションの名前で、必須です。この属性は Veracode にのみ適用されます。

        buildVersion:Veracode スキャン名/ビルドバージョンで、オプションです。この属性は Veracode にのみ適用されます。

        securityToolId:ServiceNow にオンボーディングされたセキュリティツール (オンボーディングされたセキュリティツールのsys_id)で、オプションです。

      詳細については、「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. パイプラインを実行して、セキュリティスキャン結果を取得します。