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

How to define custom patterns for secret scanning #7

Open
carmal891 opened this issue Apr 21, 2024 · 3 comments
Open

How to define custom patterns for secret scanning #7

carmal891 opened this issue Apr 21, 2024 · 3 comments
Labels
question Further information is requested

Comments

@carmal891
Copy link

carmal891 commented Apr 21, 2024

The official Github secret scanning documentation mentions defining custom patterns for secret scanning :

https://docs.github.com/en/enterprise-cloud@latest/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning

Can we enable the same feature using the secret-scanning-review-action ?

@carmal891 carmal891 changed the title How to enable custom pattern How to define custom patterns for secret scanning Apr 21, 2024
@felickz
Copy link
Collaborator

felickz commented Apr 22, 2024

My sample from the ReadMe is actually using a custom pattern

Image

RSA Private Key :)

Image

Once you dry run, publish the pattern and it will be available here! It would be best to further enable the pattern for push protection so it should only show up in the secret-scanning-review-action when it is bypassed!

@felickz felickz added the question Further information is requested label Apr 22, 2024
@carmal891
Copy link
Author

Thank you for the prompt response. However my question was whether it is possible to keep the pattern as code rather than utulize the repo UI console. For example like a .patterns file and then pass it to the action attributes

Secret-Scanning-Job:
     needs: initial-setup-job
     runs-on: ubuntu-latest
     steps:     
     - name: Secret Scanning Review Action
       uses: advanced-security/secret-scanning-review-action@v0
       with:
         token: ${{ secrets.SECRET_SCAN_REVIEW_GITHUB_TOKEN }}
         fail-on-alert: true
         fail-on-alert-exclude-closed: false
         patterns-path: .patterns

Is something like this feasible ?

@felickz
Copy link
Collaborator

felickz commented Apr 23, 2024

That would be an amazing update to the product to support patterns as code. I would suggest you drop that feedback to the product team in the community forum: https://github.com/orgs/community/discussions/categories/code-security. The only customization as code today is a paths ignore via secret-scanning.yml.

Unfortunately, it would be a bit out of scope for this project as we are just pulling the secret alerts from the back end. The one area this got me thinking is maybe it would help out some to provide some ignore list of secrets. If some alerts are maybe even too noisy to show on PR but might be rolled out via custom pattern.

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

No branches or pull requests

2 participants