Skip to content

TA2ZTD/devsecops-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Otonom DevSecOps Master Pipeline

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.

Gemini_Generated_Image_7yzb8o7yzb8o7yzb

Kullanılan Teknolojiler ve Güvenlik Araçları

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)

  • image

Zafiyet Yönetim Merkezi: OWASP DefectDojo

  • image

Secret Scanning: Gitleaks

  • 1_Ben-0Jp8xsszbJR1JS9q8g

SAST (Statik Kod Analizi): SonarQube

  • image

SCA: Trivy

  • images

DAST (Dinamik Analiz): OWASP ZAP & ProjectDiscovery Nuclei

  • 1586766458581
  • 1_U5MxN6VKGkqL_RbHaUC5tg

Kurulum ve Kullanım Rehberi

Ön Koşullar

  • Docker ve Docker Compose'un bilgisayarınızda kurulu olması.
  • Sistemde minimum 8 GB (Tercihen 16 GB) boş RAM bulunması.

1. Ana Projeyi Klonlayın

Öncelikle bu repoyu bilgisayarınıza indirin:

2. DefectDojo Kurulumu ve Başlatılması

Zafiyetleri görselleştireceğimiz merkezi panomuzu ayağa kaldırıyoruz:

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.

3. Jenkins ve SonarQube'un Başlatılması

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

4. Pipeline Konfigürasyonu

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")

5. DevSecOps Hattının Başlatılması

  1. Tarayıcınızdan Jenkins arayüzüne (http://localhost:8080) erişin.
  2. Sol menüden "New Item" seçeneğine tıklayın.
  3. Projeye bir isim verin ve "Pipeline" türünü seçerek OK tuşuna basın.
  4. Karşınıza çıkan ayar sayfasında en alta inerek "Pipeline" sekmesini bulun.
  5. "Definition" kısmından "Pipeline script" seçeneğini aktif tutarak, düzenlediğiniz Jenkinsfile dosyasının tüm içeriğini buradaki kutuya yapıştırın.
  6. 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. image


Örnek Zafiyet Haritası

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.
image

ENGLISH DESCRIPTION

Autonomous DevSecOps Master Pipeline

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).

Gemini_Generated_Image_7yzb8o7yzb8o7yzb

Technologies and Security Tools Used

Our system consists of industry-standard open-source tools integrated with each other:

Orchestration: Jenkins (utilizing Docker-in-Docker architecture)

  • image

Vulnerability Management Center: OWASP DefectDojo

  • image

Secret Scanning: Gitleaks

  • 1_Ben-0Jp8xsszbJR1JS9q8g

SAST (Static Application Security Testing): SonarQube,

  • image

SCA (Software Composition Analysis): Trivy

  • images

DAST (Dynamic Application Security Testing): OWASP ZAP & ProjectDiscovery Nuclei

  • 1586766458581
  • 1_U5MxN6VKGkqL_RbHaUC5tg

Installation and Usage Guide

Prerequisites

  • Docker and Docker Compose installed on your machine.
  • Minimum 8 GB (Preferably 16 GB) of free RAM.

1. Clone the Main Project

First, download this repository to your computer:

2. DefectDojo Setup and Initialization

Launch our central dashboard where vulnerabilities will be visualized:

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.

3. Start Jenkins and SonarQube

Return to the main directory (where the original docker-compose.yml is located) and start the infrastructure:

  • docker-compose up -d

4. Pipeline Configuration

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")

5. Launch the DevSecOps Pipeline

  1. Access the Jenkins interface at http://localhost:8080.
  2. Click "New Item" from the left menu.
  3. Give the project a name, select "Pipeline", and click OK.
  4. Scroll down to the Pipeline section.
  5. Keep "Pipeline script" as the definition and paste the entire contents of your edited Jenkinsfile into the script box.
  6. 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. image

Sample Vulnerability Map

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.
image

About

Jenkins, Nuclei, SonarQube, ZAP, Trivy ve DefectDojo kullanarak uçtan uca otonom DevSecOps laboratuvarı. "Shift-Left" prensibiyle otomatik zafiyet tarama ve yönetimi. || End-to-end autonomous DevSecOps lab using Jenkins, Nuclei, SonarQube, ZAP, Trivy, and DefectDojo. Automated vulnerability scanning and management following "Shift-Left" principles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors