Build a GitLab instance project index and search repositories for sensitive keywords (API-only, no cloning).
Project description
GitlabHarvester — Global GitLab Code & Secret Search Tool (Python)
GitlabHarvester is a fast, scalable tool for searching keywords across an entire GitLab instance using the API — without cloning repositories.
Built for security audits, secret discovery, compliance checks, and large‑scale code intelligence across thousands of projects.
Global term search across a full GitLab instance — especially valuable for GitLab CE environments.
🚀 Overview
GitLab Community Edition does not provide full instance‑wide code search like EE.
GitlabHarvester fills this gap by:
- building a lightweight instance project index
- scanning repositories via API
- streaming results in JSONL
- supporting resumable sessions
- keeping memory usage constant
Designed to operate efficiently on environments with 10k–100k repositories.
🔍 Key Advantages
| Problem | Solution |
|---|---|
| No global search | Instance‑wide scan |
| Cloning thousands repos | API‑only scanning |
| Large instances | Streaming architecture |
| Repeated audits | Cached project index |
✨ Features
- Instance‑wide keyword search
- No repository cloning
- JSONL project index
- Branch scanning strategies
- Smart fork analysis
- Resume interrupted scans
- Streaming output
- Low memory footprint
- Automation‑friendly
📦 Installation
Recommended — install from PyPI (isolated environment)
pipx install gitlab-harvester
Run:
gitlab-harvester --help
Alternative — pip
pip install gitlab-harvester
Development install
git clone https://github.com/Cur1iosity/GitlabHarvester.git
cd GitlabHarvester
pip install .
Editable mode:
pip install -e .
Install latest dev version
pipx install git+https://github.com/Cur1iosity/GitlabHarvester.git
Requirements
- Python 3.10+
- GitLab token with read_api permission
⚡ Quick Start
Search single keyword:
gitlab-harvester -H https://gitlab.example.com -t $TOKEN --search password
Search from file:
gitlab-harvester -H https://gitlab.example.com -t $TOKEN --terms-file words.txt
Build index only:
gitlab-harvester -H https://gitlab.example.com -t $TOKEN --dump-only
🌿 Branch Control
Two independent controls:
--index-branches— stored branches--scan-branches— scanned branches
Example:
gitlab-harvester -H ... -t ... --scan-branches 10
Store all + scan all:
gitlab-harvester -H ... -t ... --index-branches all --scan-branches all
Shortcut:
--branches N
🍴 Fork Strategies
--forks skip|include|branch-diff|all-branches
Recommended → branch-diff
Behavior:
| Mode | Behavior |
|---|---|
| skip | ignore forks |
| include | treat as normal repos |
| branch-diff | scan default + unique branches |
| all-branches | full exhaustive scan |
💾 Sessions & Resume
Create session:
gitlab-harvester -H ... -t ... --terms-file words.txt --session audit
Resume:
gitlab-harvester -H ... -t ... --session-file audit.jsonl --resume
📊 Output
Two file types:
| File | Purpose |
|---|---|
| Project index | cached project metadata |
| Session file | hits + checkpoints |
Format → JSONL (streaming‑friendly)
🧰 Post‑Processing Utilities
Deduplicate results
python scripts/dedup.py --input session.jsonl --output dedup.jsonl
Options:
--no-normalize--sqlite db.sqlite
Convert JSONL → JSON
python scripts/convert_jsonl_to_json.py \
--input session.jsonl \
--output result.json
Pretty format:
jq . result.json > formatted.json
🏗 Architecture
GitLab API
↓
Indexer
↓
Branch planner
↓
Matcher
↓
JSONL stream
Constant memory usage regardless of instance size.
🎯 Typical Use Cases
- secret discovery
- credential leaks detection
- internal audits
- redteam/pentest reconnaissance
- DevSecOps validation
- large‑scale code search
🔐 Security Notice
Use only on GitLab instances where you are authorized to perform scanning.
🤝 Contributing
Pull requests and ideas welcome.
📜 License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitlab_harvester-0.1.6.tar.gz.
File metadata
- Download URL: gitlab_harvester-0.1.6.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
045842c04cf3eaefdf23302e1dd1b2a5c637d5ed6ae24bcf08fcd4969841714f
|
|
| MD5 |
f7dfe80a40adb4e590d1cd2f1c15608c
|
|
| BLAKE2b-256 |
43ce1b390ebb311d1ee051c9a3b3873175d97cb7d9d05ceaa0a26ff5554e32b7
|
Provenance
The following attestation bundles were made for gitlab_harvester-0.1.6.tar.gz:
Publisher:
python-publish.yml on Cur1iosity/GitlabHarvester
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitlab_harvester-0.1.6.tar.gz -
Subject digest:
045842c04cf3eaefdf23302e1dd1b2a5c637d5ed6ae24bcf08fcd4969841714f - Sigstore transparency entry: 955964962
- Sigstore integration time:
-
Permalink:
Cur1iosity/GitlabHarvester@8ff849f6d2c25ae6f43309e5643c442b92db73cb -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/Cur1iosity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8ff849f6d2c25ae6f43309e5643c442b92db73cb -
Trigger Event:
release
-
Statement type:
File details
Details for the file gitlab_harvester-0.1.6-py3-none-any.whl.
File metadata
- Download URL: gitlab_harvester-0.1.6-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8176f72829dc1ed498d63616293dc6a525ca28d4e4fdc4c3b11f46736d161618
|
|
| MD5 |
cd833f52f27e7ad3de93df0a106a5852
|
|
| BLAKE2b-256 |
cdef8dfec54e9ae22cb173a6add988435a2d9dc2b07ae5ab6efb940ecff95c08
|
Provenance
The following attestation bundles were made for gitlab_harvester-0.1.6-py3-none-any.whl:
Publisher:
python-publish.yml on Cur1iosity/GitlabHarvester
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitlab_harvester-0.1.6-py3-none-any.whl -
Subject digest:
8176f72829dc1ed498d63616293dc6a525ca28d4e4fdc4c3b11f46736d161618 - Sigstore transparency entry: 955964965
- Sigstore integration time:
-
Permalink:
Cur1iosity/GitlabHarvester@8ff849f6d2c25ae6f43309e5643c442b92db73cb -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/Cur1iosity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8ff849f6d2c25ae6f43309e5643c442b92db73cb -
Trigger Event:
release
-
Statement type: