Semgrep - Improve pre scan checks and ease of extending rules - #230
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
Enhance the pre-scan validation for Semgrep custom rules and update the module configuration to invoke the new checks and use a local rules directory.
- Extended
prescan_checks.shto verify URL extensions, HTTP status codes, file existence, and ensure at least one YAML rule is present. - Updated
module.yamlto copy and run the new pre-scan script, default toboost/sast/rules/semgrep@stablerules, and adjust the Semgrep scan command to use the local.semgrepfolder.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scanners/boostsecurityio/semgrep/prescan_checks.sh | New script implementing detailed pre-scan rule validation (URL extension, fetch status, local file checks) |
| scanners/boostsecurityio/semgrep/module.yaml | Integrates the pre-scan script into setup/steps, updates default SEMGREP_RULES, and adjusts scan command |
Comments suppressed due to low confidence (1)
scanners/boostsecurityio/semgrep/module.yaml:15
- The
setupsection previously used a nested list (- - name:). Verify the indentation matches the expected structure—this may need an extra dash (- -) to nest correctly undersetup:.
- name: Utility scripts
SUSTAPLE117
previously approved these changes
Jul 7, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Franck-Boost <francois.lajeunesse-robert@boostsecurity.io>
SUSTAPLE117
approved these changes
Jul 7, 2025
lindycoder
added a commit
that referenced
this pull request
Jan 28, 2026
This change is to add support for having env vars passed down to the test runners. For security reasons and to avoid env pollution, an allow list of prefix can be given to the test-action, if an env var does not match, it will be rejected at parse time and cause a failure of the check. In the case where we do not provide a list of allowed env prefixes, no environment variable will be accepted. Documentation for Setting Up Scanner Tests has also been updated
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Improve pre-scan checks:
Modified the pre-scan check to ensure that custom rules are well-defined:
.yamlor.yml.semgrepdirectoy includes at least one yaml file.Ease of extending rules:
boost/sast/rules/semgrep@stableorboost/sast/rules/semgrep@canaryinstead of providing an URL.Smoke tests:
Smoke tests definition was updated to add tests cases for both valid and invalid custom ruleset.
https://github.com/boost-sandbox/module-tests-semgrep/actions/runs/16124713060