Repository navigation
[release-6.6] LOG-9752: prevent TOML literal-multiline injection in generated collector config - #3518
Conversation
…config
go-toml v1 emits struct fields tagged `multiline:"true" literal:"true"`
(transforms.Remap.Source and transforms.Filter.Condition) verbatim between
''' delimiters with no escaping. A value derived from an untrusted
ClusterLogForwarder spec that contains the ''' terminator breaks out of the
TOML string and injects arbitrary TOML into the collector configuration.
FIND-001 (LOG-9704) fixed only the drop-filter sink. This closes the
remaining sinks that share the same encoder gap:
- Structural guard (internal/utils/toml): toml.Marshal now walks the config
and rejects any literal-multiline field whose value contains the terminator.
This is the single choke point every VRL sink funnels through, so it covers
output user-templates, prune/drop FieldPath, kubeAPIAudit wildcards, and any
future literal sink. A malformed config is never rendered; the reconciler
reports the error instead of deploying a crash-looping collector.
- Defense-in-depth admission validation, so a bad spec is rejected with a
clear status condition before generation:
- outputs: cloudwatch.groupName, elasticsearch.index, googleCloudLogging.logId,
kafka.topic, loki.tenantKey, splunk.index
- filters: prune/drop FieldPath quoted segments
- filters: kubeAPIAudit rule strings (users, groups, verbs, namespaces,
nonResourceURLs, resources) which previously had no controller validation
A shared common.ValidateTOMLLiteralSafe helper backs all three.
ref: LOG-9752
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extend admission-time TOML literal-multiline injection guards to every user-controlled string that reaches a Vector remap source: - filters: validate openshiftLabels keys/values; validate kubeAPIAudit rule Level, rule OmitStages, and filter-level OmitStages - outputs: validate splunk source/sourceType/payloadKey, s3 keyPrefix, and syslog facility/severity/appName/procId/msgId/payloadKey Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Splunk IndexedFields flow through GenerateQuotedPathSegmentArrayStr into the Vector remap source; %q quoting escapes quotes and newlines but not the literal-multiline terminator, so validate each entry at admission time. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@openshift-cherrypick-robot: Ignoring requests to cherry-pick non-bug issues: LOG-9752 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/cluster-logging-operator/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
/label tide/merge-method-squash |
|
/approve |
|
/label verified |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcantrill, openshift-cherrypick-robot The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest-required |
2 similar comments
|
/retest-required |
|
/retest-required |
|
/retest |
|
/label verified |
|
/retest-required |
1 similar comment
|
/retest-required |
|
/retest |
|
/retest-required |
|
/retest-required |
|
@openshift-cherrypick-robot: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #3492
/assign jcantrill