-
Notifications
You must be signed in to change notification settings - Fork 404
Use of "iam.amazonaws.com/permitted" annotation causes conflicts with existing KIAM setups #174
Comments
iam.amazonaws.com/permitted
annotation causes conflicts with existing KIAM setups
Thanks @mmcaya for taking the time to do such a good write-up <3 In regard to issue 2: As far as i understand (correct me if i'm wrong), Kiam is designed to "just" intercept the metadata API. If a pod has already assumed a role, Kiam can do nothing if the pod tries to "escalate" privileges (i.e. assume other roles). I personally 100% support documenting this issue and making the I need to take some more time to dig into issue 1 you mentioned. Just for clarity so no one wastes effort: is someone already working on these issues? |
👍 Sorry for the delayed response, thanks for the fixes! |
I'm submitting a...
related to
roleArn
functionality described in issue Support to have IAM user Assume a Role when retrieving secret data #143and implemented in PR feat: add option to assume role #144
Use of KIAM
iam.amazonaws.com/permitted
annotation forroleArn
validation causes conflicts with existing KIAM setups.iam.amazonaws.com/permitted
is a KIAM created and managed annotation, and not part of any known standard.(e.g. kube2iam uses a different annotation:
iam.amazonaws.com/allowed-roles
)Issue 1:
What is the current behavior?
Kubernetes external secrets errors out when
iam.amazonaws.com/permitted
is present, has valid values intended forkiam
, but is not provided aroleArn
in theExternalSecret
descriptor.This is a common use case when
kiam
is handling the IAM for thekubernetes-external-secret
operator, and no additional role assumption is required by the individualExternalSecret
resourcesTo reproduce:
Namespace annotated for
kiam
support only:What's the expected behavior?
Secret sync should be allowed when namespace annotation is present, and no
roleArn
is provided.Issue 2
What is the current behavior?
kiam
orkubernetes-external-secrets
will now incorrectly permit (i.e. pass the regex and proceed to attempt an sts call) assumption of roles in a namespace not intended to be used bykiam
orkubernetes-external-secrets
. The sharing of an annotation allows for nondeterministic behavior from each operator when used at the same time.Scenario (AWS ARNs truncated for brevity):
kubernetes external secret
controller useskiam
to assume roles for processing, with that role (and all other allowedkiam
roles) covered by theiam.amazonaws.com/permitted: kiam-roles.*
annotation on the namespacekubernetes external secrets
ExternalSecret
has a desiredroleArn
valuemy-team-external-secret-role.*
kiam
policies are attached tokiam-server
pods, and have no knowledge ofExternalSecret
levelkubernetes-external-secret
role / policeskubernetes-external-secret
policies are assumed at runtime from thekubernetes-external-secret
controller AFTER it assumes a role viakiam
, and have no knowledge of all the otherkiam
level role / policesIn order to support this, one of the following must now happen:
(kiam|my-team-external-secret-role).*
kiam
ORkubernetes-external-secrets
is "permitting" roles they can not actually assumenamespace-iam-roles.*
kiam
ORkubernetes-external-secrets
is still "permitting" roles they can not actually assumeWhat's the expected behavior?
One of the following should be done to
kubernetes-external-secrets
prevent conflictsBackwards Compatible Break - change the support annotation for
kubernetes-external-secrets
to be something under the existing CRD naming ofexternalsecrets.kubernetes-client.io
,Allow the annotation to be configurable so that both
kiam
andkubernetes-external-secrets
can run without conflictExplicitly document this issue in the
README.md
The text was updated successfully, but these errors were encountered: