61
1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

Embed Size (px)

Citation preview

Page 1: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

1

Grid Security: PKI Based Authentication Infrastructure

M.EffatparvarFall 1391

Page 2: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

2

Security

As Grid Resources and Users are Distributed and Owned by different organizations, only authorized users should be allowed to access them.

A simple authentication infrastructure is needed. Also, both users and owners should be protected

from each other. The Users need be assured about security of their:

Data Code Message

Page 3: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

3

Cryptography Overview

Keys, Encryption and Decryption Symmetric and Asymmetric Public and Private keys

Digital Signatures Secure hashes

Page 4: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

4

Keys

A key can be thought of as simply a collection of bits

The more bits, the stronger the key

Keys are tied to specific encryption algorithms

Lengths vary depending on the encryption algorithm

e.g. 128 bits is long for some algorithms, but short for others

0 1 0 1 0 0 1 1 1 0

1 0 1 1 1 1 0 1 1 1

Page 5: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

5

Encryption

Encryption is the process of taking some data and a key and feeding it into a function and getting encrypted data out

Encrypted data is, in principal, unreadable unless decrypted

EncryptionFunction

Page 6: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

6

Decryption

Decryption is the process of taking encrypted data and a key and feeding it into a function and getting out the original data

Encryption and decryption functions are linked

DecryptionFunction

Page 7: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

7

Symmetric Encryption

Encryption and decryption functions that use the same key are called symmetric

In this case everyone wanting to read encrypted data must share the same key

DES is an example of symmetric encryption

Encrypt

Decrypt

Page 8: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

8

Asymmetric Encryption

Encryption and decryption functions that use a key pair are called asymmetric

Keys are mathematically linked

RSA is an example of asymmetric encryption

Page 9: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

9

Asymmetric Encryption

When data is encrypted with one key, the other key must be used to decrypt the data

And vice versa

Encrypt

Decrypt

Decrypt

Encrypt

Page 10: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

10

Public and Private Keys

With asymmetric encryption each user can be assigned a key pair: a private and public key

Private key is known only to owner

Public key is given away to the world

Page 11: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

11

Public and Private keys

Anything encrypted with the private key can only be decrypted with the public key

And vice versa Since the private

key is known only to the owner, this is very powerful…

Encrypt

Decrypt

Page 12: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

12

Digital Signatures

Digital signatures allow the world to verify I created a hunk of data

e.g. email, code

Page 13: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

13

Digital Signatures

Digital signatures are created by encrypting a hash of the data with my private key

The resulting encrypted data is the signature

This hash can then only be decrypted by my public key

Hash

Encrypt

Page 14: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

14

Digital Signature

Given some data with my signature, if you decrypt a signature with my public key and get the hash of the data, you know it was encrypted with my private key

Hash

=?Decrypt

Page 15: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

15

Digital Signature

Since I’m the only one with access to my private key, you know I signed the hash and the data associated with it

But, how do you know that you have my correct public key?

Answer: A Public Key Infrastructure…

?

Page 16: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

16

Public Key Infrastructure (PKI) PKI allows you to know

that a given public key belongs to a given user

PKI builds on asymmetric encryption:

Each entity has two keys: public and private

Data encrypted with one key can only be decrypted with other.

The private key is known only to the entity

The public key is given to the world encapsulated in a X.509 certificate

Owner

Page 17: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

17

Public Key Infrastructure (PKI) Overview

X.509 Certificates Certificate Authorities (CAs) Certificate Policies (CPs)

Namespaces Requesting a certificate

Certificate Request Registration Authority

Owner

Page 18: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

18

Certificates

A X.509 certificate binds a public key to a name

It includes a name and a public key (among other things) bundled together and signed by a trusted party (Issuer)

NameIssuerPublic KeySignature

Page 19: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

19

John Smith2/25, Brunton RdVictoria

BD 01-06-1970Male 165cms, 65KgB&W Eyes

State ofVictoria

Seal

Certificates

Similar to passport or driver’s license

NameIssuerPublic KeySignature

Page 20: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

20

Certificates

By checking the signature, one can determine that a public key belongs to a given user.

NameIssuerPublic KeySignature

Hash

=?Decrypt

Public Key fromIssuerIss

uer

Page 21: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

21

Certificates

Question: Who signs certificates?

Answer: A small set of trusted entities known as Certificate Authorities (CAs)

Issuer?

NamePublic Key

Page 22: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

22

Certificate Authorities (CAs)

A small set of trusted entities known as Certificate Authorities (CAs) are established to sign certificates

A Certificate Authority is an entity that exists only to sign user certificates

The CA signs it’s own certificate which is distributed in a trusted manner

Name: CAIssuer: CACA’s Public KeyCA’s Signature

Page 23: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

23

Certificate Authorities (CAs)

The public key from the CA certificate can then be used to verify other certificates

NameIssuerPublic KeySignature

Hash

=?Decrypt

Name: CAIssuer: CACA’s Public KeyCA’s Signature

Page 24: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

24

Certificate Policy (CP)

Each CA has a Certificate Policy (CP) which states when and how a CA issues certificates.

It states who it will issue certificates for Just like the State of Victoria only issues driver’s

licenses’ for residents of the state of Victoria

A CA for a grid typically only issues certificates for folks that are already approved to use resources on the grid

Page 25: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

25

Certificate Policy (CP)

A CA’s CP states how it identifies the people it issues certificates to Similar to having to show a birth

certificate to get a driver’s license Some CA’s are very stringent and require

similar proof of identity Others are lenient and only require proof

via email

Page 26: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

26

Namespaces

Each CA’s Certificate Policy also states the namespace of certificates issued by the CA

A namespace is a hierarchy similar to the hierarchy used for Internet hostnames

Grid

Globus

mcs.anl.gov

Von Welch

NASA LBNL

Root

Top-levelorganizations

OrganizationalUnits Entity

uiuc.edu

Page 27: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

27

Namespaces

Each CA constrains itself to signing certificates that are in a namespace that are a portion of the overall space

E.g. the Globus CA signs certificates only under the Globus organization

Grid

Globus

mcs.anl.gov

Von Welch

NASA LBNL

uiuc.edu

Page 28: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

28

Requesting a Certificate

To request a certificate a user starts by generating a key pair

Page 29: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

29

Certificate Request

The user then signs their own public key to form what is called a Certificate Request

Sign

CertificateRequest

Public Key

Page 30: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

30

Certificate Issuance

The user then takes the certificate to the CA

The CA usually includes a Registration Authority (RA) which verifies the request:

The name is unique with respect to the CA

It is the real name of the user

Etc.

CertificateRequest

Public KeyID

Page 31: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

31

Certificate Issuance

The CA then signs the certificate request and issues a certificate for the user

CertificateRequest

Public Key

NameIssuerPublic KeySignature

Sign

Page 32: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

32

Secure Socket Layer (SSL)

Also known as TLS (Transport Layer Security) Uses certificates and TCP sockets to provide

a secured connection Authentication of one or both parties using the

certificates Message protection

Confidentiality (encryption) Integrity

Certificates TCP Sockets

SSL/TLS

Page 33: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

33

SSL Authentication

Start by exchanging X.509 certificates

Each side then sends over a challenges

Challenge is signed with private key and sent back over

Sign

Page 34: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

34

SSL Authentication

Each side then verifies certificate using PKI and signature using certificate

If everything checks then the identity from the certificate can be trusted

CA

Check Certificate

Check Signature

Page 35: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

35

SSL Message Protection

After authentication a shared session key is established to be used for message protection

Confidentiality == Encryption of messages to prevent eavesdropping

Integrity == Signing of messages to prevent modification

Encrypt Sign

Message

Page 36: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

36

Mutual Authentication

A and B are two parties: Both need to trust each others’ CA.

A B (A establishes connection to B and gives his certificate (name,pub. Key) to B).

B makes sure that it can trust CA of A. B generates random message A and asks it

encrypt it. A encrypts it and send to B B decrypts using A’s public key. If the msg. is

same as what B has sent, then A is who it is claiming to be.

Page 37: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

37

Globus/Grid Security Infrastructure (GSI) based on PKI

GSI is:

PKI(CAs and

Certificates)

SSL/TLS

Proxies and Delegation

PKI forcredentials

SSL forAuthenticationAnd message protection

Proxies and delegation (GSIExtensions) for secure singleSign-on

PKI: Public Key Infrastructure, SSH: Secure Socket LayerTLS: Transport Level Security

Page 38: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

38

Globus Security: Review

GSI extends existing standard protocols & APIs

Based on standards: SSL/TLS, X.509, GSS-API Extensions for single sign-on and delegation

The Globus Toolkit provides: Generic Security Services API (GSS-API) on GSI

protocols The GSS-API is the IETF standard for adding

authentication, delegation, message integrity, and message confidentiality to applications.

Various tools for credential management, login/logout, etc.

Page 39: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

39

Obtaining a Certificate

The program grid-cert-request is used to create a public/private key pair and unsigned certificate in ~/.globus/:

usercert_request.pem: Unsigned certificate file userkey.pem: Encrypted private key file

