Cloud Security

Cloud Native Security

Overview
Cloud Data Center
Cluster (Kubernetes)
Container
Code

Cluster Security: Kubernetes

Authentication
Authentication hands-on
Confirms that Rancher setup is up and ready
1
kubectl get nodes
Extract configuration information
1
cat ~/.kube/config
Create a new user account
1
2
sudo useradd -s /bin/bash -d /home/student -m -G docker student
sudo su - student
1
2
kubectl get nodes
kubectl get svc
Setup authorization to access K8S
1
mkdir .kube
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: COPY_FROM_ABOVE
    server: COPY_FROM_ABOVE
name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: student
  name: student@kubernetes
current-context: student@kubernetes
kind: Config
preferences: {}
users:
- name: student
user:
    client-certificate-data: COPY_FROM_ABOVE
    client-key-data: COPY_FROM_ABOVE
1
2
kubectl get nodes
kubectl get svc
Challenge

Adding at least another Kubernetes cluster from one of your classmates’ experiment to your student account. In other words, one account can have access to multiple K8S cluster.

RBAC Authorization
1
kubectl describe pods kube-apiserver -n kube-system | grep authorization
1
2
kubectl get role --all-namespaces
kubectl describe role system::leader-locking-kube-controller-manager -n kube-system
1
2
kubectl get clusterrole --all-namespaces
kubectl describe clusterrole cluster-admin
1
2
kubectl get RoleBinding --all-namespaces
kubectl get ClusterRoleBinding
1
kubectl api-resources --sort-by name -o wide
Kubernetes Ingress

Container Security

Pod Security Standards
Privileged
Baseline
Restricted