Skip to content

Commit

Permalink
Check for exposed GitLab CI configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
mestizo committed Oct 31, 2024
1 parent d49dba9 commit 5a66509
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions other/files/configs/gitlab-ci-discovery.bcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
metadata:
language: v2-beta
name: "GitLab CI Exposure"
description: "Tests for exposed GitLab CI files"
author: "Patrick Harrison"
tags: "exposure", "gitlab", "config", "file"

run for each:
potential_path = "/.gitlab-ci.yml"

given host then
send request called check:
method: "GET"
path: {potential_path}

if "stage" in {check.response.body} then
report issue:
severity: low
confidence: firm
detail: `GitLab CI file found at {check.request.url}`
remediation: "Ensure your configuration files are not exposed."
end if

0 comments on commit 5a66509

Please sign in to comment.