Step 01 · Cloudflare DNS
DNS resolution
The browser looks up static.ju25.uk and gets a CNAME to the distribution's *.cloudfront.net name. Anycast routes it to a nearby edge.
Configuration
A DNS-only (grey cloud) record at Cloudflare, so TLS ends at CloudFront with this platform's own certificate. The ACM validation CNAME stays in place for automatic renewal.
Security boundary
None of its own. DNS is outside AWS and managed by hand; integrity comes from TLS in step 03.
If it fails
A wrong or missing record means the name does not resolve, and nothing in AWS can help. If the validation record is deleted, ACM cannot renew and the certificate expires in June 2027. Runbook: certificate and DNS.
Step 02 · cloudfront.tf
CloudFront edge delivery
The edge serves from cache when it can and fetches from the origin on a miss. A viewer-request function sends the projects.ju25.uk host to the portfolio page.
Configuration
PriceClass_200, which includes India- Managed
CachingOptimized policy, compression on - Only
GET and HEAD; HTTP/2 and HTTP/3; IPv6 - 403 and 404 become
/404.html
Security boundary
The only public entry point. Every rule (TLS, headers, methods) is applied here, in one place.
If it fails
Edge outages are AWS's to fix. Misconfiguration is ours, and every change is planned on a pull request, approved and checked again for drift afterwards.
Step 03 · domain.tf, cloudfront.tf
HTTPS and TLS
CloudFront presents an ACM certificate for the custom names and redirects plain HTTP with a 301. HSTS tells browsers to use HTTPS for a year.
Configuration
- ACM certificate in
us-east-1, DNS-validated, sni-only minimum_protocol_version = TLSv1.2_2021viewer_protocol_policy = redirect-to-https- HSTS
max-age=31536000; includeSubDomains
Security boundary
Encryption and server identity in transit. A TLS 1.1 handshake was refused (checked 4 Dec 2026).
If it fails
An expired or mismatched certificate makes browsers refuse the site. ACM renews on its own while the validation record exists. The certificate is valid until 20 June 2027.
Step 04 · aws_cloudfront_origin_access_control
Origin Access Control
On a cache miss CloudFront does not fetch the object anonymously. OAC makes it sign the origin request as the CloudFront service, on behalf of this one distribution.
Configuration
origin_access_control_origin_type = "s3"
signing_behavior = "always"
signing_protocol = "sigv4"
Security boundary
Proves CloudFront's identity to S3. It replaces the legacy Origin Access Identity, which cannot sign every request type and is no longer recommended.
If it fails
If OAC is detached, S3 gets unsigned requests and answers 403, which visitors see as the 404 page. It fails closed: no content leaks.
Step 05 · Signature Version 4
SigV4 authentication
The origin request carries a SigV4 signature from the CloudFront service principal and the distribution's ARN as its source. S3 checks the signature before it reads the policy.
Configuration
Nothing to store or rotate. CloudFront holds the signing credentials, and the trust is expressed only in the bucket policy (step 07).
Security boundary
Authenticity and integrity of the origin request, so a third party cannot pose as this distribution.
If it fails
A bad signature is a 403 at S3, again failing closed. The configuration check oac-signs-sigv4 runs after every infrastructure change.
Step 06 · s3.tf
Private S3 origin
The bucket holds the files and nothing else can read them. Its name comes from a generated suffix, so it does not reveal the account ID.
Configuration
- Block Public Access: all four settings on
- Object ownership
BucketOwnerEnforced, so ACLs are off - Versioning, with old versions expiring after 30 days
- SSE-S3 encryption at rest
Security boundary
Confidentiality of the origin. Even a mistaken public policy is blocked by Block Public Access.
If it fails
A deleted or overwritten object can be recovered from its previous version for 30 days. Publishing a wrong commit is reversed by republishing an older one (rollback).
Step 07 · aws_s3_bucket_policy
Bucket policy enforcement
Two statements: read access for exactly one distribution, and a deny for any request that does not use TLS.
Allow s3:GetObject Principal: cloudfront.amazonaws.com
Condition: AWS:SourceArn = <this distribution>
Deny s3:* Principal: *
Condition: aws:SecureTransport = false
Configuration
Written in Terraform with the distribution's ARN, so another distribution, even in another account using the same service principal, is refused.
Security boundary
Authorisation: who may read which objects. Listing is never allowed, which is why a missing key returns 403.
If it fails
The configuration check only-this-distribution fails the run if the policy drifts. Runbook: CloudFront and S3 access.
Step 08 · deploy-site.yml, deploy_site.sh
GitHub Actions deployment
A merge that touches site/ runs validation, then waits for approval of the production environment, then publishes.
Configuration
- Refuse symbolic links; require
index.html and 404.html - Upload assets first, then HTML and
version.json - Delete files that are gone only at the end
- A rollback input accepts only commits already on
main
Security boundary
Change control: a named approval plus a commit that passed every check.
If it fails
A failed upload leaves the old pages in place, because pages are uploaded after their assets. The verify job fails the run if the live commit differs from the one expected.
Step 09 · infra/bootstrap/bootstrap.yaml
OIDC role assumption
The job asks GitHub for a signed OIDC token and exchanges it with AWS STS for credentials that last about an hour. Nothing long-lived exists to leak.
aud = sts.amazonaws.com
sub = repo:ShivaSai06@<owner-id>/secure-static-platform@<repo-id>:environment:production
Configuration
Three roles: plan (read-only, pull requests and main), apply (environment infra) and deploy (environment production: upload and invalidate only). Trust uses the numeric IDs, so a renamed or re-created repository cannot inherit it.
Security boundary
Identity of the pipeline. The pipeline can never create or change IAM roles; those come from the bootstrap stack.
If it fails
"Not authorized to perform sts:AssumeRoleWithWebIdentity" means the token's sub did not match. Runbook: diagnose OIDC failures.
Step 10 · deploy_site.sh
Cache invalidation
After uploading, the script invalidates /* and waits until every edge has dropped the old copies. Then the verify job asks for /version.json.
Configuration
- HTML and
version.json: Cache-Control: no-cache - Other assets:
public, max-age=300 - Invalidation path
/*, which is free at this volume
Security boundary
Consistency: visitors never get new HTML that points to assets missing from the edge.
If it fails
The run fails while waiting, and old content is served until the TTL expires. Running the workflow again is safe, because the upload and the invalidation are idempotent.