Skip to content

Conversation

@MuneebUllahKhan222
Copy link
Contributor

@MuneebUllahKhan222 MuneebUllahKhan222 commented Dec 24, 2025

Description:

Datadog token verification previously relied on an App-key–dependent endpoint (/api/v2/users) to validate the Application Key + API Key combination. If this endpoint returned an error (for example, due to insufficient App Key permissions), the detector would mark the token as unverified and skip API key validation entirely.
Additionally, Datadog uses region-specific API endpoints. When the hard-coded cloud endpoint did not match the user’s actual region, verification requests were sent to the wrong endpoint.

This behaviour caused valid Datadog API keys to be reported as unverified, resulting in false negatives.

To resolve this issue I have done the following changes:

  • Removed API key validation from this detector and introduced a dedicated API key detector here

  • Added support for user-provided Datadog endpoints.

    • If no endpoint is explicitly provided, the detector attempts to infer it from the data using regex.
    • If inference fails, it falls back to the default cloud endpoint hard-coded in the codebase.

Checklist:

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

@MuneebUllahKhan222 MuneebUllahKhan222 requested a review from a team December 24, 2025 07:13
@MuneebUllahKhan222 MuneebUllahKhan222 requested review from a team as code owners December 24, 2025 07:13
@MuneebUllahKhan222 MuneebUllahKhan222 changed the title Datadog detector verification fix [INS-240] Datadog detector verification fix Dec 24, 2025
@MuneebUllahKhan222 MuneebUllahKhan222 changed the base branch from main to datadog-detector-multi-endpoint December 24, 2025 08:58
@MuneebUllahKhan222 MuneebUllahKhan222 changed the base branch from datadog-detector-multi-endpoint to main December 24, 2025 11:55
@kashifkhan0771
Copy link
Contributor

Good work 🚀

Copy link
Contributor

@nabeelalam nabeelalam left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks!

@MuneebUllahKhan222 MuneebUllahKhan222 changed the title [INS-240] Datadog detector verification fix [INS-254] Datadog detector verification fix Jan 14, 2026
@MuneebUllahKhan222 MuneebUllahKhan222 changed the title [INS-254] Datadog detector verification fix [INS-254] Datadog detector verification fix and endpoint configuration Feb 3, 2026
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.

4 participants