Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Last active March 1, 2022 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infamousjoeg/a671d13a4c68a234bbdd409c0d30726a to your computer and use it in GitHub Desktop.
Save infamousjoeg/a671d13a4c68a234bbdd409c0d30726a to your computer and use it in GitHub Desktop.
Conjur Authn-K8s - Initial Config Manifest
---
apiVersion: v1
kind: Namespace
metadata:
name: cyberark-conjur
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: authn-k8s-sa
namespace: cyberark-conjur
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: conjur-authenticator
rules:
- apiGroups: [""]
resources: ["pods", "serviceaccounts"]
verbs: ["get", "list"]
- apiGroups: ["extensions"]
resources: [ "deployments", "replicasets"]
verbs: ["get", "list"]
- apiGroups: ["apps"]
resources: [ "deployments", "statefulsets", "replicasets"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["pods/exec"]
verbs: ["create", "get"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: conjur-authenticator
subjects:
- kind: ServiceAccount
name: authn-k8s-sa
namespace: cyberark-conjur
roleRef:
kind: ClusterRole
name: conjur-authenticator
apiGroup: rbac.authorization.k8s.io
@infamousjoeg
Copy link
Author

After applying, the secret variables for authn-k8s need to be populated:

service-account-token: kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep kops-admin | awk '{print $1}')
ca-cert: kubectl config view --raw --minify --flatten --output='jsonpath={.clusters[].cluster.certificate-authority-data}' | base64 -D
api-url: kubectl config view --raw --minify --flatten --output='jsonpath={.clusters[].cluster.server}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment