Skip to content

[DO NOT REVIEW] [SVLS-8660] test: gitleaks smoke test (DO NOT MERGE)#1142

Draft
litianningdatadog wants to merge 3 commits intomainfrom
tianning.li/SVLS-8660-gitleak-test
Draft

[DO NOT REVIEW] [SVLS-8660] test: gitleaks smoke test (DO NOT MERGE)#1142
litianningdatadog wants to merge 3 commits intomainfrom
tianning.li/SVLS-8660-gitleak-test

Conversation

@litianningdatadog
Copy link
Copy Markdown
Contributor

@litianningdatadog litianningdatadog commented Mar 30, 2026

Human review is not needed as it is to test github scan feature.

Purpose

Do not merge. This is a smoke-test PR to verify that the Secrets Scan CI job added in #1134 correctly detects and blocks PRs containing credential-shaped strings.

What this PR does

Adds integration-tests/gitleaks-smoke-test.sh containing:

  • A fake AWS Access Key ID matching the AKIA[A-Z0-9]{16} pattern (AKIAIOSFODNN7EXAMPLE)
  • A fake AWS Secret Access Key matching the aws-secret-access-key rule

Both values are from official AWS documentation and are not real credentials.

Expected outcome

The Secrets Scan job should fail with findings for both fake keys, demonstrating the scanner is working correctly.

After verification

  • Confirm Secrets Scan job fails with gitleaks findings
  • Close this PR without merging
  • Delete the branch

Related

🤖 Generated with Claude Code

Adds a dedicated smoke-test script containing a fake AWS access key
(AKIAIOSFODNN7EXAMPLE) and fake AWS secret key to verify that the
gitleaks Secrets Scan CI job correctly detects and blocks credential-
shaped strings committed to a PR.

This file is intentionally flagged and must NOT be merged to main.
Delete this branch after confirming the CI job fails.

See: .github/workflows/secrets-scan.yml (added in PR #1134)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@litianningdatadog litianningdatadog marked this pull request as ready for review March 30, 2026 20:14
@litianningdatadog litianningdatadog requested a review from a team as a code owner March 30, 2026 20:14
@litianningdatadog litianningdatadog changed the title [SVLS-8660] test: gitleaks smoke test (DO NOT MERGE) [DO NOT REVIEW] [SVLS-8660] test: gitleaks smoke test (DO NOT MERGE) Mar 30, 2026
@litianningdatadog litianningdatadog removed the request for review from lym953 March 30, 2026 20:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR creates an intentional smoke test for the gitleaks secrets scanning CI job. It adds a shell script containing two well-documented fake AWS credentials from official AWS documentation (AKIAIOSFODNN7EXAMPLE for the access key and wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY for the secret key). The purpose is to verify that the Secrets Scan workflow (introduced in PR #1134) correctly detects and blocks PRs containing credential-shaped strings. The PR is explicitly marked "DO NOT MERGE" and describes a workflow of deleting the test branch after confirming the CI job fails as expected.

Changes:

  • Creates integration-tests/gitleaks-smoke-test.sh containing fake AWS credentials to test gitleaks detection
  • Includes clear documentation explaining the file is a temporary smoke test with references to AWS documentation confirming the credentials are fake

FAKE_AWS_SECRET="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"

echo "This file is intentionally flagged by gitleaks for smoke-test purposes."
echo "Key: $FAKE_AWS_KEY"
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The echo statement on line 20 only prints the AWS key but not the AWS secret. Line 17 defines both FAKE_AWS_SECRET, but only FAKE_AWS_KEY is echoed. For consistency and to verify both credentials are detected by gitleaks, consider also echoing the secret value, or clarify if the secret is only being tested through the variable assignment itself.

Suggested change
echo "Key: $FAKE_AWS_KEY"
echo "Key: $FAKE_AWS_KEY"
echo "Secret: $FAKE_AWS_SECRET"

Copilot uses AI. Check for mistakes.
The canonical AWS doc examples (AKIAIOSFODNN7EXAMPLE / wJalrXUtnFEMI...)
are in gitleaks' internal global allowlist and are not flagged.
Replace with unique fake values that match the AKIA[A-Z0-9]{16} pattern
but are not suppressed, so the Secrets Scan CI job actually triggers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@litianningdatadog litianningdatadog marked this pull request as draft March 30, 2026 20:22
The previous key AKIAVQD12YX3RSMOKETEST was 22 chars but gitleaks'
aws-access-token rule requires exactly AKIA[A-Z0-9]{16} (20 total).
Use AKIAT3STFAKEKEY12345 which is the correct length.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants