AWS security best practices: 15 ways to secure your AWS environment

AWS security best practices: 15 ways to secure your AWS environment

Santerra Holler October 09, 2026

AWS security best practices: 15 ways to secure your AWS environment

Book a Demo

Updated on November 4, 2026

Nearly every cloud breach starts with something the customer configured, such as a public bucket, a wildcard policy, a leaked access key or a disabled trail, even though AWS builds secure primitives. AWS security best practices are the controls that close those gaps: least-privilege identity with temporary credentials, a multi-account structure with guardrails, encryption backed by well-governed keys, private networking, organization-wide logging, continuous detection and automated response. The 15 practices below are current as of November 2026. They are grouped by security domain and ordered by impact, so a small team and an enterprise estate can both see what to do first.

Key takeaways

  • ✓Identity comes first in AWS: lock down the root user, replace long-lived access keys with roles and federation, and remove permissions nobody uses.
  • ✓A multi-account structure built with AWS Organizations and Control Tower, and enforced by service control policies, limits the blast radius of any single mistake.
  • ✓AWS Security Hub aggregates GuardDuty and Inspector findings but does not replace their detection work, so all three need to be enabled.
  • ✓An organization-wide CloudTrail trail with log file validation, stored in a locked-down Log Archive account, is the evidence base for incident response and audits.
  • ✓Automated remediation with EventBridge, Lambda and Systems Manager closes routine misconfigurations in minutes instead of leaving them in a ticket queue.

How to prioritise AWS security work

Start with identity and logging, then move to guardrails and data protection, then to detection, workload hardening and automation. Before you choose controls, confirm which layer you own, because the shared responsibility model shifts with each service.

The shared responsibility model by service

AWS secures physical data centres, hypervisors and managed service infrastructure. Your share of the work depends on the service:

Service AWS secures You secure
Amazon EC2 Hardware, hypervisor, physical network Guest OS patching, AMIs, security groups, instance roles, data encryption, IMDSv2
Amazon RDS Database engine patching (within your maintenance window), host OS Network exposure, database users, encryption at rest, snapshot sharing, backup retention
Amazon S3 Storage durability and service infrastructure Bucket policies, Block Public Access, encryption keys, versioning, access logging
AWS Lambda Runtime environment, OS and scaling Function code, dependencies, execution role scope, secrets, triggers
Amazon EKS Control plane availability and patching Worker nodes, add-ons, RBAC, pod identity, network policies, container images, API endpoint access

Rollout by maturity stage

Stage Practices (numbered below) Outcome
Foundational (first 30 days) 1, 2, 4, 11 Root locked, no long-lived keys, stale access removed, tamper-evident logging
Guardrails (days 31–60) 3, 5, 6, 7, 8, 9 Least privilege, account isolation, preventive policies, governed encryption and secrets
Operational (days 61–90) 10, 12, 13, 14, 15 Private networking, continuous detection, patched workloads, automated response, audit-ready evidence

Startups vs enterprises: a small team can run one organization with three accounts (management, security, workloads), IAM Identity Center, a single organization trail and Security Hub. An enterprise estate needs Control Tower, dedicated Log Archive and Audit accounts, delegated administrators for every security service, and organizational units split by environment and data sensitivity.

AWS IAM best practices

Identity misuse is behind most AWS compromises, so these four AWS IAM best practices carry the highest return: protect the root user, use temporary credentials everywhere, grant each identity only the permissions it needs and remove whatever goes unused.

1. Lock down the root user and enforce MFA

The root user can close the account, change billing and bypass most IAM controls, so reserve it for the few tasks that require it.

  • ✓Delete any root access keys and never create new ones.
  • ✓Enable hardware or passkey MFA on root in every account, and use centralized root access management in AWS Organizations to remove root credentials from member accounts.
  • ✓Alert the security channel through an EventBridge rule that matches CloudTrail events where userIdentity.type equals Root.
  • ✓Require MFA for all human users through your identity provider.

2. Replace long-lived access keys with roles and federation

Static IAM user access keys leak through code repositories, laptops, CI logs and baked AMIs, and they keep working until someone revokes them. Temporary credentials from AWS STS expire on their own.

  • ✓Federate workforce access through IAM Identity Center connected to Okta, Entra ID or another SAML/OIDC provider, with permission sets per job function.
  • ✓Give EC2 instances, ECS tasks and Lambda functions IAM roles instead of embedded keys.
  • ✓Use GitHub Actions or GitLab OIDC federation so pipelines assume a role per deployment instead of storing keys as CI secrets.
  • ✓Enforce IMDSv2 on EC2 to block SSRF-based theft of instance role credentials.

