How kareemcheez/aws-secure-stack works
This project is an AWS environment built with Terraform to deploy a secure-by-default AWS architecture. Its purpose is to enforce cloud best practices—specifically in security (IAM policies, AWS Config, SecurityHub, and optionally GuardDuty), cost control (budgets), logging (CloudTrail and S3 logging), and hosting a static site. The modularized Terraform structure indicates that each major component (IAM policies, logging, budgets, etc.) is encapsulated into a dedicated module, making it easier to manage and enable/disable features as needed.
Main Components
• Control Plane: The root Terraform configuration files (main.tf, variables.tf, outputs.tf, versions.tf) that wire the modules together.
• Modules: Each module represents a specific AWS resource or feature. The key modules include:
– IAM Policy – enforcing AWS account password and security rules.
– S3 Logging – creating an encrypted, versioned S3 bucket for logs.
– CloudTrail – capturing multi-region API event logs directed to the S3 bucket.
– Budgets – managing monthly budget alerts.
– Static Site – hosting a public static website on S3.
– Optionals (e.g., GuardDuty, AWS Config, SecurityHub) – which enhance security monitoring and compliance (these are disabled by default but can be enabled via terraform.tfvars).
• External Services: AWS Services such as S3, CloudTrail, IAM, AWS Budgets, and the AWS hosting environment.
Relationships and Interactions
• Modules may interact indirectly via shared resources (for example, CloudTrail’s logs are stored in the S3 Logging module’s bucket).
• Budget Alerts help monitor expenditures across the deployed resources.
• The static site may have dependencies on CloudFront (if used) or S3 bucket configuration for hosting, connecting it to domain management, if applicable.
• Optionally, when enabled, security modules such as SecurityHub, GuardDuty, and AWS Config work in tandem to provide comprehensive security posture monitoring, forming a feedback loop with the security policies enforced through IAM.
Architectural Patterns and Design Principles
• Modularity: The project’s folder structure shows clear separation of concerns with independent modules.
• Infrastructure as Code (IaC): Using Terraform declarative configurations for reproducibility and version control.
• Secure-by-default Setup: Emphasis on security (IAM policies, encrypted logging, monitoring via CloudTrail/SecurityHub) throughout the design.
• Optional/Feature Flags: Clear ability to enable or disable specific features like GuardDuty and AWS Config by configuration variables, providing flexibility based on cost or compliance requirements.
Relevant Technologies and Frameworks
• Terraform (v1.5+): For provisioning the AWS components.
• AWS Provider (v5+): To manage AWS services.
• AWS Services: S3 for logging and static site hosting, CloudTrail for auditing, AWS Budgets for financial control, and security services such as IAM, SecurityHub, GuardDuty, and AWS Config.