23
www.eu-eela.org E-infrastructure shared between Europe and Latin America FP6−2004−Infrastructures−6-SSA-026409 Prácticas Autorización y Autenticación Juan Eduardo Murrieta León DGSCA - UNAM Tutorial para Usuarios Ciudad de México, 23.10.2007

Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

Embed Size (px)

Citation preview

Page 1: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

www.eu-eela.org

E-infrastructure shared between Europe and Latin America

FP6−2004−Infrastructures−6-SSA-026409

Prácticas Autorización yAutenticaciónJuan Eduardo Murrieta LeónDGSCA - UNAMTutorial para UsuariosCiudad de México, 23.10.2007

Page 2: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

2

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

Temario

• Acensando la UI

• Llaves pública y privada

• VOMS– voms-proxy-init– voms-proxy-info– voms-proxy-destroy

• MyProxy– myproxy-init– myproxy-info– myproxy-get-delegation– myproxy-destroy

Page 3: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

3

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

• Conectarse a la UI vía Secure Shell– Ejecutar el programa Secure Shell Client

• Hostname: gilda02.super.unam.mx

• Username: mexicocityXX Donde XX está en [01..40]

• Password: GridMEXXX Donde XX está en [01..40]

• Clave del Certificado: MEXICOCITY

Cómo acceder a la Interfaz de Usuario

Page 4: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

4

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

Preliminares: directorio .globus

• El directorio.globus contiene su certificado personal y su llave privada

• Ponga atención a los permisos – userkey.pem contiene su llave privada, y debe se legible sólo

por usted (permisos 400)– usercert.pem es su certificado y contiene su llave pública, la

cual debe ser legible por otros (permisos 644)

•[mexicocity01]$ ls -la .globus/u*

•-rw-r--r-- 1 mexicocity01 gilda 1131 Oct 1 03:27 .globus/usercert.pem

•-r-------- 1 mexicocity01 gilda 963 Oct 1 03:27 .globus/userkey.pem

Page 5: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

5

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

voms-proxy-init: crear credenciales

• Principales opciones voms-proxy-init --voms <vo-name:[command]> -help, -usage Despliega la ayuda -version Despliega la versión -debug Habilita salida de depuración adicional -quiet, -q Modo silencioso, salida mínima -verify Verifica el certificado para hacer el proxy -pwstdin Permite que la palabra clave sea leída de stdin -limited Crea un proxy limitado -valid <h:m> El Proxy es válido para h horas y m minutos (por omisión 12:00) -hours H El Proxy es válido por H horas (por omisión:12) -bits Número debits en la llave {512|1024|2048|4096} -cert <certfile> Ubicación no estándar del certificado de usuario -key <keyfile> Ubicación no estándar de la llave del usuario -certdir <certdir> Ubicación no estándar del directorio de certificados de confianza -out <proxyfile> Ubicación no estándar del nuevo certificado proxy -voms <voms<:command>> Especifica el servidor voms : “command” es opcional. -order <group<:role>> Especifica el orden de los atributos. -vomslife <h:m> Intenta obtener un pseudo-certificado VOMS válido por h horas y

m minutos (por omisión el valor de -valid). -include <file> Incluye el contenido de los archivos especificados -confile <file> Ubicación no estándar de la dirección del servidor de voms. -vomses <file> Ubicación no estándar de los archivos de configuración.

Page 6: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

6

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

voms-proxy-init: salida

[mexicocity01]$ voms-proxy-init --voms gilda

Cannot find file or dir: /home/mexicocity01/.glite/vomses

Your identity: /C=IT/O=GILDA/OU=Personal Certificate/L=MEXICOCITY/CN=MEXICOCITY01/[email protected]

Enter GRID pass phrase: ************

Creating temporary proxy ............................... Done

Contacting voms.ct.infn.it:15001 [/C=IT/O=INFN/OU=Host/L=Catania/CN=voms.ct.infn.it] "gilda" Done

Creating proxy ................................. Done

Your proxy is valid until Tue Oct 18 23:06:20 2007

ANTIGUA

Page 7: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

7

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

voms-proxy-info: verifica credenciales

• voms-proxy-info– Principales opciones :

-all imprime todas las opciones del proxy

-file especifica una ubicación diferente del proxy

Page 8: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

8

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

[antigua01]$ voms-proxy-info --all

subject : /C=IT/O=GILDA/OU=Personal Certificate/L=MEXICOCITY/CN=MEXICOCITY01/[email protected]/CN=proxy

issuer : /C=IT/O=GILDA/OU=Personal Certificate/L=ANTIGUA/CN=MEXICOCITY01/[email protected]

identity : /C=IT/O=GILDA/OU=Personal Certificate/L=ANTIGUA/CN=MEXICOCITY1/[email protected]

type : proxy

strength : 512 bits

path : /tmp/x509up_u501

timeleft : 11:57:40

=== VO gilda extension information ===

VO : gilda

subject : /C=IT/O=GILDA/OU=Personal Certificate/L=MEXICOCITY/CN=MEXICOCITY01/[email protected]

issuer : /C=IT/O=INFN/OU=Host/L=Catania/CN=voms.ct.infn.it

attribute : /gilda/Role=NULL/Capability=NULL

timeleft : 11:57:33

voms-proxy-info salida

Atributos estándar de globus

extensionesVoms

Page 9: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

9

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

voms-proxy-destroy: destruye credenciales

• voms-proxy-destroy– No tiene opciones– Termina sesión en la grid

• Destruye el certificado proxy señalado por la variable de ambiente $X509_USER_PROXY

Page 10: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

10

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

[mexicocity01]$ echo $X509_USER_PROXY

/tmp/x509up_u501

