feat: add configurable values for exploit intelligence integration#1112
feat: add configurable values for exploit intelligence integration#1112Strum355 wants to merge 1 commit into
Conversation
Reviewer's GuideAdds 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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 theExploitIntelligenceschema; either add it to the schema or remove it from the template to keep configuration consistent. - Including
create.exploitIntelligencein theread:documentscope 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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| 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: | |
There was a problem hiding this comment.
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.
f879116 to
c2abb8a
Compare
| "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" |
There was a problem hiding this comment.
Unrelated change but it seems like this file wasnt regenerated after changes were made to this field elsewhere
f2c10e2 to
7cfadba
Compare
7cfadba to
136770c
Compare
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:
Enhancements: