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

Custom patterns with Talismanrc for CLI/scanner not working #274

Closed
varaamo opened this issue Nov 1, 2020 · 16 comments
Closed

Custom patterns with Talismanrc for CLI/scanner not working #274

varaamo opened this issue Nov 1, 2020 · 16 comments

Comments

@varaamo
Copy link

varaamo commented Nov 1, 2020

In the scan mode, it appears talismanrc with custom configuration is not been read.
So all the custom regex in the talismarc is not processed by the talisman CLI. However Talisman pre-push hook is able to read and process fine.

@svishwanath-tw
Copy link
Collaborator

This is currently a known/expected behaviour.
The fix for this is a work in progress.

@varaamo
Copy link
Author

varaamo commented Nov 2, 2020

Thanks for confirming. Any ETA for the fix?

@svishwanath-tw
Copy link
Collaborator

@varaamo : would you be able to submit a PR for the same ?

@varaamo
Copy link
Author

varaamo commented Nov 3, 2020

I'm not that familiar with the code base nor the go programing language that it is written in, to make/suggest changes to support this capability

@varaamo
Copy link
Author

varaamo commented Nov 10, 2020

@svishwanath-tw, will you able to help implement this feature?

@svishwanath-tw
Copy link
Collaborator

@varaamo : I will give it a try. What do you have in mind when you say help ?

@varaamo
Copy link
Author

varaamo commented Nov 10, 2020

implement and release a version that we can download and use :-)

svishwanath-tw added a commit to svishwanath-tw/talisman that referenced this issue Nov 10, 2020
@varaamo
Copy link
Author

varaamo commented Nov 10, 2020

Thank you @svishwanath-tw

@svishwanath-tw
Copy link
Collaborator

@varaamo : The implementation is far from complete FYI. This is just a draft. Far from release. Would you be willing to do some testing and give feedback on these changes ?

@varaamo
Copy link
Author

varaamo commented Nov 11, 2020

@svishwanath-tw , Yes I can test and provide feedback after you provide the talisman cli binaries when ready

@svishwanath-tw
Copy link
Collaborator

@varaamo : Can you try out with binaries available at https://github.com/thoughtworks/talisman/releases/tag/scanwithrc

@varaamo
Copy link
Author

varaamo commented Nov 11, 2020

@svishwanath-tw, do i need to build the source code for the binaries? It would be easier if you can upload the binaries directly

@svishwanath-tw
Copy link
Collaborator

svishwanath-tw commented Nov 12, 2020

@varaamo : That link has binaries now. Please download and use.
I had uploaded them when I created this pre-release. But it looks like it didn't take.
Please check now.

@varaamo
Copy link
Author

varaamo commented Nov 12, 2020

Thank you. I was able to test and it is working for me. I tested with the following custom patterns in .talismanrc and the scan was able to correctly identify them within the test file I'd created
custom_patterns:

  • (?i)(.password)\s*=\s*[0-9a-zA-Z/+=_]{32}
  • (?i)(.secret)\s*=\s*[0-9a-zA-Z/+=_]{32}
  • (?i)(_secret)\s*=\s*[0-9a-zA-Z/+=_]{32}
  • (?i)(ApiKey)\s*=\s*[0-9a-zA-Z/+=_]{32}
  • (?s) AKIA[0-9A-Z]{16}
  • (?s)AIza[0-9A-Za-z-_]{35}
  • (?s)[0-9]+-[0-9A-Za-z_]{32}.apps.googleusercontent.com
  • (?s)[=\s"]eyJ[A-Za-z0-9_/+-].[A-Za-z0-9._/+-]

@svishwanath-tw
Copy link
Collaborator

Glad to know that this is working.
However there is talk introducing scan specific configs into talismanrc on the PR.
This is just FYI @varaamo

@varaamo
Copy link
Author

varaamo commented Nov 13, 2020

Thanks for the FYI @svishwanath-tw . Any idea when these changes would be available in the main release?

svishwanath-tw added a commit to svishwanath-tw/talisman that referenced this issue Mar 4, 2021
svishwanath-tw added a commit to svishwanath-tw/talisman that referenced this issue Mar 6, 2021
svishwanath-tw added a commit to svishwanath-tw/talisman that referenced this issue Mar 6, 2021
svishwanath-tw added a commit that referenced this issue Mar 6, 2021
svishwanath-tw added a commit that referenced this issue Jun 13, 2021
svishwanath-tw added a commit that referenced this issue Jun 13, 2021
svishwanath-tw added a commit that referenced this issue Jun 14, 2021
svishwanath-tw added a commit that referenced this issue Jun 24, 2021
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