AI S3 Security Scanner is a serverless AWS security monitoring system. It automatically scans S3 buckets for encryption settings, leverages Gemini AI to analyze security risks, and provides intelligent security insights.
- Automated S3 Scanning: Periodically checks all S3 buckets in your account for server-side encryption.
- AI-Powered Analysis: Uses Google Gemini AI (
gemini-2.0-flash-exp) to explain the security implications of unencrypted buckets. - Actionable Insights: Provides clear, human-readable recommendations for immediate security remediation.
- Serverless Architecture: Built with AWS Lambda for cost-effectiveness and scalability.
- Automated Scheduling: Configured to run automatically every 12 hours using Amazon EventBridge.
The system follows a serverless architecture as shown below:
- EventBridge: Triggers the Lambda function on a schedule.
- Lambda Function: Executes the
s3_scanner.pyscript. - S3: The target of the security scan.
- Gemini AI: Analyzes the findings and generates a security report.
- AWS Account with appropriate permissions (S3 Read, Lambda Execution).
- Python 3.9+ environment.
- Google Gemini API Key.
-
Clone the Repository:
git clone <repository-url> cd AI-Security-Scanner-for-AWS-S3
-
Install Dependencies: Install the required Python packages:
pip install -r requirements.txt -t package/
-
Configure Environment Variables: Set your Gemini API key:
export GOOGLE_API_KEY="your-google-api-key"
-
Deploy to AWS Lambda:
- Package the code and dependencies into
s3_scanner.zip. - Upload the ZIP file to AWS Lambda.
- Set the
GOOGLE_API_KEYenvironment variable in the Lambda configuration.
- Package the code and dependencies into
-
Schedule Scans: Create an EventBridge rule to trigger the Lambda function every 12 hours.
Once deployed, the Lambda function will run automatically. You can also trigger it manually from the AWS Console to see the results immediately in the CloudWatch logs.
The AI analysis will categorize findings and suggest immediate actions, such as enabling AES256 or aws:kms encryption on vulnerable buckets.
Developed as an AI-enhanced security utility for AWS infrastructure.

