AWS security best practices assessments using Prowler

Aakib
11 min readJan 2, 2025

--

In today’s world securing your cloud infrastructure is not just a priority it is a necessity . As more businesses use AWS to run their applications and store data , it is important to keep these systems safe from hackers and other risks . AWS provides many tools to help with security , but it can be tricky to set everything up correctly. This is where Prowler comes in a tool that helps you check if your AWS setup is secure.

In this blog, we will break down how Prowler works , why AWS security is important , and how you can use this tool to make sure your AWS environment is safe

Why Security in AWS is Essential

When you use AWS, both you and AWS share responsibility for keeping things secure. AWS is responsible for the security of the cloud , like managing data centers and hardware . But you are responsible for securing everything inside the cloud, like how you manage user access, set up servers , and protect data

If something is not set up properly in your AWS account like if sensitive data is not protected it could lead to a data theft or other security problems . Regularly checking your setup to make sure it follows best security practices helps prevent these issues. That is where Prowler can help you to enhance your AWS security

What is Prowler

Prowler is a free tool that helps you check your AWS account for security problems . It checks your AWS setup and finds any weak spots that could lead to attacks

Prowler looks at different parts of your AWS account , such as:

  • Networking (VPC) : Are your network configurations secure, and are access points restricted?
  • Virtual machines (EC2) : Are your servers secure?
  • Security Groups : Are your firewall rules properly configured to limit access ?
  • User permissions (IAM) : Do your users and roles have the right permissions and access ?
  • Storage (S3) : Are your files secure, and who can access them?
  • Logging (CloudTrail) : Is all activity in your AWS account being monitored
  • Database (RDS) : Is your data encrypted and protected from unauthorized access ?
  • Backups (EBS/Snapshot) : Are your backups secure and regularly tested for recovery ?
  • Multi-Factor Authentication (MFA) : Is MFA enabled for all users to add an extra layer of security ?

It also tells you how to fix any issues if finds .

Key Features of Prowler

1. CIS Benchmark Checks

The CIS Benchmark is a set of rules that explains how to keep an AWS environment secure . Prowler checks if your AWS setup follows these rules , making sure there are no unsafe settings

2. Scans large no. of AWS Services

AWS has many services (like EC2, S3, and IAM), and each one needs to be configured securely. Prowler scans many of these services to find security issues, such as:

  1. EC2 instances allowing anyone on the internet to connect.
  2. S3 buckets that are publicly accessible when they should not be.
  3. Not having encryption, which keeps sensitive data safe

3. Helps in Following the rules and regulations.

If your company needs to follow certain security rules (like GDPR or HIPAA), Prowler can help by checking if your AWS environment meets these requirements. For example , it will verify if your data is encrypted or if you are keeping track of all changes and activity in your account.

4. Customizable

Prowler comes with many built in checks , but you can also create your own checks if you have specific needs . This makes it flexible for companies with unique security requirements.

5. Detailed Reports

After Prowler runs a scan, it creates a report showing all the security issues it found. The report also suggests how to fix these problems. This helps both technical teams and management understand what needs to be done to improve security.

How to Install and Setup Prowler

The first step in using Prowler is to install it on your computer or system. Prowler is a command line tool , which means you will be using a terminal or command prompt to run it

1.Installation of Prowler :

  1. Open a terminal on your computer. If you are using Windows, you can use Git Bash or PowerShell. On macOS or Linux, use the default terminal. In my case I am using ubuntu
  2. Run the following command in your terminal to download Prowler:
git clone https://github.com/prowler-cloud/prowler

3. This command clone the github repository in your local machine

4. Run the follwing comands to install prowler

cd prowler
apt install python3-poetry
poetry shell
poetry install
python prowler.py -v

5. Now Prowler is installed and ready to run.

2. Configure Your AWS Credentials

To allow Prowler to scan your AWS environment, it needs permission to access your AWS account. This is done through AWS IAM credentials. Before running Prowler, make sure you have the AWS CLI is installed in your local machine. If you don’t have the aws cli installed then follow the below command to install the aws cli

1. Installing aws-cli

sudo su
apt update
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo apt-get install unzip -y
unzip awscliv2.zip
sudo ./aws/install
aws --version

2. Configure aws

1. Create an IAM user

click on iam

2. click on user →create user

3. Give a name to your user and tick on provide user access to management console and then click on I want an IAM user option

5. choose a password for your user →click next

6. Attach the policies directly to your iam user → click next

note →I will provide the administrator accesss for now but we careful while attaching the policies at your workapce

review and create user

7. click on create user

8. download your password file if it is autogenerated otherwise it is your’s choice

9. Now click on your Prowler IAM user →security credentials

10. scroll down to access keys and create an access keys

11.choose aws cli from the options listed

12. click next and download you csv file for username and password

13. go to your terminal and type →aws configure

14. Now it is ask to your access key and secret key for this open your csv file and paste the access and secret key and remain everything default

15. Now you are ready to configure aws from your terminal

16. Once your AWS credentials are properly set up, Prowler will be able to scan your AWS environment for security issues.

3. Run a Basic Security Scan

Now you have Prowler installed and your AWS credentials configured, you can run your first security scan. This basic scan checks your AWS environment against the CIS AWS Foundations Benchmark that is a set of security practices.

To see a prowler dashboard run the following command

prowler dashboard

To start the basic scan, type the following command into your terminal:

prowler aws #if you are working with aws
output of the above command

What this command does:

  • It runs all the built-in checks for different AWS services like EC2 , S3 , IAM and more.
  • Prowler will start listing the results of the scan directly in your terminal. It will show which checks passed and which ones failed .

For each failed check , Prowler will tell you what the issue is (for exmple “S3 bucket is publicly accessible”) and how to fix it ( Turn off public access).

To check the no. of services prowler support

prowler aws --list-services

4. Focus on Specific Services

Sometimes, you might only want to check a particular AWS service instead of running a full scan . For example → you might want to check the security of your S3 storage or your EC2 instances without scanning everything.

To do this, you can run more focused scans. For example, if you want to check just your S3 storage, use the following command:

./prowler -g s3

This command only checks S3 buckets and makes sure that they are configured securely . If you want to check EC2 instances you can use :

prowler aws --service s3 

This is helpful when you are trying to fix an issue with a particular service or when you want to regularly monitor specific areas of your setup.

5. Generating Detailed Reports

After Prowler finishes scanning your AWS environment , you might want to save the results in a report. Prowler allows you to export the results in different formats like HTML , CSV or JSON .

For example , if you want a clean , easy to read HTML report that you can share with your team , run this command :

prowler aws --output prowler_report --output-format html

This will run the scan and save the output in prowler_report.html in the current directory.

prowler aws — service s3 — output s3_report — output-format html

This command will check S3-related configurations and save the report as s3_report.html.

This command creates an HTML file with all the results of the scan, including which checks passed or failed and recommendations on how to fix issues. You can open this report in a web browser, making it easy to review and share.

Other formats, such as CSV for use in spreadsheets and JSON , are also available, depending on how you want to work with the data.

Best Practices for AWS Security Using Prowler

Now that you understand how to use Prowler, let’s explore some best practices to help you get the most out of it . These tips will help you use Prowler helps you maintain the security of your AWS environment continuously, rather than just checking it once.

1. Automate Regular Security Scans

Cloud security is an ongoing effort, not something you do just once Even if your AWS environment is secure today, changes happen new resources get added, configurations change, and new risks can appear . This is why it is important to regularly scan your AWS account.

You can set up Prowler to run these scans automatically on a regular basis. By doing this, you won’t need to remember to manually run checks every week or month. There are several ways to automate these scans :

  • Use AWS Lambda: You can set up Lambda functions to automatically run Prowler on a schedule, like daily or weekly
  • Add to CI/CD pipeline: If you are using a CI/CD pipeline, integrate Prowler as part of your deployment process. This way, Prowler can check your environment each time you deploy new updates or make changes to your AWS infrastructure.

By automating scans, you ensure that potential security risks are detected quickly before they become major issues.

2. Regularly Review IAM Permissions

One of the most important aspects of AWS security is managing who has access to your AWS account and what they are allowed to do. AWS Identity and Access Management (IAM) controls this, and it is essential to regularly check that permissions are set correctly .

Over the time many users may collect permissions that they don’t need anymore, or new users might be given too broad access. This can increase the risk of accidental or malicious actions.

Prowler helps you regularly review your IAM setup by doing checks for

  • Users or roles have too many permissions .
  • There are any unused accounts or roles that should be deleted.
  • Multi factor authentication (MFA) is enabled to add an extra layer of security.

Make it a habit to audit IAM permissions and clean up unused or excessive permissions. Always apply the principle of least privilege, which means giving users only the access they need and nothing more.

3. Implement Encryption Across Services

Encryption ensures that your data is protected, even if someone manages to access it. AWS allows you to encrypt data both at rest (when it is stored, like in S3 or RDS databases) and in transit (when it is being moved, like over the internet).

Prowler checks if your data is encrypted correctly by doing checks

  • Are your S3 buckets encrypted ?
  • Are your RDS databases using encryption to protect stored data ?
  • Is encryption being used for data in transit, like when it is sent from your website to a database ?

Make sure encryption is enforced for all sensitive data , and regularly use Prowler to confirm that these settings remain in place.

4. Strengthen Security Group Settings

AWS security groups act like a firewall for your EC2 instances. They control who can access your servers and what kind of traffic is allowed in or out. It is important to keep these settings tight to prevent unauthorized access.

One common mistake is leaving security groups too open. For example allowing SSH from anywhere on the internet is risky. Prowler can help you identify:

  • Security groups that are too permissive, such as allowing anyone to connect to your servers.
  • Unnecessary open ports that might be exposing your EC2 Instances

After running a Prowler scan, review any flagged security groups and restrict access to only what is necessary. This will help reduce the chances of an external attack.

To wrap up :

Keeping your AWS environment secure is really important today. Using tools like Prowler helps you check and improve your security regularly , so your data stays safe and meets necessary rules. Remember security is not just a one time job it is something you need to do all the time. By following good practices and checking your settings more often, you can protect your cloud systems from risks and keep your business running well. Stay alert and stay safe!

--

--

Aakib
Aakib

Written by Aakib

Cloud computing and DevOps Engineer and to be as a fresher I am learning and gaining experiance by doing some hands on projects on DevOps and in AWS OR GCP

Responses (5)