[mexicocity01]$ voms-proxy-destroy

[mexicocity01]$

[mexicocity01]$ voms-proxy-info --all

Couldn't find a valid proxy.

[mexicocity01]$

voms-proxy-destroy: salida

Page 11: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

11

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

Primer Ejercicio

1. Cree un certificado proxy plano sin solicitar membresía (VO)

2. Verifique su proxy, compruebe que éste no tiene extensiones VOMS

3. Destruya el proxy creado

4. Verifique su proxy de nuevo

5. Repita los pasos 1-4 de nuevo, esta vez solicitando la membresía al grupo gilda

Page 12: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

12

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

Proxy de larga duración : MyProxy

• Servidor myproxy:– myproxy-init

Permite crear y almacenar un certificado proxy de larga duración

– myproxy-info Obtiene información acerca de un certificado de larga duración

almacenado y vigente

– myproxy-get-delegation Obtiene un nuevo certificado proxy del servidor MyProxy

– myproxy-destroy

• Verifíquelos con la opción myproxy-xxx --help• Un servicio dedicado en el RB puede renovar

automáticamente el proxy– Contactando al servidor myproxy

Page 13: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

13

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

myproxy-init: almacena cred. proxy

• Principales opciones • -c hours especifica el tiempo de vida de las

credenciales almacenadas• -t hours especifica el tiempo de vida máximo de las

credenciales recibidas• -s <hostname> especifica el servidor myproxy usado

para almacenar las credenciales• -d almacena una credencial con el DN en el proxy, en

lugar del nombre del usuario (obligatorio para algunos servicios de administración de datos y renovación de certificados)

• Para renovación de certificados es también obligatorio –n (sin palabra clave). También tiene que especificar el subject de los principales que pueden renovar una delegación (-R sujeto, o -A para cualquier principal)

Page 14: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

14

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

myproxy-init: salida

[antigua01]$ myproxy-init Your identity: /C=IT/O=GILDA/OU=Personal

Certificate/L=MEXICOCITY/CN=MEXICOCITY01/[email protected] GRID pass phrase for this identity: ***********Creating proxy ................................. DoneProxy Verify OKYour proxy is valid until: Tue Mar 13 14:00:18 2007Enter MyProxy pass phrase: ***********Verifying password - Enter MyProxy pass phrase:A proxy valid for 168 hours (7.0 days) for user antigua01 now exists on

grid001.ct.infn.it.[mexicocity01]$

ANTIGUA

CLAVE DE MYPROXY

Page 15: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

15

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

myproxy-info: recibe la información del

proxy almacenado • Útil para recibir información sobre las credenciales

almacenadas• Necesita que existan credenciales locales para ejecutarse

– El usuario necesita tener un proxy válido para ejecutar este comando.

• Si las credenciales han sido inicializadas con la opción –d, se puede usar también esta opción

Page 16: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

16

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

myproxy-info salida

[mexicocity01]$ myproxy-info -v

Socket bound to port 20000.

server name: /C=IT/O=INFN/OU=Host/L=Catania/CN=grid001.ct.infn.it

checking if server name matches "[email protected]"

server name does not match

checking if server name matches "[email protected]"

server name accepted

username: mexicocity01

owner: /C=IT/O=GILDA/OU=Personal Certificate/L=MEXICOCITY/CN=MEXICOCITY01/[email protected]

timeleft: 167:54:03 (7.0 days)

Page 17: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

17

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

myproxy-get-delegation: obtiene el proxy

• Este comando se utiliza para recibir la delegación de un certificado proxy de larga duración almacenado en un servidor myproxy

• Es independiente de la máquina, no es necesario tener el certificado cargado

• Si las credenciales fueron inicializadas con la opción –d, también se tiene que especificar en la petición del myproxy-get-delegation

Page 18: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

18

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

myproxy-get-delegation: salida

[mexicocity01]$ myproxy-get-delegation

Enter MyProxy pass phrase:

A proxy has been received for user antigua01 in /tmp/x509up_u501

Page 19: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

19

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

myproxy-destroy: destruyendo el proxy

• Borra, si existe, las credenciales de larga duración del servidor myproxy especificado

• Para especificar el servidor myproxy se debe usar la opción -s

• De nuevo, el usuario debe tener una certificado proxy válido

Page 20: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

20

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

myproxy-destroy: salida

[mexicocity01]$ myproxy-destroy -vSocket bound to port 20000.

server name: /C=IT/O=INFN/OU=Host/L=Catania/CN=grid001.ct.infn.itchecking if server name matches "[email protected]"server name does not matchchecking if server name matches "[email protected]"server name acceptedDefault MyProxy credential for user mexicocity01 was successfully removed.

Page 21: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

21

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

Segundo Ejercicio

1. Cree un myproxy en el servidor grid001.ct.infn.it

2. Obtenga una delegación del servidor myproxy

3. Verifique la información del proxy creado en el servidor myproxy

4. Destruya tanto el proxy local como el proxy almacenado en el servidor myproxy

5. Repita los pasos 1-4 usando la opción –d

6. ¿Qué diferencias encuentra entre los dos proxys?

Page 22: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

22

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

Extensiones Voms en un proxy delegado

• myproxy no soporta nativamente a VOMS

• Para solventar este problema:– Obtenga el proxy delegado– Ejecute el comando voms-proxy-init, con la opción –noregen

Page 23: Www.eu-eela.org E-infrastructure shared between Europe and Latin America FP62004Infrastructures6-SSA-026409 Prácticas Autorización y Autenticación Juan

24

E-infrastructure shared between Europe and Latin America

Ciudad de México, Tutorial para Usuarios, 23.10.2007FP6−2004−Infrastructures−6-SSA-026409

Preguntas