-
Notifications
You must be signed in to change notification settings - Fork 101
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
Allow connection secrets to be backed up and restored #140
Comments
One tricky issue here is that we have a one-to-many from-secret-to-secret relationship. i.e. One source secret can be propagated to many destination secrets. We configure this using annotations. On the "from" secret: metadata:
annotations:
to.propagation.crossplane.io/some-uid: namespace/name
to.propagation.crossplane.io/some-other-uid: namespace/another-name On the "to" secret: metadata:
annotations:
from.propagation.crossplane.io/namespace: somenamespace
from.propagation.crossplane.io/name: somename
from.propagation.crossplane.io/uid: some-uid Updating the latter is trivial; we can just remove Some ideas I'm considering are... Just use the namespace and name as the key: metadata:
annotations:
to.propagation.crossplane.io/namespace-name: "true"
to.propagation.crossplane.io/namespace-different-name: "true" Hash the namespace and name as a key: metadata:
annotations:
to.propagation.crossplane.io/A83D2: namespace/name
to.propagation.crossplane.io/E2E48: "true" |
Another option would be to encode the set of "to" secrets in a single annotation: metadata:
annotations:
to.propagation.crossplane.io: namespace/name,othernamespace/anothername This has a few implications; primarily that updating the set of secrets becomes a little trickier to handle. Some other things to consider:
|
I also considered introducing a new custom resource, something like: apiVersion: propagation.crossplane.io/v1alpha1
kind: ConnectionSecretPropagation
metadata:
namespace: crossplane-system
name: some-managed-secret
spec:
secretRef:
name: some-managed-secret
propagateTo:
- secretRef:
namespace: default
name: some-claim-secret
- secretRef:
namespace: default
name: some-target-secret There are some nice properties of this approach; we could avoid having our claim and target controllers write connection secrets, and instead just create a
|
What problem are you facing?
When a connection secret is backed up and subsequently restored using a tool like https://velero.io it will no longer be constantly propagated by the secret reconciler. This is because the propagating and propagated connection secrets rely on UID based annotations to configure and consent to propagation, and a secret's UID changes when it is backed up and restored.
How could Crossplane help solve your problem?
Crossplane could remove the use of UIDs in the propagation annotations. Resources are uniquely identified at a particular point in time by their group, kind, namespace, and name. UIDs allow a resource to be uniquely identified over time. We included the UID in the propagation annotations to cover the case in which:
from
consents to propagate to Secretto
.to
is deleted.to
.1 Propagation continues, propagating
from
toto
, which is now owned by the malicious party.In retrospect this concern doesn't really fit with how RBAC works in Kubernetes; if the malicious party had access to create and read Secret
to
at step 3, they probably had access to read the previous iteration of Secretto
at step 1. Including the UID in the propagation configuration thus only really protects against the case in which:from
to Secretto
.to
is deleted, butfrom
is still configured to propagate.from
to createto
from
by creatingto
and relying on propagationI don't think we need to be too concerned about this case.
The text was updated successfully, but these errors were encountered: