Repository navigation
CI: scan the diff for leaked credentials - #7
Merged
Merged
Conversation
Rectifying a leak: a Backblaze application key was committed in a test and, although the commit was amended away, force-pushing does not delete the object on GitHub, so it stayed reachable by SHA in this public repository until the key was revoked. GitHub's push protection is enabled but does not recognise Backblaze keys, so this job scans the diff of every PR and push to main for B2 keys, AWS access key IDs, aws_secret_access_key assignments and private key headers. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Por quê
A aplicação key do Backblaze foi commitada por engano num teste (commit
f6c6665), corrigida depois com--amend+ force-push. Force-push não apaga o objeto no GitHub: o commit antigo continuou acessível pelo SHA neste repo público, e a key só parou de funcionar quando foi revogada no console do Backblaze.O
secret_scanning_push_protectiondo GitHub já estava ligado, mas ele não conhece chaves de Backblaze — por isso passou. O GitGuardian também não pegou.O que este PR faz
Adiciona um job de CI (
Secrets / Diff scan) que roda em todo push namaine em todo PR, olhando só o diff, procurando:K005…(application key do Backblaze — o formato que vazou)AKIA…(access key ID da AWS)aws_secret_access_key-----BEGIN … PRIVATE KEY-----)Testado localmente: pega a key que vazou e não casa com os placeholders que ficaram no teste (
b2-key-id/b2-application-key). Os próprios padrões estão partidos na fonte para o arquivo não se auto-detectar.