-
Notifications
You must be signed in to change notification settings - Fork 172
Add CodeQL and Bandit Static Analysis Scans #560
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
513be56
Add CodeQL and Bandit Static Analysis Scans
kkraus14 b08572d
Add concurrency groups and cancel in progress
kkraus14 67cd71a
Add bandit to pre-commit
kkraus14 0c2458b
Change CodeQL workflow to only be manually triggered for now
kkraus14 95238cf
skip bandit on pre-commit.ci
kkraus14 4d7632c
Revert "Change CodeQL workflow to only be manually triggered for now"
kkraus14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "Static Analysis: Bandit Scan" | ||
|
||
on: | ||
push: | ||
branches: | ||
- "pull-request/[0-9]+" | ||
- "main" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
analyze: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
security-events: write | ||
steps: | ||
- name: Perform Bandit Analysis | ||
uses: PyCQA/bandit-action@8a1b30610f61f3f792fe7556e888c9d7dffa52de # v1.0.0 | ||
leofang marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: "Static Analysis: CodeQL Scan" | ||
|
||
on: | ||
push: | ||
branches: | ||
- "pull-request/[0-9]+" | ||
- "main" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
|
||
kkraus14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
jobs: | ||
analyze: | ||
name: Analyze (${{ matrix.language }}) | ||
runs-on: ubuntu-latest | ||
permissions: | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
kkraus14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
matrix: | ||
include: | ||
- language: python | ||
build-mode: none | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
leofang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
build-mode: ${{ matrix.build-mode }} | ||
queries: security-extended | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:${{matrix.language}}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,16 +6,20 @@ ci: | |
autoupdate_branch: '' | ||
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' | ||
autoupdate_schedule: quarterly | ||
skip: [] | ||
skip: [bandit] | ||
kkraus14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
submodules: false | ||
|
||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.11.4 | ||
rev: 971923581912ef60a6b70dbf0c3e9a39563c9d47 #v0.11.4 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --show-fixes] | ||
- id: ruff-format | ||
- repo: https://github.com/PyCQA/bandit | ||
rev: 8ff25e07e487f143571cc305e56dd0253c60bc7b #v1.8.3 | ||
hooks: | ||
- id: bandit | ||
Comment on lines
+19
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does pin the version of Bandit to v1.8.3 which could cause mismatches between this and the GitHub workflow. |
||
|
||
default_language_version: | ||
python: python3 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.