Skip to content

fix: prevent Gateway API key exposure through metrics - #7

Open
aicyberg wants to merge 1 commit into
graphops:mainfrom
aicyberg:fix/redact-api-key-metrics
Open

aicyberg wants to merge 1 commit into
graphops:mainfrom
aicyberg:fix/redact-api-key-metrics

Conversation

@aicyberg

@aicyberg aicyberg commented Aug 5, 2026

Copy link
Copy Markdown

Summary

  • remove Graph Gateway API keys from Prometheus labels
  • add a regression test proving encoded metrics contain no credential data
  • default the unauthenticated metrics listener to 127.0.0.1
  • document protection requirements for an explicit non-loopback bind

Why

In SSE mode, the current metric label sets include the raw Gateway API key.
The metrics listener also defaults to 0.0.0.0:9091 without authentication,
so a reachable endpoint can expose active credentials. Credential labels also
create unnecessary high-cardinality time series.

This change keeps operational dimensions (tool_name, endpoint_type, and
status) while removing credential material entirely. No real credential was
used or accessed during validation.

Validation

  • cargo fmt --check
  • cargo test (six tests)
  • cargo clippy --all-targets --all-features -- -D warnings
  • git diff --check

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.

1 participant