Skip to content

Commit 8d860ba

Browse files
filipi86claude
andauthored
docs: document CycloneDX SBOM export across docs and monitor help (#37)
Follows up #36 by documenting the new --format cyclonedx everywhere users look for output formats. - docs/usage.md: bump "four formats" to five, add the format to the table, add a dedicated CycloneDX SBOM section with example output and scope/usage notes - docs/modules.md: add an SBOM Export subsection under the SCA engine - docs/index.md: list CycloneDX in standards and the reporter package comment - docs/branch-monitoring.md: add cyclonedx to the monitor --format values - docs/security.md: include cyclonedx in the 0600 report-permission note - README.md: reporter package comment - cli/monitor: add cyclonedx to the --format help text (monitor routes through reporter.New, so the format already works there) Co-authored-by: filipi86 <filipi86@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1758828 commit 8d860ba

7 files changed

Lines changed: 69 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ drogonsec/
320320
│ ├── engine/ # SAST rules engine (20+ languages)
321321
│ ├── leaks/ # Secret detection engine
322322
│ ├── sca/ # Dependency analysis engine
323-
│ ├── reporter/ # Text/JSON/SARIF/HTML reporters
323+
│ ├── reporter/ # Text/JSON/SARIF/HTML/CycloneDX reporters
324324
│ ├── ai/ # AI remediation engine (Ollama + Cloud)
325325
│ └── config/ # Types and configuration
326326
└── rules/ # YAML rule definitions (community-extensible)

docs/branch-monitoring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ jobs:
370370
| `--tls-cert` | — | PEM certificate for HTTPS |
371371
| `--tls-key` | — | PEM private key for HTTPS |
372372
| `--interval` | `5m` | Poll interval (min `30s`) |
373-
| `--format` | `text` | `text`, `json`, `sarif`, `html` |
373+
| `--format` | `text` | `text`, `json`, `sarif`, `html`, `cyclonedx` |
374374
| `--output` | stdout | Base path for report files |
375375
| `--severity` | `LOW` | Minimum severity to report |
376376
| `--workers` | `4` | Parallel scan workers |

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Inspired by Horusec, Drogonsec is its modern, actively maintained successor with
5353
- **CWE** — Common Weakness Enumeration mapping on every finding
5454
- **CVSS 3.1** — Severity scoring for accurate risk prioritization
5555
- **SARIF 2.1** — Native integration with GitHub Security and Azure DevOps
56+
- **CycloneDX 1.5** — SBOM export for Grype, Trivy, and Dependency-Track
5657

5758
---
5859

@@ -89,7 +90,7 @@ drogonsec/
8990
│ ├── engine/ # SAST rules engine (20+ languages)
9091
│ ├── leaks/ # Secret detection engine
9192
│ ├── sca/ # Dependency analysis engine
92-
│ ├── reporter/ # Text / JSON / SARIF / HTML reporters
93+
│ ├── reporter/ # Text / JSON / SARIF / HTML / CycloneDX reporters
9394
│ ├── ai/ # AI remediation (Ollama OSS + Cloud)
9495
│ └── config/ # Types and configuration
9596
└── rules/ # YAML rule definitions (community-extensible)

docs/modules.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,21 @@ CVSS : 7.5
107107
OWASP : A03:2025 - Software Supply Chain Failures
108108
```
109109
110+
### SBOM Export (CycloneDX)
111+
112+
The dependency inventory the SCA engine builds can be exported as a
113+
[CycloneDX](https://cyclonedx.org) 1.5 Software Bill of Materials, so it can be
114+
consumed by Grype, Trivy, and Dependency-Track:
115+
116+
```bash
117+
drogonsec scan . --format cyclonedx --output sbom.json
118+
```
119+
120+
Each dependency becomes a CycloneDX component with a Package URL (purl). The v1
121+
SBOM is a flat component list; the transitive dependency graph and SPDX output
122+
are planned for a later release. See [Usage → Output Formats](usage.md#output-formats)
123+
for details.
124+
110125
---
111126

112127
## Leaks Engine — Secret Detection

docs/security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Auto-detecting a local Ollama requires more than `HTTP 200` on port `11434` —
108108

109109
## Report Output Permissions
110110

111-
When `--output <file>` is used for `text`, `json`, `sarif`, or `html` reports, the file is created with mode `0600` (user-only). Reports embed vulnerable code snippets, matched secrets, and AI remediation text; on shared CI runners or workstations they should not be world-readable by default. If you need the report to be readable by other accounts, adjust the permissions after generation.
111+
When `--output <file>` is used for `text`, `json`, `sarif`, `html`, or `cyclonedx` reports, the file is created with mode `0600` (user-only). Reports embed vulnerable code snippets, matched secrets, and AI remediation text; on shared CI runners or workstations they should not be world-readable by default. If you need the report to be readable by other accounts, adjust the permissions after generation.
112112

113113
---
114114

docs/usage.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,15 @@ Always pass your API key via `AI_API_KEY` environment variable.
8888

8989
## Output Formats
9090

91-
Drogonsec supports four output formats, suited for different workflows:
91+
Drogonsec supports five output formats, suited for different workflows:
9292

9393
| Format | Flag | Use Case |
9494
|---|---|---|
9595
| Text (default) || Human-readable terminal output |
9696
| JSON | `--format json` | SIEM, automation, further processing |
9797
| HTML | `--format html` | Shareable reports, management presentations |
9898
| SARIF | `--format sarif` | GitHub Security tab, Azure DevOps |
99+
| CycloneDX | `--format cyclonedx` | SBOM for Grype, Trivy, Dependency-Track |
99100

100101
```bash
101102
# JSON report
@@ -106,8 +107,54 @@ drogonsec scan . --format html --output report.html
106107

107108
# SARIF for GitHub Security integration
108109
drogonsec scan . --format sarif --output results.sarif
110+
111+
# CycloneDX SBOM (Software Bill of Materials)
112+
drogonsec scan . --format cyclonedx --output sbom.json
113+
```
114+
115+
> **Tip:** for machine formats (`json`, `sarif`, `cyclonedx`) always pass
116+
> `--output`, so the scan's progress output stays on the terminal and the file
117+
> receives only the clean document.
118+
119+
### CycloneDX SBOM
120+
121+
The `cyclonedx` format exports a [CycloneDX](https://cyclonedx.org) 1.5 JSON
122+
Software Bill of Materials of the dependencies discovered by the SCA engine. Each
123+
dependency becomes a component with a Package URL (purl), so the output is
124+
directly consumable by Grype, Trivy, and Dependency-Track.
125+
126+
Supported ecosystems and their purl types: npm, pypi, golang, maven, gem
127+
(rubygems), composer (packagist), pub.
128+
129+
```bash
130+
drogonsec scan . --format cyclonedx --output sbom.json
109131
```
110132

133+
Example output (truncated):
134+
135+
```json
136+
{
137+
"bomFormat": "CycloneDX",
138+
"specVersion": "1.5",
139+
"serialNumber": "urn:uuid:cadae14d-aa47-44...",
140+
"version": 1,
141+
"metadata": {
142+
"timestamp": "2026-06-23T12:00:00Z",
143+
"tools": { "components": [ { "type": "application", "name": "DrogonSec Security Scanner", "version": "0.1.0" } ] },
144+
"component": { "type": "application", "name": "myproject" }
145+
},
146+
"components": [
147+
{ "type": "library", "bom-ref": "pkg:npm/lodash@4.17.15", "name": "lodash", "version": "4.17.15", "purl": "pkg:npm/lodash@4.17.15" }
148+
]
149+
}
150+
```
151+
152+
> **Scope:** the SBOM is a flat component inventory. The SCA engine resolves
153+
> manifests rather than full lockfiles, so the transitive dependency graph is
154+
> not yet expressed. Transitive resolution and SPDX output are planned for a
155+
> later release. The SBOM is derived from the SCA engine, so do not combine it
156+
> with `--no-sca`.
157+
111158
---
112159

113160
## Controlling Severity

internal/cli/monitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func init() {
8686
monitorCmd.Flags().StringVar(&monInterval, "interval", "5m", "polling interval: e.g. 30s, 5m, 1h (min: 30s)")
8787

8888
// Scan output flags (mirrors scan command for familiarity).
89-
monitorCmd.Flags().StringVarP(&monFmt, "format", "f", "text", "output format: text, json, sarif, html")
89+
monitorCmd.Flags().StringVarP(&monFmt, "format", "f", "text", "output format: text, json, sarif, html, cyclonedx")
9090
monitorCmd.Flags().StringVarP(&monOutput, "output", "o", "", "output file base path (branch + timestamp appended per scan)")
9191
monitorCmd.Flags().StringVar(&monSeverity, "severity", "LOW", "minimum severity to report: LOW, MEDIUM, HIGH, CRITICAL")
9292
monitorCmd.Flags().IntVar(&monWorkers, "workers", 4, "number of parallel scan workers")

0 commit comments

Comments
 (0)