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

Add semgrep rules #5042

Merged
merged 2 commits into from
Sep 23, 2024
Merged

Add semgrep rules #5042

merged 2 commits into from
Sep 23, 2024

Conversation

johanbrandhorst
Copy link
Collaborator

@johanbrandhorst johanbrandhorst commented Aug 24, 2024

Add semgrep rules

Instrument our security scanner with the ability to use custom semgrep
rules. This is inspired by the HVS teams use of semgrep.

semgrep: add rule to detect string interpolation in WithInfoMsg

The event.WithInfoMsg function expects a set of key value tuples,
but it can easily be misunderstood to accept string interpolation
arguments. This check will error if any string interpolation verbs are
used in calls to event.WithInfoMsg

View this rule in the playground here: https://semgrep.dev/playground/r/YGUpBXB/johan_brandhorst_personal_org.with-info-msg-string-interpolation

semgrep/event-with-info-msg.yaml Outdated Show resolved Hide resolved
semgrep/event-with-info-msg.yaml Outdated Show resolved Hide resolved
Instrument our security scanner with the ability to use custom semgrep
rules. This is inspired by the HVS teams use of semgrep.
The event.WithInfoMsg function expects a set of key value tuples,
but it can easily be misunderstood to accept string interpolation
arguments. This check will error if any string interpolation verbs are
used in calls to event.WithInfoMsg
@johanbrandhorst johanbrandhorst merged commit 0ef88d0 into main Sep 23, 2024
62 checks passed
@johanbrandhorst johanbrandhorst deleted the jbrandhorst-add-semgrep-rules branch September 23, 2024 17:07
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.

2 participants