Skip to content

Commit d4a2857

Browse files
committed
fix: update playbook documentation with corrections
- Remove blue-green deployment references from production flow - Mask thumbprint in security docs (show only last 4 chars) - Add missing staging environment to secrets configuration - Add production-specific networking with dedicated AWS account - Add domain/URL configuration for all environments - Update production URL to https://core.kainos-studio.com/
1 parent 2aed824 commit d4a2857

File tree

4 files changed

+138
-13
lines changed

4 files changed

+138
-13
lines changed

playbook/CICD_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ TF_VAR_session_secret
174174
5. Terraform plan
175175
6. Senior team approval gate
176176
7. Pre-deployment backup
177-
8. Blue-green deployment
177+
8. Standard deployment
178178
9. Health checks
179179
10. Smoke tests
180180
11. Traffic switching

playbook/NETWORKING_GUIDE.md

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,87 @@ The Kainos Studio infrastructure implements a multi-tier network architecture wi
88

99
## 🟠 AWS Network Architecture
1010

11+
### Domain and URL Configuration
12+
13+
| Environment | Domain/URL | SSL Certificate | Purpose |
14+
|-------------|------------|-----------------|---------|
15+
| **Development** | `https://dev.core.kainos-studio.com/` | Wildcard SSL | Development testing |
16+
| **Staging** | `https://staging.core.kainos-studio.com/` | Wildcard SSL | Pre-production validation |
17+
| **Production** | `https://core.kainos-studio.com/` | Dedicated SSL | Live production service |
18+
19+
#### DNS Configuration
20+
```hcl
21+
# Development
22+
resource "aws_route53_record" "dev" {
23+
zone_id = var.hosted_zone_id
24+
name = "dev.core.kainos-studio.com"
25+
type = "A"
26+
27+
alias {
28+
name = aws_cloudfront_distribution.dev.domain_name
29+
zone_id = aws_cloudfront_distribution.dev.hosted_zone_id
30+
evaluate_target_health = false
31+
}
32+
}
33+
34+
# Staging
35+
resource "aws_route53_record" "staging" {
36+
zone_id = var.hosted_zone_id
37+
name = "staging.core.kainos-studio.com"
38+
type = "A"
39+
40+
alias {
41+
name = aws_cloudfront_distribution.staging.domain_name
42+
zone_id = aws_cloudfront_distribution.staging.hosted_zone_id
43+
evaluate_target_health = false
44+
}
45+
}
46+
47+
# Production
48+
resource "aws_route53_record" "prod" {
49+
zone_id = var.hosted_zone_id
50+
name = "core.kainos-studio.com"
51+
type = "A"
52+
53+
alias {
54+
name = aws_cloudfront_distribution.prod.domain_name
55+
zone_id = aws_cloudfront_distribution.prod.hosted_zone_id
56+
evaluate_target_health = false
57+
}
58+
}
59+
```
60+
61+
### Account Structure
62+
63+
| Environment | AWS Account | Purpose |
64+
|-------------|-------------|---------|
65+
| **Development** | Shared Account | Development and testing |
66+
| **Staging** | Shared Account | Pre-production validation |
67+
| **Production** | Dedicated Account | Production workloads with enhanced security |
68+
1169
### VPC Design
1270

71+
#### Development and Staging (Shared Account)
1372
| Component | Configuration | Purpose |
1473
|-----------|---------------|---------|
1574
| **VPC CIDR** | 10.0.0.0/16 | Main network space |
16-
| **Availability Zones** | 3 AZs minimum | High availability |
75+
| **Availability Zones** | 2-3 AZs | High availability |
76+
| **DNS Resolution** | Enabled | Service discovery |
77+
| **DNS Hostnames** | Enabled | Resource naming |
78+
79+
#### Production (Dedicated Account)
80+
| Component | Configuration | Purpose |
81+
|-----------|---------------|---------|
82+
| **VPC CIDR** | 10.1.0.0/16 | Isolated production network |
83+
| **Availability Zones** | 3 AZs minimum | Maximum availability |
1784
| **DNS Resolution** | Enabled | Service discovery |
1885
| **DNS Hostnames** | Enabled | Resource naming |
86+
| **Flow Logs** | Enabled to S3 | Enhanced monitoring |
87+
| **VPC Peering** | Cross-account if needed | Secure connectivity |
1988

