3. Configuring authentication Flashcards
Cuales son los dos métodos de autenticación en openshift?
OAuth Access Token y X.509 client certificates
Cual usuario y grupo se asigna si el request no tiene OAuth access token?
system:anonymous virtual user
system:unauthenticated virtual group
Cuales son los identity providers?
HTPasswd
Keystone
LDAP
GitHub or GitHub Enterprise
OpenID Connect
Como se puede autenticar como “cluster administrator” en openshift?
kubeadmin user/pass virtual user oauth
kubeconfig archivo que embebe X.509 certificado de cliente
Cuando se crea el archivo kubeconfig?
Al momento de la instalación del cluster
Como se usa el archivo kubeconfig para obtener acceso?
export KUBECONFIG=root/auth/kubeconfig
o
oc –config /home/user/auth/kubeconfig get nodes
Como se puede obtener la ruta donde esta el archivo kubecofig?
Los logs de instalación proveen la ruta del archivo kubeconfig
Como se elimina las credenciales del usuario kubeadmin
oc delete secret kubeadmin -n kube-system
Que rol debe tener el usuario nuevo de administración antes de poder eliminar las credenciales de kubeadmin?
cluster-admin
.spec.identityProviders
apiVersion: config.openshift.io/v1
kind: OAuth
metadata:
name: cluster
spec:
identityProviders:
- name: my_htpasswd_provider
mappingMethod: claim
type: HTPasswd
htpasswd:
fileData:
name: htpasswd-secret
Como se actualiza el identity provider oauth
oc get oath cluster -o yaml > oauth.yaml
modify
oc replace -f oauth.yaml
Cual es el paquete del binario htpasswd
httpd-utils
Como se crea un archivo con htpasswd
htpasswd -c -B -b /tmp/htpasswd student redhat123
Como se agrega un usuario y password a un archivo htpasswd
htpasswd -b /tmp/htpasswd student redhat1234
Como se agrega a un archivo htpasswd
htpasswd -b /tmp/htpasswd student redhat1234
Como se eliminan las credenciales de un archivo htpasswd
htpasswd -D /tmp/htpasswd student
Como se crea un secreto a partir de un archivo
oc create secret generic htpasswd-secret \
> –from-file htpasswd=/tmp/htpasswd -n openshift-config
Como se puede extraer un secreto
oc extract secret/htpasswd-secret -n openshift-config \ > –to /tmp/ –confirm
/tmp/htpasswd
Como se puede actualizar un secreto?
oc set data secret/htpasswd-secret \
> –from-file htpasswd=/tmp/htpasswd -n openshift-config
Que operador se redespliega cuando se cambia un secreto
watch oc get pods -n openshift-authentication
Como se elimina el usuario manager del archivo /tmp/htpasswd
htpasswd -D /tmp/htpasswd manager
oc set data secret/htpasswd-secret \
> –from-file htpasswd=/tmp/htpasswd -n openshift-config
oc delete user manager
oc get identities | grep manager
oc delete identity my_htpasswd_provider:manager
Como asignar permisos de cluster_admin a usuario student
oc adm policy add-cluster-role-to-user cluster-admin student