sidik 1.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sidik-1.3.3/LICENSE +21 -0
- sidik-1.3.3/PKG-INFO +355 -0
- sidik-1.3.3/README.md +330 -0
- sidik-1.3.3/pyproject.toml +55 -0
- sidik-1.3.3/setup.cfg +4 -0
- sidik-1.3.3/sidik/__init__.py +51 -0
- sidik-1.3.3/sidik/__main__.py +9 -0
- sidik-1.3.3/sidik/assets/SIDIK-nobg-dark.png +0 -0
- sidik-1.3.3/sidik/assets/SIDIK-nobg-purelogo-dark.png +0 -0
- sidik-1.3.3/sidik/assets/__init__.py +1 -0
- sidik-1.3.3/sidik/assets/sidik_icon.ico +0 -0
- sidik-1.3.3/sidik/cli.py +823 -0
- sidik-1.3.3/sidik/core.py +255 -0
- sidik-1.3.3/sidik/data/__init__.py +1 -0
- sidik-1.3.3/sidik/data/pypi_advisories.json +1 -0
- sidik-1.3.3/sidik/dependency_analyzer/__init__.py +6 -0
- sidik-1.3.3/sidik/dependency_analyzer/analyzer.py +118 -0
- sidik-1.3.3/sidik/dependency_analyzer/database.py +263 -0
- sidik-1.3.3/sidik/dependency_analyzer/matcher.py +127 -0
- sidik-1.3.3/sidik/dependency_analyzer/osv_import.py +308 -0
- sidik-1.3.3/sidik/dependency_analyzer/parsers.py +242 -0
- sidik-1.3.3/sidik/gui.py +2986 -0
- sidik-1.3.3/sidik/i18n.py +720 -0
- sidik-1.3.3/sidik/models.py +115 -0
- sidik-1.3.3/sidik/plugins.py +86 -0
- sidik-1.3.3/sidik/reporting/__init__.py +6 -0
- sidik-1.3.3/sidik/reporting/aggregator.py +41 -0
- sidik-1.3.3/sidik/reporting/formatter.py +1195 -0
- sidik-1.3.3/sidik/secret_detector/__init__.py +5 -0
- sidik-1.3.3/sidik/secret_detector/context.py +108 -0
- sidik-1.3.3/sidik/secret_detector/detector.py +395 -0
- sidik-1.3.3/sidik/secret_detector/entropy.py +48 -0
- sidik-1.3.3/sidik/secret_detector/patterns.py +139 -0
- sidik-1.3.3/sidik.egg-info/PKG-INFO +355 -0
- sidik-1.3.3/sidik.egg-info/SOURCES.txt +46 -0
- sidik-1.3.3/sidik.egg-info/dependency_links.txt +1 -0
- sidik-1.3.3/sidik.egg-info/entry_points.txt +3 -0
- sidik-1.3.3/sidik.egg-info/requires.txt +14 -0
- sidik-1.3.3/sidik.egg-info/top_level.txt +1 -0
- sidik-1.3.3/tests/test_dependency_analyzer.py +83 -0
- sidik-1.3.3/tests/test_end_to_end.py +95 -0
- sidik-1.3.3/tests/test_features_enhancement.py +258 -0
- sidik-1.3.3/tests/test_i18n.py +159 -0
- sidik-1.3.3/tests/test_logo_integration.py +102 -0
- sidik-1.3.3/tests/test_osv_import.py +161 -0
- sidik-1.3.3/tests/test_plugins.py +156 -0
- sidik-1.3.3/tests/test_secret_detector.py +63 -0
- sidik-1.3.3/tests/test_v11_contract.py +173 -0
sidik-1.3.3/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SIDIK Research Team - Universitas Sultan Ageng Tirtayasa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sidik-1.3.3/PKG-INFO
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sidik
|
|
3
|
+
Version: 1.3.3
|
|
4
|
+
Summary: SIDIK: Secret Identification and Dependency Inspection Kit (Lightweight Offline Python SAST & SCA)
|
|
5
|
+
Author: Radityo Budi Waskito, Fauzi Nur Ibrahim, Raditya Ahmad Pratama, Zayyan Fadhlur Rahman, Muhammad Fahri Indra Saputra, Mohamad Hilman
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/radityobw/SIDIK
|
|
8
|
+
Project-URL: Repository, https://github.com/radityobw/SIDIK
|
|
9
|
+
Project-URL: Issues, https://github.com/radityobw/SIDIK/issues
|
|
10
|
+
Keywords: security,sast,sca,secret-detection,vulnerability-scanner,osv,sarif
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: packaging>=23.0
|
|
15
|
+
Requires-Dist: tomli>=2.0.0; python_version < "3.11"
|
|
16
|
+
Provides-Extra: gui
|
|
17
|
+
Requires-Dist: pillow>=10.0.0; extra == "gui"
|
|
18
|
+
Requires-Dist: matplotlib>=3.8.0; extra == "gui"
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: python-docx>=1.2.0; extra == "dev"
|
|
21
|
+
Requires-Dist: pip-audit>=2.10.0; extra == "dev"
|
|
22
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
23
|
+
Requires-Dist: twine>=5.0.0; extra == "dev"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
<div align="center">
|
|
27
|
+
|
|
28
|
+
<img src="logo/SIDIK-nobg-dark.png" alt="SIDIK Logo" width="320"/>
|
|
29
|
+
|
|
30
|
+
# SIDIK: *Secret Identification and Dependency Inspection Kit*
|
|
31
|
+
|
|
32
|
+
**Instrumen Analisis Keamanan Statis (*SAST*) & Analisis Komposisi Perangkat Lunak (*SCA*) Luring Terpadu untuk Ekosistem Python**
|
|
33
|
+
*Unified Offline Static Application Security Testing (SAST) & Software Composition Analysis (SCA) for Python*
|
|
34
|
+
|
|
35
|
+
[](#)
|
|
36
|
+
[](#)
|
|
37
|
+
[](#)
|
|
38
|
+
[](#)
|
|
39
|
+
[](#)
|
|
40
|
+
[](#)
|
|
41
|
+
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
# 🇮🇩 Bahasa Indonesia
|
|
47
|
+
|
|
48
|
+
## 📌 Ikhtisar Proyek
|
|
49
|
+
|
|
50
|
+
**SIDIK** (*Secret Identification and Dependency Inspection Kit*) adalah instrumen analisis keamanan statis (*Static Application Security Testing* / SAST) dan analisis komposisi perangkat lunak (*Software Composition Analysis* / SCA) terpadu berbasis Python yang beroperasi **100% secara luring (*offline*)** tanpa mengirim kode sumber ke peladen pihak ketiga (*zero data leakage*).
|
|
51
|
+
|
|
52
|
+
Dengan mengintegrasikan **12 aturan ekspresi reguler (*regex*) terkurasi**, **kalkulasi entropi informasi Shannon**, dan **penyaringan konteks leksikal** bersama **basis data kerentanan lokal Google OSV (`29.208` rekaman advisori lintas `8.038` paket PyPI)** yang mendukung **5 format manifes Python**, SIDIK dirancang untuk mengatasi masalah kejenuhan peringatan (*alert fatigue*) sekaligus menghilangkan ketergantungan jaringan internet pada *pipeline* CI/CD maupun jaringan terisolasi (*air-gapped*).
|
|
53
|
+
|
|
54
|
+
### 👥 Tim Peneliti & Pengembang (Kontribusi Setara / *Equal First Authors*)
|
|
55
|
+
Jurusan Informatika, Fakultas Teknik, Universitas Sultan Ageng Tirtayasa (Untirta):
|
|
56
|
+
1. **Radityo Budi Waskito** (*Corresponding Author* - Orkestrasi *Pipeline* Terpadu, CLI Interaktif, & *GitHub Actions* CI/CD)
|
|
57
|
+
2. **Fauzi Nur Ibrahim** (Mesin Deteksi *Hardcoded Secret* 3 Lapis, Entropi Shannon, & Konteks Leksikal)
|
|
58
|
+
3. **Raditya Ahmad Pratama** (Mesin *Offline SCA* 5 Format Manifes, Evaluator Versi Semantik PEP 440, & Indeks OSV)
|
|
59
|
+
4. **Zayyan Fadhlur Rahman** (Konstruksi Korpus 25 Repositori GitHub Nyata, *Benchmark* SCA v2, & Evaluasi Komparatif)
|
|
60
|
+
5. **Muhammad Fahri Indra Saputra** (*Desktop GUI High-DPI* Dwibahasa, Lokalisasi `i18n`, & Pelaporan 7 Format termasuk SARIF v2.1.0)
|
|
61
|
+
6. **Mohamad Hilman** (Pembimbingan Metodologi Riset, Kurasi Riset Ilmiah, & Penelaahan Akademik)
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## ✨ Fitur dan Kapabilitas Utama
|
|
66
|
+
|
|
67
|
+
1. **Deteksi *Hardcoded Secret* 3 Lapis (*Multi-Layer Secret Detection*):**
|
|
68
|
+
- Mendeteksi 12 kategori kredensial sensitif (`SEC001` - `SEC012`: *AWS Access Key ID*, *Google API Key*, *OpenAI API Key*, *Stripe Live Key*, *GitHub Classic & Fine-Grained PAT*, *Slack Token*, *JSON Web Token*, *Hardcoded Password*, *Database Connection URI*, *Asymmetric Private Key*, dan *Generic High-Entropy Secret*).
|
|
69
|
+
- Dilengkapi penyaring baris cepat (*fast line pre-check*), kalkulasi entropi Shannon, dan penyaringan konteks leksikal untuk mengeliminasi alarm palsu dari variabel tiruan (*mock*, *dummy*, *example*, *sample*, *test fixture*), UUID, maupun *hash* Git SHA-1.
|
|
70
|
+
2. **Analisis Komposisi Perangkat Lunak Luring (*Offline Multi-Manifest SCA*):**
|
|
71
|
+
- Mendukung **5 format manifes dependensi Python**: `requirements.txt`, `pyproject.toml` (PEP 621 & Poetry), `Pipfile`, `poetry.lock`, dan `setup.py` (ekstraksi AST aman tanpa eksekusi kode dinamis).
|
|
72
|
+
- Mengevaluasi spesifikasi versi terkunci (`==`) maupun rentang versi fleksibel (`>=`, `~=`, `<`, `!=`) sesuai standar PEP 440 terhadap **`29.208` rekaman advisori kerentanan PyPI** secara instan tanpa koneksi internet.
|
|
73
|
+
3. **Tiga Mode Antarmuka (*Triple-Interface Ecosystem*):**
|
|
74
|
+
- **Mode 1 - *One-Shot CLI* & Otomasi CI/CD (`python -m sidik` / `action.yml`):** Mendukung *git pre-commit hook* otomatis (`--install-hook`), ambang batas kegagalan (`--fail-on {any,low,medium,high,critical}`), dan integrasi *GitHub Actions*.
|
|
75
|
+
- **Mode 2 - *Interactive CLI Menu* (`run_sidik_cli.bat` / `python sidik.py --cli`):** Antarmuka terminal interaktif berbasis menu bernomor yang mudah dioperasikan tanpa menghafal argumen baris perintah.
|
|
76
|
+
- **Mode 3 - *Desktop GUI High-DPI* Dwibahasa (`run_sidik.bat` / `python sidik.py --gui`):** Antarmuka visual modern bertema gelap (*dark mode*) dengan 5 tombol *preset* korpus riset, pencarian instan (*live search*), penyalinan massal kode & solusi (*bulk copy*), serta tab **Visualisasi & Hasil Riset** yang merender grafik *benchmark* secara adaptif (*auto-resize*).
|
|
77
|
+
4. **Dukungan Dwibahasa Dinamis (*Instant Bilingual Toggle* ID ↔ EN) & Panduan Remediasi:**
|
|
78
|
+
- Seluruh tampilan GUI, laporan konsol, dan rekomendasi perbaikan spesifik per aturan/CVE dapat dialihkan secara instan antara **Bahasa Indonesia (`id`)** dan **Bahasa Inggris (`en`)**.
|
|
79
|
+
5. **Tujuh Format Ekspor Laporan Standar Industri:**
|
|
80
|
+
- Mendukung ekspor ke **Konsol Berwarna ANSI** (`console`), **OASIS SARIF v2.1.0** (`sarif` untuk *GitHub Code Scanning*), **GitHub Actions Workflow Annotations** (`github`), **Dasbor Web HTML Mandiri** (`html`), **Markdown** (`markdown`), **JSON Terstruktur** (`json`), dan **Tabel CSV/Spreadsheet** (`csv`).
|
|
81
|
+
6. **Mekanisme Pengecualian Fleksibel (*Whitelist & Ignore Support*):**
|
|
82
|
+
- Mendukung berkas `.sidikignore` (sintaks pola `.gitignore`) serta komentar penekan sebaris (`# sidik:ignore`, `# nosec`, `# noqa: sidik`).
|
|
83
|
+
7. **Arsitektur Ekstensi *Plugin* Terdekupel (`sidik.plugins`):**
|
|
84
|
+
- Menyediakan *hook* pasca-pemindaian berbasis `importlib.metadata.entry_points(group="sidik.plugins")` sehingga ekstensi opsional seperti `SIDIK-ML` dapat memperkaya CLI, konsol interaktif, GUI, serta laporan tanpa menambah dependensi ML ke `sidik`.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 📁 Struktur Direktori Repositori
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
SIDIK/
|
|
92
|
+
├── logo/ # Aset identitas visual & ikon aplikasi multi-resolusi
|
|
93
|
+
├── sidik/ # Paket inti mesin pemindai SIDIK
|
|
94
|
+
│ ├── __init__.py # Metadata paket & ekspor publik
|
|
95
|
+
│ ├── __main__.py # Titik masuk modul (python -m sidik)
|
|
96
|
+
│ ├── cli.py # Antarmuka One-Shot CLI, TUI Interaktif, & Git Hook
|
|
97
|
+
│ ├── core.py # Orkestrator SecurityScanner (SAST + SCA terpadu)
|
|
98
|
+
│ ├── gui.py # Antarmuka Desktop GUI High-DPI & Visualisasi Riset
|
|
99
|
+
│ ├── i18n.py # Mesin lokalisasi dwibahasa (ID/EN) & kamus remediasi
|
|
100
|
+
│ ├── models.py # Struktur data (SecretCandidate, Finding, ScanReport)
|
|
101
|
+
│ ├── plugins.py # Kontrak plugin terdekupel entry_points (sidik.plugins)
|
|
102
|
+
│ ├── data/
|
|
103
|
+
│ │ └── pypi_advisories.json # Basis data luring 29.208 advisori OSV (8.038 paket PyPI)
|
|
104
|
+
│ ├── secret_detector/ # Subsistem deteksi kredensial rahasia 3 lapis
|
|
105
|
+
│ │ ├── patterns.py # 12 aturan ekspresi reguler terkurasi (SEC001-SEC012)
|
|
106
|
+
│ │ ├── entropy.py # Kalkulator entropi informasi Shannon
|
|
107
|
+
│ │ ├── context.py # Penyaring konteks leksikal & indikator mock/test
|
|
108
|
+
│ │ └── detector.py # Mesin pemindai secret dengan fast line pre-check
|
|
109
|
+
│ ├── dependency_analyzer/ # Subsistem analisis dependensi luring (Offline SCA)
|
|
110
|
+
│ │ ├── parsers.py # Pengurai 5 format manifes (req, toml, Pipfile, lock, setup.py)
|
|
111
|
+
│ │ ├── matcher.py # Pencocok rentang versi semantik PEP 440
|
|
112
|
+
│ │ ├── database.py # Pengelola indeks advisori kerentanan lokal
|
|
113
|
+
│ │ ├── osv_import.py # Kompilator snapshot Google OSV PyPI ke indeks lokal
|
|
114
|
+
│ │ └── analyzer.py # Orkestrator pemindaian manifes dependensi
|
|
115
|
+
│ └── reporting/ # Subsistem agregasi, deduplikasi, & 7 format laporan
|
|
116
|
+
│ ├── aggregator.py # Penggabung temuan & kalkulator ringkasan keparahan
|
|
117
|
+
│ └── formatter.py # Generator laporan (Console, SARIF, GitHub, HTML, MD, JSON, CSV)
|
|
118
|
+
├── dataset/ # Korpus pengujian empiris (Zero Data Leakage)
|
|
119
|
+
│ ├── external/ # Korpus 25 repositori GitHub nyata (186.876 LOC, 109 kandidat)
|
|
120
|
+
│ ├── dependencies_v2/ # Benchmark SCA v2 (70 manifes rakitan rilis PyPI; 39 berkas uji / N=200)
|
|
121
|
+
│ ├── secrets/ # Dataset uji terkontrol & studi ablasi secret (N=100 berkas uji)
|
|
122
|
+
│ ├── dependencies/ # Dataset manifes dependensi v1 (N=60)
|
|
123
|
+
│ └── ground_truth/ # Anotasi label kebenaran dasar (JSON)
|
|
124
|
+
├── experiments/ # Skrip otomatis evaluasi ilmiah & komparasi alat industri
|
|
125
|
+
│ ├── run_external_benchmarks.py # Benchmark 25 repo nyata & komparasi Gitleaks, Bandit, Trivy, pip-audit
|
|
126
|
+
│ ├── run_experiments.py # Evaluasi dataset terkontrol terhadap baseline internal
|
|
127
|
+
│ ├── ablation_study.py # Studi ablasi 4 konfigurasi komponen (Konfig A, B, C, D)
|
|
128
|
+
│ ├── evaluate_metrics.py # Kalkulator metrik (Precision, Recall, F1, MCC, FPR, FNR)
|
|
129
|
+
│ └── generate_charts.py # Generator grafik publikasi (300 DPI) & bundel visualisasi GUI
|
|
130
|
+
├── figures/ # Grafik hasil eksperimen (Paper & Dark-Theme GUI Bundle)
|
|
131
|
+
├── results/ # Rekaman JSON hasil eksperimen & benchmark komparatif
|
|
132
|
+
├── tests/ # Suite pengujian otomatis (62 unit & integration tests)
|
|
133
|
+
├── CHANGELOG.md # Riwayat rilis paket sidik
|
|
134
|
+
├── LICENSE # Lisensi MIT
|
|
135
|
+
├── pyproject.toml # Konfigurasi paket, dependencies, & entry points sidik/sidik-gui
|
|
136
|
+
├── action.yml # Definisi komposit GitHub Actions untuk integrasi CI/CD
|
|
137
|
+
├── sidik.py # Peluncur universal (GUI, Interactive CLI, & One-Shot CLI)
|
|
138
|
+
├── run_sidik.bat # Peluncur cepat Desktop GUI (Windows)
|
|
139
|
+
├── run_sidik_cli.bat # Peluncur cepat Interactive CLI Menu (Windows)
|
|
140
|
+
├── run_sidik.sh # Peluncur lintas platform (Linux / macOS)
|
|
141
|
+
└── requirements.txt # Daftar dependensi runtime & visualisasi
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 📊 Hasil Evaluasi Empiris & *Benchmark* Komparatif
|
|
147
|
+
|
|
148
|
+
Seluruh hasil pengujian direkam secara transparan di direktori [`results/`](results/) dan divisualisasikan di [`figures/`](figures/):
|
|
149
|
+
|
|
150
|
+
### 1. Evaluasi Deteksi *Hardcoded Secret* pada 25 Repositori GitHub Nyata (`186.876` LOC, `1.193` Berkas `.py`, `109` Kandidat)
|
|
151
|
+
> **Catatan Transparansi Korpus:** Ke-25 repositori publik memiliki `0` kebocoran kunci produksi aktif (`TP = 0`; seluruh `109` kandidat adalah kode pengujian/*fixture*/contoh dokumentasi). Oleh karena itu, evaluasi pada korpus ini mengukur ketahanan terhadap alarm palsu (*False Positive Rate* / FPR) dan kecepatan eksekusi.
|
|
152
|
+
|
|
153
|
+
| Perangkat Pemindai | Versi | *False Positive* (FP) | *True Negative* (TN) | *False Positive Rate* (FPR) | Waktu Pindai *Secret* | Kecepatan (*Throughput*) |
|
|
154
|
+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
|
|
155
|
+
| **Bandit** | `v1.9.4` | 98 | 11 | 89,91% | 25,26 dtk | 7.398 LOC/dtk |
|
|
156
|
+
| *Baseline Regex* | Internal | 14 | 95 | 12,84% | 3,34 dtk | 55.950 LOC/dtk |
|
|
157
|
+
| **SIDIK (Usulan)** | **Terpadu** | **14** | **95** | **12,84% (-85,7% vs Bandit)** | **3,19 dtk** | **58.581 LOC/dtk** |
|
|
158
|
+
| **Gitleaks** | `v8.30.1` | **0** | **109** | **0,00%** | 10,41 dtk | 17.951 LOC/dtk |
|
|
159
|
+
|
|
160
|
+
* Pada **Pemindaian Terpadu (*Unified Pipeline*: *Secret* + SCA + `tracemalloc`)** lintas 25 repositori nyata, SIDIK menuntaskan pemeriksaan dalam **`4,64 detik`** (`~2,55 detik` jika dipindai sekaligus) dan mengidentifikasi **`302` kerentanan dependensi nyata** pada 45 berkas manifes proyek publik.
|
|
161
|
+
|
|
162
|
+
### 2. Evaluasi *Software Composition Analysis* (SCA v2) pada Rilis Paket PyPI (`N=200` Entri di `39` Manifes Uji)
|
|
163
|
+
|
|
164
|
+
| Perangkat SCA | Cakupan Format Manifes | TP | FP | TN | FN | *Precision* | *Recall* | *F1-Score* | Waktu Pindai |
|
|
165
|
+
| :--- | :--- | :-: | :-: | :-: | :-: | :---: | :---: | :---: | :---: |
|
|
166
|
+
| **`pip-audit`** (`v2.10.1`) | `requirements.txt` saja (`N=37`) | 0 | 0 | 20 | 17 | 0,0000 | 0,0000 | 0,0000 | 0,15 dtk |
|
|
167
|
+
| **Trivy** (`v0.76.1`) | Wajib *lockfile* (`N=200`) | 35 | 0 | 100 | 65 | 1,0000 | 0,3500 | 0,5185 | 132,00 dtk |
|
|
168
|
+
| **SIDIK (Usulan)** | **5 Format Lengkap (`N=200`)** | **100** | **0** | **100** | **0** | **1,0000** | **1,0000** | **1,0000** | **0,33 dtk** |
|
|
169
|
+
|
|
170
|
+
### 3. Studi Ablasi Komponen pada Dataset Uji Terkontrol *Secret* (`N=100` Berkas: `50` Positif, `50` Negatif)
|
|
171
|
+
|
|
172
|
+
| Konfigurasi Ablasi | *True Positive* (TP) | *False Positive* (FP) | *True Negative* (TN) | *False Negative* (FN) | *Precision* | *Recall* | *F1-Score* | MCC |
|
|
173
|
+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
|
174
|
+
| **Konfig A (*Regex* Saja)** | 45 | 10 | 40 | 5 | 0,8182 | 0,9000 | 0,8572 | 0,7035 |
|
|
175
|
+
| **Konfig B (*Regex* + Konteks)** | 45 | **0** | **50** | 5 | **1,0000** | 0,9000 | **0,9474** | **0,9045** |
|
|
176
|
+
| **Konfig C (*Regex* + Entropi)** | 45 | 10 | 40 | 5 | 0,8182 | 0,9000 | 0,8572 | 0,7035 |
|
|
177
|
+
| **Konfig D (SIDIK Penuh)** | 45 | **0** | **50** | 5 | **1,0000** | 0,9000 | **0,9474** | **0,9045** |
|
|
178
|
+
|
|
179
|
+
### 4. Profil Transparan Konsumsi Memori (RAM) & Waktu Eksekusi
|
|
180
|
+
* **Alokasi Memori Pemindaian Aktif (*Active Scanning Memory*):** Berkisar **`0,15 MB - 0,91 MB` per repositori** (rerata **`0,39 MB`** per repositori pada 25 proyek GitHub; **`0,13 - 0,21 MB`** pada uji *secret* `N=100`; serta **`1,58 MB`** untuk pemindaian gabungan 25 repositori sekaligus).
|
|
181
|
+
* **Inisialisasi Basis Data OSV Luring (*One-Time DB Index Load*):** Membutuhkan **`116,47 MB`** satu kali di awal (*singleton cache*) saat memuat indeks `29.208` rekaman advisori JSON ke memori.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 🚀 Panduan Penggunaan Cepat (*Quick Start*)
|
|
186
|
+
|
|
187
|
+
### 1. Instalasi Dependensi & Aktivasi *Virtual Environment*
|
|
188
|
+
Pastikan Python `3.9+` telah terpasang, lalu buat/aktifkan `.venv` dan pasang paket beserta dependensi:
|
|
189
|
+
```bash
|
|
190
|
+
# Buat & aktifkan virtual environment (disarankan)
|
|
191
|
+
python -m venv .venv
|
|
192
|
+
.\.venv\Scripts\Activate.ps1 # Windows PowerShell
|
|
193
|
+
# source .venv/bin/activate # Linux / macOS
|
|
194
|
+
|
|
195
|
+
pip install -e ".[gui]"
|
|
196
|
+
# Opsional: pasang ekstensi ML pada venv yang sama
|
|
197
|
+
# pip install -e ..\SIDIK-ML
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
> **Catatan Windows PowerShell:** Jika Anda masuk ke direktori `.venv\Scripts` tanpa mengaktifkan `.\Activate.ps1`, gunakan awalan `.\` saat menjalankan skrip konsol (misalnya `.\sidik -i`, `.\sidik --gui`, `.\sidik-ml -i`, atau `.\sidik-ml --gui`). Jika aktivasi dibatasi kebijakan eksekusi, jalankan langsung melalui `python -m sidik ...` atau `python -m sidik_ml ...`.
|
|
201
|
+
|
|
202
|
+
### *Structured Candidate Contract* (`SIDIK` -> `SIDIK-ML`)
|
|
203
|
+
Sejak `v1.1.0`, `SecurityScanner.extract_secret_candidates()` dan `SecretDetector.extract_candidates()` menyediakan objek berversi `SecretCandidate` (`schema_version = "1.0.0"`, `compute_stable_id()` berbasis SHA-256) tanpa menyimpan nilai rahasia mentah (`masked_value` + `value_sha256`).
|
|
204
|
+
|
|
205
|
+
### 2. Menjalankan *Desktop GUI* (Mode Visual)
|
|
206
|
+
```bash
|
|
207
|
+
sidik --gui # atau sidik-gui / python -m sidik --gui
|
|
208
|
+
python sidik.py --gui # atau klik dua kali run_sidik.bat pada Windows
|
|
209
|
+
```
|
|
210
|
+
* Gunakan tombol **`🌐 English (EN)` / `🌐 Indonesia (ID)`** di kanan atas untuk mengganti bahasa secara instan.
|
|
211
|
+
* Gunakan 5 tombol **Presets** (`Uji Secrets (N=100)`, `Uji Dependensi v2`, `25 Repo Eksternal (Secret)`, `25 Repo Eksternal (Full)`, `Kode Sumber SIDIK`) untuk mendemonstrasikan hasil riset secara langsung.
|
|
212
|
+
* Buka tab **`Visualisasi & Hasil Riset`** untuk melihat grafik evaluasi RQ1 - RQ4 dan *Master Bundle*.
|
|
213
|
+
|
|
214
|
+
### 3. Menjalankan *Interactive CLI Menu* (Mode Terminal Interaktif)
|
|
215
|
+
```bash
|
|
216
|
+
sidik -i # setara dengan: sidik interactive / python -m sidik -i
|
|
217
|
+
python sidik.py -i # atau klik dua kali run_sidik_cli.bat pada Windows
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### 4. Menjalankan *One-Shot CLI* & Ekspor 7 Format Laporan
|
|
221
|
+
```bash
|
|
222
|
+
# Pemindaian standar di terminal (argumen posisional atau --target / -t)
|
|
223
|
+
sidik .
|
|
224
|
+
python -m sidik --target dataset/secrets/test --lang id
|
|
225
|
+
python -m sidik --target dataset/dependencies_v2/test --lang en
|
|
226
|
+
|
|
227
|
+
# Ekspor ke 7 format laporan (console, json, markdown, csv, html, sarif, github)
|
|
228
|
+
python -m sidik --target dataset/external/_repos --format html --output results/audit_report.html
|
|
229
|
+
python -m sidik --target dataset/external/_repos --format sarif --output results/sidik.sarif
|
|
230
|
+
|
|
231
|
+
# Pasang Git Pre-Commit Hook otomatis & ambang batas CI/CD
|
|
232
|
+
python -m sidik --install-hook
|
|
233
|
+
python -m sidik --target . --fail-on high
|
|
234
|
+
|
|
235
|
+
# Gunakan plugin ML opsional (jika sidik-ml terpasang di venv yang sama)
|
|
236
|
+
sidik --list-plugins
|
|
237
|
+
sidik --target . --enable-ml --ml-model path/ke/model.skops
|
|
238
|
+
sidik -i --enable-ml
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### 5. Menjalankan 63 *Unit Test* & Eksperimen *Benchmark*
|
|
242
|
+
```bash
|
|
243
|
+
# Jalankan seluruh 63 unit & integration tests
|
|
244
|
+
python -m unittest discover tests -v
|
|
245
|
+
|
|
246
|
+
# Jalankan eksperimen & buat ulang seluruh grafik riset
|
|
247
|
+
python experiments/run_experiments.py
|
|
248
|
+
python experiments/ablation_study.py
|
|
249
|
+
python experiments/run_external_benchmarks.py
|
|
250
|
+
python experiments/generate_charts.py
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### 6. Distribusi *Container* (`ghcr.io`) & Paket Rilis
|
|
254
|
+
```bash
|
|
255
|
+
# Jalankan lewat GitHub Container Registry (tanpa instalasi Python lokal)
|
|
256
|
+
docker run --rm -v "${PWD}:/workspace" ghcr.io/radityobw/sidik:latest --target /workspace --format console
|
|
257
|
+
|
|
258
|
+
# Atau pasang langsung dari PyPI (`pip install "sidik[gui]"`) atau aset .whl pada GitHub Releases v1.3.3
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 🗺️ Ekosistem Perangkat Lunak Publik (*Public Software Ecosystem*)
|
|
264
|
+
|
|
265
|
+
| Repositori | Peran Utama | Versi Terkini | Tautan |
|
|
266
|
+
| :--- | :--- | :---: | :--- |
|
|
267
|
+
| **SIDIK** | Mesin pemindai deterministik SAST & OSV SCA + host *plugin* UI | `v1.3.3` | [`github.com/radityobw/SIDIK`](https://github.com/radityobw/SIDIK) |
|
|
268
|
+
| **SIDIK-ML** | Perangkat lunak ekstensi *Explainable Non-ANN ML* & *plugin* | `v0.5.3` | [`github.com/radityobw/SIDIK-ML`](https://github.com/radityobw/SIDIK-ML) |
|
|
269
|
+
|
|
270
|
+
> **Publikasi Ilmiah:** Artikel penelitian deterministik awal telah diterbitkan di [*Jurnal Media Akademik (JMA)*](https://jurnal.mediaakademik.com/index.php/jma/article/view/9068/6647).
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
# 🇬🇧 English
|
|
275
|
+
|
|
276
|
+
## 📌 Project Overview
|
|
277
|
+
|
|
278
|
+
**SIDIK** (*Secret Identification and Dependency Inspection Kit*) is a unified, lightweight Static Application Security Testing (SAST) and Software Composition Analysis (SCA) instrument for Python projects that operates **100% offline** with **zero data leakage**.
|
|
279
|
+
|
|
280
|
+
By combining **12 curated regular expression rules**, **Shannon entropy verification**, and **lexical context filtering** with an **offline Google OSV advisory database (`29,208` vulnerability records across `8,038` PyPI packages)** supporting **5 Python manifest formats**, SIDIK suppresses false alarms while eliminating network latency and internet dependencies in CI/CD pipelines and air-gapped environments.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## ✨ Key Features
|
|
285
|
+
|
|
286
|
+
1. **Three-Layer Secret Detection Engine:**
|
|
287
|
+
- Covers 12 credential categories (`SEC001` - `SEC012`: AWS, Google Cloud, OpenAI, Stripe, GitHub Classic/Fine-Grained PAT, Slack, JWT, Password Assignments, Database URIs, Private Keys, and Generic Secrets).
|
|
288
|
+
- Combines a fast line pre-check filter, Shannon entropy calculation, and lexical context analysis to suppress false positives from test fixtures, mock tokens, UUIDs, and Git SHA-1 hashes.
|
|
289
|
+
2. **Offline Multi-Manifest SCA Engine:**
|
|
290
|
+
- Parses `requirements.txt`, `pyproject.toml` (PEP 621 & Poetry), `Pipfile`, `poetry.lock`, and `setup.py` (static AST parsing without code execution).
|
|
291
|
+
- Evaluates exact pins (`==`) and semantic version ranges (`>=`, `~=`, `<`) against **`29,208` offline PyPI advisories** in `0.33s`.
|
|
292
|
+
3. **Triple-Interface Ecosystem & 7 Report Formats:**
|
|
293
|
+
- Operates via **One-Shot CLI** (`python -m sidik`, `--install-hook`, `--fail-on`, GitHub Action `action.yml`), **Interactive CLI Menu** (`python sidik.py --cli`), and **High-DPI Bilingual Desktop GUI** (`python sidik.py --gui`).
|
|
294
|
+
- Exports findings to **ANSI Console**, **OASIS SARIF v2.1.0**, **GitHub Actions Annotations**, **Standalone HTML Dashboard**, **Markdown**, **JSON**, and **CSV**.
|
|
295
|
+
4. **Decoupled Plugin Architecture (`sidik.plugins`):**
|
|
296
|
+
- Exposes standard `importlib.metadata.entry_points(group="sidik.plugins")` hooks and the leak-safe `SecretCandidate` contract so external extensions like [`SIDIK-ML`](https://github.com/radityobw/SIDIK-ML) enrich CLI, TUI, GUI, and reports without adding ML dependencies to `sidik`.
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## 📊 Summary of Empirical Benchmarks
|
|
301
|
+
|
|
302
|
+
| Benchmark Suite | Dataset Scale | SIDIK Result | Industry / Baseline Comparison |
|
|
303
|
+
| :--- | :--- | :--- | :--- |
|
|
304
|
+
| **1. Real-World GitHub Secret Scan** | 25 Repos (`186,876` LOC, `1,193` files, `109` candidates) | **14 FP (12.84% FPR)** in **3.19s** (`58,581` LOC/s; `4.64s` unified scan with **302** real dependency CVEs) | **85.7% fewer FPs** than Bandit (`98 FP / 89.91%`, `25.26s`); **3.3x faster** than Gitleaks (`0 FP`, `10.41s`) |
|
|
305
|
+
| **2. Multi-Manifest PyPI SCA v2** | `N=200` balanced entries across `39` test manifests (5 formats) | **100/100 TP (Precision 1.00, Recall 1.00, F1 1.00)** in **0.33s** | Outperforms Trivy (`35/100 TP`, `F1 0.5185`, `132.00s`) and `pip-audit` (`0/17 TP` on `N=37` unpinned `requirements.txt`) |
|
|
306
|
+
| **3. Controlled Secret Ablation** | `N=100` Python files (`50` positive, `50` negative traps) | **0 FP, 45 TP (Precision 1.00, Recall 0.90, F1 0.9474, MCC 0.9045)** | Context filter eliminates all **10 FPs** produced by regex-only baseline (`F1 0.8572`) |
|
|
307
|
+
| **4. Memory & Resource Profile** | `tracemalloc` across all benchmarks | **0.15 - 0.91 MB** active scan RAM/repo (avg **0.39 MB**; **1.58 MB** combined 25 repos) | Transparently reports **116.47 MB** one-time initialization for loading the `29,208`-record OSV JSON index |
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## 🚀 Quick Start
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
# 1. Create and activate virtual environment (recommended)
|
|
315
|
+
python -m venv .venv
|
|
316
|
+
.\.venv\Scripts\Activate.ps1 # Windows PowerShell
|
|
317
|
+
# source .venv/bin/activate # Linux / macOS
|
|
318
|
+
|
|
319
|
+
# 2. Install SIDIK with GUI support (plus optional SIDIK-ML plugin)
|
|
320
|
+
pip install -e ".[gui]"
|
|
321
|
+
# pip install -e ..\SIDIK-ML
|
|
322
|
+
|
|
323
|
+
# 3. Launch Desktop GUI, Interactive TUI, or One-Shot CLI (symmetric with sidik-ml)
|
|
324
|
+
sidik --gui # or sidik-gui / python -m sidik --gui
|
|
325
|
+
sidik -i --lang en # or sidik interactive / python -m sidik -i
|
|
326
|
+
sidik . # or sidik --target . / python -m sidik --target .
|
|
327
|
+
sidik --target . --format html --output audit_report.html --lang en
|
|
328
|
+
|
|
329
|
+
# 4. Run with optional SIDIK-ML triage plugin (when installed)
|
|
330
|
+
sidik --list-plugins
|
|
331
|
+
sidik --target . --enable-ml --ml-model path/to/model.skops
|
|
332
|
+
|
|
333
|
+
# 5. Run full regression suite (63 tests)
|
|
334
|
+
python -m unittest discover tests -v
|
|
335
|
+
|
|
336
|
+
# 6. Run via GitHub Container Registry (ghcr.io) or install from PyPI (`pip install "sidik[gui]"`)
|
|
337
|
+
docker run --rm -v "${PWD}:/workspace" ghcr.io/radityobw/sidik:latest --target /workspace --format console
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
> **Windows PowerShell Note:** Inside `.venv\Scripts` without prior `.\Activate.ps1`, prefix commands with `.\` (e.g., `.\sidik -i`, `.\sidik --gui`, `.\sidik-ml -i`) or invoke via `python -m sidik ...` / `python -m sidik_ml ...`.
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## 🗺️ Public Software Ecosystem
|
|
345
|
+
|
|
346
|
+
| Repository | Primary Role | Latest Version | Link |
|
|
347
|
+
| :--- | :--- | :---: | :--- |
|
|
348
|
+
| **SIDIK** | Deterministic SAST & OSV SCA core + UI plugin host | `v1.3.3` | [`github.com/radityobw/SIDIK`](https://github.com/radityobw/SIDIK) |
|
|
349
|
+
| **SIDIK-ML** | Explainable Non-ANN ML extension & `sidik.plugins` adapter | `v0.5.3` | [`github.com/radityobw/SIDIK-ML`](https://github.com/radityobw/SIDIK-ML) |
|
|
350
|
+
|
|
351
|
+
> **Scientific Publication:** The foundational deterministic study is published in [*Jurnal Media Akademik (JMA)*](https://jurnal.mediaakademik.com/index.php/jma/article/view/9068/6647).
|
|
352
|
+
|
|
353
|
+
## 📄 License
|
|
354
|
+
|
|
355
|
+
Distributed under the **MIT License**. See [LICENSE](LICENSE).
|