Bu proje, Java tabanlı test otomasyonu ile OWASP ZAP entegrasyonu sağlayan profesyonel bir test otomasyon projesidir. OWASP Juice Shop uygulaması üzerinde güvenlik testleri gerçekleştirir.
- Selenium WebDriver ile web otomasyonu
- OWASP ZAP entegrasyonu ile güvenlik taraması
- TestNG framework'ü ile test yönetimi
- Maven ile bağımlılık yönetimi
- Docker ile kolay kurulum ve çalıştırma
- HTML raporları ile test sonuçları
- ZAP proxy üzerinden trafik yakalama
- Java 21 veya üzeri
- Maven 3.6 veya üzeri
- Docker Desktop
- Chrome tarayıcısı
git clone https://github.com/resatkvc/SecureTestAutomation-ZAP.git cd SecureTestAutomation-ZAP
mvn clean install
docker-compose up -d
mvn test
- ✅ Başarılı login testi
- ❌ Başarısız login testi
- 🔍 Boş kullanıcı bilgileri testi
- 🛡️ SQL injection testi
- 🔍 Pasif tarama (trafik yakalama)
- 🚀 Aktif tarama (güvenlik analizi)
target/surefire-reports/index.html
- TestNG HTML raporutarget/surefire-reports/emailable-report.html
- E-posta raporu
reports/zap_report_YYYYMMDD_HHMMSS.html
- ZAP güvenlik raporu
logs/test-automation.log
- Güncel log dosyası
# Sadece login testleri mvn test -Dtest=JuiceShopLoginTest # Sadece ZAP entegrasyon testleri mvn test -Dtest=ZapIntegratedTest # Tüm testleri paralel çalıştırma mvn test -Dparallel=methods -DthreadCount=4
# Servisleri başlat docker-compose up -d # Servisleri durdur docker-compose down # Servis durumunu kontrol et docker ps
ZAP'ı manuel olarak kurmak için:
docker run -d -p 8080:8080 --name zap-proxy owasp/zap2docker-stable:latest zap.sh -daemon -host 0.0.0.0 -port 8080 -config api.addrs.addr.name=.* -config api.addrs.addr.regex=true -config api.key=test-api-key
SecureTestAutomation-ZAP/ ├── src/ │ ├── main/java/secure/com/Main.java │ ├── main/resources/logback.xml │ └── test/java/secure/com/ │ ├── test/ │ │ ├── BaseTest.java │ │ ├── JuiceShopLoginTest.java │ │ ├── ZapIntegratedTest.java │ │ └── DockerTestSuite.java │ └── zap/SimpleZapManager.java ├── scripts/ (Docker yönetim scriptleri) ├── docker-compose.yml ├── testng.xml ├── pom.xml └── README.md
src/test/java/secure/com/test/BaseTest.java
dosyasında:
protected static final String BASE_URL = "http://localhost:3000"; protected static final String ZAP_PROXY_HOST = "localhost"; protected static final int ZAP_PROXY_PORT = 8080;
src/main/resources/logback.xml
dosyasında log seviyelerini ayarlayabilirsiniz.
# Docker'ın çalıştığını kontrol edin docker --version # Container loglarını kontrol edin docker-compose logs # Servisleri yeniden başlatın docker-compose down docker-compose up -d
# Container'ın çalıştığını kontrol edin docker ps # Web arayüzüne erişimi test edin curl http://localhost:3000
# ZAP API'sine erişimi test edin curl http://localhost:8080/JSON/core/view/version/
- Fork yapın
- Feature branch oluşturun (
git checkout -b feature/amazing-feature
) - Değişikliklerinizi commit edin (
git commit -m 'Add amazing feature'
) - Branch'inizi push edin (
git push origin feature/amazing-feature
) - Pull Request oluşturun
Bu proje MIT lisansı altında lisanslanmıştır.
- OWASP Juice Shop - Test uygulaması
- OWASP ZAP - Güvenlik tarama aracı
- Selenium - Web otomasyon framework'ü
- TestNG - Test framework'ü