Skip to content

Harden legacy AWS deployment templates#88

Open
genson1808 wants to merge 1 commit into
BAWES-Universe:masterfrom
genson1808:codex/aws-deploy-template-hardening-55
Open

Harden legacy AWS deployment templates#88
genson1808 wants to merge 1 commit into
BAWES-Universe:masterfrom
genson1808:codex/aws-deploy-template-hardening-55

Conversation

@genson1808
Copy link
Copy Markdown

/claim #55

Summary

  • harden the legacy aws-template.sh, aws-template-dev.sh, and aws-template-docker.sh helpers so they no longer write inline GitHub private/public key placeholders into deploy key files
  • require GITHUB_DEPLOY_KEY_PATH and install the deploy key with mode 600, with optional public-key copy when GITHUB_DEPLOY_PUBLIC_KEY_PATH is provided
  • replace the account-specific ECR registry literals in the Docker template with AWS_ECR_ACCOUNT_ID, AWS_ECR_REGION, AWS_ECR_IMAGE, and AWS_ECR_TAG variables
  • add docs and a local regression guard for the deployment-template hardening rules

Demo

  • docs/demo/studenthub-55-aws-template-hardening-demo.webm

Validation

  • python3 scripts/check-aws-template-hardening.py
  • bash -n aws-template.sh && bash -n aws-template-dev.sh && bash -n aws-template-docker.sh
  • python3 -m py_compile scripts/check-aws-template-hardening.py
  • git diff --check
  • ffprobe -v error -show_entries format=duration,size -show_streams docs/demo/studenthub-55-aws-template-hardening-demo.webm

Safety scope

No live AWS/IAM calls, key rotation, bucket policy changes, candidate data, credentials, or private exports are accessed or committed.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@genson1808 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 37 minutes and 17 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ebc6b324-c487-4f53-9482-7767a19f2a8e

📥 Commits

Reviewing files that changed from the base of the PR and between 7b023ff and 6fcdbe9.

⛔ Files ignored due to path filters (1)
  • docs/demo/studenthub-55-aws-template-hardening-demo.webm is excluded by !**/*.webm
📒 Files selected for processing (5)
  • aws-template-dev.sh
  • aws-template-docker.sh
  • aws-template.sh
  • docs/security/aws-deployment-template-hardening.md
  • scripts/check-aws-template-hardening.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dosubot
Copy link
Copy Markdown

dosubot Bot commented May 15, 2026

Related Knowledge

1 document with suggested updates is ready for review.

BAWES Universe

StudentHub – Complete Services & Infrastructure Map (Org-wide)”
View Suggested Changes
@@ -4,7 +4,7 @@
 |------------------|--------------|------------------------------------------------------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------|-------------------------------------------|
 | AWS S3           | Storage      | Hosts static frontend builds and stores backend exports                 | admin portal, backend                         | [studenthub-admin/.circleci/config.yml](https://github.com/BAWES-Universe/studenthub-admin/blob/b453c0c7d0b0f170964a82948fb09da610cde5e9/.circleci/config.yml#L1-L202), [studenthub/README.md](https://github.com/BAWES-Universe/studenthub/blob/ca90a5502040ba8191fe9f80d29d0b6a4d2a6152/README.md#L9-L150) | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | s3://studenthub-admin-dev/, s3://studenthub-admin-prod/, s3://studenthub-uploads-dev-server/ |
 | AWS CloudFront   | Hosting/CDN  | CDN for serving static frontend assets                                  | admin portal                                  | [studenthub-admin/.circleci/config.yml](https://github.com/BAWES-Universe/studenthub-admin/blob/b453c0c7d0b0f170964a82948fb09da610cde5e9/.circleci/config.yml#L1-L202)                  | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | EWGE3N1OKYVZX (dev), E3PPAL159PAQIU (staging) |
-| AWS ECR          | Storage      | Stores Docker images for backend deployment                             | backend                                       | [studenthub/README.md](https://github.com/BAWES-Universe/studenthub/blob/ca90a5502040ba8191fe9f80d29d0b6a4d2a6152/README.md#L9-L150)               | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | 438663597141.dkr.ecr.eu-west-2.amazonaws.com |
+| AWS ECR          | Storage      | Stores Docker images for backend deployment                             | backend                                       | [studenthub/README.md](https://github.com/BAWES-Universe/studenthub/blob/ca90a5502040ba8191fe9f80d29d0b6a4d2a6152/README.md#L9-L150)               | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ECR_ACCOUNT_ID, AWS_ECR_REGION, AWS_ECR_IMAGE, AWS_ECR_TAG | Registry configured via environment variables (deployment template hardening) |
 | CircleCI         | Other        | CI/CD pipeline for building and deploying frontend                      | admin portal                                  | [studenthub-admin/.circleci/config.yml](https://github.com/BAWES-Universe/studenthub-admin/blob/b453c0c7d0b0f170964a82948fb09da610cde5e9/.circleci/config.yml#L1-L202)                  | context: org-global                    | N/A                                       |
 | Railway          | Hosting      | Deploys and manages backend environments and MySQL databases            | backend, cron/worker                          | [studenthub/railway/railway.md](https://github.com/BAWES-Universe/studenthub/blob/ca90a5502040ba8191fe9f80d29d0b6a4d2a6152/railway/railway.md#L1-L34), [studenthub/environments/dev-server-railway/deployments/july_2025/3_july_2025_deployment.sh](https://github.com/BAWES-Universe/studenthub/pull/8) | RAILWAY_DOCKERFILE_PATH                | mysql.railway.internal                    |
 | Netlify          | Hosting/CDN  | Hosts static frontend portals (SPA routing)                             | staff portal, admin portal                    | [studenthub-staff/src/_redirects](https://github.com/BAWES-Universe/studenthub-staff/pull/12), [studenthub-staff/angular.json](https://github.com/BAWES-Universe/studenthub-staff/pull/13), [studenthub-admin/src/netlify.toml](https://github.com/BAWES-Universe/studenthub-admin/pull/10) | NODE_VERSION, NODE_OPTIONS             | N/A                                       |

[Accept] [Edit] [Decline]

How did I do? Any feedback?  Join Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant