AWS Builder Center
Building CloudGuard AI: Exploring AWS Security Assessment with Boto3 and STS

Building CloudGuard AI: Exploring AWS Security Assessment with Boto3 and STS

CloudGuard AI is a project that explores how developers can assess AWS security configurations using Python, Boto3, and AWS STS. This article walks through its architecture, credential handling, identity verification, supported security checks, and lessons learned while building and deploying the application.

Building CloudGuard AI: Exploring AWS Security Assessment with Boto3 and STS

1. Introduction

Cloud security is an important responsibility when developing and managing applications on Amazon Web Services (AWS). A small configuration mistake, such as an overly permissive security group or an improperly configured S3 bucket, can expose resources to unnecessary risks.
While AWS provides several security services, developers and students also need practical ways to understand their cloud environments and identify common security misconfigurations.
This motivated me to build CloudGuard AI, a project developed for the Build on AWS Challenge 2026.
CloudGuard AI is an AWS security assessment platform that connects to an AWS environment, verifies the caller's identity, examines selected resource configurations, and presents security findings through a centralized dashboard.
In this article, I'll explain the technologies behind the project, how Boto3 and AWS STS work together, and some of the security considerations I encountered during development.

2. Technology Stack

The application uses the following technologies:
  • Python and FastAPI: Backend API and scanning operations.
  • Boto3: Python SDK for interacting with AWS services.
  • AWS STS: Identity verification through  GetCallerIdentity .
  • Amazon S3: Assessment of bucket security configurations.
  • Amazon EC2: Assessment of security group configurations.
  • React and Vite: Frontend application.
  • Tailwind CSS: User interface styling.
  • Vercel: Public deployment of the application.
The architecture separates the frontend, backend API, and AWS service interactions. This keeps AWS operations on the backend rather than exposing cloud credentials in the browser.

3. Understanding Boto3 and AWS STS

Two important AWS concepts used in this project are Boto3 and AWS Security Token Service (STS).

What is Boto3?

Boto3 is the AWS SDK for Python. It allows Python applications to communicate with AWS services through their APIs.
Instead of manually constructing HTTP requests, developers can use Boto3 clients and resources to perform operations on services such as S3, EC2, and STS.
For example, the following code creates an S3 client:
import boto3

session = boto3.Session(region_name="ap-south-1")

s3 = session.client("s3")

response = s3.list_buckets()

for bucket in response["Buckets"]:
print(bucket["Name"])
This demonstrates how a Python application can interact with AWS services through Boto3.

What is AWS STS?

AWS Security Token Service (STS) is an AWS service that provides temporary security credentials and supports identity-related operations.
One particularly useful operation is  GetCallerIdentity .
It returns information about the AWS identity making the request, including:
  • AWS account ID
  • ARN (Amazon Resource Name)
  • User ID
CloudGuard AI uses this operation to identify the AWS principal associated with a scanning session.
import boto3

session = boto3.Session(
profile_name="default"
)

sts = session.client("sts")

identity = sts.get_caller_identity()

print("Account:", identity["Account"])
print("ARN:", identity["Arn"])
print("User ID:", identity["UserId"])
An important distinction:  GetCallerIdentity  identifies the caller. It does not grant additional permissions or establish that the caller has access to every AWS resource.

4. AWS Credential Handling

Credential management was one of the important design considerations during development.
CloudGuard AI supports two approaches for configuring AWS access in its live scanning implementation.

Option 1: Explicit AWS credentials

The application can create a Boto3 session using credentials supplied for an authorized AWS account.
session = boto3.Session(
aws_access_key_id=access_key,
aws_secret_access_key=secret_key,
aws_session_token=session_token,
region_name=region
)
The session token is optional and is used when working with temporary credentials.

Option 2: AWS CLI profiles

Developers can also use an existing AWS CLI profile.
session = boto3.Session(
profile_name="cloudguard-readonly"
)
This allows Botocore to resolve credentials through the configured AWS profile and its supported credential mechanisms, including AWS IAM Identity Center (SSO) configurations.
Using a profile avoids requiring developers to manually enter credentials into the application.
Security consideration: AWS credentials should never be hardcoded into source code, committed to GitHub, or exposed through frontend environment variables. Credentials should be handled on the backend and restricted to the permissions required for the assessment.

