Skip to content

Remove hardcoded GitHub PAT from secret handler#31

Draft
al1dazzi with Copilot wants to merge 2 commits into
mainfrom
copilot/rch-task-9df4a5fbcf8d2790-remediate-github-token
Draft

Remove hardcoded GitHub PAT from secret handler#31
al1dazzi with Copilot wants to merge 2 commits into
mainfrom
copilot/rch-task-9df4a5fbcf8d2790-remediate-github-token

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown

This change remediates the selected Reachable secret finding in internal/handlers/secrets.go: a GitHub Personal Access Token shape was committed in source and exposed by a handler response. The hardcoded value is removed from the repository, and the handler now sources any runtime token from environment instead.

  • Secret remediation

    • Removed the committed GitHub PAT-shaped constant from internal/handlers/secrets.go.
    • Stopped returning a source-controlled GitHub token value from CloudTokens.
  • Runtime secret sourcing

    • Introduced REACH_TESTBED_GITHUB_TOKEN as the runtime source for the github_token response field.
    • Preserved existing handler shape and the AWS synthetic fixture to keep the change narrowly scoped.
  • Focused coverage

    • Added internal/handlers/secrets_test.go to cover:
      • configured runtime GitHub token
      • unset runtime GitHub token
const githubTokenEnvVar = "REACH_TESTBED_GITHUB_TOKEN"

func CloudTokens(w http.ResponseWriter, _ *http.Request) {
	_ = json.NewEncoder(w).Encode(map[string]string{
		"aws_access_key_id": syntheticAWSAccessKeyID,
		"github_token":      os.Getenv(githubTokenEnvVar),
	})
}

Reachable remediation status

  • RCH-RULE-b4ff9103fixed (internal/handlers/secrets.go)

Copilot AI changed the title [WIP] Remediate uncovered GitHub Personal Access Token Remove hardcoded GitHub PAT from secret handler Jun 23, 2026
Copilot AI requested a review from al1dazzi June 23, 2026 15:26
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