AWS Security Best Practices: A Practical Guide for Users
AWS security starts with identity, encryption and monitoring. These practices protect an AWS account, its data and its workloads from misuse.
On this page
Short answer
AWS security is the set of practices that protect an AWS account, its data and its workloads from unauthorised access, loss and misuse. The practices cover who can sign in, what the network exposes, how data is stored, and how problems are spotted early.
What does AWS security cover?
AWS security is the set of practices that protect an AWS account, its data and its workloads from unauthorised access, loss and misuse. It covers five areas: identity, network, data, logging and cost guardrails. Each area has a small number of habits that do most of the work.
AWS runs on a shared responsibility model. AWS secures the cloud itself: the data centres, the hardware and the software that runs the services. You secure what you put in the cloud: your accounts, your data, your network settings and your applications. Most breaches in cloud accounts come from the customer side of that line, not from AWS itself.
| Area | What it protects | First step |
|---|---|---|
| Identity | Who can sign in and act | Lock the root user, add MFA |
| Network | What the internet can reach | Close public access by default |
| Data | Stored files and databases | Turn on encryption and backups |
| Logging | Record of what happened | Turn on CloudTrail in all regions |
| Cost guardrails | Spending after a breach | Set billing alarms |
The order matters. Identity comes first, because a stolen sign-in bypasses every other control. Then close the network, then protect the data, then make sure you can see what happened. A team that works through the five areas in that order gets a solid baseline in a few days.
Who can access your account?
Access to an AWS account should go through named IAM users or roles, never through shared passwords or the root user for daily work. The root user can do anything in the account, including closing it, so it should be locked away with a strong password and hardware MFA, and used only for the few tasks that need it.
Give every person and every service only the permissions it needs, for only as long as it needs them. A developer who deploys code needs write access to the services they deploy, not to billing or to user management. A backup job needs read access to the data it copies, not delete access. Least privilege limits the damage when one credential is stolen.
Use roles instead of long-lived access keys wherever you can. Services running on EC2, Lambda or containers should take a role, so AWS hands them short-lived credentials automatically. For the keys that remain, rotate them on a schedule and remove any key that has not been used in months. Keys left in code, chat logs or old laptops are a common way in.
Turn on MFA for every human user, including administrators. A password alone is a single point of failure; a second factor means a stolen password is not enough. For teams, require MFA before anyone can change security settings or create new users.
How do you keep the network closed?
Keep the network closed by default and open only what a service must expose. Most workloads belong in private subnets, with only a load balancer or a small set of public endpoints facing the internet. Anything that does not need public access should not have a public address at all.
Security groups act as a firewall around each resource. Write rules that name the exact port and the exact source, such as port 443 from the load balancer only, instead of opening a wide range to the whole internet. Review the rules when a service changes, because old rules that allowed a temporary test often stay open for years.
Storage buckets deserve the same care. An S3 bucket with public read access can leak data to anyone who finds its address, so block public access at the account level and open a single bucket only when a real use case needs it. The same rule applies to databases: they should sit in private subnets and accept connections only from the application servers that use them.
For public-facing applications, add a web application firewall in front of them. It filters common web attacks before they reach your code, and it gives you one place to block a bad actor instead of patching every service. Serverless designs reduce the network surface further, since there are no servers to patch or expose directly. See AWS serverless architecture for how that pattern fits together.
How is data protected?
Data is protected by encryption, access control and backups. Turn on encryption at rest for storage and databases, and encryption in transit for every connection, so data is unreadable to anyone who intercepts it or picks up a discarded disk. AWS manages the keys by default, and you can bring your own keys when a policy or a customer contract requires it.
Control who can read each bucket and table, not just who can sign in. A policy that allows only the application role and the backup role is far safer than one that allows the whole account.
Backups are the last line of defence against deletion, whether accidental or malicious. Turn on versioning for storage buckets so an overwritten file can be restored, and take regular snapshots of databases with a retention period that matches your needs. Store a copy of critical backups in a second account or region, so a problem in one account cannot wipe the only copy.
Finally, know what data you hold and where it lives. Tag resources by owner and by sensitivity, and review the list each quarter. Data that nobody owns tends to be data nobody protects, and it is usually the data that leaks first. The same discipline applies to AI workloads, where models can reach sensitive data through the tools they use. See data security in AI systems for how to limit what a model can touch.
How do you spot trouble early?
You spot trouble early by logging everything and watching for the few signals that matter. Turn on CloudTrail in every region so every API call is recorded, and keep the logs in a bucket that only auditors can change. Without that trail, you cannot tell what an attacker did or which data they touched.
Add GuardDuty for threat detection and AWS Config for checking that resources stay in their intended state. GuardDuty watches for odd patterns such as sign-ins from unusual places or large data downloads, while Config flags resources that drift from your rules, such as a bucket that becomes public or a port that opens to the internet.
Set billing alarms as a security control, not just a cost control. A sudden jump in spend often means an attacker is running resources in your account, such as mining or sending spam. An alarm that fires within hours can save days of cleanup and a large bill.
Decide in advance who gets the alert and what they do first. An alert that goes to a shared inbox nobody reads is the same as no alert at all. One named person should own the first response: confirm the finding, isolate the affected resource, and then work out the cause.
What does a secure setup look like in practice?
A secure AWS setup is built in six steps, and each step takes hours, not weeks. Start with the account itself, then work outward to the network, the data and the monitoring, so the most dangerous gaps close first.
- Lock the root user. Set a long password, add hardware MFA, and store the credentials offline. Never use root for daily work.
- Create named users and roles. Give each person an IAM user with MFA, and give each service a role with only the permissions it needs.
- Close the network. Put workloads in private subnets, tighten security groups to named ports and sources, and block public access on storage.
- Turn on encryption and backups. Encrypt storage and databases, enable versioning, and schedule snapshots with a second copy elsewhere.
- Turn on logging and alerts. Enable CloudTrail in all regions, turn on GuardDuty and Config, and set billing alarms.
- Review on a schedule. Once a quarter, check unused users and keys, open ports, public buckets and failed sign-ins.
Run the same six steps for every new account, and keep a written checklist so the steps are not skipped under time pressure. New accounts are the ones most often left open, because the team is focused on shipping and security is assumed to come later.
When you need a recovery plan as well as a secure baseline, backups are the part most teams underinvest in. See best cloud backup software for how to choose a backup tool that fits an AWS setup.
Example (hypothetical): a small team locks down its account
Example (hypothetical): a team of 8 people runs one AWS account with 3 applications. They start with 24 long-lived access keys, no MFA on 3 users, and 2 storage buckets open to the public. Their cleanup takes one working week.
First they lock the root user and add MFA to all 8 users, which takes about 2 hours. Then they replace 20 of the 24 keys with roles, leaving 4 keys for tools that cannot use roles. Rotating those 4 keys takes 5 minutes each, or 20 minutes per quarter. The 2 public buckets are closed, and the team confirms from a test account that the data is no longer reachable.
They then turn on CloudTrail, GuardDuty and a billing alarm set at 20 percent above normal spend. In the first month the alarm fires once, for a test that ran longer than planned, and the team learns the alarm works. The total time spent is about 12 hours across the week, and the account now has no standing keys for people, no public buckets and a log of every action.
What are the common mistakes?
The most common AWS security mistakes are using the root user daily, leaving keys in code, opening storage to the public, and never looking at the logs. Each one is easy to fix, and each one is a common way attackers get in.
- Daily root use. The root user can do anything, so a stolen root password is a full account takeover. Use named users and roles instead.
- Keys in code. Access keys pasted into code, chat or old laptops leak constantly. Use roles, and rotate any key you cannot remove.
- Public buckets. A bucket opened for a quick test often stays open. Block public access at the account level and open single buckets only on purpose.
- Wide security groups. Opening all ports to the whole internet for a test is common and dangerous. Name the port and the source.
- No logging. Without CloudTrail you cannot tell what happened after an incident. Turn it on in every region.
- Alerts nobody owns. An alarm that goes to an unread inbox helps no one. Give one person the first response.
Key takeaways
- Identity comes first: lock root, add MFA and use roles instead of keys
- Close the network by default and open only named ports to named sources
- Encrypt data, control who can read it, and keep a backup copy elsewhere
- Turn on CloudTrail, GuardDuty and billing alarms, and give one person the first response
- Review unused users, keys, open ports and public buckets every quarter
Frequently asked questions
What is the shared responsibility model?
The shared responsibility model splits security between AWS and the customer. AWS secures the cloud itself, such as data centres and hardware, while the customer secures what they put in the cloud, such as accounts, data and network settings.
Should I use the AWS root user?
No, not for daily work. The root user can do anything in the account, so it should be locked with a strong password and hardware MFA, and used only for the few tasks that need it. Daily work should go through named IAM users and roles.
How often should access keys be rotated?
Rotate keys on a regular schedule, such as every 90 days, and remove any key that has not been used in months. Better still, replace long-lived keys with roles, so AWS hands out short-lived credentials automatically.
Is MFA really necessary for every user?
Yes. A password alone is a single point of failure, and passwords leak often. MFA means a stolen password is not enough to sign in, which blocks the most common way attackers enter an account.
What is the first thing to check in an old AWS account?
Check identity first: unused users, old access keys and users without MFA. Then check for public storage buckets and wide-open security groups. Those checks find the most dangerous gaps in most accounts.
How do I know if my AWS account was breached?
Look for sign-ins from unusual places, new users or roles you did not create, and sudden jumps in spending. CloudTrail logs show what was done and when, which is why logging should be turned on before an incident happens.