Skip to content

Remove hardcoded GitHub token fixture and return non-sensitive token state - #10

Draft
al1dazzi with Copilot wants to merge 2 commits into
mainfrom
copilot/rch-task-e3f43a4a58ec6a04-remediate-token-detectio
Draft

al1dazzi with Copilot wants to merge 2 commits into
mainfrom
copilot/rch-task-e3f43a4a58ec6a04-remediate-token-detectio

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown

This PR addresses a Reachable secret finding in internal/handlers/secrets.go where a committed GitHub token-like literal was returned by a handler. The change removes the literal and keeps runtime behavior useful without exposing secret values.

  • Secret sink remediation (CloudTokens)

    • Removed the hardcoded syntheticGitHubToken constant from source.
    • Replaced token echo with a state marker derived from REACH_TESTBED_GITHUB_TOKEN:
      • "configured" when present
      • "not_configured" when absent
    • Kept existing response shape and unrelated fields intact (aws_access_key_id remains unchanged).
  • Regression coverage for secret non-echo behavior

    • Added focused tests in internal/handlers/secrets_test.go to verify:
      • attack-like token input is never reflected in response output
      • configured/not_configured semantics remain stable
githubTokenState := "not_configured"
if os.Getenv("REACH_TESTBED_GITHUB_TOKEN") != "" {
    githubTokenState = "configured"
}

_ = json.NewEncoder(w).Encode(map[string]string{
    "aws_access_key_id": syntheticAWSAccessKeyID,
    "github_token":      githubTokenState,
})

Co-authored-by: al1dazzi <247480224+al1dazzi@users.noreply.github.com>
Copilot AI changed the title [WIP] Remediate token detection using secrets manager Remove hardcoded GitHub token fixture and return non-sensitive token state Sep 11, 2026
Copilot AI requested a review from al1dazzi September 11, 2026 20:44

This branch has not been deployed

No deployments
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