2089
#### VPC Configuration
90+
91+
##### Development/Staging VPC
2192
```hcl
2293
resource "aws_vpc" "kainos_core" {
2394
cidr_block = "10.0.0.0/16"
@@ -27,18 +98,55 @@ resource "aws_vpc" "kainos_core" {
2798
tags = {
2899
Name = "kainos-core-vpc-${var.environment}"
29100
Environment = var.environment
101+
Account = "shared"
102+
}
103+
}
104+
```
105+
106+
##### Production VPC
107+
```hcl
108+
resource "aws_vpc" "kainos_core_prod" {
109+
cidr_block = "10.1.0.0/16"
110+
enable_dns_hostnames = true
111+
enable_dns_support = true
112+
113+
tags = {
114+
Name = "kainos-core-vpc-prod"
115+
Environment = "production"
116+
Account = "dedicated"
117+
}
118+
}
119+
120+
# Enhanced Flow Logs for Production
121+
resource "aws_flow_log" "prod_vpc" {
122+
iam_role_arn = aws_iam_role.flow_log.arn
123+
log_destination = aws_s3_bucket.flow_logs.arn
124+
traffic_type = "ALL"
125+
vpc_id = aws_vpc.kainos_core_prod.id
126+
127+
tags = {
128+
Name = "kainos-core-prod-flow-logs"
30129
}
31130
}
32131
```
33132

34133
### Subnet Architecture
35134

135+
#### Development and Staging (Shared Account)
36136
| Subnet Type | CIDR Blocks | Purpose | Internet Access |
37137
|-------------|-------------|---------|-----------------|
38138
| **Public Subnets** | 10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24 | NAT Gateways, Load Balancers | Direct |
39139
| **Private Subnets** | 10.0.11.0/24, 10.0.12.0/24, 10.0.13.0/24 | Lambda functions, RDS | Via NAT |
40140
| **Database Subnets** | 10.0.21.0/24, 10.0.22.0/24, 10.0.23.0/24 | Database instances | None |
41141