Must be readable only by the owner

Mail usercert_request.pem to [email protected] Receive a Globus-signed certificate

Place in ~/.globus/usercert.pem Other organizations use different approaches

NCSA, NPACI, NASA, etc. have their own CA

Page 40: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

40

Your New CertificateCertificate: Data: Version: 3 (0x2) Serial Number: 28 (0x1c) Signature Algorithm: md5WithRSAEncryption Issuer: C=US, O=Globus, CN=Globus Certification Authority Validity Not Before: Apr 22 19:21:50 2003 GMT Not After : Apr 22 19:21:50 2004 GMT Subject: /O=Grid/O=Globus/OU=cs.mu.oz.au/CN= John Smith Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:bf:4c:9b:ae:51:e5:ad:ac:54:4f:12:52:3a:69: <snip> b4:e1:54:e7:87:57:b7:d0:61 Exponent: 65537 (0x10001)Signature Algorithm: md5WithRSAEncryption 59:86:6e:df:dd:94:5d:26:f5:23:c1:89:83:8e:3c:97:fc:d8: <snip> 8d:cd:7c:7e:49:68:15:7e:5f:24:23:54:ca:a2:27:f1:35:17:

Validity Start

Page 41: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

41

-----BEGIN CERTIFICATE-----MIICAzCCAWygAwIBAgIBCDANBgkqhkiG9w0BAQQFADBHMQswCQY

<snip>u5tX5R1m7LrBeI3dFMviJudlihloXfJ2BduIg7XOKk5g3JmgauK4-----END CERTIFICATE-----

Sample usercert.pem:

-----BEGIN RSA PRIVATE KEY-----Proc-Type: 4,ENCRYPTEDDEK-Info: DES-EDE3-CBC,1E924694DBA7D9D1+W4FEPdn/oYntAJPw2tfmrGZ82FH611o1gtvjSKH79wdFxzKhnz474Ijo5Bl

<snip>et5QnJ6hAO4Bhya1XkWyKHTPs/2tIflKn0BNIIIYM+s=-----END RSA PRIVATE KEY-----

Sample userkey.pem:

Certificate and Key Data

Page 42: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

42

Certificate Information

To get cert information run grid-cert-info% grid-cert-info -subject/O=Grid/O=Globus/OU=cs.mu.oz.au/CN=John Smith

Options for printing cert information-all -startdate-subject -enddate-issuer -help

Page 43: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

43

“Logging on” to the Grid

To run programs, authenticate to Globus:% grid-proxy-initEnter PEM pass phrase: ******

Creates a temporary, local, short-lived proxy credential for use by our computations

Options for grid-proxy-init:-hours <lifetime of credential>-bits <length of key>-help

Page 44: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

44

grid-proxy-init Details

grid-proxy-init creates the local proxy file. User enters pass phrase, which is used to

decrypt private key. Private key is used to sign a proxy certificate

with its own, new public/private key pair. User’s private key not exposed after proxy has

been signed Proxy placed in /tmp, read-only by user NOTE: No network traffic! grid-proxy-info displays proxy details

Page 45: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

45

Grid Sign-On With grid-proxy-init

User certificate file

Private Key(Encrypted)

PassPhrase

User Proxycertificate file

Page 46: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

46

Destroying Your Proxy (logout)

To destroy your local proxy that was created by grid-proxy-init:% grid-proxy-destroy

This does NOT destroy any proxies that were delegated from this proxy. You cannot revoke a remote proxy Usually create proxies with short lifetimes

Page 47: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

47

Proxy Information

To get proxy information run grid-proxy-info% grid-proxy-info -subject/O=Grid/O=Globus/OU=cs.mu.oz.au/CN=John Smith

Options for printing proxy information-subject -issuer-type -timeleft-strength -help

Options for scripting proxy queries-exists -hours <lifetime of credential>-exists -bits <length of key>

Returns 0 status for true, 1 for false:

Page 48: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

48

Important Files

/etc/grid-security hostcert.pem: certificate used by the server in

mutual authentication hostkey.pem: private key corresponding to the

server’s certificate (read-only by root) grid-mapfile: maps grid subject names to local user

accounts (really part of gatekeeper) /etc/grid-security/certificates

CA certificates: certs that are trusted when validating certs, and thus needn’t be verified

ca-signing-policy.conf: defines the subject names that can be signed by each CA

Page 49: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

49

Important Files

$HOME/.globus usercert.pem: User’s certificate (subject

name, public key, CA signature) userkey.pem: User’s private key

(encrypted using the user’s pass phrase) /tmp

