3

i am trying the gitlab default secret detection option.

here is Gitlab CI file i am trying

include:
    - template: Security/Secret-Detection.gitlab-ci.yml

stages:
    - test

test:
  stage: test
  artifacts:
    reports:
      secret_detection: gl-secret-detection-report.json
  script:
    - pwd
    - ls
    - cat gl-secret-detection-report.json

i am not getting the file as artifacts.

error i am getting is :

cat: can't open 'gl-secret-detection-report.json': No such file or directory
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1

however in default stage of Gitlab it is creating the file

Uploading artifacts for successful job
00:03
Uploading artifacts...
gl-secret-detection-report.json: found 1 matching files and directories 
Uploading artifacts as "secret_detection" to coordinator... ok  id=1asdfas239 responseStatus=201 Created token=jT28Z-ot
Cleaning up file based variables
00:00
Job succeeded

so secret_detection stage is working which is default using template.

chagan lal
  • 95
  • 1
  • 6
  • I got the same problem. Were you able to resolve this issue? According to the docs https://docs.gitlab.com/ee/user/application_security/secret_detection/ the artifacts should be available in Merge request widget, Pipeline security report, Vulnerability Report. In my case they are not – Mike Apr 17 '23 at 06:52

0 Answers0