Code Monkey home page Code Monkey logo

Comments (6)

gytisgreitai avatar gytisgreitai commented on May 28, 2024 1

Ok, so it seems that namespace is somehow used in the encryption? And I cannot reuse same encrypted file in multiple namespaces?

from sealed-secrets.

bakins avatar bakins commented on May 28, 2024

@gytisgreitai see #61 - PR forthcoming to support this in kubeseal

from sealed-secrets.

anguslees avatar anguslees commented on May 28, 2024

@gytisgreitai this is a feature :)

Imagine you had two users using the same cluster, but who should not be able to read each other's secrets. Without this feature, the SealedSecret from Alice could be uploaded to the cluster by Bob (in Bob's namespace), and the controller would happily decrypt Alice's SealedSecret for Bob.
To prevent this attack, the SealedSecret is created in a way that is cryptographically tied to the namespace+name of the original input Secret. The controller will refuse to decrypt a SealedSecret that has been "moved" to a different namespace+name.

#61 is a way to disable this feature, effectively making the SealedSecret "cluster wide". With #61, You can add the "sealedsecrets.bitnami.com/cluster-wide": "true" annotation to the input Secret, and kubeseal and the controller will disable/ignore the namespace+name check.

@gytisgreitai Does that make more sense? I attempted to explain the above in the README (https://github.com/bitnami/sealed-secrets/blame/master/README.md#L183), but it could certainly be clearer / more prominent. Patches to the docs gratefully accepted.

from sealed-secrets.

gytisgreitai avatar gytisgreitai commented on May 28, 2024

Uh I'm so sorry, I searched for issues, but should have thoroughly read the README.md

Yes, that makes perfect sense, though we're a small shop so does not apply to us :) I'll wait for #61 to be merged and release.

Thank you for great work, kubeseal looks awesome :)

from sealed-secrets.

linuxbsdfreak avatar linuxbsdfreak commented on May 28, 2024

@gytisgreitai this is a feature :)

Imagine you had two users using the same cluster, but who should not be able to read each other's secrets. Without this feature, the SealedSecret from Alice could be uploaded to the cluster by Bob (in Bob's namespace), and the controller would happily decrypt Alice's SealedSecret for Bob.
To prevent this attack, the SealedSecret is created in a way that is cryptographically tied to the namespace+name of the original input Secret. The controller will refuse to decrypt a SealedSecret that has been "moved" to a different namespace+name.

#61 is a way to disable this feature, effectively making the SealedSecret "cluster wide". With #61, You can add the "sealedsecrets.bitnami.com/cluster-wide": "true" annotation to the input Secret, and kubeseal and the controller will disable/ignore the namespace+name check.

@gytisgreitai Does that make more sense? I attempted to explain the above in the README (https://github.com/bitnami/sealed-secrets/blame/master/README.md#L183), but it could certainly be clearer / more prominent. Patches to the docs gratefully accepted.

@anguslees . Could you provide me the sample how to add the annotation?. i am doing this for the adm namespace

 kubectl -n adm create secret docker-registry docker-registry-secret --docker-server=xxxxx --docker-username=xxxx --docker-password=xxxx --docker-email="xxxx" --dry-run -o json > docker-registry-secret-clusterwide.json

Edited the docker-registry-secret-clusterwide.json and added the following

    "metadata": {
        "name": "docker-reg-secret-clusterwide",
        "namespace": "adm",
        "creationTimestamp": null,
        "sealedsecrets.bitnami.com/cluster-wide": "true"
    },

Then ran the following

./kubeseal --format=yaml --cert=pub-cert.pem < docker-reg-secret-clusterwide.json \
> docker-reg-secret-clusterwide.yaml

However i have to re add the "sealedsecrets.bitnami.com/cluster-wide": "true" in the yaml file. Is that correct? I would like to use this secret in other namespaces.

from sealed-secrets.

anguslees avatar anguslees commented on May 28, 2024

@linuxbsdfreak: annotations are nested one level further, like:

"metadata": {
   "name": "docker-reg-secret-clusterwide",
   "namespace": "adm",
   "creationTimestamp": null,
   "annotations": {
      "sealedsecrets.bitnami.com/cluster-wide": "true"
   }
},
...

If it's all working correctly, kubeseal will automatically add the same annotation to the produced SealedSecret (and encrypt slightly differently).

from sealed-secrets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.