Skip to content

Commit 5199203

Browse files
committed
docs: professional README overhaul
1 parent 6186fec commit 5199203

File tree

1 file changed

+54
-112
lines changed

1 file changed

+54
-112
lines changed

README.md

Lines changed: 54 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,107 @@
1-
# ⭐ osv-vuln-bot — Always-Green OSV Scanner (Python CLI)
1+
# 🔎 OSV Vulnerability Bot — AlwaysGreen Python Project
22

3-
A lean, production-grade **Python CLI** to audit dependencies against [OSV.dev](https://osv.dev/).
4-
It mirrors CI locally, enables **CodeQL**, enforces a **strict always-green** workflow (linear history + required checks), and fails builds when risk thresholds are met.
3+
Automated vulnerability scanning and CI hardening for Python projects.
4+
This repo integrates **OSV‑Scanner** against `poetry.lock`, a strict **green CI** (ruff, black, pytest, mypy), and **CodeQL** for security—all guarded by branch protection.
55

66
<div align="center">
77

8-
[![CI / build](https://github.com/CoderDeltaLAN/osv-vuln-bot/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/CoderDeltaLAN/osv-vuln-bot/actions/workflows/build.yml)
9-
[![CodeQL Analysis](https://github.com/CoderDeltaLAN/osv-vuln-bot/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/CoderDeltaLAN/osv-vuln-bot/actions/workflows/codeql.yml)
8+
[![CI](https://github.com/CoderDeltaLAN/osv-vuln-bot/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/CoderDeltaLAN/osv-vuln-bot/actions/workflows/ci.yml)
9+
[![CodeQL](https://github.com/CoderDeltaLAN/osv-vuln-bot/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/CoderDeltaLAN/osv-vuln-bot/actions/workflows/codeql.yml)
1010
[![Release](https://img.shields.io/github/v/release/CoderDeltaLAN/osv-vuln-bot?display_name=tag)](https://github.com/CoderDeltaLAN/osv-vuln-bot/releases)
1111
![Python 3.11|3.12](https://img.shields.io/badge/Python-3.11%20|%203.12-3776AB?logo=python)
1212
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
13-
[![Donate](https://img.shields.io/badge/Donate-PayPal-0070ba?logo=paypal&logoColor=white)](https://www.paypal.com/donate/?hosted_button_id=YVENCBNCZWVPW)
1413

1514
</div>
1615

1716
---
1817

19-
## Repo layout
18+
## What this project does
2019

21-
```text
22-
.
23-
├── scripts/ # Utilities (e.g., gen_deps_from_poetry.py)
24-
├── examples/deps.sample.json # Example dependency inventory
25-
├── src/osv_vuln_bot/ # Python package + CLI
26-
├── tests/ # pytest (95%+ coverage)
27-
└── .github/workflows/ # build.yml, codeql.yml, etc.
28-
```
20+
- Runs **OSV‑Scanner** on `poetry.lock` to surface known vulnerabilities early.
21+
- Enforces **always‑green** PRs with required checks: *Analyze*, *python (3.11)*, *python (3.12)*.
22+
- Uses **CodeQL** for code‑scanning and **Release Drafter** + conventional commits for clean releases.
23+
- Keeps **linear history** via squash‑merge and branch protection.
2924

3025
---
3126

32-
## 🚀 Quick Start (Python)
27+
## Quick start (local)
3328

3429
```bash
35-
cd /home/user/Proyectos/osv-vuln-bot
36-
poetry install --no-interaction
37-
38-
# Local gates (mirror CI)
39-
poetry run ruff check .
40-
poetry run black --check .
41-
PYTHONPATH=src poetry run pytest -q
42-
poetry run mypy src
30+
# Install tooling (inside your virtualenv)
31+
python -m pip install -U pip
32+
pip install ruff black pytest mypy
33+
34+
# Lint/format/tests/types (mirrors CI)
35+
ruff check .
36+
black --check .
37+
PYTHONPATH=src pytest -q
38+
mypy src
4339
```
4440

45-
### CLI usage
46-
47-
Generate inventory from `poetry.lock` and scan:
48-
41+
### Local OSV scan
4942
```bash
50-
cd /home/user/Proyectos/osv-vuln-bot
51-
poetry run python scripts/gen_deps_from_poetry.py poetry.lock > deps.json
52-
poetry run osv-vuln-bot --deps deps.json --fail-on high
53-
```
54-
55-
Help & options:
43+
# Option A: Using osv-scanner CLI
44+
python -m pip install osv-scanner
45+
osv-scanner --lockfile=poetry.lock
5646

57-
```bash
58-
cd /home/user/Proyectos/osv-vuln-bot
59-
poetry run osv-vuln-bot --help
47+
# Option B: Docker (if you prefer containers)
48+
docker run --rm -v "$PWD:/work" ghcr.io/google/osv-scanner:latest \
49+
--lockfile=/work/poetry.lock
6050
```
6151

62-
**Notes**
63-
- `--deps` expects a JSON array of `{ "ecosystem":"PyPI", "name":"<pkg>", "version":"<ver>" }`.
64-
- `--fail-on` supports: `none | low | moderate | high | critical`.
65-
- If the threshold is met or exceeded, the process **exits non-zero** (perfect for CI gating).
66-
67-
---
68-
69-
## 🧪 Local Developer Workflow (mirrors CI)
70-
71-
```bash
72-
cd /home/user/Proyectos/osv-vuln-bot
73-
poetry run ruff check .
74-
poetry run black --check .
75-
PYTHONPATH=src poetry run pytest -q
76-
poetry run mypy src
77-
```
52+
> CI runs these gates on PRs and `main`. Branch protection blocks merges if any fail.
7853
7954
---
8055

81-
## 🔧 CI (GitHub Actions)
56+
## CI / CD
8257

83-
- Linux matrix **Python 3.11 / 3.12** with steps matching local gates.
84-
- **OSV scan** integrated (job fails when the risk threshold is hit).
85-
- **Artifacts** with per-job logs for troubleshooting.
86-
- **CodeQL** runs on PRs and `main`.
58+
- **CI:** `.github/workflows/ci.yml` → Linux, Python 3.11/3.12, ruff/black/pytest/mypy.
59+
- **Security:** `.github/workflows/codeql.yml` → CodeQL analysis on PRs and `main`.
60+
- **Releases:** Drafted by Release Drafter; tags via GitHub Releases. Keep commits conventional for good notes.
8761

88-
Relevant Python job fragment:
62+
Example Python steps (as in CI):
8963

9064
```yaml
91-
- run: python -m pip install --upgrade pip
92-
- run: pip install poetry
93-
- run: poetry install --no-interaction
94-
- run: poetry run ruff check .
95-
- run: poetry run black --check .
96-
- env:
97-
PYTHONPATH: src
98-
run: poetry run pytest -q
99-
- run: poetry run mypy src
100-
- name: Generate deps from poetry.lock
101-
run: poetry run python scripts/gen_deps_from_poetry.py poetry.lock > deps.ci.json
102-
- name: OSV scan (fail on high)
103-
run: poetry run osv-vuln-bot --deps deps.ci.json --fail-on high
65+
- run: python -m pip install -U pip
66+
- run: pip install ruff black pytest mypy
67+
- run: ruff check .
68+
- run: black --check .
69+
- run: pytest -q
70+
- run: mypy src
10471
```
10572
10673
---
10774
108-
## 🗺 When to Use This Project
75+
## Branch protection (main)
10976
110-
- You need **security gating** with OSV on PRs and `main`.
111-
- Python repos that must **stay green** (branch protections + auto-merge).
112-
- Prefer **linear history** via squash-merge.
77+
- Required checks: **Analyze**, **python (3.11)**, **python (3.12)**.
78+
- Linear history, no force‑push, conversations resolved, admins enforced.
79+
- Squash‑merge only; auto‑merge allowed once checks pass.
11380
11481
---
11582
116-
## 🧩 Customization
83+
## Contributing
11784
118-
- Tune `--fail-on` to match your risk appetite.
119-
- Swap the inventory source (e.g., generate JSON from `requirements.txt`).
120-
- Extend the CI matrix or add OS runners if required.
85+
- Use **small, atomic PRs** and **Conventional Commits** (e.g., `feat: ...`, `fix: ...`, `docs: ...`).
86+
- Keep local gates green before pushing.
87+
- Enable **auto‑merge** when checks pass.
12188

12289
---
12390

124-
## 🛡 Security
91+
## Security Policy
12592

126-
- Private disclosures via GitHub Security Advisories.
127-
- **CodeQL** enabled; OSV runs on every PR and `main`.
128-
- Secret scanning is enabled; never commit secrets.
93+
Please report vulnerabilities via **GitHub Security Advisories** (private) or open a minimal reproducible issue if appropriate. CodeQL and OSV scans run automatically on PRs and `main`.
12994

13095
---
13196

132-
## 🙌 Contributing
97+
## Sponsorship
13398

134-
- **Small, atomic PRs** using Conventional Commits.
135-
- Keep **local gates** green before pushing.
136-
- Enable **auto-merge** once checks pass.
99+
If this project is useful, consider supporting continued maintenance and polish. Thank you!
100+
[**PayPal Donate**](https://www.paypal.com/donate/?hosted_button_id=YVENCBNCZWVPW)
137101

138102
---
139103

140-
## 📈 SEO Keywords
141-
142-
osv scanner python cli, osv.dev vulnerability audit, poetry lock deps to osv,
143-
always green ci python, ruff black pytest mypy, github actions matrix, codeql analysis,
144-
branch protection required checks, squash merge linear history, dependency security gating
145-
146-
---
147-
148-
## 👤 Author
149-
150-
**CoderDeltaLAN (Yosvel)**
151-
152-
GitHub: https://github.com/CoderDeltaLAN
153-
154-
---
155-
156-
## 💚 Donations & Sponsorship
157-
158-
If this project saves you time, consider supporting ongoing maintenance. Thank you!
159-
[![Donate](https://img.shields.io/badge/Donate-PayPal-0070ba?logo=paypal&logoColor=white)](https://www.paypal.com/donate/?hosted_button_id=YVENCBNCZWVPW)
160-
161-
---
104+
## License
162105

163-
## 📄 License
106+
Distributed under the **MIT License**. See [LICENSE](LICENSE).
164107

165-
Released under the **MIT License**. See [LICENSE](LICENSE).

0 commit comments

Comments
 (0)