파이프라인에서 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 단계를 수행할 수 있습니다.
하네스 파이프라인의 경우 일반 Docker 컨테이너 이미지를 통해서만 Checkmarx 스캔을 구성할 수 있습니다. 자세한 내용은 일반 Docker 컨테이너 이미지를 사용하여 파이프라인에 대한 사용자 지정 작업 구현 문서를 참조하십시오.
- 파이프라인의 단계로 이동하여 사용자 지정 작업을 추가합니다.
Azure DevOps - 파이프라인 .yml 파일로 이동합니다.
- 오른쪽의 작업 섹션에서 ServiceNow DevOps 보안 결과 확장 작업을 검색합니다.
- ServiceNow 엔드포인트를 입력합니다.
- 다음과 같이 보안 결과 속성을 입력합니다.
- 체크막스 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. - 체크막스 원
- 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.
- 체크막스 SAST
- 추가를 선택하여 파이프라인에 사용자 지정 작업 코드를 추가합니다.
젠킨스 - 구성된 파이프라인에서 파이프라인 구문으로 이동합니다.
- 샘플 단계 목록에서 snDevOpsSecurityResult 단계를 선택하고 단계에서 보안 검사 속성 값을 업데이트합니다.
- 파이프라인 스크립트 생성을 선택하여 스니펫을 생성합니다. 스니펫을 복사하여 파이프라인에 붙여넣을 수 있습니다.
- 체크막스 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. - 체크막스 원
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.
- 체크막스 SAST
GitHub 작업 - 워크플로우 .yml 파일로 이동합니다.
- 오른쪽의 마켓플레이스 섹션에서 ServiceNow DevOps 보안 결과 사용자 지정 작업을 검색합니다.
- .yml 파일에 다음 코드 조각을 추가합니다.
- 체크막스 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. - 체크막스 원
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.
- 체크막스 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: {} - 파이프라인을 실행하여 보안 검사 결과를 검색합니다.