AWS Cloud Security
Comprehensive AWS cloud infrastructure security - from IAM and access management through network security to audit and compliance.

What is AWS Cloud Security?
AWS Cloud Security encompasses all practices, tools, and processes for securing your cloud infrastructure on Amazon Web Services. Key areas include access management (IAM), network security (VPC, security groups), data protection, and monitoring. A properly configured AWS infrastructure is the foundation for secure operation of your applications in the cloud.
Why is AWS Security Critical?
When we create servers for application deployment, we introduce a whole range of security layers that must be protected. Just as we secure application code, third-party code, and container images, we must also secure the environment beneath the container - the server and the entire infrastructure network.
- Access Management: Who has access to which services, which users and what permissions on AWS
- Network Security: VPC configuration, security groups, NACLs, and firewall rules
- Data Protection: Encryption of data at rest and in transit, key management
- Audit & Compliance: Activity tracking, logging, and regulatory compliance
- Credential Management: Managing access keys, rotation, and secure storage
Security Risks from Misconfiguration
- Stolen credentials: Hardcoded access keys in pipelines or application code
- Excessive permissions: Users with admin access they do not need
- Unrevoked permissions: Former employees with active accounts
- Open ports: Publicly accessible SSH or database ports
- Missing MFA: Accounts without multi-factor authentication
AWS IAM - Identity and Access Management
AWS IAM is the service for managing access to your AWS account. It allows you to create users, groups, and roles with precise permissions.
Root User vs Admin User
The root user is created automatically when an AWS account is set up and has permissions to do absolutely anything. Do not use it for day-to-day operations, only for tasks that require root user credentials: for example changing the root user email or password of a standalone account, closing the account, or restoring permissions when the only IAM administrator accidentally revokes their own access. Since June 2025, AWS requires MFA for root users across all account types, including member accounts in AWS Organizations. In Organizations you can centrally remove root credentials from member accounts.
Best Practice: An Administrator in IAM Identity Center
Immediately after creating an AWS account, set up an administrative user in AWS IAM Identity Center and stop using the root user. AWS recommends that people access AWS through federation with temporary credentials, not through IAM users with long-term keys.
Users, Groups & Policies
Policies are highly granular - you can decide on read-only, write, or delete access to each specific resource.
You can also restrict access with additional conditions, for example limiting access to a specific region only. The example above follows the official AWS sample and uses the aws:ResourceTag/Owner condition.
IAM Roles for CI/CD Pipelines
For automated processes like CI/CD pipelines, do not use static access keys. Instead, use IAM Roles with short-lived tokens, for example through OIDC and AssumeRoleWithWebIdentity in GitLab CI/CD.
AWS Security Layers
Defense in Depth Approach
1. Account Security
Securing the AWS account
- MFA for all users (AWS requires it for the root user)
- Strong password policy
- Credential reports for auditing
- AWS Organizations for multi-account setup
2. Identity & Access Management
Managing identities and access
- Least privilege access - only the permissions needed
- IAM Roles instead of long-lived credentials
- Service-linked roles for AWS services
- Resource-based policies
3. Network Security
Securing the network
- VPC isolation - private and public subnets
- Security Groups (stateful firewall)
- Network ACLs (stateless firewall)
- VPC Flow Logs for monitoring
4. Data Protection
Protecting data
- Encryption at rest (KMS, S3 encryption)
- Encryption in transit (TLS/SSL)
- AWS Secrets Manager for credentials
- S3 bucket policies
5. Monitoring & Audit
Activity tracking and auditing
- CloudTrail for API logging
- CloudWatch for metrics and alarms
- AWS Config for compliance
- GuardDuty for threat detection
AWS Security Services
AWS IAM
Central service for managing users, groups, roles, and policies.
- Users, Groups, Roles
- Policies and Permissions
- Identity Federation
- Service Control Policies (AWS Organizations)
AWS Secrets Manager
Secure storage and rotation of credentials and API keys.
- Automatic secrets rotation
- RDS integration
- Access auditing
- Cross-account sharing
AWS CloudTrail
Logging of all API calls within an AWS account.
- Management events
- Data events
- Multi-region trails
- Log file integrity
Amazon GuardDuty
Threat detection from CloudTrail, VPC Flow Logs and DNS logs using threat intelligence and ML models.
- Anomaly detection
- Threat intelligence
- Automatic findings
- Integration with AWS Security Hub and Security Hub CSPM
Practical Example: Secure EC2 Deployment
AWS Security Best Practices - Summary
Account & Identity
- Never use the root user for routine operations
- MFA for all users
- Strong password policy
- Regular permission reviews
- Remove unused accounts
Access Management
- Least privilege - only the permissions needed
- Use Roles instead of long-lived credentials
- OIDC/Federation for CI/CD pipelines
- Resource-based policies where possible
- Long-term access keys only where a role cannot be used; update them when needed based on last used information
Network & Data
- Private subnets for application servers
- Security Groups with minimal rules
- No SSH from the internet - use Session Manager
- Encryption at rest and in transit
- VPC Flow Logs for auditing
What NOT to Do
- Hardcoded credentials in code or pipelines
- Sharing access keys between users
- Open port 22 (SSH) from the internet
- Wildcard (*) permissions in production
- Disabling CloudTrail logging
- Public S3 buckets without good reason (new buckets do not allow public access by default; keep Block Public Access on)
Sources
- AWS IAM User Guide: Security best practices in IAM (October 2026)
- AWS IAM User Guide: AWS account root user (October 2026)
- AWS What's New: AWS IAM now enforces MFA for root users across all account types (June 2025)
- AWS IAM User Guide: Amazon EC2: Allows starting or stopping EC2 instances a user has tagged (October 2026)
- GitLab Docs: Configure OpenID Connect in AWS to retrieve temporary credentials (October 2026)
- AWS Systems Manager User Guide: Configure instance permissions required for Systems Manager (October 2026)
- Amazon GuardDuty User Guide: What is Amazon GuardDuty? (October 2026)
- AWS What's New: AWS Security Hub is now generally available with near real-time risk analytics (December 2025)
- Amazon S3 User Guide: Blocking public access to your Amazon S3 storage (October 2026)