3. Enforce least privilege and ban wildcards

Wildcard permissions turn a minor compromise into a full account takeover. A common case is a deployment role granted "Action": "*", "Resource": "*" because it was faster than scoping.

// Bad: full access to every bucket
{ "Effect": "Allow", "Action": "s3:*", "Resource": "*" }

// Good: read-only access to one prefix
{ "Effect": "Allow", "Action": ["s3:GetObject"],
  "Resource": "arn:aws:s3:::invoices-prod/reports/*" }
  • ✓Validate every policy with IAM Access Analyzer policy checks in CI before deployment.
  • ✓Generate policies from CloudTrail activity with Access Analyzer policy generation, then trim them.
  • ✓Apply permissions boundaries to roles that developers can create themselves.
  • ✓Narrow where permissions work with conditions such as aws:SourceVpce, aws:PrincipalOrgID and aws:RequestedRegion.

4. Remove unused identities, permissions and stale keys

Unused roles and forgotten keys are an attacker’s easiest foothold, so IAM security best practices only hold if access shrinks over time instead of accumulating.

  • ✓Pull the IAM credential report monthly and disable any access key unused for 90 days.
  • ✓Use Access Analyzer unused access findings and last-accessed data to remove services a role never calls.
  • ✓Use Access Analyzer external access findings to catch roles, buckets and KMS keys shared outside your organization.

For example, a CI role unused for 120 days that still holds iam:PassRole and ec2:RunInstances should be deleted now. Reviewing it again next quarter leaves it exposed for another three months.

Multi-account architecture and AWS security controls

Account boundaries are the strongest isolation AWS offers. AWS Organizations puts workloads in separate accounts and applies preventive AWS security controls at the organization level, so no single account can opt out.

5. Build a multi-account landing zone

With a single account, one compromised credential reaches production, logs and backups at once. A landing zone separates them:

  1. Set up AWS Control Tower, which creates the management account, a Log Archive account and an Audit (security tooling) account.
  2. Create organizational units such as Security, Infrastructure, Workloads/Prod, Workloads/Non-Prod and Sandbox.
  3. Register the Audit account as delegated administrator for GuardDuty, Security Hub, Inspector, Macie, Config and IAM Access Analyzer, so the management account holds no workloads.
  4. Adopt a naming convention such as acme-prod-payments and mandatory tags (owner, environment, data-classification) enforced with tag policies.

6. Enforce guardrails with SCPs and Control Tower controls

Service control policies set the maximum permissions for every account in an OU, even for account administrators. A baseline SCP stops anyone from disabling security tooling:

{ "Effect": "Deny",
  "Action": ["cloudtrail:StopLogging", "cloudtrail:DeleteTrail",
             "guardduty:DeleteDetector", "config:StopConfigurationRecorder",
             "organizations:LeaveOrganization"],
  "Resource": "*" }

Add SCPs that deny unapproved Regions and block creating IAM users with access keys. AWS has also brought AWS Security Hub controls into the AWS Control Tower Control Catalog, covering security, cost, durability and operations, so you manage preventive, proactive and detective controls in one place.

  • ✓Identify the relevant entries by their control owner, AWS Security Hub.
  • ✓Enable them in Control Tower or automate with the ListControls, GetControl and EnableControl APIs.
  • ✓Check supported Regions before enabling a control, including AWS GovCloud (US) where it applies.

AWS infrastructure security best practices

These practices protect data and network paths. Govern encryption keys, lock down storage, centralise secrets and keep workloads off the public internet.

7. Govern encryption with AWS KMS

Most services encrypt by default with AWS managed keys. Those keys suit low-sensitivity data, but you cannot scope them, share them across accounts or disable them.

  • ✓Use customer managed keys for regulated data, cross-account access and any case where you must control who can decrypt.
  • ✓Separate duties in key policies. Key administrators manage the key and schedule its deletion but cannot use it, and application roles encrypt and decrypt but cannot change the policy.
  • ✓Enable automatic rotation on symmetric customer managed keys (yearly by default, configurable from 90 to 2,560 days). Old key material still decrypts existing data.
  • ✓Rely on envelope encryption. KMS encrypts a data key and the data key encrypts the payload, so large objects never travel to KMS.
  • ✓Alert on ScheduleKeyDeletion and DisableKey events, and enable EBS encryption by default in every Region.

