Bu repository, "Shift-Left" prensiplerini merkeze alarak sıfırdan inşa edilmiş, %100 otonom çalışan uçtan uca bir DevSecOps CI/CD laboratuvar ortamıdır.
Sistem, bilerek zafiyetli bırakılmış OWASP Juice Shop uygulamasını hedef alır. Kaynak kodun taranmasından uygulamanın canlı ortamda hacklenmesine kadar tüm güvenlik testleri insan müdahalesi olmadan gerçekleştirilir ve sonuçlar merkezi bir zafiyet panosunda (DefectDojo) toplanır.
Sistemimiz, siber güvenlik endüstrisinde standart olarak kabul edilen açık kaynaklı araçların birbiriyle entegre edilmesinden oluşur:
Orkestrasyon: Jenkins (Docker-in-Docker mimarisi ile)
Zafiyet Yönetim Merkezi: OWASP DefectDojo
Secret Scanning: Gitleaks
SAST (Statik Kod Analizi): SonarQube
SCA: Trivy
DAST (Dinamik Analiz): OWASP ZAP & ProjectDiscovery Nuclei
- Docker ve Docker Compose'un bilgisayarınızda kurulu olması.
- Sistemde minimum 8 GB (Tercihen 16 GB) boş RAM bulunması.
Öncelikle bu repoyu bilgisayarınıza indirin:
-
cd devsecops-lab
Zafiyetleri görselleştireceğimiz merkezi panomuzu ayağa kaldırıyoruz:
-
cd django-DefectDojo
-
./dc-build-local-images.sh
-
./dc-up-d.sh postgres-redis
Not: Kurulum tamamlandığında docker-compose.yml dosyasından target portu 8081 olarak değiştirin (default port 8080 olarak geliyor ancak o portta jenkins çalışıyor.) ve terminalde beliren admin parolasını not alın. http://localhost:8081 adresinden Dojo'ya giriş yapın. Sağ üstteki profil menüsünden "API v2 Key" sekmesine giderek anahtarınızı kopyalayın.
Ana dizine (docker-compose.yml dosyasının olduğu yere) geri dönün ve altyapıyı başlatın:
docker-compose up -d
Klonladığınız klasördeki Jenkinsfile dosyasını bir metin editörüyle açın ve en üstteki environment bloğunda bulunan şu değişkenleri kendi Dojo sunucunuza göre düzenleyin:
DOJO_URL(Varsayılan: http://host.docker.internal:8081)DOJO_API_KEY(Yukarıda kopyaladığınız anahtar)PRODUCT_NAME(DefectDojo'da görünmesini istediğiniz proje adı, örn: "OWASP Juice Shop")
- Tarayıcınızdan Jenkins arayüzüne (
http://localhost:8080) erişin. - Sol menüden "New Item" seçeneğine tıklayın.
- Projeye bir isim verin ve "Pipeline" türünü seçerek OK tuşuna basın.
- Karşınıza çıkan ayar sayfasında en alta inerek "Pipeline" sekmesini bulun.
- "Definition" kısmından "Pipeline script" seçeneğini aktif tutarak, düzenlediğiniz
Jenkinsfiledosyasının tüm içeriğini buradaki kutuya yapıştırın. - Kaydedin ve sol menüden "Build Now" butonuna basın!
Sistem sırasıyla Gitleaks, SonarQube, Trivy, ZAP ve Nuclei'yi konteynerler halinde ayağa kaldırıp taramaları yapacak ve saniyeler içinde tüm sonuçları DefectDojo panelinize aktaracaktır.

Bu pipeline'ı OWASP Juice Shop üzerinde çalıştırdığınızda DefectDojo panosunda yaklaşık olarak şu tabloyla karşılaşacaksınız:
- Secret Scanning: 4000+ ifşa olmuş token ve parola.
- SCA: 90+ CVE kütüphane zafiyeti.
- DAST: Güvenlik başlığı (CSP) eksiklikleri ve davranışsal zafiyetler.
ENGLISH DESCRIPTION
This repository is a fully autonomous, end-to-end DevSecOps CI/CD laboratory environment built from scratch, centering on "Shift-Left" security principles.
The system targets the intentionally vulnerable OWASP Juice Shop application. From source code scanning to dynamic application security testing in a live environment, all security tests are performed without human intervention, and the results are aggregated in a central vulnerability dashboard (DefectDojo).
Our system consists of industry-standard open-source tools integrated with each other:
Orchestration: Jenkins (utilizing Docker-in-Docker architecture)
Vulnerability Management Center: OWASP DefectDojo
Secret Scanning: Gitleaks
SAST (Static Application Security Testing): SonarQube,
SCA (Software Composition Analysis): Trivy
DAST (Dynamic Application Security Testing): OWASP ZAP & ProjectDiscovery Nuclei
- Docker and Docker Compose installed on your machine.
- Minimum 8 GB (Preferably 16 GB) of free RAM.
First, download this repository to your computer:
-
cd devsecops-lab
Launch our central dashboard where vulnerabilities will be visualized:
-
cd django-DefectDojo
Note: Before starting, you must change the target port to 8081 in the docker-compose.yml file (it defaults to 8080, which will conflict with Jenkins).
After that, run the following commands:
-
./dc-build-local-images.sh
-
./dc-up-d.sh postgres-redis
Note: Once the installation is complete, change the target port to 8081 in the docker-compose.yml file (it defaults to 8080, but Jenkins is already running on that port) and make a note of the admin password displayed in the terminal. Log in to Dojo at http://localhost:8081. Go to the "API v2 Key" tab in the profile menu (top right) to copy your key.
Return to the main directory (where the original docker-compose.yml is located) and start the infrastructure:
- docker-compose up -d
Open the Jenkinsfile in the cloned directory with a text editor and update the following variables in the environment block:
- DOJO_URL (Default: http://host.docker.internal:8081)
- DOJO_API_KEY (The key you copied above)
- PRODUCT_NAME (The project name as you want it to appear in DefectDojo, e.g., "OWASP Juice Shop")
- Access the Jenkins interface at http://localhost:8080.
- Click "New Item" from the left menu.
- Give the project a name, select "Pipeline", and click OK.
- Scroll down to the Pipeline section.
- Keep "Pipeline script" as the definition and paste the entire contents of your edited Jenkinsfile into the script box.
- Save and click the "Build Now" button!
The system will sequentially spin up Gitleaks, SonarQube, Trivy, ZAP, and Nuclei as ephemeral containers, conduct the scans, and upload all results into your DefectDojo dashboard automatically.

When you run this pipeline against OWASP Juice Shop, you will see a result similar to this in DefectDojo:
- Secret Scanning: 4000+ exposed tokens and passwords.
- SCA: 90+ CVE library vulnerabilities.
- DAST: Missing security headers (CSP) and behavioral vulnerabilities.