5. Verifying AWS Identity Before Scanning

Connecting to an AWS environment is not enough. The application should also establish which identity is making the request.
CloudGuard AI uses STS  GetCallerIdentity  to verify the AWS identity before performing a live scan.
The general workflow is:
  1. The user configures an authorized AWS credential source.
  1. The backend creates the appropriate Boto3 session.
  1. The application calls STS  GetCallerIdentity .
  1. The backend receives the account ID and ARN.
  1. The application proceeds with the live scanning operation.
  1. The verified identity is associated with the scan result.
The identity check is performed when the user requests identity verification and again before each live scan.
This helps ensure that the application has visibility into the AWS identity associated with the operation.
However, identity verification alone is not a complete security boundary. AWS IAM permissions, credential protection, and resource-level access controls remain essential.

6. What Does CloudGuard AI Assess?

The current scanner focuses on selected AWS resources rather than attempting to inspect every service in an AWS account.

Amazon S3

S3 buckets can contain sensitive application data, backups, and other important information.
CloudGuard AI examines selected bucket security configurations to help identify potential misconfigurations.

Amazon EC2 Security Groups

Security groups act as virtual firewalls controlling inbound and outbound traffic for AWS resources.
For example, exposing SSH access on port 22 to the entire internet can increase the attack surface.
CloudGuard AI examines security group configurations to identify potentially risky network exposure.

Centralized Findings

The dashboard organizes assessment results so users can understand:
  • Identified security findings
  • Finding severity
  • Resource information
  • Overall assessment statistics
The application also supports report exports associated with individual scans.
These findings are intended to help developers investigate potential security issues. They should not be interpreted as a guarantee that an AWS environment is completely secure.

7. Demo Mode and Live Scanning

An important implementation decision was separating demonstration functionality from live AWS access.
CloudGuard AI supports a simulated scanner provider for demonstration purposes. This allows users to explore the dashboard and example findings without connecting their own AWS account.
Live scanning is a separate capability that requires an authorized AWS credential source and appropriate IAM permissions.
The publicly deployed version is configured for demo mode, with live AWS scanning disabled.
This distinction is important: the public deployment demonstrates the application's interface and assessment workflow; it does not perform live scans against visitors' AWS accounts.

8. Security Lessons Learned

Building CloudGuard AI helped me understand that developing a cloud security tool requires careful consideration of the tool's own security.
Some of the important lessons were:
1. Never expose AWS credentials
Cloud credentials must remain on the backend. They should never be embedded in frontend code or committed to a public repository.
2. Verify identity before sensitive operations
STS  GetCallerIdentity  provides useful visibility into which AWS identity is executing a request.
3. Use least-privilege permissions
A security scanner should only receive the permissions required to inspect its supported resources. Broad administrative permissions should be avoided.
4. Separate demo and live environments
Demonstration functionality should not accidentally provide access to real AWS accounts.
5. Treat findings as assessment results, not absolute guarantees
A scanner that examines selected S3 and EC2 configurations cannot replace a complete AWS security review.

9. Future Improvements

CloudGuard AI currently focuses on selected AWS security assessments. There are several areas that could improve its capabilities:
  • More comprehensive IAM security analysis.
  • Cross-account access through a carefully designed STS AssumeRole workflow.
  • Stronger authentication and authorization for multi-user access.
  • Additional AWS service coverage.
  • More granular security findings and remediation guidance.
  • Improved isolation between users and their assessment data.
These improvements would help evolve the project into a more comprehensive AWS security assessment platform.

10. Conclusion

Building CloudGuard AI gave me an opportunity to work with AWS services beyond basic cloud deployment.
Through Boto3, I explored how Python applications communicate with AWS services. Through STS, I learned how to identify the AWS principal executing an operation. Working with S3 and EC2 also helped me understand how configuration mistakes can introduce security risks.
One of my biggest takeaways is that a cloud security tool must be designed with security in mind from the beginning. Protecting credentials, verifying identity, limiting permissions, and separating demonstration environments from live access are all important parts of that process.
CloudGuard AI is an ongoing project, and this is a starting point for exploring practical AWS security assessment.

Project Links

Thank you for reading!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article