Skip to content

resatkvc/SecureTestAutomation-ZAP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Selenium + ZAP Test Otomasyon Projesi

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.

🎯 Proje Özellikleri

  • 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

📋 Gereksinimler

  • Java 21 veya üzeri
  • Maven 3.6 veya üzeri
  • Docker Desktop
  • Chrome tarayıcısı

🛠️ Hızlı Başlangıç

1. Projeyi İndirin

git clone https://github.com/resatkvc/SecureTestAutomation-ZAP.git cd SecureTestAutomation-ZAP

2. Bağımlılıkları Yükleyin

mvn clean install

3. Docker Servislerini Başlatın

docker-compose up -d

4. Testleri Çalıştırın

mvn test

🧪 Test Senaryoları

Login Testleri

  • ✅ Başarılı login testi
  • ❌ Başarısız login testi
  • 🔍 Boş kullanıcı bilgileri testi
  • 🛡️ SQL injection testi

ZAP Entegrasyon Testleri

  • 🔍 Pasif tarama (trafik yakalama)
  • 🚀 Aktif tarama (güvenlik analizi)

📊 Raporlar

Test Raporları

  • target/surefire-reports/index.html - TestNG HTML raporu
  • target/surefire-reports/emailable-report.html - E-posta raporu

ZAP Güvenlik Raporları

  • reports/zap_report_YYYYMMDD_HHMMSS.html - ZAP güvenlik raporu

Log Dosyaları

  • logs/test-automation.log - Güncel log dosyası

🚀 Gelişmiş Kullanım

Belirli Testleri Çalıştırma

# 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

Docker Servislerini Yönetme

# Servisleri başlat docker-compose up -d # Servisleri durdur docker-compose down # Servis durumunu kontrol et docker ps

OWASP ZAP Kurulumu (Opsiyonel)

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

📁 Proje Yapısı

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 

⚙️ Konfigürasyon

Test Ayarları

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;

Log Seviyeleri

src/main/resources/logback.xml dosyasında log seviyelerini ayarlayabilirsiniz.

🔧 Sorun Giderme

Docker Sorunları

# 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

Juice Shop Bağlantı Sorunları

# Container'ın çalıştığını kontrol edin docker ps # Web arayüzüne erişimi test edin curl http://localhost:3000

ZAP Bağlantı Sorunları

# ZAP API'sine erişimi test edin curl http://localhost:8080/JSON/core/view/version/

🤝 Katkıda Bulunma

  1. Fork yapın
  2. Feature branch oluşturun (git checkout -b feature/amazing-feature)
  3. Değişikliklerinizi commit edin (git commit -m 'Add amazing feature')
  4. Branch'inizi push edin (git push origin feature/amazing-feature)
  5. Pull Request oluşturun

📝 Lisans

Bu proje MIT lisansı altında lisanslanmıştır.

🙏 Teşekkürler

Releases

No releases published

Packages

No packages published