AWS Security Guide: 7 Best Practices to Avoid Security Risks

There are many different benefits when engaging with Amazon Web Services as your cloud platform either as a standalone provider or as a multi-cloud, hybrid computing environment. AWS comes with a level of flexibility and agility in its service and infrastructure which makes it possible for an organization’s network to be innovative, responsive and open to quick change.

However, AWS comes with own set of challenges as well. While Amazon provides its subscribers with a wide variety of security features, organizations often do not use them to its fullest. While cloud security can be overwhelming at times, robust cybersecurity is still possible to achieve as long as potential pitfalls and best practices are kept in mind.

Insufficient Visibility

Additionally, companies use environments that make use of different cloud accounts across geographical regions. This encourages scattered visibility and makes identifying risks increasingly tricky. What you cannot see, you cannot secure.

Best Practice

Exposed Root Accounts

We strongly recommend that you do not use the root user for your everyday tasks, even the administrative ones. Instead, adhere to the best practice of using the root user only to create your first IAM user. Then securely lock away the root user credentials and use them to perform only a few account and service management tasks.

Best Practice

Extra, Unnecessary Privileges

However, administrators regularly assign overly necessary access to different AWS resources. This not only allows users to modify and gain access to resources they shouldn’t get but also allows malicious users to cause additional harm if these accounts are breached.

Best Practice

Rotate IAM Access Keys and Credentials

Best Practice

{ “Version”: “2012–10–17”, “Statement”: [ { “Effect”: “Allow”, “Action”: [ “iam:ListUsers”, “iam:GetAccountPasswordPolicy” ], “Resource”: “*” }, { “Effect”: “Allow”, “Action”: [ “iam:*AccessKey*”, “iam:ChangePassword”, “iam:GetUser”, “iam:*ServiceSpecificCredential*”, “iam:*SigningCertificate*” ], “Resource”: [“arn:aws:iam::*:user/${aws:username}”] } ]

}

Poor Authentication Practices

Best Practice

Get Rid of Unwanted Privileges

However, administrators regularly assign overly necessary access to different AWS resources. This not only allows users to modify and gain access to resources they shouldn’t get but also allows malicious users to cause additional harm if these accounts are breached.

Let’s take an example. User A who is new to IAM wants to create a new IAM user with privileges to manage EC2 instances for their AWS infrastructure. However, since User A is new, they are not sure what to put in the role’s access policy. To meet the immediate requirements, he/she attaches the PowerUserAccess policy that looks like this:

{ “Version”: “2012–10–17”, “Statement”: [ { “Effect”: “Allow”, “NotAction”: “iam:*”, “Resource”: “*” } ]

}

This is highly not recommended because any breach of this particular account will breach the entire AWS infrastructure for that particular company.

Best Practice

AWS offers more information about the policies that were last accessed under the Access Advisor tab. User A can scope down these application-specific permissions to get rid of permissions that are not used.

Unpatched Host Servers and Services

Traditional network vulnerability scanners are active on on-premise networks, but not so much when it comes to vulnerabilities in the cloud environment. This is one of the factors that needs to be taken into consideration while setting up your cloud migration strategy.

Best Practice

Alternatively, you can also manually perform updates as follows. The steps below are intended for use with Amazon Linux.

  1. Start a screen session in your shell window. Screen sessions help you reconnect to a SSH session even after being disconnected.

You can see all active screens by running

[ec2-user ~]$ screen -lsThere is a screen on:17793.pts-0.ip-12–34–56–78(Detached)

1 Socket in /var/run/screen/S-ec2-user.

You can then grab the process ID from the previous command and use it to connect to a detached screen as follows:

2. Run the yum update command to run the updates. Furthermore, you can add the — security flag to install just the security updates.

If you need to update multiple EC2 instances, consider using EC2 run command update to manage your Linux instances.

Broad IP Ranges for Security Groups and Unrestricted Outbound Traffic

Research by a reputed cloud analyst shows about 85% of resources that are associated with security groups have no restriction over outbound traffic whatsoever. An uncomfortably large number of companies were not adhering to network security related best practices and also had risky or misconfigurations.

Best practices in the industry rule that any outbound access needs to be restricted to inhibit data exfiltration during a security breach or any accidental data loss.

Best Practice

Conclusion

Thanks to Amazon, there are some useful security measures that organizations can use to control the security of their environment. Unfortunately, most do not. Some of these include IAM, AWS CloudTrail and permissions on cloud resources which can be configured in a manner to suit the organization’s requirements.

Originally published at www.womenwhocode.com.

--

--

We are a 501(c)(3) non-profit organization dedicated to inspiring women to excel in technology careers. https://www.womenwhocode.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Women Who Code

We are a 501(c)(3) non-profit organization dedicated to inspiring women to excel in technology careers. https://www.womenwhocode.com/