Skip to content

Static Security CI Check - #167

Merged
alecbcs merged 6 commits into
llnl:mainfrom
cmelone:add/bandit-ci
Aug 27, 2025
Merged

Static Security CI Check#167
alecbcs merged 6 commits into
llnl:mainfrom
cmelone:add/bandit-ci

Conversation

@cmelone

@cmelone cmelone commented Aug 22, 2025

Copy link
Copy Markdown
Member

The Bandit Python security tool will be run for each PR, and any results
will be uploaded to GitHub's security dashboard for this repository.

GitHub's CodeQL feature is also enabled.

A bot will add inline comments to the PR if any issues are found. Example:

Screenshot 2025-08-22 at 10 16 42 AM

@github-actions github-actions Bot added ci Involving Project CI & Unit Tests dependencies Modifications to a Dependency File labels Aug 22, 2025
@github-advanced-security

Copy link
Copy Markdown
Contributor

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment thread src/hubcast/clients/github/auth.py Fixed
The Bandit Python security tool will be run for each PR, and any results
will be uploaded to GitHub's security dashboard for this repository.
@cmelone cmelone changed the title Add/bandit ci Static Security CI Check Aug 22, 2025
@cmelone
cmelone requested a review from alecbcs August 22, 2025 17:26

@alecbcs alecbcs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple quick suggestions. Otherwise this is looking good for me.

Comment thread .github/workflows/requirements/security.txt Outdated
Comment thread .github/workflows/security.yml Outdated
Comment thread .github/workflows/security.yml
Comment thread src/hubcast/clients/github/auth.py
Comment thread src/hubcast/clients/github/auth.py Fixed
- minimize requirements.txt for the security check
- use always() instead of || true to ensure the sarif file is uploaded
- add explanation to ignore check line

Co-authored-by: Caetano Melone <melone1@llnl.gov>
Co-authored-by: Alec Scott <scott112@llnl.gov>
Comment thread .github/workflows/security.yml Fixed
… trigger

Co-authored-by: Caetano Melone <melone1@llnl.gov>
Co-authored-by: Alec Scott <scott112@llnl.gov>
@cmelone
cmelone requested a review from alecbcs August 26, 2025 22:29
Comment thread .github/workflows/codeql.yml Outdated
@alecbcs

alecbcs commented Aug 26, 2025

Copy link
Copy Markdown
Member

Can we merge the CodeQL CI YAML file into the existing security CI YAML so that we run both out of a single file and they're triggered by the same conditions?

@cmelone

cmelone commented Aug 26, 2025

Copy link
Copy Markdown
Member Author

I'll try

Comment thread .github/workflows/security.yml Fixed
Comment thread .github/workflows/security.yml Fixed
@cmelone

cmelone commented Aug 26, 2025

Copy link
Copy Markdown
Member Author

ok @alecbcs that worked, though for some reason I needed to pull out the permissions into ci.yml from security.yml...

@alecbcs alecbcs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks @cmelone for the quick turnaround!

@alecbcs
alecbcs merged commit 81d9fce into llnl:main Aug 27, 2025
9 checks passed
@cmelone
cmelone deleted the add/bandit-ci branch August 27, 2025 16:15
cmelone added a commit to cmelone/repligit that referenced this pull request Sep 3, 2025
replica of llnl/hubcast#167 and
llnl/hubcast#169:

- adds Bandit (Python static security analysis) check to each PR
- enables GitHub's CodeQL feature
- adds permissions blocks to existing workflows
cmelone added a commit to llnl/repligit that referenced this pull request Sep 4, 2025
* ci: add security checks

replica of llnl/hubcast#167 and
llnl/hubcast#169:

- adds Bandit (Python static security analysis) check to each PR
- enables GitHub's CodeQL feature
- adds permissions blocks to existing workflows

* allow use of asserts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Involving Project CI & Unit Tests dependencies Modifications to a Dependency File

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants