feat(charts): allow auto workflows to set own posixuid#1364
feat(charts): allow auto workflows to set own posixuid#1364JamesDoingStuff wants to merge 1 commit into
Conversation
7f729f9 to
4309ce9
Compare
4309ce9 to
89bb3c6
Compare
| workflows.diamond.ac.uk/creator-posix-uid: '{{ . }}' | ||
| {{- else }} | ||
| workflows.diamond.ac.uk/creator-posix-uid: '{{ `{{ request.userInfo.extra | "workflows.diamond.ac.uk/posixuid" | [0] }}` }}' | ||
| workflows.diamond.ac.uk/creator-posix-uid: '{{ `{{ request.userInfo.extra."workflows.diamond.ac.uk/posixuid"[0] || machineuid }}` }}' |
There was a problem hiding this comment.
checking I understand the safety reasoning here: it's impossible for a malicious user to set "workflows.diamond.ac.uk/machine-uid" themselves because "workflows.diamond.ac.uk/posixuid" is always set and is out of their control?
There was a problem hiding this comment.
Yes that was my thinking - I just tried running a workflow with the label set manually and the pod was still my UID rather than the machine one
|
Could be worth adding a validating rule that rejects workflows that carry a machine-uid label unless submitted by a trusted Service account? maybe the events metacontroller? |
|
@TBThomas56 I like that idea. The fact that we create the |
AP-1110
I had to remove the pipe expressions from the JMESPath in the policy - they don't seem to work with the || operator. Possibly a kyverno bug, as they seem to behave as one would expect in the JMESPath tutorial/playground.
If
identity-mapperchanges related to AP-1140 are merged in before this, then that policy will need updating instead in a similar way to howworkflow-label-clusterpolicyis here e.g.