Skip to content

Demo: glsec findings as code scanning annotations - #2

Open
predictor2718 wants to merge 1 commit into
mainfrom
demo/pipeline-findings
Open

predictor2718 wants to merge 1 commit into
mainfrom
demo/pipeline-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, each with the rule's title, severity and help.

Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com>
predictor2718 added a commit that referenced this pull request Oct 26, 2026
Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com>
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
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