Skip to content

Commit

Permalink
Create azure-pipelines-checkov.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: ҉αkα x⠠⠵ <[email protected]>
  • Loading branch information
4k4xs4pH1r3 authored Dec 18, 2024
1 parent c041f58 commit d822f51
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions DevSecOps/azure-pipelines-checkov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
trigger:
branches:
include:
- master

pool:
vmImage: 'ubuntu-latest'

stages:
- stage: Checkov_Scan
jobs:
- job: Checkov_Scan
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
- script: |
pip install --quiet checkov && pip install --quiet --upgrade checkov
export CKV_OPENAI_MAX_FINDINGS="0"
mkdir -p "$(Build.ArtifactStagingDirectory)/vulns"
checkov -d . --quiet \
--output cli \
--output csv \
--output-file-path "$(Build.ArtifactStagingDirectory)/vulns/" \
--enable-secret-scan-all-files \
--deep-analysis \
--create-baseline \
--run-all-external-checks \
--external-checks-dir devsecops/checkov/cloudformation/checks/resource/aws/ \
--include-all-checkov-policies \
--framework cloudformation \
--openai-api-key "$oai" \
--summary-position bottom \
--no-fail-on-crash \
|| true
displayName: 'Run Checkov Scan'
env:
oai: $(oai)
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/vulns'
artifact: 'checkov-results'

- stage: Checkov_Scan_Soft_Fail
jobs:
- job: Checkov_Scan_Soft_Fail
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
- script: |
pip install --quiet checkov && pip install --quiet --upgrade checkov
export CKV_OPENAI_MAX_FINDINGS="0"
mkdir -p "$(Build.ArtifactStagingDirectory)/vulns"
checkov -d . --quiet \
--output cli \
--output csv \
--output-file-path "$(Build.ArtifactStagingDirectory)/vulns/" \
--enable-secret-scan-all-files \
--deep-analysis \
--create-baseline \
--run-all-external-checks \
--external-checks-dir devsecops/checkov/cloudformation/checks/resource/aws/ \
--include-all-checkov-policies \
--framework cloudformation \
--openai-api-key "$oai" \
--summary-position bottom \
--no-fail-on-crash \
--soft-fail \
|| true
displayName: 'Run Checkov Scan (Soft Fail)'
env:
oai: $(oai)
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/vulns'
artifact: 'checkov-results-soft-fail'

0 comments on commit d822f51

Please sign in to comment.