stash icon indicating copy to clipboard operation
stash copied to clipboard

Handling storage secret for BackupBlueprint

Open tamalsaha opened this issue 6 years ago • 3 comments

  • [ ] Should operator copy storage secret from its own namespace into the BackupConfiguration namespace? Currently, users have to manually create the storage secret in the BackupConfiguration namespace.

tamalsaha avatar Jul 24 '19 13:07 tamalsaha

Hello,

This is a big deal for my company as I would like to create some kind of cluster-automated backups, leaving developpers with the choice to select a predefined Blueprint for their namespaced projects, without bothering with setting up the S3 configuration which is common to everybody.

So, if operator copy the storage secret from its own NS to the BackupConfiguration namespace, it'll allow automated backups to the same backend - but doesn't prevent namespace admins to read the copied secret (which is unwanted as the backend's credentials will leak all over the place).

The only solution I can think of is by creating some kind of restic proxy/gateway in the operator's NS (or wherever devs don't have access to the secrets), with the proxy/gateway providing the secret and authenticating BackupConfigurations.

It feels like a hack but some S3 gateways already exist. Maybe there's a more K8s native way for preventing secrets leaking which I'm not aware of.

Regards

r-mach avatar Aug 21 '19 13:08 r-mach

Well, copying secrets automatically doesn't impose more security risks than current manual routine. The end result is always Secret in application owner's Namespace. So I would support this approach as first-aid solution that gives more automation with the same risks.

As long-term(-ish) solution I would explore the opposite to @r-mach 's method. Why not start BackupSession in "native" to operator, BackupBlueprint and Secrets' namespace and access targets like mongodb://mongo.my-app-namespace:27017?

There are two pitfalls with this solution:

  1. works only for "smart" backup targets aka databases, not PVCs (or does it?)
  2. would probably have problems in clusters with restrictive NetworkPolicies

zarbis avatar Oct 17 '19 13:10 zarbis

I agree with @r-mach . Maybe we can do something like this #930

hossainemruz avatar Oct 20 '19 19:10 hossainemruz