Skip to content
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 customers to request CA cert (e.g. for external clients) #410

Open
2 tasks
sbernauer opened this issue May 3, 2024 · 3 comments
Open
2 tasks

Allow customers to request CA cert (e.g. for external clients) #410

sbernauer opened this issue May 3, 2024 · 3 comments
Assignees

Comments

@sbernauer
Copy link
Member

sbernauer commented May 3, 2024

There is a similar Issue for Pods: #320

As a SDP user I need to get the current ca.crt so that I can put it in external clients or e.g. OpenShift routes.

Things to watch out

Preview Give feedback

Workaround

Until this is implemented you can use one of the following workarounds:

  1. Read the ca.crt from the referenced Secret in the SecretClass. Usually it is called secret-provisioner-tls-ca and is located either in the default or stackable-operators namespace.
  2. Use a Pod similar to the following
apiVersion: v1
kind: Pod
metadata:
  name: extract-ca-cert
spec:
  volumes:
    - name: tls
      ephemeral:
        volumeClaimTemplate:
          metadata:
            annotations:
              secrets.stackable.tech/class: tls
              secrets.stackable.tech/scope: pod
          spec:
            storageClassName: secrets.stackable.tech
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: "1"
  containers:
    - name: extract-ca-cert
      image: docker.stackable.tech/stackable/testing-tools:0.2.0-stackable24.3.0
      command: [bash, -c]
      args:
        - |
          cat /tls/ca.crt
          sleep infinity
      volumeMounts:
        - name: tls
          mountPath: /tls
  securityContext:
    fsGroup: 1000
@fhennig
Copy link
Contributor

fhennig commented May 27, 2024

This needs to be documented as well (once implemented)

@nightkr
Copy link
Member

nightkr commented Jan 24, 2025

So we have a few options to go on here...

  1. Have sec-op expose it as a REST API
  2. Have sec-op write it as a ConfigMap
  3. 2 but with a custom CRD instead of a ConfigMap

I'm inclined to say that a CM is the way to go here. It should be easier for outsiders to interact with, and is already supported by things like k8s mounts. It also means we don't have to interact with webhooks or worry about what happens when said webhook goes down.

If we go with the CM approach then we also have to decide who is responsible for deciding where it should go.

  • 2a. Configured in the SecretClass backend
    • Transparently handles k8sSearch as well (just provide the CM yourself!)
    • Users can't assume anything about how to get a particular SecretClass's trust info
    • Simpler lifecycle
  • 2b. New CRD (preliminarily named TruststoreClaim)
    • Automatically replicates to the user's namespace
      • Do we actually care about accessing this from inside k8s? Should users just use regular secret volumes for this?
    • Lets users decide formatting
    • Need to decide how to handle k8sSearch (one option is to let admins provide a fixed configmap to serve)

So far, I'm leaning towards 2b, but that is far from a final call.

@sbernauer
Copy link
Member Author

I just wanted to mention that in the future we also need a mechanism to generate cert-pairs for the users.
E.g. users of mTLS secured Kafka need some way of obtaining a cert issued on "sebastian.bernauer", valid for 1 year. Or something like that. Just to keep in mind when designing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Refinement
Status: Refinement: In Progress
Development

No branches or pull requests

3 participants