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

chore(docs): add guide for service accounts #2761

Merged
merged 2 commits into from
Aug 8, 2017

Conversation

michelleN
Copy link
Member

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 3, 2017
@jascott1 jascott1 added the docs label Aug 3, 2017
Copy link
Contributor

@jascott1 jascott1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and much needed!

@michelleN michelleN force-pushed the service-account-docs branch 2 times, most recently from 0c8f151 to e91657b Compare August 7, 2017 20:16
@michelleN
Copy link
Member Author

Thanks @jascott1!
I updated this with a non cluster-admin example as well. Would you mind taking a peek when you have a chance?

Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good and helpful. I left one small nit comment that doesn't need to be fixed if you don't want to.

@@ -0,0 +1,112 @@
# Tiller and Service Accounts

In Kubernetes, granting a role to an application-specific service account is a best practice to ensure that your application is operating in the scope that you have specified. Read more about service account permissions in Kubernetes [in the official docs](https://kubernetes.io/docs/admin/authorization/rbac/#service-account-permissions). Bitnami also has a fantastic guide for [configuring RBAC in your cluster](https://docs.bitnami.com/kubernetes/how-to/configure-rbac-in-your-kubernetes-cluster/) that takes you through RBAC basics.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Change "Read more about service account permissions in Kubernetes [in the official docs]" to "Read more about service account permissions [in the official Kubernetes docs]". Reads a little cleaner.

@michelleN michelleN merged commit 3f33651 into helm:master Aug 8, 2017
@michelleN michelleN deleted the service-account-docs branch August 8, 2017 16:46
name: tiller-binding
namespace: tiller-world
subjects:
- kind: ServiceAccount
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One problem with this approach: Those with the ability to create pods in namespace "tiller-world" can use the "tiller" service account, attaining all the privileges meant for Tiller. That may be too generous when the normal permissions afforded to users are a subset of those you'd like to grant to Tiller.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another concern came to mind, after writing earlier: This arrangement is vulnerable to privilege escalation attack from people with limited access to this "tiller-world" namespace.

Say that someone has the following privileges in this namespace, and only these privileges:

apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
 name: discover-tiller
rules:
- apiGroups:
  - ""
  resources:
  - pods
  verbs:
  - list
- apiGroups:
  - ""
  resources:
  - pods/portforward
  verbs:
  - create
# Possibly even more restrictive:
# resourceNames:
# - <name of Tiller pod>

With those privileges, this person can run helm --tiller-namespace=tiller-world delete ..., or helm --tiller-namespace=tiller-world install ..., running any pods and reading any Secrets he likes within this namespace to which he wasn't supposed have any such privileges.

name: tiller-manager
rules:
- apiGroups: ["", "extensions", "apps"]
resources: ["deployments", "replicasets", "pods", "configmaps", "secrets", "namespaces"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is strange to address the "namespaces" resource in a Role, as opposed to in a ClusterRole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm 2.2.3 not working properly with kubeadm 1.6.1 default RBAC rules
5 participants