Skip to content

Conversation

@skellish-turbot
Copy link
Contributor

Overview

This PR adds a new policy pack that automatically sets AWS account aliases using organization account names for accounts that are part of an AWS organization. This enables a more user-friendly navigation experience by displaying meaningful names in breadcrumbs instead of numerical account IDs.

Features

  • Stack Native Implementation: Uses Terraform templates to manage account aliases as infrastructure
  • Smart Priority Logic: Existing aliases take precedence over organization names
  • Robust Name Sanitization: Converts organization names to AWS-compliant aliases (lowercase, alphanumeric + hyphens, 3-63 chars)
  • Flexible Configuration: Defaults to Check mode with option to enable Enforce mode
  • Comprehensive Documentation: Includes examples, sanitization rules, and usage instructions

How It Works

  1. Account has alias: Do nothing (existing alias takes precedence)
  2. Account has organization name only: Create alias from sanitized organization name
  3. Account has neither: Do nothing (account number displays)

Example

Before:
After:

Files Added

  • policy_packs/aws/guardrails/enforce_account_organization_name_display/
    • main.tf - Policy pack definition
    • policies.tf - Stack Native policy settings
    • providers.tf - Terraform provider configuration
    • README.md - Comprehensive documentation

Testing

The policy pack follows all policy pack guidelines and includes:

  • Proper directory structure and naming conventions
  • Check mode as default with Enforce option
  • Complete documentation with examples
  • AWS-compliant name sanitization logic

- Python script to report Guardrails errors and alarms
- Support for multiple output formats (text, JSON, CSV)
- Flexible filtering by resource type, states, and time windows
- Command-line interface with comprehensive options
- Integration with Turbot CLI via _turbot.py module
- Comprehensive documentation and examples
…ror_report

- Add --insecure flag to disable SSL certificate verification for self-signed certs
- Add shebang line and make script executable for direct execution
- Add comprehensive test suite with 36 unit tests (89% coverage)
- Update README with SSL feature, testing docs, and chmod instructions
- Add pytest dependencies to requirements.txt
- Move from error-reporting/ to turbot_error_report/ under python_utils/
- Add case-sensitive state validation with helpful error messages
- Require full URIs for --resource-type (remove short form support)
- Add custom error handler with help instructions for all validation errors
- Update tests to cover new validation logic and URI requirements
- Update README with URI-only examples and clearer documentation
- Change timestamp filter from 'timestamp' to 'stateChangeTimestamp'
- Ensures script results match UI reports exactly
- Update unit tests to use correct field name
- Restore original .gitignore from main branch
- These changes were accidentally included in the initial commit
- PR should only contain error reporting utility changes
- The main README.md was accidentally deleted in the initial commit
- This PR should only add the error reporting utility, not modify existing files
- Restore original README.md from main branch
- Create policy pack to automatically set AWS account aliases using organization names
- Use Stack Native policies to manage account aliases as infrastructure
- Implement priority logic: existing aliases take precedence over organization names
- Add robust name sanitization (lowercase, alphanumeric + hyphens, 3-63 chars)
- Default to Check mode with option to enable Enforce mode
- Include comprehensive documentation with examples and sanitization rules
- Follow policy pack guidelines with proper directory structure and naming
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