Skip to content

Fix shell injection in trust_flush CronJob#715

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
stuggi:fix_cron_arg
Jun 23, 2026
Merged

Fix shell injection in trust_flush CronJob#715
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
stuggi:fix_cron_arg

Conversation

@stuggi

@stuggi stuggi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Replace the bash -c string concatenation of TrustFlushArgs with a direct argv array, preventing shell metacharacter injection. The CronJob now executes keystone-manage as Command: ["keystone-manage", "trust_flush", ...args] instead of Command: ["/bin/bash"] Args: ["-c", "keystone-manage trust_flush" + args].

Additionally add kubebuilder:validation:Pattern on the TrustFlushArgs CRD field to reject shell metacharacters at the API level.

Jira: OSPRH-31632

Replace the bash -c string concatenation of TrustFlushArgs with a
direct argv array, preventing shell metacharacter injection. The
CronJob now executes keystone-manage as Command: ["keystone-manage",
"trust_flush", ...args] instead of Command: ["/bin/bash"] Args:
["-c", "keystone-manage trust_flush" + args].

Additionally add kubebuilder:validation:Pattern on the TrustFlushArgs
CRD field to reject shell metacharacters at the API level.

Jira: OSPRH-31632

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
@stuggi

stuggi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/retest

2 similar comments
@stuggi

stuggi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@stuggi

stuggi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@stuggi stuggi requested a review from Deydra71 June 23, 2026 06:51

@Deydra71 Deydra71 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.

lgtm

@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Deydra71, stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot Bot merged commit dd47f94 into openstack-k8s-operators:main Jun 23, 2026
7 checks passed
@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@stuggi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/functional 8ca3c2b link unknown /test functional

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@stuggi

stuggi commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

/cherry-pick 18.0-fr6

@openshift-cherrypick-robot

Copy link
Copy Markdown

@stuggi: new pull request created: #717

Details

In response to this:

/cherry-pick 18.0-fr6

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 kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants