Script steps¶
Steps for policies that inspect composed GitLab CI job scripts
(before_script, script, after_script, and effective_script).
Given¶
Given I have any job with effective script definedGiven I have any job with script definedGiven I have any job with before_script defined
When¶
When a variable is expanded within a commandWhen variables are used as part of a pathWhen command substitution is usedWhen an array is expandedWhen the effective script has more than 1 lineWhen a pipeline is usedWhen rm is used recursivelyWhen temporary files are required
Then¶
Then the variable must be wrapped in double quotesThen pipefail must be enabledThen eval must not be usedThen untrusted remote scripts must not be executedThen script downloads must verify checksumsThen package installs of type "{manager}" must use pinned versionsThen unresolved script references must not be present
Existing property matchers also work once scripts are on job entities:
Then its effective script must not match "curl[^\\n]*\\|\\s*(ba)?sh"