GSM Infrastructure applies defense-in-depth across every layer of the stack: GitHub Actions authenticates to AWS using short-lived OIDC tokens (no static credentials), IAM policies are split into three scope-limited layers, sensitive runtime secrets never leave SSM Parameter Store, network ingress is constrained to specific CIDR blocks and AWS-managed prefix lists, S3 is hardened with encryption and HTTPS enforcement, and container images are automatically scanned for vulnerabilities on upload. This page documents each control so you can audit, extend, or adapt them to your organization’s requirements.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ti-infinite/GSMInfrastructure/llms.txt
Use this file to discover all available pages before exploring further.
Keyless CI/CD Authentication
The base stack provisions a GitHub OIDC provider (token.actions.githubusercontent.com) and an InfraExecutorRole that GitHub Actions assumes via sts:AssumeRoleWithWebIdentity. No long-lived AWS access keys are stored in GitHub Secrets — only the role ARN (AWS_INFRA_ROLE_ARN) is needed.
The trust policy uses StringLike conditions to restrict role assumption to a specific organization, repository, and deployment context:
| Subject pattern | Grants access to |
|---|---|
repo:{org}/{repo}:ref:refs/heads/{branch} | Pushes to the configured branch (e.g., main) |
repo:{org}/{repo}:environment:infra-* | Jobs in environments named infra-dev, infra-qa, infra-prod |
repo:{org}/{repo}:environment:backend-* | Jobs in backend-dev, backend-qa, backend-prod |
repo:{org}/{repo}:environment:frontend-* | Jobs in frontend-dev, frontend-qa, frontend-prod |
CreateOIDCProvider should be set to false if you have already deployed the base stack once (or if another stack in the same AWS account has already created the GitHub OIDC provider). Only one OIDC provider per issuer URL is allowed per AWS account.IAM Least-Privilege Policies
TheInfraExecutorRole has three separate IAM policies attached. Every resource ARN is prefixed with {env}- so a policy deployed for dev cannot operate on prod resources.
ParametersResourcesPolicy
Covers infrastructure lifecycle operations:
- SNS — create/delete/subscribe topics scoped to
{env}-* - Budgets — create/update/delete budgets scoped to
{env}-* - SSM GetParameter — read parameters under
/{env}/*and/aws/service/*(for ECS-optimized AMI lookups) - SSM Session Manager —
StartSession,TerminateSession,ResumeSession,DescribeSessions,GetConnectionStatuson any resource (required for Console access) - KMS — encrypt/decrypt with any key in the account/region
- IAM — full role/policy/instance-profile lifecycle scoped to
{env}-*ARNs - CloudFormation — full stack lifecycle scoped to
{env}-*stacks - EventBridge — put/delete rules and targets on any rule ARN
RuntimeResourcesPolicy
Covers compute and observability resources:
- ECS — cluster, service, and task definition management scoped to
{env}-*clusters/services/task-definitions;DeregisterTaskDefinitionandDescribeTaskDefinitionare allowed on*(required by AWS) - CloudWatch Logs — create/delete log groups and set retention policies scoped to
/*/{env}-* - ELB — NLB lifecycle scoped to
{env}-*load balancers - Lambda — function lifecycle scoped to
{env}-*functions - GuardDuty — detector create/update/delete/describe on any detector ARN in the account
StaticResourcesPolicy
Covers storage, CDN, compute, and registry resources:
- S3 — full bucket/object lifecycle scoped to
{env}-*-frontendbucket ARNs only - CloudFront — distribution and OAC lifecycle; CloudFront Function lifecycle
- EC2 — security group, instance, EIP, and ENI management (describe actions require
*per AWS) - ECR — repository lifecycle, image push/pull, scanning config scoped to
{env}-*repositories;GetAuthorizationTokenrequires* - EventBridge Scheduler — schedule and schedule group lifecycle (
*required by AWS) - Service Discovery — Cloud Map namespace and service lifecycle (
*required by AWS) - Route 53 — hosted zone and record set management (
*required by AWS)
Secrets Management
Runtime secrets are stored in AWS SSM Parameter Store and injected into containers at task start — they are never embedded in container images, CloudFormation templates, or GitHub variables. The two secrets used by the backend services are:| Secret | Default SSM path | Used by |
|---|---|---|
JWT_SECRET | dev/backend/JWT_SECRET | All four services |
DB_MASTER_URL | dev/backend/DB_MASTER_URL | auth, application, operations |
Secrets field using full parameter ARNs:
S3 and CloudFront Security
The frontend S3 bucket ({env}-{appName}-frontend) is hardened with three controls:
1. All public access blocked:
s3:GetObject only when the request AWS:SourceArn matches the specific CloudFront distribution ARN — any direct S3 access attempt is denied.
Versioning is enabled on the bucket, providing an audit trail of deployed frontend builds.
Network Isolation
The EC2 instance runs in a private subnet with no inbound internet-facing rules. All legitimate inbound traffic arrives through CloudFront. ECS Security Group — inbound rules:| Protocol | Port | Source | Purpose |
|---|---|---|---|
| TCP | 80 | pl-3b927c52 (CloudFront prefix list) | HTTPS traffic forwarded by CloudFront |
| TCP | 80 | VPC CIDR (VpcIdCidrBlock) | Internal VPC traffic |
| TCP | 8081–8083 | 172.17.0.0/16 (Docker bridge) | Inter-container communication |
| Protocol | Port | Destination | Purpose |
|---|---|---|---|
| TCP | 443 | 0.0.0.0/0 | HTTPS outbound (SSM, ECR, AWS APIs) |
| UDP | 53 | 0.0.0.0/0 | DNS resolution |
| TCP | 8081–8083 | 172.17.0.0/16 | Inter-container communication |
| TCP | DBPortParameterName (default 1433) | SqlServerProviderIp | Database connectivity |
ECR Security
Every ECR repository created by the infrastructure stack has image scanning on push enabled:GuardDuty
TheRuntimeResourcesPolicy grants the InfraExecutorRole permissions to manage GuardDuty detectors: