Skip to content

Commit 6906ced

Browse files
committed
org rules
1 parent a04b86b commit 6906ced

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/semprep.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: zizmor GitHub Actions static analysis
1+
name: Semgrep static analysis
22
on:
33
push:
44
pull_request:
@@ -22,7 +22,15 @@ jobs:
2222
# A Docker image with Semgrep installed. Do not change this.
2323
image: semgrep/semgrep
2424
steps:
25-
# Fetch project source with GitHub Actions Checkout. Use either v3 or v4.
25+
# Fetch project source with GitHub Actions Checkout.
2626
- uses: actions/checkout@v4
27-
# Run the "semgrep scan" command on the command line of the docker image.
28-
- run: semgrep scan --config auto
27+
28+
# Fetch org-wide custom Semgrep rules from the central repository.
29+
- uses: actions/checkout@v4
30+
with:
31+
repository: grafana/security-github-actions
32+
path: .semgrep-org-rules
33+
sparse-checkout: sempgrep/custom-rules.yaml
34+
35+
# Run semgrep with: auto rules + org-wide shared rules
36+
- run: semgrep scan --config auto --config .semgrep-org-rules/.semgrep/

semgrep/custom-rules.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rules:
2+
- id: deny-actions-create-github-app-token
3+
patterns:
4+
- pattern-regex: "uses:\\s*actions/create-github-app-token"
5+
paths:
6+
include:
7+
- "*.yaml"
8+
- "*.yml"
9+
message: >
10+
Do not use actions/create-github-app-token. Use the organization's
11+
approved alternative for generating GitHub App tokens.
12+
languages: [generic]
13+
severity: ERROR

0 commit comments

Comments
 (0)