glsec

Rules / GL071

GL071 Manual approval gate without allow_failure: false

Severity: warn
OWASP: CICD-SEC-1 – Insufficient Flow Control Mechanisms

What glsec checks

glsec flags a job that looks like a manual approval gate in front of a production deploy but does not actually block the pipeline.

GitLab distinguishes two kinds of manual jobs (job control docs):

A top-level when: manual job placed before a production deploy is therefore a no-op gate: the deploy runs regardless of whether the "approval" was ever clicked.

A job is flagged when all of the following hold:

Trigger example

stages: [build, approve, deploy]

approve_prod:
  stage: approve
  when: manual          # optional → allow_failure: true by default
  script: [echo approved]

deploy_prod:
  stage: deploy
  environment: production
  script: [./deploy.sh]  # runs even if approve_prod was never triggered

Safe alternative

Make the gate blocking with allow_failure: false:

approve_prod:
  stage: approve
  when: manual
  allow_failure: false  # pipeline stops here until triggered
  script: [echo approved]

Or move the manual condition into rules:, where it is blocking by default:

approve_prod:
  stage: approve
  rules:
    - when: manual
  script: [echo approved]

What is not flagged

References

Documentation for glsec 1.23.0. Source of this page · Rule implementation