Skip to content

feat: add configurable values for exploit intelligence integration#1112

Open
Strum355 wants to merge 1 commit into
trustification:release/3.y.zfrom
Strum355:nsc/exploit-intelligence-integration
Open

feat: add configurable values for exploit intelligence integration#1112
Strum355 wants to merge 1 commit into
trustification:release/3.y.zfrom
Strum355:nsc/exploit-intelligence-integration

Conversation

@Strum355

@Strum355 Strum355 commented Jul 22, 2026

Copy link
Copy Markdown
Member

As part of TPA changes in guacsec/trustify#2464

Summary by Sourcery

Add configurable Exploit Intelligence integration to the Trusted Profile Analyzer Helm chart and deployment.

New Features:

  • Introduce exploitIntelligence configuration section with URL, polling, retry, and OIDC options for integrating with an external Exploit Intelligence service.
  • Expose Exploit Intelligence-related environment variables to the server deployment when the integration is enabled.
  • Extend sample TrustedProfileAnalyzer CR and default values to include exploitIntelligence.enabled.
  • Grant RBAC and scope mappings for creating and reading Exploit Intelligence resources in the authentication helper templates.

Enhancements:

  • Enforce schema validation that requires an Exploit Intelligence URL when the integration is enabled.

@sourcery-ai

sourcery-ai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds configurable Helm values and wiring for an Exploit Intelligence integration in the Trusted Profile Analyzer chart, including schema definitions, sample CR config, deployment env var injection, and auth permissions/scopes.

File-Level Changes

Change Details Files
Introduce Exploit Intelligence configuration block in Helm values and schema, including validation of required fields when enabled.
  • Add exploitIntelligence root property to values.schema.yaml referencing new ExploitIntelligence definition
  • Define ExploitIntelligence object with fields for URLs, polling behavior, retry settings, and OIDC credentials
  • Add conditional schema rule that requires exploitIntelligence.url when exploitIntelligence.enabled is true
  • Add ExploitIntelligenceOidc definition for EI-specific OIDC client credentials
helm-charts/redhat-trusted-profile-analyzer/values.schema.yaml
Provide default and sample configuration for the Exploit Intelligence integration.
  • Add exploitIntelligence.enabled default to Helm values.yaml
  • Add exploitIntelligence.enabled field to the sample TrustedProfileAnalyzer CR spec
helm-charts/redhat-trusted-profile-analyzer/values.yaml
config/samples/v1_trustedprofileanalyzer.yaml
Wire Exploit Intelligence configuration into the server deployment via environment variables.
  • Create exploit_intelligence.tpl helper to map exploitIntelligence values to EXPLOIT_INTELLIGENCE* env vars, gated by enabled flag
  • Use trustification.common.requiredEnvVarValue helper to enforce EXPLOIT_INTELLIGENCE_URL when enabled
  • Inject exploit-intelligence env vars into the server Deployment template
helm-charts/redhat-trusted-profile-analyzer/templates/helpers/_exploit_intelligence.tpl
helm-charts/redhat-trusted-profile-analyzer/templates/services/server/030-Deployment.yaml
Extend authentication permissions and scope mappings to cover Exploit Intelligence operations.
  • Add create.exploitIntelligence and read.exploitIntelligence permissions to the auth helper
  • Map read:document scope to include EI-related permissions in keycloak scope mappings
helm-charts/redhat-trusted-profile-analyzer/templates/helpers/_auth.tpl

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • The Helm helper template for exploit intelligence references exploitIntelligence.authToken, but this field is not defined in the ExploitIntelligence schema; either add it to the schema or remove it from the template to keep configuration consistent.
  • Including create.exploitIntelligence in the read:document scope mapping looks semantically off; consider moving this permission into a more appropriate create/update scope to match the intended action semantics.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The Helm helper template for exploit intelligence references `exploitIntelligence.authToken`, but this field is not defined in the `ExploitIntelligence` schema; either add it to the schema or remove it from the template to keep configuration consistent.
- Including `create.exploitIntelligence` in the `read:document` scope mapping looks semantically off; consider moving this permission into a more appropriate create/update scope to match the intended action semantics.

## Individual Comments

### Comment 1
<location path="helm-charts/redhat-trusted-profile-analyzer/templates/helpers/_exploit_intelligence.tpl" line_range="46-19" />
<code_context>
+  value: {{ . | quote }}
+{{- end }}
+
+{{- with $ei.authToken }}
+- name: EXPLOIT_INTELLIGENCE_AUTH_TOKEN
+  {{- include "trustification.common.envVarValue" . | nindent 2 }}
+{{- end }}
+
+{{- with $ei.oidc }}
</code_context>
<issue_to_address>
**issue (bug_risk):** Using `$ei.authToken` here conflicts with the strict ExploitIntelligence schema that disallows this field.

Because `ExploitIntelligence` has `additionalProperties: false`, `$ei.authToken` can never be populated, so this env var will always be unset and suggests a configuration option that doesn’t actually exist. Please either remove the `EXPLOIT_INTELLIGENCE_AUTH_TOKEN` section from the template, or add an `authToken` field to both the ExploitIntelligence and JSON schemas to match this usage.
</issue_to_address>

### Comment 2
<location path="helm-charts/redhat-trusted-profile-analyzer/values.schema.yaml" line_range="840-849" />
<code_context>
+  ExploitIntelligenceOidc:
</code_context>
<issue_to_address>
**suggestion (bug_risk):** The OIDC description requires clientId/clientSecret/issuerUrl together, but the schema doesn’t enforce this relationship.

The schema currently allows any subset of `clientId`, `clientSecret`, and `issuerUrl`, which can result in partially configured OIDC and runtime failures. Please update the JSON Schema (e.g., using if/then or allOf with `required`) so that either all three fields are present or none are, consistent with the documented requirement.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +840 to +849
ExploitIntelligenceOidc:
type: object
additionalProperties: false
description: |
OIDC credentials for authenticating with the EI service using client credentials flow.
All three of clientId, clientSecret, and issuerUrl must be set together.
properties:
clientId:
$ref: "#/definitions/ValueOrRef"
description: |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (bug_risk): The OIDC description requires clientId/clientSecret/issuerUrl together, but the schema doesn’t enforce this relationship.

The schema currently allows any subset of clientId, clientSecret, and issuerUrl, which can result in partially configured OIDC and runtime failures. Please update the JSON Schema (e.g., using if/then or allOf with required) so that either all three fields are present or none are, consistent with the documented requirement.

@Strum355
Strum355 changed the base branch from main to release/3.y.z July 22, 2026 10:56
@Strum355
Strum355 force-pushed the nsc/exploit-intelligence-integration branch 2 times, most recently from f879116 to c2abb8a Compare July 22, 2026 11:02
"cacheTTL": {
"type": "string",
"description": "the time a cache is allowed to live (in s) before forcing a reload.\n"
"description": "Enable read-only mode. When true, the server rejects all mutating API\nrequests with 503 and the importer suspends all import jobs.\nthe time a cache is allowed to live (in s) before forcing a reload.\n"

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.

Unrelated change but it seems like this file wasnt regenerated after changes were made to this field elsewhere

@Strum355
Strum355 force-pushed the nsc/exploit-intelligence-integration branch 3 times, most recently from f2c10e2 to 7cfadba Compare July 23, 2026 09:40
@Strum355
Strum355 force-pushed the nsc/exploit-intelligence-integration branch from 7cfadba to 136770c Compare July 24, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant