Skip to content

feat: exploit intelligence integration#2534

Open
Strum355 wants to merge 9 commits into
mainfrom
feature/exploit-intelligence-integration
Open

feat: exploit intelligence integration#2534
Strum355 wants to merge 9 commits into
mainfrom
feature/exploit-intelligence-integration

Conversation

@Strum355

@Strum355 Strum355 commented Jul 22, 2026

Copy link
Copy Markdown
Member

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Strum355, your pull request is larger than the review limit of 150000 diff characters

@Strum355
Strum355 requested a review from ruromero July 22, 2026 16:41
@rh-jfuller
rh-jfuller requested a review from a team July 22, 2026 18:42
@Strum355
Strum355 force-pushed the feature/exploit-intelligence-integration branch from 068214e to c74a322 Compare July 23, 2026 08:50
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.86733% with 357 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.51%. Comparing base (7316619) to head (de5108a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
modules/exploit-intelligence/src/runner/polling.rs 64.24% 102 Missing and 36 partials ⚠️
modules/exploit-intelligence/src/runner/worker.rs 51.28% 56 Missing and 1 partial ⚠️
modules/exploit-intelligence/src/service/mod.rs 72.85% 52 Missing and 5 partials ⚠️
...odules/exploit-intelligence/src/runner/analysis.rs 78.48% 12 Missing and 22 partials ⚠️
modules/exploit-intelligence/src/runner/mod.rs 63.41% 15 Missing ⚠️
server/src/profile/api.rs 92.85% 9 Missing and 2 partials ⚠️
modules/exploit-intelligence/src/endpoints/mod.rs 87.50% 0 Missing and 9 partials ⚠️
modules/exploit-intelligence/src/error.rs 33.33% 8 Missing ⚠️
modules/exploit-intelligence/src/model/mod.rs 95.97% 5 Missing and 3 partials ⚠️
entity/src/exploit_intelligence_job.rs 0.00% 6 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2534      +/-   ##
==========================================
+ Coverage   72.17%   72.51%   +0.34%     
==========================================
  Files         465      480      +15     
  Lines       28702    30309    +1607     
  Branches    28702    30309    +1607     
==========================================
+ Hits        20715    21980    +1265     
- Misses       6813     7069     +256     
- Partials     1174     1260      +86     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread migration/src/m0002270_create_exploit_intelligence_job.rs
Comment thread migration/src/m0002270_create_exploit_intelligence_job.rs
Comment thread modules/fundamental/src/lib.rs Outdated
Comment thread server/src/profile/api.rs

/// Base URL of the Exploit Intelligence web UI for deep-linking to reports.
#[arg(long, env = "EXPLOIT_INTELLIGENCE_UI_URL")]
pub exploit_intelligence_ui_url: Option<String>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume if exploit_intelligence_url is set, so must be this one (and others). We need to make sure this information is available. Clap supports this.

@Strum355 Strum355 Jul 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume if exploit_intelligence_url is set, so must be this one (and others).

Not necessarily true, although it may be the most common case in practice. The EI client both serves the UI and provides the API (or an API gateway, whichever) so its entirely possible that the same URL is used.

Comment thread server/src/profile/api.rs
Comment thread server/src/profile/api.rs Outdated
Comment thread server/src/profile/api.rs Outdated

@ctron ctron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that, unless impossible, this should go into it's own module. It doesn't seem to be "fundemental".

Also, how can the UI evaluate if this feature is configured or not?

@ruromero ruromero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Exploit Intelligence Integration

Solid feature with well-designed job queue, comprehensive tests, and good resilience patterns. The convention and code quality items below should be addressed before merge.

See inline comments for details.

Comment thread modules/fundamental/Cargo.toml Outdated
Comment thread modules/fundamental/src/endpoints.rs
Comment thread modules/fundamental/src/endpoints.rs Outdated
Comment thread modules/exploit-intelligence/src/runner/polling.rs
Comment thread modules/exploit-intelligence/src/runner/polling.rs
Comment thread modules/fundamental/src/exploit_intelligence/runner/polling.rs Outdated
Comment thread modules/exploit-intelligence/src/service/mod.rs
Comment thread server/src/profile/api.rs Outdated
Comment thread server/src/profile/api.rs Outdated
Comment thread modules/exploit-intelligence/src/model/mod.rs
@Strum355

Copy link
Copy Markdown
Member Author

Also, how can the UI evaluate if this feature is configured or not?

Thanks for pointing this out, seems my changes disappeared into a git stash. Im taking the approach of adding a flag to /.well-known/trustify, any concerns with that? Seems reasonably straightforward and clean

{"version":"0.5.0-rc.1","readOnly":false,"exploitIntelligence":false,"build":{...}}

I think that, unless impossible, this should go into it's own module. It doesn't seem to be "fundemental".

Ill have a look into this 👍

@Strum355
Strum355 requested review from ctron and ruromero July 23, 2026 16:38
@Strum355
Strum355 force-pushed the feature/exploit-intelligence-integration branch from 4e515b5 to fe36624 Compare July 23, 2026 21:10
Comment thread modules/exploit-intelligence/src/runner/worker.rs
Strum355 and others added 9 commits July 24, 2026 12:55
…ion (#2435)

Create database entities and migration for tracking Exploit Intelligence
analysis jobs. Every job has at least one component row — CycloneDX
single-component jobs get exactly one, SPDX product jobs get N.

Job table tracks lifecycle (sbom_id, vulnerability_id, status) while all
per-component results (scan_id, finding, advisory_id) live exclusively on
the component table. Report URLs are derived at query time from config +
scan_id, not stored.

Includes composite index on (sbom_id, vulnerability_id) for the
find_active_job deduplication query, and FK indexes per CONVENTIONS.md.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Renumber EI migration from m0002250 to m0002270 to resolve collision
  with m0002250_create_cpe_status
- Move create.exploitIntelligence permission from read:document to
  create:document scope (write operations should not be gated by
  read-only access)
- Remove duplicate doc comment on compute_job_report_url

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 17 service-level tests covering job creation, dedup, dequeue
mechanics (visibility timeout, retry exhaustion, batch limit),
status guard enforcement, failure cascade to components, visibility
extension, component lifecycle, and excluded component semantics.

Add 12 runner-level tests using wiremock to mock the EI service API,
covering both CycloneDX and SPDX flows: successful analysis with
findings, VEX advisory ingestion, EI-side analysis failure, upload
rejection, transient retry, all-excluded products, mixed components,
product-level failure, and error classification.

Fix advisory_id not being linked to components after VEX ingestion
(strip_prefix("urn:uuid:") failed when the ingestor returned a
plain UUID without the prefix).

Fix dequeue_jobs returning stale pre-update models by reflecting
the UPDATE in memory before returning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…-intelligence

  - New crate modules/exploit-intelligence/ (trustify-module-exploit-intelligence) with its own Error type (3 variants: Unavailable, Database, Any) and ResponseError impl
  - Moved all 13 EI source files, updated crate::exploit_intelligence:: → crate:: paths, replaced SourceDocument round-trip with direct StorageKey::from_sha256()
  - Cleaned fundamental: removed pub mod exploit_intelligence, removed ei_service parameter from configure(), removed backon/reqwest/bytes from deps, removed EI imports from 5 integration test files and test
  helpers
  - Rewired server: imports now come from trustify_module_exploit_intelligence, EI endpoints mounted directly in /api scope alongside importer/ingestor/fundamental
@Strum355
Strum355 force-pushed the feature/exploit-intelligence-integration branch from db0c4ef to de5108a Compare July 24, 2026 11:55
@Strum355
Strum355 requested a review from rh-jfuller July 24, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants