-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(controller): podSpecPatch updates override the ref template in Secure
mode
#13909
base: main
Are you sure you want to change the base?
Conversation
acc027a
to
e27b47d
Compare
@@ -4023,6 +4023,9 @@ func (woc *wfOperationCtx) setStoredWfSpec(ctx context.Context) error { | |||
wfutil.JoinWorkflowMetaData(&woc.wf.ObjectMeta, &wfDefault.ObjectMeta) | |||
workflowTemplateSpec = wftHolder.GetWorkflowSpec() | |||
} | |||
if len(woc.execWf.Spec.PodSpecPatch) > 0 && woc.controller.Config.WorkflowRestrictions.MustNotChangeSpec() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also applies to Strict mode right? MustUseReference
is more suitable perhaps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think templateReferencing: Secure has prohibited changes, maybe podSpecPatch can also exist in strict mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The definition of workflowRestrictions
is here, I'm not very sure, but it seems that podSpecPatch
can exist in strict mode.
argo-workflows/docs/workflow-controller-configmap.yaml
Lines 387 to 395 in b93ffd8
# workflowRestrictions restricts the Workflows that the controller will process. | |
# Current options: | |
# Strict: Only Workflows using "workflowTemplateRef" will be processed. This allows the administrator of the controller | |
# to set a "library" of templates that may be run by its operator, limiting arbitrary Workflow execution. | |
# Secure: Only Workflows using "workflowTemplateRef" will be processed and the controller will enforce | |
# that the WorkflowTemplate that is referenced hasn't changed between operations. If you want to make sure the operator of the | |
# Workflow cannot run an arbitrary Workflow, use this option. | |
workflowRestrictions: | | |
templateReferencing: Strict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider it a security concern if you allow podSpecPatch when Secure is set to Strict mode. Our use-case is we want to allow people to create workflows, but only from things that exist from workflow templates without any changes.
e27b47d
to
af83e12
Compare
@chengjoey The E2E test failures were due to a bug in Kit, which was just fixed. If you merge your changes with |
…ecure` mode Signed-off-by: joey <[email protected]>
af83e12
to
f98a5d6
Compare
Fixes #13871
Motivation
podSpecPatch
seems not to be set when referencingwf template
and inSecure
modeModifications
Verification
wf:
kubectl get wf