142+
#### Production (Dedicated Account)
143+
| Subnet Type | CIDR Blocks | Purpose | Internet Access |
144+
|-------------|-------------|---------|-----------------|
145+
| **Public Subnets** | 10.1.1.0/24, 10.1.2.0/24, 10.1.3.0/24 | NAT Gateways, Load Balancers | Direct |
146+
| **Private Subnets** | 10.1.11.0/24, 10.1.12.0/24, 10.1.13.0/24 | Lambda functions, RDS | Via NAT |
147+
| **Database Subnets** | 10.1.21.0/24, 10.1.22.0/24, 10.1.23.0/24 | Database instances | None |
148+
| **Management Subnets** | 10.1.31.0/24, 10.1.32.0/24, 10.1.33.0/24 | Bastion hosts, monitoring | Restricted |
149+
42150
#### Subnet Configuration
43151
```hcl
44152
# Public Subnets
@@ -431,13 +539,22 @@ resource "aws_flow_log" "vpc" {
431539

432540
### Pre-deployment Security
433541

542+
#### Development and Staging
434543
- [ ] VPC/VNet CIDR doesn't overlap with existing networks
435544
- [ ] Security groups/NSGs follow least privilege principle
436545
- [ ] NACLs configured for defense in depth
437546
- [ ] VPC endpoints/Private endpoints configured for AWS/Azure services
438547
- [ ] Flow logs enabled for network monitoring
439548
- [ ] DNS resolution properly configured
440549

550+
#### Production (Additional Requirements)
551+
- [ ] Dedicated AWS account with isolated networking
552+
- [ ] Enhanced VPC Flow Logs to S3 with encryption
553+
- [ ] Cross-account IAM roles configured securely
554+
- [ ] Network monitoring and alerting configured
555+
- [ ] Bastion host access properly configured
556+
- [ ] Management subnet access restricted to authorized personnel
557+
441558
### Post-deployment Security
442559

443560
- [ ] Network connectivity tested from all subnets

playbook/diagrams/prod-deployment-flow.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ flowchart LR
88
Security --> Plan[📋 Terraform Plan<br/>Production]
99
Plan --> Senior[👔 Senior Team<br/>Approval]
1010
Senior --> Backup[💾 Pre-deployment<br/>Backup]
11-
Backup --> BlueGreen[🔄 Blue-Green<br/>Deployment]
12-
BlueGreen --> Health[❤️ Health Checks<br/>& Monitoring]
11+
Backup --> Deploy[🚀 Deploy to<br/>Production]
12+
Deploy --> Health[❤️ Health Checks<br/>& Monitoring]
1313
Health --> Smoke[🧪 Smoke Tests<br/>& Validation]
1414
Smoke --> Traffic[🔀 Traffic Switch<br/>to New Version]
1515
Traffic --> Live[🌟 Production<br/>Live]
@@ -40,7 +40,7 @@ flowchart LR
4040
classDef trigger fill:#6C757D,stroke:#fff,stroke-width:2px,color:#fff
4141
4242
class Traffic,Live success
43-
class GHA,BlueGreen,Health process
43+
class GHA,Deploy,Health process
4444
class Security,Plan,Smoke validation
4545
class Senior,Backup approval
4646
class Rollback,Previous,Investigate,Review rollback
@@ -63,7 +63,7 @@ flowchart LR
6363
4. **Terraform Plan**: Generate production infrastructure changes
6464
5. **Senior Approval**: Senior team and management review
6565
6. **Pre-deployment Backup**: Create full system backup
66-
7. **Blue-Green Deployment**: Deploy to parallel environment
66+
7. **Deploy to Production**: Deploy directly to production environment
6767
8. **Health Checks**: Comprehensive system health validation
6868
9. **Smoke Tests**: Critical functionality validation
6969
10. **Traffic Switch**: Gradually shift traffic to new version
@@ -82,11 +82,10 @@ flowchart LR
8282

8383
### Deployment Strategy
8484

85-
#### Blue-Green Deployment
86-
- **Blue Environment**: Current production version
87-
- **Green Environment**: New version being deployed
88-
- **Traffic Switching**: Gradual migration from blue to green
89-
- **Rollback Capability**: Instant switch back to blue if issues
85+
#### Direct Production Deployment
86+
- **Strategy**: Direct deployment to production environment
87+
- **Validation**: Comprehensive pre-deployment testing in staging
88+
- **Rollback Capability**: Terraform state rollback if issues occur
9089

9190
#### Health Checks
9291
- **Application Health**: API endpoints responding correctly
@@ -104,7 +103,7 @@ flowchart LR
104103
- ✅ All security and compliance checks pass
105104
- ✅ Senior team approval obtained
106105
- ✅ Pre-deployment backup completed successfully
107-
-Blue-green deployment executes without errors
106+
-Production deployment executes without errors
108107
- ✅ All health checks pass
109108
- ✅ Smoke tests validate critical functionality
110109
- ✅ Traffic switch completes successfully

playbook/security/CLOUD_CONNECTIVITY_SECURITY.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The project uses OpenID Connect (OIDC) for secure, keyless authentication from G
1616
|-----------|---------------|---------|
1717
| **OIDC Provider** | `https://token.actions.githubusercontent.com` | GitHub Actions identity provider |
1818
| **Audience** | `sts.amazonaws.com` | AWS STS service identifier |
19-
| **Thumbprint** | `6938fd4d98bab03faadb97b34396831e3780aea1` | GitHub's certificate thumbprint |
19+
| **Thumbprint** | `************************************aea1` | GitHub's certificate thumbprint |
2020
| **Subject Claims** | `repo:org/repo:ref:refs/heads/main` | Repository and branch restrictions |
2121

2222
### IAM Roles and Policies
@@ -175,6 +175,15 @@ AZURE_TENANT_ID: tenant-id
175175
AZURE_SUBSCRIPTION_ID: dev-subscription-id
176176
```
177177
178+
#### Staging Environment
179+
```yaml
180+
# GitHub Environment Secrets (with protection rules)
181+
AWS_ROLE_ARN: arn:aws:iam::ACCOUNT:role/GitHubActions-Staging-Role
182+
AZURE_CLIENT_ID: staging-client-id
183+
AZURE_TENANT_ID: tenant-id
184+
AZURE_SUBSCRIPTION_ID: staging-subscription-id
185+
```
186+
178187
#### Production Environment
179188
```yaml
180189
# GitHub Environment Secrets (with protection rules)

0 commit comments

Comments
 (0)