跳到主要内容
版本:v0.21

GitLab CI

在需要扫描的仓库中创建 .gitlab-ci.yml

stages:
- security

amwscan:
stage: security
image:
name: marcocesarato/php-antimalware-scanner:latest
entrypoint: [""]
script:
- mkdir -p amwscan-output
- >-
php /usr/local/bin/scanner "$CI_PROJECT_DIR"
--lite --report-only --report-format=sarif
--path-report="$CI_PROJECT_DIR/amwscan-output/amwscan-report.sarif"
--disable-checksum --disable-definitions-update
artifacts:
when: always
paths:
- amwscan-output/amwscan-report.sarif
expire_in: 30 days

GitLab 会在扫描器镜像中检出仓库。when: always 制品设置可在发现结果返回退出代码 1 时保留 SARIF 报告。