feat: public CDN for MinIO assets bucket #132
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform!132
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "126-minio-public-cdn"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
assetsbucket (anonymous GET only)postgres_wal,tf_state_backups) remain private (default deny)Changes
terraform/main.tf: Addedtailscale.com/funnel = "true"annotation tokubernetes_ingress_v1.minio_api_funnelingress resourceterraform/main.tf: Addedminio_s3_bucket_policy.assets_public_readresource — allows anonymouss3:GetObjectonarn:aws:s3:::assets/*Test Plan
tofu fmt && tofu validatepassestofu plan -lock=falseshows 2 to add, 1 to change, 0 to destroytofu applyclean — 2 added, 1 changedassets/westside/jerseys/IMG_4164.jpegreturns 200postgres_wal/returns 400 (denied)kubectl get ingress -n minio minio-api-funnelconfirms annotation{"tailscale.com/funnel":"true"}Review Checklist
tofu fmtappliedtofu validatepassesRelated
plan-wkq— Phase 11 (Girls Tryout) blocker: email images not rendering in GmailPR #132 Review
DOMAIN REVIEW
Tech stack: OpenTofu / Kubernetes / MinIO S3 / Tailscale funnel ingress
This PR makes two changes to
terraform/main.tf:Funnel annotation on
minio_api_funnelingress -- addstailscale.com/funnel = "true"to expose the MinIO S3 API (port 9000) to the public internet. This follows the exact same pattern used by every other funnel ingress in this file (grafana, alertmanager, forgejo, woodpecker, harbor, minio console, keycloak -- all at lines 543, 574, 671, 801, 978, 1076, 2067).Public-read bucket policy for
assetsbucket -- grants anonymouss3:GetObjectonarn:aws:s3:::assets/*. This is a standard S3 CDN pattern.Security analysis:
s3:GetObject(read-only). Nos3:ListBucket(directory listing not possible), nos3:PutObjectors3:DeleteObject(no anonymous writes).Principal: { AWS: ["*"] }scope is intentional for a public CDN use case.postgres-wal,tf-state-backups) use IAM user policies with specific principals and are unaffected by this change.minio_funnel) was already public-funneled with root password auth. Pre-existing, not in scope.Terraform quality:
jsonencode()for the policy block matches the existing pattern used for CNPG and TF backup IAM policies (lines 1418, 2143).assets_public_read) is clear and descriptive.minio_s3_bucket.assets.bucket.BLOCKERS
None.
This is a Terraform-only infrastructure change (no application code, no tests to write). The bucket policy is correctly scoped. No secrets committed. No unvalidated user input.
NITS
Minor: The bucket policy does not include a
Sidfield in the Statement. While optional in S3 policy syntax, addingSid = "PublicReadAssets"would make the policy self-documenting when inspected viamc admin policyor the MinIO console. Non-blocking.Minor: The
assetsbucket hasforce_destroy = true(line 1135). This is pre-existing and not introduced by this PR, but worth noting -- atofu destroyor bucket resource recreation would delete all CDN assets. Consider whether this is still appropriate now that the bucket serves as a public CDN backing store. Non-blocking, discovered scope.SOP COMPLIANCE
126-minio-public-cdnreferences #126)plan-wkq)tofu fmtapplied per test plantofu validatepasses per test planPROCESS OBSERVATIONS
VERDICT: APPROVED