Add program metadata, asset value tracking, and Intigriti reward-grid parser#95
Open
psyray wants to merge 6 commits into
Open
Add program metadata, asset value tracking, and Intigriti reward-grid parser#95psyray wants to merge 6 commits into
psyray wants to merge 6 commits into
Conversation
Introduce a new ProgramMetadata struct to capture program-level details (rewards, rules, testing instructions, stats) for each platform. This data is stored in a new `program_metadata` SQLite table and queryable via `bbscope db program`. - Add metadata extraction logic for Bugcrowd, HackerOne, Immunefi, Intigriti, and YesWeHack pollers. - Implement upsert and retrieval methods in the storage package. - Update platform documentation with details on captured metadata. - Add tests for Bugcrowd, Intigriti, and YesWeHack metadata parsers.
Normalize asset value for Bugcrowd, Intigriti, and YesWeHack programs. The value is stored in the database and exposed via the API. Add UI dropdowns to filter programs by minimum reward, currency, and report count.
Add AGENTS.md with AI agent guidelines
The researcher API omits structured bounty tables, so parse them from the markdown rules payload. This unifies rendering across platforms and adds a minimal markdown renderer for the web UI.
Owner
|
Hey! Thanks for this! I need some time to review it as it's a big one, but will do! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a program metadata system that captures rich program-level information (rewards, rules, qualifying vulnerabilities, reports stats, testing instructions, etc.) for all supported platforms, tracks per-asset value severity across platforms, and adds a markdown reward-table parser for Intigriti. The web UI gains a metadata section on program pages and new filters on the scope table.
fix #81
Changes
Program metadata system
scope.ProgramMetadataandscope.RewardGridtypes (pkg/scope/metadata.go) modeling rewards, rules, qualifying/non-qualifying vulnerabilities, testing instructions, account setup, and program stats. Pointer fields distinguish "unset" from "zero".program_metadataPostgres table (pkg/storage/storage.go) withUpsertProgramMetadata,GetProgramMetadata,GetProgramMetadataByPlatformHandle(pkg/storage/metadata.go).polling.processOneProgramnow upserts metadata after scope entries (non-fatal on failure).bbscope db program <platform>/<handle>subcommand (cmd/db.go) to print stored metadata from the CLI.domains.content. Also includes a fallback to the newerassetsCollectionshape when the legacydomains.contentarray is empty.Intigriti markdown reward-grid parser
parseIntigritiMarkdownRewardGridsscans the rules markdown for tables that look like reward grids (severity rows × asset category columns with currency amounts) and parses them intoscope.RewardGridentries — one per asset category column.amountRegex, which requires a currency symbol ($/€/£) or code (USD/EUR/GBP).Up to $X(Max only),$X - $Y(both),$X(min=max), andFrom $X(Min only) cell syntaxes.Asset value tracking
asset_valuecolumn ontargets_raw(with idempotentADD COLUMN IF NOT EXISTSmigration) andAssetValuefield onScopeElement/TargetItem/UpsertEntry/Entry/Change.critical,high,medium,low,very_low) from each platform's tier/P1-max/bounty-tier semantics:tier.id(legacy) orbountyTierId(assetsCollection).asset_valuefield in the program response.Web UI (
website/)website/pkg/core/markdown.go) for safely rendering platform rules as HTML — supports headings, lists, GFM tables, code blocks, blockquotes, inline bold/italic/code/links. Input is HTML-escaped up-front; only generated tags appear in output. Links withjavascript:/data:schemes are neutralized.sanitizeRulesHTML) for HTML-formatted rules: strips<script>/<style>/<iframe>/<object>/<embed>,on*=event handlers, andjavascript:URLs.bounty_reward_max,reports_count), and three new filters: min reward, currency, and "has reports". URL state is preserved for the new filters.title(falling back to handle) for display.program_metadata.titleis joined into the programs index and updates feed via aLEFT JOINonprogram_metadata./engagements/prefix stripped for consistency.Other
AGENTS.mdadded with repository guidance for AI agents.polling.gofield alignment cleaned up viagofmt.Validation
go vet ./...andgo test ./...from the repo root before merge.ADD COLUMN IF NOT EXISTS,CREATE TABLE IF NOT EXISTS).Notes for reviewers
parseIntigritiMarkdownRewardGridsand its tests for the supported syntaxes.