Repository navigation
Add linter: glsec - #1188
Open
predictor2718 wants to merge 1 commit into
Open
Add linter: glsec#1188predictor2718 wants to merge 1 commit into
predictor2718 wants to merge 1 commit into
Conversation
Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds glsec as a linter. I maintain glsec; it is a security linter for GitLab CI/CD pipelines, for GitLab what zizmor and actionlint are for GitHub Actions. It reports mutable images and includes, script injection through branch names and commit messages, secrets in
variables:, unprotected deployments and similar issues.Notes on the definition:
gitlab-ciin the plugin, as renovate does for its config:.gitlab-ci.ymland anything ending in.gitlab-ci.yml.glsec --format sarif --no-color ${target}. glsec exits 1 when it finds error-level issues, sosuccess_codes: [0, 1]; exit 2 is a parse or usage error.sandbox_type: copy_targets. glsec refuses a pipeline file that is a symbolic link out of its directory (a guard against reading files outside the repository), and in the default sandbox the target is such a link. Without this the test shows two task failures and no issues.issue_url_formatpoints at the rule pages on https://glsec.github.io/rules/.suggest_if: files_present, sotrunk initsuggests it when a pipeline file exists..gitlab-ci.yml, the same way the zizmor test moves its inputs under.github/workflows.Testing, run in a Node 22 container with trunk 1.25.0:
npm test linters/glsecpasses; the snapshot has GL001 (mutable image tag), GL011 (curl piped to sh) and GL024 (pipe without pipefail) and no task failures.npm test tests/repo_tests: 236 passed.trunk check --upstream upstream/main: no new issues.