Skip to content

Unblock code mirror: perform one-time AzDO secret scanning bypass for false positives - #1993

Merged
dagood merged 1 commit into
dotnet:masterfrom
dagood:fix-azdo-mirror
Jan 22, 2020
Merged

dagood merged 1 commit into
dotnet:masterfrom
dagood:fix-azdo-mirror

Conversation

@dagood

@dagood dagood commented Jan 22, 2020

Copy link
Copy Markdown
Member

Our code mirror from GitHub to AzDO is not working, blocking official builds: https://dev.azure.com/dnceng/internal/_build/results?buildId=491921&view=logs&j=a3453f18-ed27-56b8-78ee-81a7631275fb&t=31021d3c-3c27-555b-7ff0-047656185682&l=19

error: remote unpack failed: error VS403654: The push was rejected because it might contain credentials or other secrets.
To https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
 ! [remote rejected]         master -> master (VS403654: The push was rejected because it might contain credentials or other secrets.

/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.DefaultProxyCredentials.cs(93,34-60) : error : CSCAN0220 : hash EHZG3hT5yNPz483bdwL8SrWW91p4oJH5ozVc4wlTsZE=
/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs(27,30-52) : error : CSCAN0220 : hash fkg0qNod8TBSphqoBnt4NPzUDzl+p/tGoIJ+oQm7hdY=

These are obviously not secrets:

private const string Password = "password1";

I believe we have bypassed this check before, but the error was reactivated by #1676 moving the files around. That PR's merge commit is also the first commit our AzDO repo is lacking.


The instructions say that we need to push an empty commit with the message **BYPASS_SECRET_SCANNING** to bypass it, so after submitting this PR I'm going to fast-forward merge it to master. This will trigger the mirroring build to run again with this commit at the tip of master and succeed, if the instructions in the error message are correct.

If another PR gets merged before this PR gets reviewed (blocking the FF merge I need to do) I'm going to rebase this PR and FF merge it immediately afterwards.

@dagood
dagood requested a review from a team January 22, 2020 02:11
@dagood dagood self-assigned this Jan 22, 2020
@dagood
dagood merged commit 4dbc6f1 into dotnet:master Jan 22, 2020
@dagood
dagood deleted the fix-azdo-mirror branch January 22, 2020 02:19
@dagood

dagood commented Jan 22, 2020

Copy link
Copy Markdown
Member Author

This will trigger the mirroring build to run again

Funny, this part didn't work because the commit contains no changed files, and Maestro triggers on any file changing in the repo.

I pushed master to AzDO manually, which worked. We have a fresh official build running now: https://dev.azure.com/dnceng/internal/_build/results?buildId=492043&view=results

@dagood

dagood commented Jan 22, 2020

Copy link
Copy Markdown
Member Author

@ManickaP @scalablecory, think it's reasonable to rename these props to something less passwordy in case they show up as new files again at some point in the future? Unfortunately I'm not sure how much change is needed, it might not just be the property name.

@jonfortescue

Copy link
Copy Markdown
Contributor

@dagood /password = .+/i (or something to that effect) will get picked up by the scanner. You can suppress this a couple of ways; documentation for it lives here.

@ViktorHofer

Copy link
Copy Markdown
Member

@dagood see how I suppressed that for the dotnet/runtime-assets repo: https://github.com/dotnet/runtime-assets/blob/master/.config/CredScanSuppressions.json.

@ManickaP

Copy link
Copy Markdown
Member

@dagood @ViktorHofer I've been playing with CredScan locally. I can take the results and put them into the suppression file if you want. Should I do it?

@dagood

dagood commented Jan 26, 2020

Copy link
Copy Markdown
Member Author

IMO that would be nice to have, yeah. Basically documentation for what's already suppressed and how to suppress again without a special commit.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants