Audit AWS and Azure Security with Prowler: A Practical Guide to Fixing Cloud Drift

Security tutorial - IT technology blog
Security tutorial - IT technology blog

The 2 AM Cloud Security Wake-up Call

It started with a frantic call from a former colleague at 2 AM. Their startup had just opened an AWS bill 10 times higher than the previous month. After twenty minutes of digging, we found the leak: an exposed S3 bucket and an EC2 instance hijacked for a massive crypto-mining operation. The cause? A junior developer had opened security groups to ‘0.0.0.0/0’ to debug a connection and simply forgot to close the door. This happens more often than most teams care to admit.

Cloud platforms like AWS and Azure offer incredible scale, but they also provide plenty of ways to fail. We often treat infrastructure as ‘set it and forget it.’ In reality, configuration drift is a silent threat. One day your storage bucket is private; the next, a small policy tweak makes it public to the entire internet.

Why Cloud Environments Drift into Danger

Why does this keep happening? Root cause analysis usually points to three culprits: massive complexity, ‘Click-ops,’ and a misunderstanding of the shared responsibility model. Modern cloud consoles have thousands of toggles. It is terrifyingly easy to check the wrong box.

Infrastructure drift thrives when teams manually click around the UI (Click-ops) instead of using Infrastructure as Code (IaC). Without a version-controlled trail, tracking who changed what becomes impossible.

Many developers also assume that because they are on a major provider, security is ‘handled.’ But while AWS secures the ‘cloud’ itself, you are responsible for everything ‘in’ the cloud. If you leave a database wide open without a password, that’s your bill to pay. Automated scanning isn’t a luxury; it’s the only way to sleep through the night.

Comparing Audit Strategies: Manual vs. Native vs. Open Source

Back when I started auditing cloud environments, I did it by hand. I kept a spreadsheet with 50 rows, checking MFA status, IAM users, and VPC flow logs one by one. It took two full days for a single account. It was tedious, exhausting, and riddled with human error.

Native tools like AWS Security Hub or Microsoft Defender for Cloud are powerful because they are built-in. However, costs can spiral quickly as your infrastructure grows. They also tend to be ‘noisy,’ burying critical alerts under a mountain of low-priority notifications that might not apply to your specific architecture.

Enter Prowler. This open-source command-line tool performs security assessments, auditing, and incident response across 300+ unique checks. It maps your environment against CIS (Center for Internet Security) benchmarks in minutes. It’s fast, free, and provides a blunt ‘Pass/Fail’ report that tells you exactly where the fire is.

Efficiency in Action: Hands-on with Prowler

The most effective workflow is to run Prowler as a weekly audit or, ideally, as a step in your CI/CD pipeline. But before you run a single scan, ensure your own access is locked down. When I create the IAM users or Service Principals needed for these tools, I always use high-entropy passwords.

I rely on the password generator at toolcraft.app/en/tools/security/password-generator for these server-side credentials. It runs entirely in your browser, meaning no sensitive data ever touches the network. It’s a five-second step that prevents a brute-force attack on the very accounts you use to monitor your security.

Installing Prowler

Setup is straightforward. Since Prowler is Python-based, use a virtual environment to keep your system clean and avoid dependency conflicts.

# Create and enter a virtual environment
python3 -m venv prowler-venv
source prowler-venv/bin/activate

# Install the package
pip install prowler
prowler -v

Scanning AWS Infrastructure

To scan AWS, Prowler pulls from your existing AWS CLI credentials. Ensure your profile has at least the SecurityAudit and ViewOnlyAccess managed policies attached.

# Run a full scan on your default profile
prowler aws

# Audit a specific service, like S3 storage
prowler aws --services s3

# Check against a compliance framework (e.g., CIS Level 1)
prowler aws --compliance cis_1.5_aws_level1

The output highlights exactly which resources failed. It might flag an S3 bucket missing versioning or a five-year-old IAM user who still hasn’t enabled MFA.

Scanning Azure Infrastructure

Azure support in Prowler is robust. You’ll need to authenticate via the Azure CLI (az login) first. Prowler then uses that session to inspect your subscriptions.

# Authenticate with Azure
az login

# Kick off the scan
prowler azure

Prowler will catch common oversights, such as ‘Public access level is not set to Private for blob containers’ or disabled monitoring agents. These are the specific gaps attackers look for when trying to gain a foothold in your network.

A Report is Just the Beginning

Scanning is only 10% of the battle. The real value lies in fixing the mess. Prowler generates an output directory with CSV, JSON, and HTML files. I usually start with the HTML report to get a visual heat map of ‘Critical’ and ‘High’ severity findings.

Don’t try to boil the ocean. Follow this priority list:

  • Identity First: Fix MFA gaps, rotate keys older than 90 days, and prune over-privileged roles.
  • Data Second: Lock down S3/Blob storage and encrypt databases at rest.
  • Networking Third: Close ‘0.0.0.0/0’ security groups and tighten firewalls.

If Prowler flags a weak IAM password policy, take that opportunity to raise the bar. I recommend a 14-character minimum. You can use toolcraft.app/en/tools/security/password-generator to show your team what a truly ‘strong’ password looks like, helping them move away from predictable patterns.

Final Step: Automate the Audit

Once you’ve mastered the manual commands, automate them. A simple Cron job on a hardened Linux instance or a GitHub Action can run Prowler weekly. Have it upload the JSON results to a private, encrypted bucket.

This creates a historical record of your security posture. If a breach ever happens, you won’t be guessing; you’ll see exactly when a specific misconfiguration was introduced. Moving from a ‘black box’ cloud to a fully audited infrastructure takes effort, but tools like Prowler make the journey manageable.

Share: