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

pragma allow list comment is not always working #496

Closed
nbraun-wolf opened this issue Dec 2, 2021 · 9 comments · Fixed by #575
Closed

pragma allow list comment is not always working #496

nbraun-wolf opened this issue Dec 2, 2021 · 9 comments · Fixed by #575
Labels
P2 Important. E.g. a new feature that we want to include in the next release. selected The issue has been selected to be worked on. triaged The issue has been reviewed but has not been solved yet.

Comments

@nbraun-wolf
Copy link

Hi, I noticed that sometimes to allow list isn't working. I have a case here where I store a dummy api key for local development in a .env file.

# pragma: allowlist nextline secret
PDFREACTOR_APIKEY=pdfapikey22

But the pre commit hook is marking this file as error.

ERROR: Potential secrets about to be committed to git repo!
Secret Type: Secret Keyword
Location:    .env:22
@jamesliu4c
Copy link

We are also experiencing this.

@Klutch27
Copy link

Klutch27 commented Dec 30, 2021

The inline version is also problematic. I have a couple of inline # pragma: allowlist secret, but they're still getting flagged.

UPDATE: FWIW, in my case I just added it to the baseline by regenerating the file, and now it's fine.

@lorenzodb1 lorenzodb1 added the pending The issue still needs to be reviewed by one of the maintainers. label Jun 15, 2022
@efimk-lu
Copy link

Hey, any update on this one?

@jpdakran
Copy link
Member

Hello @efimk-lu. We are currently in the process of creating a triaging plan for all issues that exist in this repository. I will make a note of this one and we will investigate further at our earliest convenience. Thank you for your patience.

@jpdakran
Copy link
Member

Hi @jamesliu4c @Klutch27 @efimk-lu, which file types where you experiencing this issue with. Is it also the .env?

@jamesliu4c
Copy link

Python and JavaScript for me and @Klutch27.

@efimk-lu
Copy link

@jpdakran I had a typo, so ignore my previous comment. Things are working

@jpdakran
Copy link
Member

@jamesliu4c Can you post an example of a python or javascript file so I can attempt to reproduce. I have verified this is an issue for config files and this is because they go through an IniFileParser which stripes out comments that are on a new line. However for config files - the inline version # pragma: allowlist secret should work.

@jpdakran jpdakran added triaged The issue has been reviewed but has not been solved yet. P2 Important. E.g. a new feature that we want to include in the next release. selected The issue has been selected to be worked on. and removed pending The issue still needs to be reviewed by one of the maintainers. labels Jun 28, 2022
@jpdakran
Copy link
Member

Closing this since the original issue for the .env file has been fixed. If you wish to reopen this issue with the other file types and secret context. I would be happy to investigate that further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important. E.g. a new feature that we want to include in the next release. selected The issue has been selected to be worked on. triaged The issue has been reviewed but has not been solved yet.
Projects
None yet
6 participants