feat: AWS Cross-Account IAM Authentication for Aurora#37585
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
b671e8a to
1b3ca11
Compare
There was a problem hiding this comment.
Code Review Agent Run #a37de5
Actionable Suggestions - 1
-
superset/db_engine_specs/aws_iam.py - 1
- Use of assert statement detected · Line 435-441
Review Details
-
Files reviewed - 12 · Commit Range:
8d189af..c56bf89- .pre-commit-config.yaml
- pyproject.toml
- requirements/development.txt
- superset/db_engine_specs/aurora.py
- superset/db_engine_specs/aws_iam.py
- superset/db_engine_specs/mysql.py
- superset/db_engine_specs/postgres.py
- superset/db_engine_specs/redshift.py
- tests/unit_tests/db_engine_specs/test_aurora.py
- tests/unit_tests/db_engine_specs/test_aws_iam.py
- tests/unit_tests/db_engine_specs/test_mysql_iam.py
- tests/unit_tests/db_engine_specs/test_redshift_iam.py
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- MyPy (Static Code Analysis) - ✔︎ Successful
- Astral Ruff (Static Code Analysis) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.
Documentation & Help
Code Review Agent Run #6347c2Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Vitor-Avila
left a comment
There was a problem hiding this comment.
lgtm! left non-blocking comments
| import boto3 | ||
| from botocore.exceptions import ClientError | ||
| except ImportError as ex: | ||
| raise SupersetSecurityException( |
There was a problem hiding this comment.
Nice! Do you think it makes sense to add boto3 as an entry to optional-dependencies as well? https://github.com/apache/superset/blob/master/pyproject.toml#L114
There was a problem hiding this comment.
that could also update the pip install message
| raise SupersetSecurityException( | ||
| SupersetError( | ||
| message="boto3 is required for AWS IAM authentication.", | ||
| error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR, | ||
| level=ErrorLevel.ERROR, | ||
| ) | ||
| ) from ex |
There was a problem hiding this comment.
I'm seeing here we don't have the "Install it with: pip install boto3" portion. Is that intentional? I was thinking if there was any way to make this DRYer (like in a util method or decorator) but I think the local import needs to be on the method using it, right?
| class AWSIAMConfig(TypedDict, total=False): | ||
| """Configuration for AWS IAM authentication.""" | ||
|
|
||
| enabled: bool |
There was a problem hiding this comment.
Out of curiosity, what would be the use-case for setting it up with enabled=False?
Cover remaining 6.1 features across existing and new pages: MCP server: - Add MCP_PARSE_REQUEST_ENABLED to configuration reference - Add Audit Events section (MCP tool calls appear in Action Log) - Add Tool Pagination section documenting cursor-based pagination (#37674) Using AI with Superset: - Expand Available Tools Reference into categorized sections covering all new tools added in the MCP tool library expansion - Document preview-first workflow for generate_chart / update_chart Creating Your First Dashboard: - AG Grid server-side column filters (#35683): filter types, AND/OR logic, pagination interaction - Time Shift for AG Grid Interactive Table (#37072) - Dynamic currency formatting via currency_code_column dataset field (#36416) - ECharts option editor in Explore for JSON overrides (#37868) - Table chart: export behavior with search filter active (#36281) - Dataset folders: organizing datasets into groups (#36239) - PWA file handler: opening CSV/XLS/Parquet from OS file manager (#36191) - Share database connection option when adding a new database (#37940) Exploring Data: - Dialect-aware Format SQL (applies selected database dialect) (#39393) - SQL Lab tips section and time range natural language expressions (consolidates content from batch 4 for master branch) Importing/Exporting: - Dashboard import overwrite behavior: charts are replaced not duplicated (#36551) - UUID in REST API POST responses for dataset/chart/dashboard (#37806) New pages: - docs/docs/using-superset/embedding.mdx: embedded SDK quick start, resolvePermalinkUrl callback (#36924), DISABLE_EMBEDDED_SUPERSET_LOGOUT feature flag (#37537), URL parameters, guest token security notes - docs/admin_docs/configuration/aws-iam.mdx: cross-account IAM authentication for Aurora and Redshift via STS AssumeRole (#37585), configuration reference, trust policy setup guide Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SUMMARY
This PR adds AWS cross-account IAM authentication support for Aurora PostgreSQL, Aurora MySQL, Redshift Serverless, and provisioned Redshift clusters. This eliminates the need to store long-lived database credentials in Superset by using AWS STS AssumeRole to obtain temporary credentials.
Key changes:
AWSIAMAuthMixinclass insuperset/db_engine_specs/aws_iam.pythat handles:PostgresEngineSpec,MySQLEngineSpec,RedshiftEngineSpec) to support IAM auth viaencrypted_extra configurationAuroraPostgresEngineSpecandAuroraMySQLEngineSpecclasses for explicit Aurora supportrole_arnandexternal_idin the UIConfiguration example:
{ "aws_iam": { "enabled": true, "role_arn": "arn:aws:iam::DATA_ACCOUNT_ID:role/SupersetDatabaseAccess", "external_id": "your-unique-external-id", "region": "us-east-1", "db_username": "superset_iam_user" } }BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION