Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import_database does not work on AWS RDS databases. Because Superset tries to add permissions to all catalogs in RDS database, rather than just one catalog #32214

Open
3 tasks done
Oskar-Bonde opened this issue Feb 11, 2025 · 0 comments
Assignees
Labels
data:databases Related to database configurations and connections

Comments

@Oskar-Bonde
Copy link

Oskar-Bonde commented Feb 11, 2025

Bug description

This issue is regarding import_database in superset/commands/database/utils.py.

When importing dashboard assets using superset import_directory cli command the import_database function is called. This function tries to connect to and add permissions to all catalogs in a database, rather than the specific catalog specified in the sqlalchemy_uri in database.yaml.

Why is this an issue? If you use an AWS RDS database there is a catalog called rdsadmin. This catalog should only be access by AWS to manage automatic backups. When Superset tries run security_manager.add_permission_view_menu on all schemas in rdsadmin it fails, because it doesn't have access. This also breaks the least privileges principle.

We solved this issue using catalog_names.discard("rdsadmin"), but there should be a proper solution on master.

My suggestion is that superset only runs add_permissions on the catalog specified in the database.yaml.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

I don't know

Node version

Not applicable

Browser

Not applicable

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added the data:databases Related to database configurations and connections label Feb 11, 2025
@michael-s-molina michael-s-molina moved this from New to Blockers in Apache Superset 5.0.0 Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:databases Related to database configurations and connections
Projects
Status: Blockers
Development

No branches or pull requests

2 participants