Proxy file(s): Temporary file(s) containing unencrypted proxy private key and certificate (readable only by user’s account)

Same approach Kerberos uses for protecting tickets

Page 50: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

50

Secure Services

On most unix machines, inetd listens for incoming service connections and passes connections to daemons for processing.

On Grid servers, the gatekeeper securely performs the same function for many services It handles mutual authentication using

files in /etc/grid-security It maps to local users via the gridmap file

Page 51: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

51

Sample Gridmap File

# Distinguished name Local# username

/O=Grid/O=Globus/OU=cs.mu.oz.au/CN=John Smith jsm"/C=US/O=Globus/O=NPACI/OU=SDSC/CN=Richard Frost” frost"/C=US/O=Globus/O=USC/OU=ISI/CN=Carl Kesselman” u14543"/C=US/O=Globus/O=ANL/OU=MCS/CN=Ian Foster” itf

Gridmap file maintained by Globus administrator

Entry maps Grid-id into local user name(s)

Page 52: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

52

ExampleSecure Remote Startup

key

cert

gatekeeperclient

1. Exchange certificates, authenticate, delegate

2. Check gridmap file3. Lookup service4. Run service program

(e.g. jobmanager)

jobmanager

key

cert

1.

2.

map

4.

services3.

Page 53: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

53

Simple job submission

globus-job-run provides a simple RSH compatible interface

% grid-proxy-init Enter PEM pass phrase: *****

% globus-job-run host program [args] Authentication Test

% globusrun –a –r hostname Running a Job on Remote node

% globusrun hostname <executable> globus-job-run belle.anu.edu.au /bin/dat

Page 54: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

54

Delegation

Delegation = remote creation of a (second level) proxy credential New key pair generated remotely on

server Proxy cert and public key sent to client Clients signs proxy cert and returns it Server (usually) puts proxy in /tmp

Allows remote process to authenticate on behalf of the user Remote process “impersonates” the user

Page 55: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

55

Limited Proxy

During delegation, the client can elect to delegate only a “limited proxy”, rather than a “full” proxy GRAM (job submission) client does this

Each service decides whether it will allow authentication with a limited proxy Job manager service requires a full proxy GridFTP server allows either full or limited

proxy to be used

Page 56: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

56

Restricted Proxies

A generalization of the simple limited proxies Desirable to have fine-grained restrictions Reduces exposure from compromised proxies

Embed restriction policy in proxy cert Policy is evaluated by resource upon proxy use Reduces rights available to the proxy to a subset of

those held by the user A proxy no longer grants full impersonation rights

Extensible to support any policy language

Page 57: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

57

ExerciseSign-On & Remote Process

Creation Use grid-cert-info to examine your cert:

% grid-cert-info -all

Use grid-proxy-init to create a proxy certificate:% grid-proxy-initEnter PEM pass phrase:......................................+++++.....+++++

Use grid-proxy-info to query proxy:% grid-proxy-info -subject

Use globus-job-run to start remote programs:% globus-job-run jupiter.isi.edu /usr/bin/ls -l /tmp

Page 58: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

58

Generic Security Service API

The GSS-API is the IETF draft standard for adding authentication, delegation, message integrity, and message confidentiality to apps For secure communication between two

parties over a reliable channel (e.g. TCP) GSS-API separates security from

communication, which allows security to be easily added to existing communication code. Filters on each end of the communications link

GSS-API Extensions defined in GGF draft Globus Toolkit components all use GSS-API

Page 59: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

59

gss_inquire_cred()

Extract information (e.g. the subject name) from a credential

gss_inquire_cred_by_oid()

Extract information associated with a OID from a credential (e.g. information in certificate extensions)Will be in future version > GT 2.0

Page 60: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

60

Authorization

GSI handles authentication, but authorization is a separate issue

Authorization issues: Management of authorization on a multi-organization

grid is still an interesting problem. The grid-mapfile doesn’t scale well, and works only at

the resource level, not the collective level. Large communities that share resources exacerbates

authorization issues, which has led us to CAS (Community Authorization Service)…

Why not use Grid Bank Services ? All those GSPs providing services through the Grid

Marketplace can allow any consumer to access their services as long as GridBank guarantees the payment,

Page 61: 1 Grid Security: PKI Based Authentication Infrastructure M.Effatparvar Fall 1391

61

Security Summary

Programs for credential management grid-cert-info, grid-proxy-init, grid-proxy-

destroy, grid-proxy-info GSS-API: The Globus Toolkit Grid

Security Infrastructure (GSI) uses this API, which allows programs to easily add security

globus_gss_assist: This is a simple wrapper around GSS-API, making it easier to use