This repository contains a Kubernetes security scanner powered by Generative AI (GenAI) for detecting, analyzing, and remediating security risks in Kubernetes pods. The scanner uses AWS Bedrock's Large Language Models (LLMs) to analyze pod configurations and identify security issues in real-time.
- Features
- Prerequisites
- Installation
- Running the Scanner
- Example Usage
- Deployment
- Best Practices
- Contributing
- License
- Real-time pod scanning
- Context-aware security analysis
- Human-readable risk summaries and remediation advice
- Integration with AWS Bedrock for AI-driven security analysis
Before running the scanner, ensure you have the following:
- A Kubernetes cluster
- Python 3.8+ installed
- AWS account with Bedrock access
kubectlconfigured to interact with your Kubernetes cluster
git clone https://github.com/farhanashrafdev/k8s-genai-scanner
cd k8s-genai-scanner
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txt
Make sure your AWS credentials are set up to access Bedrock:
aws configure
from genai_analyzer import GenAIAnalyzer
analyzer = GenAIAnalyzer()
pod_spec = {
# Example pod spec here
}
analysis = await analyzer.analyze_pod(pod_spec)
print(analysis)