Skip to content

fix: grant AWS SQLWorkspace RDS vendor permissions - #153

Merged
ciiiii merged 12 commits into
mainfrom
fix/aws-sqlworkspace-vendor-permissions
Aug 26, 2026
Merged

fix: grant AWS SQLWorkspace RDS vendor permissions#153
ciiiii merged 12 commits into
mainfrom
fix/aws-sqlworkspace-vendor-permissions

Conversation

@ciiiii

@ciiiii ciiiii commented Aug 19, 2026

Copy link
Copy Markdown
Member

Motivation

SQLWorkspace needs a PostgreSQL meta store per poolmember, but StreamNativeCloudBootstrapRole has no RDS write permissions, so rds:CreateDBSubnetGroup / rds:CreateDBInstance are denied by both the attached policy and the permission boundary.

Modifications

  • Add rds:* to AllowedServices in the permission boundary, so the boundary defines the service-level ceiling only.
  • Grant scoped RDS permissions in provision2.json.tpl, authorized by tag rather than resource name:
    • aws:RequestTag/Vendor = StreamNative on CreateDBInstance, CreateDBSubnetGroup and the AddTagsToResource authorization that RDS performs during creation.
    • aws:ResourceTag/Vendor = StreamNative on modify, delete and post-create tag operations.
    • PostgreSQL, private-access and encrypted-storage conditions preserved on CreateDBInstance.
    • An explicit Deny on removing the Vendor tag, since that would make the resource unmanageable.
  • Keep Describe* and ListTagsForResource unscoped, where RDS does not support resource-level tag authorization.

Notes:

  • rds:AddTagsToResource is required for creation to succeed: when tags are passed in a create call, RDS performs a second authorization against that action.
  • og:default* / pg:default* are needed because CreateDBInstance authorizes against the default parameter and option groups it attaches.
  • No snapshot, restore or delete-snapshot permissions. The meta store is disposable — automated backups are off and no snapshot is taken on delete.

Testing

  • terraform validate and terraform fmt -check pass in modules/aws/vendor-access.
  • Rendered policies parse as JSON; RDS statements are identical in the policy and the boundary.
  • Applied to a test account and exercised end to end: instance create, update and delete all passed, and a workload pod connects to the instance over TLS.

mattisonchao and others added 8 commits August 13, 2026 13:01
Co-authored-by: Codex <codex@openai.com>
The argo AWS v2 workflow provisions an RDS instance as the RisingWave
meta store (sqlworkspace-rds-* resources tagged Vendor=StreamNative).
Add scoped RDS create/manage/final-snapshot permissions to the
StreamNativeCloudProvisionPreservePolicy and the permission boundary,
mirroring the existing least-privilege SQLWorkspace S3 statements.
The upbound terraform provider queries engine versions and instance state
while provisioning; broaden the RDS grant from specific Describe actions to
rds:Describe* in the bootstrap policy and permission boundary.
The vendor-access S3 scope (s3_bucket_pattern, typically "snc-*") does not match the per-poolmember tiered-storage bucket names produced by terraform-aws-cloud's dns-bucket module (<pm>-tiered-storage-snc). Creating a new poolmember therefore fails at provision1 with s3:CreateBucket AccessDenied, before SQLWorkspace provisioning even starts.

- provision_preserve: allow s3:CreateBucket and bucket management on *-tiered-storage-snc alongside the configured bucket pattern
- runtime_iam_policy: allow ListBucket and object access on *-tiered-storage-snc alongside the configured bucket pattern
@ciiiii
ciiiii requested a review from a team as a code owner August 19, 2026 05:33
@ciiiii ciiiii changed the title fix: grant AWS SQLWorkspace S3 and RDS vendor permissions fix: grant AWS SQLWorkspace RDS vendor permissions Aug 20, 2026

@maxsxu maxsxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two requested changes to keep the IAM model consistent and avoid coupling authorization to SQLWorkspace resource names:

  1. In permission_boundary_iam_policy.json.tpl, please add rds:* to AllowedServices and remove the detailed SQLWorkspaceRDS* statements. The permission boundary should define the service-level ceiling; the scoped permissions belong in the attached provision policy. The boundary does not grant RDS access by itself—the effective permissions remain the intersection with the role's identity policies.

  2. In provision2.json.tpl, please replace the *-snc resource-name restrictions with tag-based authorization:

    • Use aws:RequestTag/Vendor = StreamNative for CreateDBInstance, CreateDBSubnetGroup, and the required AddTagsToResource authorization during creation.
    • Preserve the PostgreSQL, private-access, and encrypted-storage conditions on CreateDBInstance.
    • Use aws:ResourceTag/Vendor = StreamNative for modify, delete, and post-create tag operations.
    • Keep Describe* and list operations unscoped where RDS does not support resource-level tag authorization.
    • Prevent removal of the Vendor ownership tag, since removing it would make the resource unmanageable through the tag-based policy.

This removes the load-bearing -snc naming convention while retaining ownership scoping. The current consumer uses skip_final_snapshot = true, so I suggest removing CreateDBSnapshot from this policy rather than retaining a name-scoped snapshot rule. If final snapshots are required, that path should be handled and tested separately because the target snapshot does not yet have a resource tag during authorization.

References:

@ciiiii
ciiiii merged commit eb8c80d into main Aug 26, 2026
6 checks passed
@ciiiii
ciiiii deleted the fix/aws-sqlworkspace-vendor-permissions branch August 26, 2026 02:43
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.

3 participants