Checkov u daha önce terrafom icin CI da pre-commit ile kullanmistim ancak bu sefer ansible icin benzeri bir yapi bulamadim ancak docker ile bagimsiz olarak kullandim.
Önce gitlab-ci dan örnek
ansible_checkov:
stage: ansible_checkov
allow_failure: true
image:
name: bridgecrew/checkov:latest
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
script:
- skipcheck="--skip-check CKV2_GHA_1"
- checkov -d . -o junitxml $skipcheck |tee checkov_report.xml
artifacts:
reports:
junit: checkov_report.xml
paths:
- checkov_report.xml
Bu örnekte ayrica junit tarzi raporla yapilan tüm testleri gitlab-ci da güzelce display edilmesini de saglamis oluyorum.