-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Resolve CredScan issues with Core, KeyVault #23653
Conversation
Resolves Azure#23505 and resolves Azure#23502
|
||
namespace Azure.Security.KeyVault.Certificates.Tests | ||
{ | ||
public partial class PemReaderTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a similar comment about excluding this file from credscan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I clearly forgot that here. I'll submit a new PR since I don't think I have anything else KV-related planned today.
@@ -50,11 +51,13 @@ | |||
}, | |||
{ | |||
"file":[ | |||
"sdk/core/Azure.Core/tests/PemReaderTests.Keys.cs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit worried it would serve as a bad example for people to add their entire cs files to ignore list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could've before.
I do include a comment that only keys should be in there (there is one test but because it needs a variable for line endings). Making these separate files and having to templatize some of them is an unnecessary burden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely don't want entire cs files blindly added but if the cs file only contains test secrets and it is clear that is what the file is for I'm OK with this approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember seeing an inline ignore syntax in CredScan similar to what cspell has. Should we use it instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some support for inline suppressions however I've been trying to avoid them because they are CredScan specific and there are other secret scanning tools we are also depending on (i.e. github secret scanning) which don't support them and having secrets being isolated to individual files or using a set of placeholders is a little easier to reason about in those contexts.
Resolves #23505 and resolves #23502