Skip to content

pup: enable OAuth for ASM WAF commands - #757

Merged
platinummonkey merged 5 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/oauth-asm-waf
Sep 16, 2026
Merged

platinummonkey merged 5 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/oauth-asm-waf

Conversation

@srosenthal-dd

@srosenthal-dd srosenthal-dd commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

Switch 10 ASM WAF functions in security.rs from make_api_no_auth! to make_api! so they send the OAuth bearer token. Add appsec_protect_read and appsec_protect_write to the OAuth scope list in auth/types.rs.

Server-side dependency

The ASM WAF routes are in dd-go's rc-api service (chi router, JWT-based auth from the API gateway). The server-side gap is at the gateway level -- the rc-api service itself has no per-route authn method configuration. This is blocked pending investigation with the remote-config team (DAL-743).

Changes

  • src/commands/security.rs: 10 make_api_no_auth! -> make_api! swaps (5 asm_custom_rules_* + 5 asm_exclusions_*)
  • src/auth/types.rs: Added appsec_protect_read and appsec_protect_write to the OAuth scope list

Switch 10 ASM WAF functions in security.rs from make_api_no_auth!
to make_api! so they send the OAuth bearer token. Add appsec_protect_read
and appsec_protect_write to the OAuth scope list in auth/types.rs.

Server-side dependency: the ASM WAF routes in dd-go rc-api need to
accept OAuth at the gateway level. This is currently blocked pending
investigation with the remote-config team (DAL-743).
Add a mockito test that drives all ten ASM WAF operations (custom rules
and exclusion filters: list/get/create/update/delete) against an
OAuth-only config (bearer token, no API/APP keys) and asserts each
request carries the Authorization: Bearer header. Add scope tests
locking appsec_protect_read into read_only_scopes() and both
appsec_protect scopes into default_scopes().
@srosenthal-dd

Copy link
Copy Markdown
Member Author

E2E validated with a local release build of this branch against datadoghq.com, using a fresh OAuth login that includes the new scopes:

  • pup security asm-custom-rules list / get <id> — 200, rules returned
  • pup security asm-exclusions list / get <id> — 200, filters returned

All four read-only commands authenticate via the OAuth bearer token end-to-end. Write commands (create/update/delete) weren't exercised to avoid mutating live rules.

(from Claude Code)

@srosenthal-dd
srosenthal-dd marked this pull request as ready for review September 16, 2026 16:04
@srosenthal-dd
srosenthal-dd requested a review from a team as a code owner September 16, 2026 16:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T16:11:10.964865Z 3ac29c6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ac29c6c19

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/security.rs
Comment thread src/auth/types.rs
@platinummonkey
platinummonkey merged commit debfc79 into DataDog:main Sep 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants