Skip to content

Demo: glsec findings as code scanning annotations - #1

Closed
predictor2718 wants to merge 1 commit into
mainfrom
demo/findings
Closed

predictor2718 wants to merge 1 commit into
mainfrom
demo/findings

Conversation

@predictor2718

Copy link
Copy Markdown
Member

Kept open on purpose as a demo, not meant to be merged.

main holds a clean pipeline. This pull request turns bad-pipeline.yml into the example from glsec.github.io/reports, and the glsec workflow uploads its SARIF report to code scanning. The findings show up as annotations on the changed lines under Files changed, and as alerts in the code scanning results of this pull request.

Comment thread bad-pipeline.yml
- set -x
- curl -sSL https://get.example.com/install.sh | sh
- 'curl -H "Authorization: Bearer $DEPLOY_TOKEN" "https://hooks.example.com/deploy?branch=$CI_COMMIT_REF_NAME"'
- ssh -o StrictHostKeyChecking=no deploy@prod.example.com ./release.sh
Comment thread bad-pipeline.yml
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
include:
- project: platform/ci-templates
ref: main
Comment thread bad-pipeline.yml
- template: Security/Secret-Detection.gitlab-ci.yml

variables:
DOCKER_AUTH_CONFIG: '{"auths":{"registry.example.com":{"auth":"ZGVwbG95OnMzY3IzdA=="}}}'
Comment thread bad-pipeline.yml

build:
stage: build
image: node:latest
Comment thread bad-pipeline.yml
expire_in: 1 week
paths:
- dist/
- .env
Comment thread bad-pipeline.yml

secret_detection:
rules:
- when: never
Comment thread bad-pipeline.yml
image: node:22.11.0
script:
- npm ci
- echo Running tests for $CI_COMMIT_REF_NAME
Comment thread bad-pipeline.yml
stage: build
image: docker:27.3.1
services:
- docker:27.3.1-dind
Comment thread bad-pipeline.yml
stage: build
image: node:latest
script:
- npm install
Comment thread bad-pipeline.yml
@@ -1,12 +1,62 @@
# The same service before the changes in the demo pull request: no findings.
# The pipeline of a small Node.js service, with the kind of security mistakes
Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com>
@predictor2718

Copy link
Copy Markdown
Member Author

Replaced by a new demo pull request: the review comments on this one were written before glsec 1.24.1 added rule titles to its SARIF, and GitHub doesn't update them.

@predictor2718
predictor2718 deleted the demo/findings branch October 26, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants