{{ message }}
Repository navigation
Conversation
DrFaust92
force-pushed
the
feat/gcs-hmac-detector
branch
from
October 17, 2026 02:23
d5d56f5 to
ac74561
Compare
Anchors on the GOOG-prefixed access ID (61 chars for service accounts, 24 for user accounts) paired with a nearby 40-char base64 secret, since these keys are usually stored under AWS names and the secret alone is indistinguishable from an AWS one. Verifies with a SigV4-signed ListBuckets against the XML API; AccessDenied still means the signature was accepted, while an unknown ID or wrong secret both come back as SignatureDoesNotMatch. Closes trufflesecurity#5339. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DrFaust92
force-pushed
the
feat/gcs-hmac-detector
branch
from
October 22, 2026 01:36
ac74561 to
f3b4072
Compare
Author
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.

Closes #5339.
What
gcshmacdetector for Google Cloud Storage HMAC keys: aGOOG-prefixed access ID (61 chars for service accounts, 24 for user accounts, per the HMAC key docs) paired with a nearby 40-char base64 secret, reusing the AWS detector's secret pattern, entropy thresholds and hex false-positive filter.ExtraDatacarriesaccount_type(service vs user account, from the ID length).ListBucketsagainststorage.googleapis.com.200and403 AccessDeniedverify (the signature was accepted, the key just can't list buckets);SignatureDoesNotMatch/InvalidAccessKeyIdare determinate negatives; anything else is indeterminate.Why
GOOGprefix is the only reliable anchor. Details in Add a Cloud Storage HMAC key detector #5339.I confirmed against the live API that an unknown access ID comes back as
403 SignatureDoesNotMatchrather thanInvalidAccessKeyId. I haven't run the positive path against a real key, so200/AccessDeniedfor a valid key follows the XML API's documented behaviour and is covered byhttptestonly. The enum is1075because #5338 already takes1074.Checklist:
go test ./pkg/detectors/gcshmac/... ./pkg/engine/defaults/...)golangci-lint run ./pkg/detectors/gcshmac/...)🤖 Generated with Claude Code
Note
Medium Risk
Adds live credential verification against GCS and reuses AWS secret heuristics, which could mis-pair IDs/secrets or trigger outbound auth attempts when verification is enabled.
Overview
Adds a new
gcshmacdetector for Google Cloud Storage HMAC keys (GOOG…access ID + 40-char secret), wired into default detectors andDetectorType_GCSHMACKey(1076).Detection pairs
GOOG-prefixed IDs (24- or 61-char user/service accounts) with nearby secrets using the AWS detector’s secret regex, entropy checks, URL decoding, and hex false-positive filtering. Results includeaccount_typeinExtraData. Optional verification signs a SigV4 ListBuckets request tostorage.googleapis.com; 200 andAccessDeniedcount as verified, while signature/access-key errors are treated as invalid.Unit tests cover common config shapes (AWS env vars, boto
gs_*keys, S3 URLs), negative cases, and mocked verification responses.Reviewed by Cursor Bugbot for commit f3b4072. Bugbot is set up for automated code reviews on this repo. Configure here.