Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that action scanning is actually work. #4

Merged
merged 5 commits into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/action_scanning.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
### Required actions to scan GitHub action workflows for security issues.
name: Scan GitHub Action workflows files for security issues

on:
pull_request:
paths:
- '.github/workflows/**.ya?ml'
pull_request: {}
workflow_dispatch: {}
push:
paths:
paths:
- '.github/workflows/**.ya?ml'
schedule:
schedule:
- cron: '39 3 * * 3'

permissions:
@@ -24,7 +23,7 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name Initialize CodeQL
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: actions
@@ -55,7 +54,7 @@ jobs:
env:
GH_REPO_OWNER: ${{ github.repository_owner }}
with:
repository: '${{ env.GH_REPO_OWNER }}/.github'
repository: '${{ env.GH_REPO_OWNER }}/github-team'
path: action_scanning

- name: Run Actions semgrep scan
15 changes: 15 additions & 0 deletions semgrep-rules/actions/pull_request_target_needs_exception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rules:
- id: pull-request-target-needs-exception
languages:
- yaml
severity: ERROR
message: pull_request_target is considered very risky and should only be used when striclty needed. Please prefer other triggers when possible.
metadata:
category: best-practice
technology:
- github-actions
patterns:
- pattern-either:
- patterns:
- pattern-inside: "{on: ...}"
- pattern: pull_request_target