Skip to content

feat(detectors): add Tencent Cloud credential detector - #5051

Open
0xDevNinja wants to merge 2 commits into
trufflesecurity:mainfrom
0xDevNinja:feat/tencentcloud-detector
Open

feat(detectors): add Tencent Cloud credential detector#5051
0xDevNinja wants to merge 2 commits into
trufflesecurity:mainfrom
0xDevNinja:feat/tencentcloud-detector

Conversation

@0xDevNinja

@0xDevNinja 0xDevNinja commented Jun 18, 2026

Copy link
Copy Markdown

Description:

Adds a new verifiable detector for Tencent Cloud credentials (Closes #4036).

Tencent Cloud uses a two-part credential:

  • SecretIdAKID prefix followed by 32 alphanumeric characters
  • SecretKey — 32 alphanumeric characters, paired with a SecretId

The detector anchors on the AKID-prefixed SecretId and pairs it with nearby SecretKey candidates (filtered by Shannon entropy to cut down on false positives from generic 32-char strings).

Verification signs a DescribeRegions request to the CVM API (cvm.tencentcloudapi.com) with Tencent's TC3-HMAC-SHA256 scheme. Tencent's 3.0 APIs return HTTP 200 even for authentication failures, embedding an Error block in the JSON body, so verification inspects the body: an AuthFailure.* code is treated as determinately invalid, the absence of an error means the credentials are valid, and any other error code surfaces as an indeterminate result.

No new third-party SDK is pulled in — the signature is computed with the standard library.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Medium Risk
Verification performs outbound signed requests with candidate cloud credentials, which is sensitive but follows existing detector patterns; pairing generic 32-char strings may still produce noise despite entropy filtering.

Overview
Adds Tencent Cloud SecretId/SecretKey detection and optional live verification, wired into the default detector list and DetectorType_TencentCloud (1056).

Detection looks for AKID-prefixed SecretIds and pairs them with nearby 32-character alphanumeric SecretKey candidates, skipping low-entropy keys to limit false positives. When verification is on, it signs a minimal DescribeRegions call to the CVM API using TC3-HMAC-SHA256 (stdlib only) and treats missing JSON errors as valid, AuthFailure.* as invalid, and other outcomes as indeterminate.

Unit tests cover pairing rules and mocked verification paths; an integration test hits real credentials from GCP test secrets.

Reviewed by Cursor Bugbot for commit 371b79d. Bugbot is set up for automated code reviews on this repo. Configure here.

@0xDevNinja
0xDevNinja requested a review from a team June 18, 2026 10:32
@0xDevNinja
0xDevNinja requested a review from a team as a code owner June 18, 2026 10:32
@0xDevNinja
0xDevNinja requested a review from a team June 18, 2026 10:32
Detects Tencent Cloud SecretId (AKID-prefixed) paired with a SecretKey and
verifies the pair against the CVM DescribeRegions API using a TC3-HMAC-SHA256
signed request. Tencent returns HTTP 200 with an Error block in the body for
authentication failures, so verification inspects the response body and treats
AuthFailure.* codes as determinately invalid.

Refs trufflesecurity#4036
@0xDevNinja
0xDevNinja force-pushed the feat/tencentcloud-detector branch from 091fed4 to 371b79d Compare June 25, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tencent cloud Credentials Detectors Request

1 participant