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

Persist '# pragma: allowlist nextline secret' in IniFileParser For ConfigFileTransformers #575

Merged

Conversation

jpdakran
Copy link
Member

Problem

  • # pragma: allowlist nextline secret are not filtered out and secrets on the proceeding line are alerted on
  • This is an issue with the ConfigFileTransformer which leverages the IniFileParser
  • The transformer and the parser does not track comments in files - This is why our logic is alerting on the secrets which should be whitelisted

Solution

  • When parsing files in the IniFileParser persist comments that match the allowlist_nextline_secret comment
  • We do not want to keep all comments and we do not want to keep allowlist_secret comment (Which occur on the same line as a secret) since this is working properly

Copy link
Member

@lorenzodb1 lorenzodb1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jpdakran jpdakran merged commit c48c0a0 into master Jun 29, 2022
@jpdakran jpdakran linked an issue Jun 29, 2022 that may be closed by this pull request
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.

pragma allow list comment is not always working
5 participants