Skip to content

feat: Enhance account-nuke.sh with SSO filters#68

Merged
venkatamutyala merged 1 commit into
mainfrom
venkatamutyala-patch-1
Oct 11, 2025
Merged

feat: Enhance account-nuke.sh with SSO filters#68
venkatamutyala merged 1 commit into
mainfrom
venkatamutyala-patch-1

Conversation

@venkatamutyala

@venkatamutyala venkatamutyala commented Oct 11, 2025

Copy link
Copy Markdown
Contributor

User description

Added filters for SSO resources in account-nuke script.


PR Type

Enhancement


Description

  • Added SSO resource filters to account-nuke script

  • Configured exclusions for AWS SSO SAML providers and roles

  • Enhanced script to preserve SSO infrastructure during cleanup


Diagram Walkthrough

flowchart LR
  A["account-nuke.sh"] --> B["common preset"]
  A --> C["new sso preset"]
  C --> D["IAMSAMLProvider filter"]
  C --> E["IAMRole filter"]
  C --> F["IAMRolePolicyAttachment filter"]
Loading

File Walkthrough

Relevant files
Enhancement
account-nuke.sh
Add SSO resource preservation filters                                       

tools/aws/account-nuke.sh

  • Added new sso preset with filters for SSO resources
  • Configured regex filter for IAMSAMLProvider with pattern
    AWSSSO_.*_DO_NOT_DELETE
  • Added glob filters for IAMRole and IAMRolePolicyAttachment with
    pattern AWSReservedSSO_*
+12/-0   

Added filters for SSO resources in account-nuke script.
Copilot AI review requested due to automatic review settings October 11, 2025 18:50

Copilot AI 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.

Pull Request Overview

This PR enhances the account-nuke script by adding SSO (Single Sign-On) resource filters to prevent accidental deletion of critical AWS SSO components during account cleanup operations.

Key changes:

  • Added a new sso preset with filters for IAM SAML providers, roles, and policy attachments
  • Implemented protection patterns for AWS Reserved SSO resources and SAML providers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codiumai-pr-agent-free

Copy link
Copy Markdown

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@venkatamutyala venkatamutyala merged commit 5b069b1 into main Oct 11, 2025
3 checks passed
@venkatamutyala venkatamutyala deleted the venkatamutyala-patch-1 branch October 11, 2025 18:51
@codiumai-pr-agent-free

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use property filter for clarity

For the IAMRolePolicyAttachment filter, add property: "RoleName" to explicitly
target the role name, making the filter more robust and its intent clearer.

tools/aws/account-nuke.sh [59-61]

 IAMRolePolicyAttachment:
-- type: "glob"
+- property: "RoleName"
+  type: "glob"
   value: "AWSReservedSSO_*"
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly points out that filtering on the RoleName property is more explicit and robust for IAMRolePolicyAttachment than relying on a glob match against the default composite identifier (RoleName/PolicyArn).

Low
  • More

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants