Skip to content

feat(security): add findings mute and rules bulk-convert commands#545

Merged
platinummonkey merged 2 commits into
chore/upgrade-dd-sdk-to-masterfrom
feat/security-mute-findings-bulk-convert
May 30, 2026
Merged

feat(security): add findings mute and rules bulk-convert commands#545
platinummonkey merged 2 commits into
chore/upgrade-dd-sdk-to-masterfrom
feat/security-mute-findings-bulk-convert

Conversation

@platinummonkey
Copy link
Copy Markdown
Collaborator

@platinummonkey platinummonkey commented May 30, 2026

Summary

Adds two security-monitoring commands surfacing endpoints from the SDK upgrade (base chore/upgrade-dd-sdk-to-master, PR #539).

Changes

  • src/commands/security.rsfindings_mute (MuteSecurityFindings, now stable per SDK #1519/#1660) and rules_bulk_convert (BulkConvertExistingSecurityMonitoringRules, SDK #1675)
  • src/main.rspup security findings mute --file and pup security rules bulk-convert --file subcommands + dispatch
  • src/auth/types.rs — add security_monitoring_findings_write to default_scopes(). Muting findings requires this scope; previously only security_monitoring_findings_read was requested at pup auth login, so OAuth2 users would have hit a 403 on mute (API/app-key users were unaffected). Left out of read_only_scopes() since it is a write scope.
  • docs/COMMANDS.md — documented the new commands

Neither endpoint is gated as an unstable op, so client.rs is unchanged.

New commands

pup security findings mute --file body.json
pup security rules bulk-convert --file body.json

Testing

  • test_findings_mute_ok / _error, test_rules_bulk_convert_ok / _error (happy + error paths)
  • Validated locally against the pinned SDK rev: cargo test green, cargo clippy clean (no warnings in pup code). Request-body fixtures match the SDK schemas (MuteFindingsRequest with mute/reason/relationships; convert payload uses the ruleIds serde field name).
  • Scope addition is covered by the existing default_scopes/read_only_scopes tests (contains-based, plus the read-only ⊆ default invariant); no count assertions affected.

🤖 Generated with Claude Code


Generated by Claude Code

- pup security findings mute: wraps MuteSecurityFindings (stable, SDK #1519/#1660)
- pup security rules bulk-convert: wraps BulkConvertExistingSecurityMonitoringRules (#1675)

Co-Authored-By: Claude <noreply@anthropic.com>
@platinummonkey platinummonkey requested a review from a team as a code owner May 30, 2026 08:12
The new `pup security findings mute` command calls mute_security_findings,
which the Datadog API gates behind the security_monitoring_findings_write
authorization scope. default_scopes() only requested
security_monitoring_findings_read, so OAuth2 users would get a 403 on mute
while API/app-key users (with full app-key permissions) succeeded.

Add security_monitoring_findings_write to default_scopes() so `pup auth
login` requests it. Left out of read_only_scopes() since it is a write
scope.

Co-Authored-By: Claude <noreply@anthropic.com>
@platinummonkey platinummonkey merged commit 10c51d3 into chore/upgrade-dd-sdk-to-master May 30, 2026
6 checks passed
@platinummonkey platinummonkey deleted the feat/security-mute-findings-bulk-convert branch May 30, 2026 10:17
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