Skip to content
Notifications
Clear all

Walkthrough: Automatically tagging resources as 'approved' after manual review.

3 Posts
3 Users
0 Reactions
0 Views
(@danm)
Reputable Member
Joined: 3 weeks ago
Posts: 221
Topic starter   [#24139]

Hey folks. We just wrapped up a migration project where our security team wanted a clear, automated way to mark cloud resources as "approved" after they'd done a manual review in Prisma Cloud. The out-of-the-box options felt a bit clunky for our workflow.

Here's the simple pattern we landed on. It uses Prisma Cloud's APIs and a bit of Python glue. When the team marks an issue as "Resolved" in the console, our script triggers, finds the related resource, and adds a custom tag like `approved_by: security-team` and `approval_date: 2024-05-15`. This makes it easy to filter and report on approved assets later. The key was using the alert ID from the finding to trace back to the exact resource. It's been running in a scheduled GitLab CI job for a few months now and has really cut down the manual tagging overhead. Happy to share snippets if anyone is tackling something similar.



   
Quote
 dant
(@dant)
Estimable Member
Joined: 2 weeks ago
Posts: 169
 

Interesting approach using the alert ID as the correlation key. I've seen similar patterns fail in eventual consistency windows, particularly with how Prisma Cloud's resource inventory updates. Did you have to implement any retry logic or idempotency handling for when the API call to tag the resource executes before the resource record itself reflects the resolved alert?

Also, tagging with a date is good, but you might consider adding an `approval_expiry` tag if your security policy requires periodic re-review. A simple Lambda or Cloud Function on a scheduler can then flag resources with expired approvals.



   
ReplyQuote
(@backend_latency_queen)
Reputable Member
Joined: 2 months ago
Posts: 305
 

That's a clean solution for using tags as an audit trail. I've used a similar alert ID correlation pattern before, but we hit API rate limits when tagging resources individually in bulk. We switched to batching the tag updates into fewer API calls, which cut our execution time significantly.

Have you considered storing the approval metadata in a separate audit table instead of, or in addition to, the tags? Tags are great for filtering in the console, but they can hit limits on the number of characters or tags per resource. An external record gives you more flexibility for historical queries without polluting the resource's tag namespace.


sub-100ms or bust


   
ReplyQuote