-
Notifications
You must be signed in to change notification settings - Fork 524
Allow k8s workload attestation when container is not ready #3460
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
Conversation
This change introduces a new configurable, `disable_container_selectors` which configures the K8s Workload Attestor to only produce pod-related selectors. This allows for workload attesation to succeed when the attestor can positively locate the workload pod but cannot yet locate the workload container at the time of attestation (e.g. postStart hook is still executing). See issue spiffe#3092 for more details. Fixes: spiffe#3092 Signed-off-by: Andrew Harding <[email protected]>
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.
Looks great!! Just some minor comments about windows implementation
// succeed with just pod related selectors when the workload pod is known | ||
// but the container may not be in a ready state at the time of attestation | ||
// (e.g. when a postStart hook has yet to complete). | ||
DisableContainerSelectors bool `hcl:"disable_container_selectors"` |
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 config will work on windows to get only pod information, but we requires to have containerID in order to get the pod metadata. I'm not sure if we can just allow this in case someone is not interested to have container metadata?
s.requireAttestSuccess(p, testPodSelectors) | ||
} | ||
|
||
func (s *Suite) TestAttestWhenContainerNotReadyButContainerSelectorsDisabled() { |
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 test will not work on windows since we require ContainerID in order to get pod
Signed-off-by: Andrew Harding <[email protected]>
Signed-off-by: Andrew Harding <[email protected]>
Signed-off-by: Andrew Harding <[email protected]>
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.
LGTM!!!
This change introduces a new configurable, `disable_container_selectors` which configures the K8s Workload Attestor to only produce pod-related selectors. This allows for workload attesation to succeed when the attestor can positively locate the workload pod but cannot yet locate the workload container at the time of attestation (e.g. postStart hook is still executing). See issue spiffe#3092 for more details. Fixes: spiffe#3092 Signed-off-by: Andrew Harding <[email protected]>
This change introduces a new configurable,
disable_container_selectors
which configures the K8s Workload Attestor to only produce pod-related selectors. This allows for workload attesation to succeed when the attestor can positively locate the workload pod but cannot yet locate the workload container at the time of attestation (e.g. postStart hook is still executing).See issue #3092 for more details.
Fixes: #3092