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

Resolve CredScan issues with Core, KeyVault #23653

Merged
merged 2 commits into from
Sep 3, 2021
Merged

Conversation

heaths
Copy link
Member

@heaths heaths commented Aug 30, 2021

Resolves #23505 and resolves #23502

@heaths heaths enabled auto-merge (squash) August 30, 2021 20:41
@heaths heaths requested a review from AlexGhiondea September 3, 2021 00:44

namespace Azure.Security.KeyVault.Certificates.Tests
{
public partial class PemReaderTests
Copy link
Contributor

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?

Copy link
Member Author

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.

@heaths heaths merged commit ff6002e into Azure:main Sep 3, 2021
@heaths heaths deleted the issue23505 branch September 3, 2021 18:19
@@ -50,11 +51,13 @@
},
{
"file":[
"sdk/core/Azure.Core/tests/PemReaderTests.Keys.cs",
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Contributor

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?

Copy link
Member

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.

heaths added a commit to heaths/azure-sdk-for-net that referenced this pull request Sep 3, 2021
heaths added a commit that referenced this pull request Sep 3, 2021
@heaths heaths mentioned this pull request Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core] CredScan: handle false positives [KeyVault] CredScan: handle false positives
4 participants