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

feat: add semgrep security issues scanning #961

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

cohow
Copy link

@cohow cohow commented Sep 14, 2024

@cohow cohow requested a review from rndquu as a code owner September 14, 2024 20:47
Copy link
Member

@rndquu rndquu left a comment

Choose a reason for hiding this comment

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

In the provided QA run the Run semgrep ci --sarif --output=semgrep.sarif || true step has this output:

Scanning 1 file tracked by git with 54 Code rules:
Nothing to scan.
Current version has 0 findings.

It seems there's smth wrong with the workflow setup because nothing was scanned. Pls refactor accordingly and make sure semgrep is run against https://github.com/ubiquity/ubiquity-dollar/tree/development/packages/contracts/src/dollar.

@cohow
Copy link
Author

cohow commented Sep 17, 2024

In the provided QA run the Run semgrep ci --sarif --output=semgrep.sarif || true step has this output:

Scanning 1 file tracked by git with 54 Code rules:
Nothing to scan.
Current version has 0 findings.

It seems there's smth wrong with the workflow setup because nothing was scanned. Pls refactor accordingly and make sure semgrep is run against https://github.com/ubiquity/ubiquity-dollar/tree/development/packages/contracts/src/dollar.

I've pushed a fix that should fix that and scan only files in the packages/contracts/src/dollar directory

QA Run: https://github.com/cohow/ubiquity-dollar/actions/runs/10903661456/job/30259764076#step:5:18

side note: i could not get semgrep ci to correctly run and scan all the files in the directory as it seems to only scan files that have changed since baseline commit so I've used semgrep scan instead for scanning and specifying directory. I believe the results are the same but let me know if there's any difference.

@cohow cohow requested a review from rndquu September 17, 2024 13:52
@cohow
Copy link
Author

cohow commented Sep 17, 2024

Ok i'm not sure how I missed that but I managed to make it run with semgrep ci which works better, it's currently running on push and pull request I believe

push QA: https://github.com/cohow/ubiquity-dollar/actions/runs/10904764860/job/30261986841#step:5:19
pull QA: https://github.com/cohow/ubiquity-dollar/actions/runs/10904765962/job/30261990853#step:5:22

PR scan uses diff-aware scanning to limit the scan to files changed since baseline commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: add security rules from semgrep
2 participants