8. Lock down S3 and protect backups

Public buckets remain the classic AWS leak, usually from a bucket policy with "Principal": "*" added for a quick test.

  • ✓Enable S3 Block Public Access at the account level and protect the setting with an SCP.
  • ✓Set Object Ownership to “bucket owner enforced” to disable ACLs entirely.
  • ✓Require TLS with a bucket policy that denies requests where aws:SecureTransport is false.
  • ✓Enable versioning, with lifecycle rules that expire old versions on a set schedule.
  • ✓Run Amazon Macie to find buckets holding PII, credentials or financial data.
  • ✓Make backups immutable with S3 Object Lock in compliance mode or AWS Backup Vault Lock in a separate account, so they survive ransomware that steals admin credentials.

9. Centralise secrets and keep them out of code

Use AWS Secrets Manager for credentials that need automatic rotation. It rotates RDS, Aurora and Redshift credentials natively and other secrets through a rotation Lambda. Use Systems Manager Parameter Store SecureString parameters for configuration values and secrets that rarely change.

  • ✓Scan commits with git-secrets or Gitleaks in pre-commit hooks and CI.
  • ✓Build AMIs and container images in a pipeline that never writes credentials to disk, and scan the output before publishing.
  • ✓Fetch Lambda secrets from Secrets Manager at runtime instead of storing them in plain-text environment variables.

10. Design private networks with controlled egress

Put databases, application servers and EKS nodes in private subnets, with only load balancers in public subnets. Use a NAT gateway per Availability Zone for required outbound traffic, and VPC endpoints for S3, DynamoDB, KMS, STS and ECR so that traffic never crosses the internet.

Control Use it for Behaviour
Security groups Instance- and ENI-level access; reference other security groups instead of CIDR ranges Stateful, allow rules only
Network ACLs Coarse subnet-level blocks, such as a known malicious range Stateless, allow and deny, evaluated in order
Route 53 Resolver DNS Firewall Blocking queries to malicious or unapproved domains, a common exfiltration path Domain allow and deny lists per VPC
AWS Network Firewall Filtering egress by domain or protocol Stateful inspection at the VPC level

Never allow 0.0.0.0/0 on ports 22 or 3389. Use Systems Manager Session Manager for shell access instead. Segment VPCs by environment and data sensitivity, and connect them through Transit Gateway route tables that keep non-production away from production.

AWS security tools and services for detection and posture

For detection and posture, the AWS security tools that matter most are CloudTrail, Config, GuardDuty, Inspector, Macie and Security Hub, each enabled organization-wide through a delegated administrator. Native AWS security tools work best when they all send findings to one place.

11. Turn on organization-wide, tamper-evident logging

  • ✓Create one organization trail covering all accounts and Regions, delivered to an S3 bucket in the Log Archive account.
  • ✓Enable log file validation so CloudTrail writes SHA-256 hashed, signed digest files you can verify with aws cloudtrail validate-logs.
  • ✓Encrypt the trail with a customer managed KMS key and protect the bucket with Object Lock.
  • ✓Add data events for sensitive S3 buckets and Lambda functions, because management events alone miss object reads.
  • ✓Enable VPC Flow Logs, S3 server access logs and Route 53 Resolver query logs. Keep hot logs searchable for 90 days and archive to S3 Glacier for the retention your regulators require.

12. Enable GuardDuty, Inspector and Security Hub together

AWS Security Hub collects findings, compliance checks and misconfiguration data from separate AWS services and correlates them in one place. According to a PeerSpot comparison of Security Hub and Google Security Command Center, it does not replace GuardDuty or Inspector, which still perform the core detection work. AWS describes Security Hub as providing near real-time risk analytics with prioritized insights across the environment.

  • ✓Enable the AWS Foundational Security Best Practices standard and the CIS AWS Foundations Benchmark in Security Hub.
  • ✓Turn on cross-Region aggregation into one home Region in the Audit account.
  • ✓Enable GuardDuty protection plans for S3, EKS, runtime monitoring, RDS and Lambda where those services run.

A short AWS security services list, grouped by control type:

