Skip to content

Document / Support on using custom rego ruleset #255

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

Open
saisatishkarra opened this issue Jan 13, 2025 · 1 comment
Open

Document / Support on using custom rego ruleset #255

saisatishkarra opened this issue Jan 13, 2025 · 1 comment

Comments

@saisatishkarra
Copy link

Is your feature request related to a problem? Please describe.
Enhancement / Clarification on how to write custom rego rules and pass it during runtime for the poutine when scanning a remote/local repo or org ?

Describe the solution you'd like

  • Any example of how this request is supported ?
  • Documentation around how to write these rego rules for poutine?
  • Where does the config live and how to pass it during runtime?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@saisatishkarra saisatishkarra changed the title Document / Support for injecting custom rego ruleset Document / Support on using custom rego ruleset Jan 13, 2025
@fproulx-boostsecurity
Copy link
Contributor

Good idea @saisatishkarra

So basically you create a .poutine.yml (in the curent working directory where you run poutine) or you have a YAML file that you point to using --config my-config.yaml.

You can see an example here https://github.com/boost-rnd/poutine-rules/blob/main/.poutine.yml

If you want to write custom rules, you specify

include:
- path: ./github_actions

And the path(s) it points to must contain *.rego files following our standard rule nomenclature i.e. package rules.something (https://github.com/boost-rnd/poutine-rules/blob/main/github_actions/all_injections.rego)

Example

package rules.injection

import rego.v1

# raise for any injection in bash/javascript
patterns.github contains `\$\{\{[^\}]+\}\}`

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

No branches or pull requests

2 participants