쿠버네티스 보안 분석을 위한 RAG (Retrieval-Augmented Generation) 시스템입니다.
- 쿠버네티스 문서 크롤링: 공식 문서에서 보안 관련 정보 수집
- 벡터 저장소: ChromaDB를 활용한 효율적인 문서 검색
- 버전별 분석: 쿠버네티스 버전별 보안 가이드 제공
- 보안 체크리스트 생성: Pod 설정에 대한 보안 점검
- RAGAS 평가: 시스템 성능 측정 및 개선
├── src/ # 메인 소스 코드
│ ├── rag_system.py # RAG 시스템 핵심
│ ├── vector_store.py # 벡터 저장소 관리
│ ├── versioned_vector_store.py # 버전별 벡터 저장소
│ ├── llm_integration.py # LLM 통합
│ ├── security_data.py # 보안 데이터 처리
│ ├── yaml_analyzer.py # YAML 파일 분석
│ ├── checklist_generator.py # 체크리스트 생성
│ ├── problem_classifier.py # 문제 분류
│ ├── api_server.py # API 서버
│ └── ragas_evaluation.py # RAGAS 평가
├── frontend/ # 웹 프론트엔드
├── scripts/ # 유틸리티 스크립트
├── extracted_docs/ # 추출된 문서
└── requirements.txt # Python 의존성
pip install -r requirements.txt# 가상환경 활성화 (선택사항)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate# Gemini API 키 설정
export GEMINI_API_KEY="your_gemini_api_key_here"
# Windows의 경우:
# set GEMINI_API_KEY=your_gemini_api_key_herepython src/vector_store.pypython src/api_server.pyPOST /analyze_pod: Pod YAML 분석POST /generate_checklist: 보안 체크리스트 생성GET /health: 서버 상태 확인
import requests
# Pod 분석
response = requests.post('http://localhost:8000/analyze_pod',
json={'yaml_content': 'your_pod_yaml_here'})
# 체크리스트 생성
response = requests.post('http://localhost:8000/generate_checklist',
json={'pod_analysis': analysis_result})- Python: PEP 8 준수
- 함수 및 클래스에 docstring 작성
- 타입 힌트 사용
# RAGAS 평가 실행
python src/ragas_evaluation.py
# 개별 모듈 테스트
python -m pytest tests/RAGAS를 통한 시스템 성능 평가:
- Faithfulness: 생성된 답변의 정확성
- Answer Relevancy: 답변의 관련성
- Context Precision: 검색된 컨텍스트의 정확성
- Context Recall: 검색된 컨텍스트의 완전성
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
이 프로젝트는 MIT 라이선스 하에 배포됩니다.
-
벡터 저장소 초기화 오류
rm -rf chroma_db/ python src/vector_store.py
-
메모리 부족
requirements.txt에서 배치 크기 조정- 가상환경 재설정
-
API 연결 오류
- 포트 8000이 사용 가능한지 확인
- 방화벽 설정 확인
문제가 발생하거나 질문이 있으시면 이슈를 생성해주세요.