Control type Services and what they cover
Preventive IAM and IAM Identity Center (authentication, federation), Organizations and Control Tower (SCPs, managed controls), KMS (encryption), WAF and Shield (layer 7 filtering, DDoS protection)
Detective CloudTrail (API activity), Config (configuration history, rules, conformance packs), GuardDuty (threats from logs and runtime signals), Inspector (CVEs), Macie (sensitive S3 data), Security Hub (aggregation and posture checks)
Investigative Amazon Detective (graph-based investigation of findings)

Your AWS security posture also depends on catching drift between audits. Continuous checks should flag permissive security groups, public storage, unencrypted data, disabled audit logs, weak password policies and unused resources. When comparing native coverage with dedicated cloud security posture management tools, look for multi-cloud support, automated remediation and integration with existing workflows.

13. Harden workloads: patching, containers and serverless

  • ✓Run Amazon Inspector for continuous CVE scanning of EC2, ECR images and Lambda functions, and block deployment of images with critical findings.
  • ✓Define SSM Patch Manager baselines that auto-approve critical patches after, for example, 7 days, and apply them in maintenance windows.
  • ✓On EKS, use EKS Pod Identity or IRSA for per-pod roles, restrict the cluster API endpoint to private access, enable control plane audit logs and apply network policies.
  • ✓On ECS, give each task its own task role and run containers as non-root with read-only root filesystems.
  • ✓On Lambda, give every function a dedicated execution role and scope trigger policies with aws:SourceArn to prevent confused-deputy invocation.
  • ✓Put AWS WAF with managed rule groups and rate-based rules in front of API Gateway, CloudFront and ALBs. Add Shield Advanced for internet-facing workloads that need DDoS response support.

AWS security and compliance: incident response and remediation

AWS security and compliance rest on the same work: pre-written playbooks, automated fixes for routine misconfigurations and controls mapped to frameworks. With those in place, the evidence already exists when an auditor or an attacker shows up.

AWS security risks and how to catch them

The biggest AWS security risks repeat across organizations. Each one has a preventive practice above and a detective control:

Risk Detective control Prevented by
Public S3 bucket Access Analyzer, Macie, Security Hub S3 controls Practice 8
Wildcard IAM permissions Unused access findings, Security Hub IAM controls Practice 3
Disabled CloudTrail EventBridge alert, Config rule cloudtrail-enabled Practice 6
Security group open to 0.0.0.0/0 Config rule restricted-ssh, Security Hub Practice 10, Firewall Manager policies

FAQ

What should you prioritize first when securing an AWS environment?

Start with identity and logging, then move to guardrails and data protection, followed by detection, workload hardening, and automation. The article emphasizes locking down root access, replacing long-lived keys, removing unused permissions, and enabling tamper-evident organization-wide logging first.

Does AWS Security Hub replace GuardDuty and Inspector?

No. Security Hub is the central aggregation and correlation layer for findings, compliance checks, and posture visibility, but GuardDuty and Inspector still perform the underlying threat detection and vulnerability scanning. The article recommends enabling all three together.

Why is a multi-account AWS architecture considered a security best practice?

A multi-account setup limits blast radius by isolating workloads, logs, backups, and security tooling into separate accounts. Using AWS Organizations and Control Tower also lets teams enforce guardrails such as service control policies so individual accounts cannot disable key security controls.

What does the article recommend for CloudTrail logging?

It recommends one organization-wide CloudTrail trail across all accounts and Regions, stored in a locked-down Log Archive account. The trail should use log file validation, encryption with a customer managed KMS key, and Object Lock protection, with added data events for sensitive S3 buckets and Lambda functions.

Why should teams replace long-lived AWS access keys with roles and federation?

Long-lived access keys are commonly exposed through repositories, laptops, CI logs, and machine images, and they remain valid until manually revoked. Roles and federation use temporary AWS STS credentials that expire automatically, which reduces the risk and impact of credential leaks.

Get a personalized demo
In your 30-minute demo, you'll see how Upwind:
virus-shield.svg
Uses runtime context to show which cloud risks are actually exploitable
eye-2.svg
Maps your workloads, APIs and AI agents in one view
check-shield.svg
Detects and responds to live attacks in real time
roku-logo.pngcarvana-logo.pngWaste_Management_logo.pngnu-logo.png
Add the Upwind RSS Feed to Slack
Connect the Upwind RSS Feed to your Slack.
Follow the how-to here.
Threat RSS
Add the Upwind RSS Feed to Slack
Connect the Upwind RSS Feed to your Slack.
Follow the how-to here.
Main RSS