{"id":51863458,"url":"https://github.com/cerberauth/reportx","last_synced_at":"2026-07-24T12:01:03.155Z","repository":{"id":369939928,"uuid":"1169879917","full_name":"cerberauth/reportx","owner":"cerberauth","description":"A Go library for transforming raw DAST tool findings into standardized report output. Import it into OWASP ZAP wrappers, Nuclei post-processors, or custom scanners.","archived":false,"fork":false,"pushed_at":"2026-07-07T13:34:19.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-07T15:16:40.880Z","etag":null,"topics":["dast","reporting","sarif","sarif-report"],"latest_commit_sha":null,"homepage":"https://github.com/cerberauth/reportx","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cerberauth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["emmanuelgautier"],"buy_me_a_coffee":"emmanuelgautier"}},"created_at":"2026-03-01T11:16:18.000Z","updated_at":"2026-07-07T13:35:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cerberauth/reportx","commit_stats":null,"previous_names":["cerberauth/reportx"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cerberauth/reportx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerberauth%2Freportx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerberauth%2Freportx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerberauth%2Freportx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerberauth%2Freportx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cerberauth","download_url":"https://codeload.github.com/cerberauth/reportx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerberauth%2Freportx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35841138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-24T02:00:07.870Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dast","reporting","sarif","sarif-report"],"created_at":"2026-07-24T12:01:02.249Z","updated_at":"2026-07-24T12:01:03.149Z","avatar_url":"https://github.com/cerberauth.png","language":"Go","funding_links":["https://github.com/sponsors/emmanuelgautier","https://buymeacoffee.com/emmanuelgautier"],"categories":[],"sub_categories":[],"readme":"# reportx\n\nA Go library for transforming raw DAST tool findings into standardized report output.\nImport it into OWASP ZAP wrappers, Nuclei post-processors, or custom scanners.\n\n## Installation\n\n```bash\ngo get github.com/cerberauth/reportx\n```\n\n## Quick start\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"os\"\n\n    \"github.com/cerberauth/reportx\"\n    \"github.com/cerberauth/reportx/format\"\n)\n\nfunc main() {\n    findings := []reportx.Finding{\n        {\n            Title:       \"SQL Injection\",\n            Severity:    reportx.SeverityCritical,\n            CWEID:       \"CWE-89\",\n            URL:         \"https://api.example.com/users\",\n            Parameter:   \"id\",\n            Description: \"User-controlled input passed to SQL query.\",\n            Remediation: \"Use parameterized queries.\",\n            Status:      reportx.StatusActive,\n        },\n    }\n\n    report, err := reportx.NewBuilder().\n        Tool(\"MyScanner\", \"1.0.0\").\n        Target(\"https://api.example.com\").\n        Title(\"Nightly scan\").\n        Findings(findings).\n        Enrich().      // auto-fill CWEName + OwaspTop10\n        Deduplicate(). // compute + apply fingerprints\n        Build()\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    data, err := format.NewSARIFFormatter().Format(report)\n    if err != nil {\n        log.Fatal(err)\n    }\n    os.Stdout.Write(data)\n}\n```\n\n## Formatters\n\n| Format | MediaType | FileExtension | Best used for |\n|--------|-----------|---------------|---------------|\n| JSON | `application/json` | `.json` | REST APIs, dashboards |\n| JSONL | `application/x-ndjson` | `.jsonl` | Streaming pipelines, `jq` |\n| SARIF | `application/sarif+json` | `.sarif.json` | GitHub Code Scanning, IDEs |\n| Markdown | `text/markdown` | `.md` | PR comments, wikis |\n| HTML | `text/html` | `.html` | Standalone reports, email |\n\n### JSON\n\n```go\ndata, err := format.NewJSONFormatter().Format(report)\n// Writes: { \"metadata\": {...}, \"findings\": [...] }\n```\n\n### JSONL\n\n```go\ndata, err := format.NewJSONLFormatter().Format(report)\n// One JSON object per line — pipe to jq or a SIEM\n```\n\n### SARIF\n\n```go\ndata, err := format.NewSARIFFormatter().Format(report)\n// Valid SARIF 2.1.0 — upload to GitHub Code Scanning\n```\n\n### Markdown\n\n```go\ndata, err := format.NewMarkdownFormatter().Format(report)\n// Post as a PR comment or embed in a wiki page\n```\n\n### HTML\n\n```go\ndata, err := format.NewHTMLFormatter().Format(report)\n// Self-contained HTML file — no external CSS or JS\n// Includes print stylesheet for clean PDF export\n```\n\n### Writing to a file\n\n```go\nerr := report.WriteToFile(\"report.sarif.json\", format.NewSARIFFormatter())\n```\n\n### Writing to any io.Writer\n\n```go\nerr := report.WriteTo(os.Stdout, format.NewJSONFormatter())\n```\n\n## CVSS scoring\n\nThe `score` sub-package computes CVSS base scores from vector strings.\n\n### CVSS 3.1\n\n```go\nimport \"github.com/cerberauth/reportx/score\"\n\ns, err := score.CalculateV31(\"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H\")\n// s = 9.8\n\nseverity := score.Label(s) // reportx.SeverityCritical\n```\n\n### CVSS 4.0\n\n```go\ns, err := score.CalculateV40(\"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H\")\n// s = 10.0\n```\n\n## Deduplication\n\n`Builder.Deduplicate()` computes a stable SHA-256 fingerprint for every finding and drops duplicates, keeping the first occurrence by index.\n\n**Fingerprint inputs** (all normalized to lowercase):\n- `CWEID` — e.g. `cwe-89`\n- `URL` — scheme + host + path, no query string or fragment, no trailing slash\n- `Parameter` — trimmed\n\nTwo findings with the same CWE, endpoint, and parameter are considered duplicates regardless of their title, description, or evidence.\n\n**Opt out** if your scanner already deduplicates, or if you intentionally want multiple findings per endpoint:\n\n```go\nreport, err := reportx.NewBuilder().\n    Findings(findings).\n    // no .Deduplicate() call\n    Build()\n```\n\n## CWE enrichment\n\n`Builder.Enrich()` fills `Finding.CWEName` and `Finding.OwaspTop10` from an embedded CWE database (no network calls). It covers 20 common web vulnerabilities including CWE-89, CWE-79, CWE-22, CWE-352, CWE-918, and more.\n\nEnrichment is a no-op when `Finding.CWEID` is empty or unknown — it never returns an error for missing data.\n\nYou can also enrich findings directly:\n\n```go\nimport \"github.com/cerberauth/reportx/enrich\"\n\nenriched := enrich.EnrichAll(findings) // returns new slice, original unchanged\n```\n\n## Evidence\n\nAttach evidence to any finding using the `evidence` sub-package. Two built-in types:\n\n```go\nimport \"github.com/cerberauth/reportx/evidence\"\n\n// HTTP request/response\nfinding.Evidence = \u0026evidence.HTTPEvidence{\n    RequestMethod:  \"POST\",\n    RequestURL:     \"https://api.example.com/login\",\n    ResponseStatus: 500,\n    RequestBody:    []byte(`{\"username\":\"' OR 1=1--\"}`),\n    ResponseBody:   []byte(\"SQLite error: syntax error\"),\n}\n\n// Any non-HTTP data\nfinding.Evidence = \u0026evidence.CustomEvidence{\n    Data: map[string]any{\n        \"payload\": `{\"__proto__\":{\"admin\":true}}`,\n        \"timing\":  \"4.2s\",\n    },\n}\n```\n\n`HTTPEvidence` also accepts raw strings if structured fields are unavailable:\n\n```go\nfinding.Evidence = \u0026evidence.HTTPEvidence{\n    RawRequest:  \"GET /users?id=1' HTTP/1.1\\r\\nHost: api.example.com\",\n    RawResponse: \"HTTP/1.1 500 Internal Server Error\\r\\n\\r\\nSQLite error: syntax error\",\n}\n```\n\nImplement `IsEmpty() bool` on any struct to use it as a custom evidence type.\n\n## Extending reportx\n\nImplement the `format.Formatter` interface to add a custom output format:\n\n```go\npackage myformat\n\nimport \"github.com/cerberauth/reportx\"\n\ntype CSVFormatter struct{}\n\nfunc (f *CSVFormatter) Format(r *reportx.Report) ([]byte, error) {\n    var buf bytes.Buffer\n    buf.WriteString(\"id,title,severity,url,cwe\\n\")\n    for _, finding := range r.Findings {\n        fmt.Fprintf(\u0026buf, \"%s,%s,%s,%s,%s\\n\",\n            finding.ID, finding.Title, finding.Severity,\n            finding.URL, finding.CWEID,\n        )\n    }\n    return buf.Bytes(), nil\n}\n\nfunc (f *CSVFormatter) MediaType() string     { return \"text/csv\" }\nfunc (f *CSVFormatter) FileExtension() string { return \".csv\" }\n```\n\nUse it with any `Report`:\n\n```go\ndata, err := new(myformat.CSVFormatter).Format(report)\n```\n\nOr write directly to a file:\n\n```go\nerr := report.WriteToFile(\"findings.csv\", new(myformat.CSVFormatter))\n```\n\n## License\n\nSee [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerberauth%2Freportx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcerberauth%2Freportx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerberauth%2Freportx/lists"}