ccna_security_ch18_fundamentals_public_key_infrastructure.odt

21
Chapter 18: Fundamentals of the Public Key Infrastructure I. Public Key Infrastructure 1. Public and Private Key Pairs 1. Key pair works as team. 2. Typical have a public key and a private key; private key is only known by the server 3. If public key is used to encrypt, only the private key can decrypt and vice versa 4. Known as Public Key Cryptography or Asymmetric Key Cryptography 5. Used for VPN authentication and a precursor to symmetric ciphers used for bulk traffic 6. Digital Signatures 7. Other uses a. RSA – Named after Rivest, Shamir, and Adleman, who created the algorithm. The primary use of this asymmetrical algorithm today is for authentication. It is also known as public key cryptography standard (PKCS) #1. The key length may be from 512 to 2048, and a minimum size for good security is at least 1024. Regarding security, bigger is better (more secure) b. DH – Diffie-Hellman key exchange protocol. DH is an asymmetrical algorithm that allows two devices to negotiate and establish shared secret keying material (keys) over an untrusted network. The interesting thing about DH is that although the algorithm itself is asymmetrical, the keys generated by the exchange are symmetrical keys that can then be used with symmetrical algorithms such as Triple Digital Encryption Standard (3DES) and Advanced Encryption Standard (AES). c. ElGamal (second character is an L) – This asymmetrical encryption system is based on the DH exchange d. DSA – Digital Signature Algorithm was developed by the U.S. National Security Agency e. ECC – Elliptic Curve Cryptography 8. Require more CPU 9. 512 to 4096 bits (minimum should be 1024) anything less than 1024 is considered unreliable and not as secure as a longer key 10. RSA is commonly used asymmetrical algorithm (RSA digital signatures) 2. RSA Algorithm, the Keys, and Digital Certifications 1. Keys are the secrets that allow cryptography to provide confidentiality 3. Who Has Keys and a Digital Certificate? 1. RSA digital signatures, each party has a public-private key pair, generated by each termination point and enrolled with a certificate authority (CA) and digitally signed by that CA. Used by termination points to authenticate each other 4. How Two Parties Exchange Public Keys 1. Each termination point sends a copy of their digital certificates and verify the authenticity of the digital signature against the CA using the CA's public key 2. Now that each party has each others public keys, they can authentication each other 3. Usually used for a VPN

Upload: florinn81

Post on 17-Jul-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

Chapter 18: Fundamentals of the Public KeyInfrastructure

I. Public Key Infrastructure1. Public and Private Key Pairs

1. Key pair works as team.2. Typical have a public key and a private key; private key is only known by the server3. If public key is used to encrypt, only the private key can decrypt and vice versa4. Known as Public Key Cryptography or Asymmetric Key Cryptography5. Used for VPN authentication and a precursor to symmetric ciphers used for bulk

traffic6. Digital Signatures7. Other uses

a. RSA – Named after Rivest, Shamir, and Adleman, who created the algorithm. The primary use of this asymmetrical algorithm today is for authentication. It is also known as public key cryptography standard (PKCS) #1. The key length may be from 512 to 2048, and a minimum size for good security is at least 1024. Regarding security, bigger is better (more secure)

b. DH – Diffie-Hellman key exchange protocol. DH is an asymmetrical algorithm that allows two devices to negotiate and establish shared secret keying material (keys) over an untrusted network. The interesting thing about DH is that although the algorithm itself is asymmetrical, the keys generated by the exchange are symmetrical keys that can then be used with symmetrical algorithms such as Triple Digital Encryption Standard (3DES) and Advanced Encryption Standard (AES).

c. ElGamal (second character is an L) – This asymmetrical encryption system is based on the DH exchange

d. DSA – Digital Signature Algorithm was developed by the U.S. National Security Agency

e. ECC – Elliptic Curve Cryptography8. Require more CPU9. 512 to 4096 bits (minimum should be 1024) anything less than 1024 is considered

unreliable and not as secure as a longer key10. RSA is commonly used asymmetrical algorithm (RSA digital signatures)

2. RSA Algorithm, the Keys, and Digital Certifications1. Keys are the secrets that allow cryptography to provide confidentiality

3. Who Has Keys and a Digital Certificate?1. RSA digital signatures, each party has a public-private key pair, generated by each

termination point and enrolled with a certificate authority (CA) and digitally signed by that CA. Used by termination points to authenticate each other

4. How Two Parties Exchange Public Keys1. Each termination point sends a copy of their digital certificates and verify the

authenticity of the digital signature against the CA using the CA's public key2. Now that each party has each others public keys, they can authentication each other3. Usually used for a VPN

Page 2: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

5. Creating a Digital Signature1. Bob takes some data, generates a hash and encrypts the hash using Bob's private key.

The hash is attached to the packet and sent to Lois for authentication of Bob. Lois can use the public key to decrypt the hash, sets the decrypted hash aside and runs thehashing algorithm against the data to verify that it's correct. Bob has now been authenticated

6. Certificate Authorities1. Certificate authority is a computer or entity that creates and issues digital

certificates.2. Inside the Digital Certificate

a. Information about the identity of the device such as IP FQDN and public key of the device

b. CA takes all the info including the public key generated by the device and generates a digital certificates CA assigns a serial number to and signs the certificate with its own digital certificate (CAs signature).

c. Also includes validity dates for the certificate, expiration, possibly revocation details.

d. Also information about the CA, including a URL to check the certificate against the CA.

e. Most web browsers have a huge list of common CAs.f. Could create your own CA server, but no one would trust it – you would use it

internally only7. Root and Identity Certificates

1. Digital certificate can be thought of as an electronic identification document2. Includes the name of the person or organization, their address, public key of that

person or device3. Root certificate – Identifies a CA4. Identity certificate – Identifies device or server of other devices that want to

participate in PKI (public key infrastructure)

Page 3: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

8. Root Certificate1. Contains public key of CA server and other details about the CA server

2. Above shows how to view a CA root certificatea. Internet Explorer

a. Tools > Internet Options > Content > Certificates > Trusted Root Certification Authorities highlight the CA and click View and then click Details1. Serial number – Issued and tracked by the CA that issued the certificate2. Issuer – The CA that issued this certificate (Even root certificates need

to have their certificates issued from someone (perhaps even themselves)3. Validity dates – The time window during which the certificate may be

considered valid. If a local computer believes the date to be off by a few years, that same PC may consider the certificate invalid due to his own error about the time. Using Network Time Protocol (NTP) is a good idea to avoid this problem

4. Subject of the certificate – This includes the Organizational Unit (OU),Organization (O), Country (C), and other details commonly found in an X.500 structured directory (more on that later in the chapter). The

Page 4: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

subject of the root certificate is the CA itself. The subject for a client's identity certificate is the client.

5. Public Key – The contents of the public key and the length of the key are often both shown. After all, the public key is public

6. Thumbprint algorithm and thumbprint – This is the hash for the certificate. On a new root certificate, you could use a phone to call and ask for the hash value and compare it to the hash value you see on the certificate. If it matches, you have just performed out-of-band (using the telephone) verification of the digital certificate

9. Identity Certificate1. Similar to a root certificate but describes the client and contains the public key of an

individual host. Example would be a web server that wants to support SSL or router that wants to use digital signatures for authentication of a VPN tunnel. Example below:

2.10.Using the Digital Certificates to get the Peer's Public Key

1. If we want to verify each other we send each other a copy of our digital signatures; which will contain each other's public key and the public key of the CA. We verify the CA using the CA public signature, and then verify each other; again by sending some data with an encrypted hash. When receiving the encrypted hash, we use the same hashing algorithm to run against the data and if we get the same hash we have authenticated each other

Page 5: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

11.X.500 and X.509v3 Certificates1. X.500 is a series of standards focused on directory services and how those

directories are organized. Microsoft Active Directory is based off of X.500.a. Directory elements foundation (Example)

a. CN=Bob (Common Name = CN)b. OU=engineering (Organizational Unit = OU)c. O=cisco.com (Organization = O)

1. org-chart way shaped like a pyramidb. X.509v3 is a standard for digital certificates widely accepted that incorporates

many of the same directory naming standardsc. LDAP (Lightweight Directory Access Protocol)

a. Common use is having a digital certificate being used for authentication and based on the details for that certificate (for example, the OU=sales in the certificate itself, the user could be dynamically assigned the access rights thatare associated with that group in Active Directory or some other LDAP accessible database.

b. Concept is to define the rights in once place and then leverage that over and over again; like setting up Active Directory for a network and using that to control what access is provided to each user after he or she authenticates

2. Most digital certificates contain the following informationa. Serial number – Assigned by the CA and used to uniquely identify the

certificateb. Subject – The person or entity that is being identifiedc. Signature algorithm – The specific algorithm that was used for signing the

digital signatured. Signature – The digital signature from the certificate authority, which is used

by devices that want to verify the authenticity of the certificate issued by that CAe. Issuer – The entity or CA that created and issued the digital certificatef. Valid from – The date the certificate became validg. Valid to – The expiration date of the certificateh. Key usage – The functions for which the public key in the certificate may be

usedi. Public key – The public portion of the public and private key pair generated by

the host whose certificate is being looked atj. Thumbprint algorithm – The hash algorithm used for data integrityk. Thumbprint – The actual hashl. Certificate revocation list location – The URL that can be checked to see

whether the serial number of any certificates issued by the CA have been revoked

Page 6: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

12.Authenticating and Enrolling with the CA1. Using a new CA as a trusted entity and obtaining your own identity certificate

a. Step1 – The first step is to authenticate the CA server, or in other words trust the CA server. Unfortunately, if you do not have the public key for the CA server, you cannot verify the digital signature of the CA server. This is sort of like the chicken and the egg story, because you need the public key, which can be found in the root's CA certificate, but you cannot verify the signature on a certificate until you have the public keya. To get the ball rolling, you could download the root certificate, and then use

an out-of-band method, such as making a phone call, to validate the root certificate. This can be done after downloading the root certificate and looking at the hash value, calling the administrators for the root CA and asking them to verbally tell you what the hash is. If the hash that they tell you over the phone matches the hash that you see on the digital certificate (and assuming that you called the right phone number and talked with the right people), you then know that the certificate is valid, and you can then use the public key contained in a certificate to verify future certificates whichare signed by that CA. This process of getting the root CA certificate installed is often referred to as authenticating the CA

b. Step2 – After you have authenticated the root CA and have a known good root certificate for that CA, you can then request your own identity certificate. This involves generating a public-private key pair and including the public key portion in any requests for your own identity certificate. An identity certificate could be for a device or person. Once you make this request, the CA can take allof your information and generate an identity certificate for you, which includes your public key, and then sends this certificate back to you. If this is done electronically, how do you verify the identity certificate you got is really from the CA server that you trust? The answer is simple because the CA has not only issued you the certificate but it also signed the certificate. Because you authenticated the CA server earlier and you have a copy of its digital certificate with its public key, you can now verify the digital signature it has put on your own identity certificate. If the signature from the CA is valid, you also know that your certificate is valid and so you can install it and use it.

Page 7: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

13.Public Key Cryptography Standards1. A lot of standards for Public Key Infrastructure (PKI)

a. Some control format and use of certificatesa. including requests to a CA for new certificatesb. the format for a file that is going to be the new identity certificatec. The file format and usage access for certificates

b. Few of the standards that should learna. PKCS #19 – This is a format of a certificate request sent to a CA who wants

to receive their identity certificate. This type of request would include the public key for the entity desiring a certificate

b. PKCS #7 – This is a format that can be used by a CA as a response to a PKCS #10 request. This response itself will very likely be the identity certificate (or certificates) that had been previously requested

c. PKCS #1 – RSA Cryptography Standardsd. PKCS #12 – A format for storing both public and private keys using a

symmetric password-based key to “unlock” the data whenever the key needs to be used or accessed

e. PKCS #3 – Diffie-Hellman key exchange14.Simple Certificate Enrollment Protocol

1. SCEP (Simple Certificate Enrollment Protocol) Automates most of the process of requesting and installing an identity certificates (Not an open standard, but supportedby most Cisco devices (developed in association with some other vendors including Cisco)a. Process of authenticating a CA serverb. generating a public-private key pairc. requesting an identity certificated. verifying and implementing the identity certificate

15.Revoked Certificates1. One must manually check to see if a certificate has been revoked unless the device is

set to automatically check each time when authenticating.2. Three basic ways to check in order of popularity

a. Certificate Revocation List (CRL) – This is a list of certificates, based on theirserial numbers, that had initially been issued by a CA but have since been revoked and as a result should not be trusted. A CRL could be very large, and the client would have to process the entire list to verify the certificate is not on the list. A CRL can be thought of as the naughty list. This is the primary protocol used for this purpose, compared to OSCP and AAA. A CRL could be accessed by several protocols, including LDAP and HTTP. A CRL could also be obtained via SCEP

b. Online Certificate Status Protocol (OCSP) – This is an alternative to CRLs. Using this method, a client simply sends a request to find the status of a certificate and gets a response without having to know the complete list of revoked certificates

c. AAA – Cisco AAA services also provide support for validating digital certificates, including a check to see whether a certificate has been revoked. Because this is a proprietary solution, this is not often used in PKI

Page 8: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

16.Uses for Digital Certificates1. HTTPS/TLS/SSL is all about the same thing.

a. HTTP combined with TLS/SSL2. Use for a banking website for instance3. remote-access VPNs for authenticating the peers (at each end)4. Can also use with IPsec which can also use digital certificates for the authentication

portion5. Use with 802.1X; authenticating a user before traffic is allowed at the edge

a. Wireless network – controlling access and requiring authentication, using digital certificates for the PCs/users, before allowing them in on the network.

17.PKI Topologies1. Small network – a single CA server may be enough2. Large network – 30,000 devices plus, a single server may not provide the

availability and fault tolerance requireda. (We are talking about a companies OWN CA server for company usage only)

18.Single Root CA1. Having one CA server having thousands of customers who want to authenticate that

CA and request their own identity certificates might be too large of a demand on oneservera. Offload some work by publishing CRLs on other serversb. Still no fault tolerance though with one CA

19.Hierarchical CA with Subordinate CAs1. You have a Root CA and subordinate or intermediary CA servers

a. The Root CA delegates authority to the subordinate CAs to create and assign identity certificates to the clients; however the Root CA is the king of the hill

2. This is called a hierarchical PKI topology where the Root CA digitally signs the subordinate CA certificates, and the subordinate CAs issue identity certificates to clientsa. The Root CA certificate and it's public key, as well as subordinate CA certificates

and THEIR associated public keys are required to verify the Root CA and the subordinate CAs all the way down the the subordinate CA that issues you a identity certificate

20.Cross-Certifying CAs1. Cross-certifying topology – CA with a horizontal trust relationship over to a second

CA so that clients of either CA could trust the signatures of the other CA

II.Putting the Pieces of PKI to Work1. Both routers and ASA can use digital certificates

Page 9: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

2. ASA example

2. Default of the ASA1. ASA by default is going to use a self-signed certificate to allow management via

HTTPS for ASDM and also for any SSL VPN clients2. You will get a warning as it's not a trusted certificate from a CA3. To use a trusted certificate, you need to install the Root certificate of a CA and then

request for an identity certificate

Page 10: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

3. Viewing the Certificates in ASDM1. ASDM has the option to configure and view both root and identity certificates

2. ff

Page 11: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

4. Adding a New Root Certificate1. Click Add to add a new root certificate

a. Options to installa. From a fileb. Paste in the informationc. use SCEP

b. This option the CA supports SCEP so we choose that option

Page 12: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

2. When adding a new root certificate you are also adding details about how you are going to work with that CA

3. Click More Optionsa. Answer questions about the CRL (Certificate Revocation List) and specify other

details about which protocols to be used for certificate verification for this firewall to use when dealing with certificates issued by this CA

4. After you call to get the hash and compare it to your calculated hash, you can request for an identity certificate

Page 13: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

5. Easier Method for Installing Both Root and Identity certificates1. Instead of manually installing a root certificate is to use SCEP to install the root,

generate a new key pair, and request your identity certificate2. Begin in the Identity Certificate area in ASDM3. Click Add

a. Assign a name to associate with the new CAb. Click Add a New Identity Certificate radio button

4. To use a brand new key pair in conjunction with this CA (that will be putting your public key into your digital certificate)a. Click New (next to the key pair option)b. Assign the key pair

a. A nameb. Size of the keyc. Click Generate Now

5. After clicking Generate Nowa. Public Private Key Pair is generated and the public key portion of it is sent to the

CA as part of the SCEP certificate request process6. CLI equivalent shown below

Page 14: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

7. Before clicking Add Certificatea. Click Advanced to specify the details of the CA server and how to reach that CA

server

8. Specify the enrollment mode of SCEP and the IP address of the CA server that supports SCEP shown below

9. Once the enrollment method and IP address are configured, click the OK button, andthen click the Add Certificate button

Page 15: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

10. Equivalent CLI commands to authenticate and enroll with a new CA via SCEP

11. f

Page 16: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

12. If the SCEP-capable CA server is reachable, and configured correctly, a success message appears, as shown below:

13. Details of certificatea. Highlight the certificate and click Show Details

Page 17: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

14. REVIEW TABLE15. f

Table 18-2 Key PKI ComponentsComponent Description

RSA digital signatures

Using its private key to encrypt a generated hash, a digital signature is created. The receiver uses the public key of the sender to validate the digital signature and verify the identity of the peer

Digital certificate File that contains the public key of the entity, a serial number, and the signature of the CA that issued the certificate

Public and privatekeys

Used as a pair to encrypt and decrypt data in an asymmetrical fashion

Certificate authority

The CA's job is to fulfill certificate requests and generate the digital certificates forits clients to use. It also maintains a list of valid certificates that have been issued, and maintains a CRL listing for any revoked certificates

X.509v3 A common certificate format used today

Subordinate CA/RA

Assistant to the CA, which can issue certificates to clients. Clients need both the certificates from the root and the subordinate to verify signatures all the way to theroot. Used in a hierarchical PKI topology

PKCS Public Key Cryptography Standards, agreed to and implemented by vendors who want the ability to have compatibility with other devices in the PKI

III. “Do I Know This Already?” Quiz

Table 18-1 “Do I Know This Already?” Section-to-Question MappingFoundation Topics Section Questions

Public Key Infrastructure 1-8

Putting the Pieces of PKI to Work 9-10

1. Why is the public key in a typical public-private key pair referred to as public?a. Because the public already has itb. Because it is shared publiclyc. Because it is a well-known algorithm that is publishedd. The last name of the creator was publica, which is Latin for public

2. What is the key component used to create a digital signature?a. Inkb. Public keyc. Private keyd. AES

3. What is the key component used to verify a digital signature?a. Sender's public keyb. Receiver's public keyc. AESd. One-time PAD

Page 18: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

4. What is another name for a hash that has been encrypted with a private key?a. MD5b. SHA-1c. AESd. Digital signature

5. What are the primary responsibilities for a certificate authority (CA)? (Choose all that apply.)a. Verification of certificatesb. Issuing identity certificatesc. Maintaining client's private keysd. Tracking identity certificates

6. Which of the following is not a way for a client to check to see whether a certificateshas been revoked?a. Look at the lifetime of the certificate itselfb. CRLc. OSCPd. LDAP

7. Which of the following could be found in a typical identity certificate? (Choose all that apply.)a. CRL locationsb. Validity datec. Public key of the certificate ownerd. Serial number

8. Which standard format is used to request a digital certificate from a CA?a. PKCS#7b. PKCS#10c. LDAPd. TLS/SSL/HTTPS

9. When obtaining the initial root certificate, what method should be used for validation of the certificate?a. Sender's public keyb. Telephonec. HTTPS/TLS/SSLd. Receiver's private key

10. Which method, when supported by both the client and the CA, is the simplest to use when implementing identity certificates on the client?a. PKCS#7b. PKCS#10c. SCEPd. LDAP

Page 19: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

IV. Review All the Key Topics

Table 18-3 Key TopicsKey Topic Element

Description Page Number

Text Public and private key pairs - 444

Text RSA algorithm, the keys, and digital certificates - 445

Text Certificate authorities - 446

Text Root and identity certificates - 446

List Certificate components - 447

Text X.500 and X.509v3 certificates - 449

List What goes into a digital certificate - 449

Text Authenticating and enrolling with the CA - 450

Text PKCS standards - 450

Text SCEP - 451

Text Revoked certificates - 451

Text PKI topologies - 452

Example 18-1 Commands to generate key pairs - 457

Example 18-2 Commands to authenticate and enroll with CA using SCEP - 458

Table 18-2 Key components for PKI - 461

Page 20: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

V. Complete the Tables and Lists from Memory

Table 18-2 Key PKI ComponentsComponent Description

RSA digital signatures Using its private key to encrypt a generated hash, a digital signatureis created. The receiver uses the public key of the sender to validatethe digital signature and verify the identity of the peer.

Digital certificate File that contains the public key of the entity, a serial number, andthe signature of the CA that issued the certificate

Public and private keys

Used as a pair to encrypt and decrypt data in an asymmetricalfashion.

Certificate authority The CA’s job is to fulfill certificate requests and generate the digitalcertificates for its clients to use. It also maintains a list of validcertificates that have been issued, and maintains a CRL listing anyrevoked certificates.

X.509v3 A common certificate format used today.

Subordinate CA/RA Assistant to the CA, which can issue certificates to clients. Clientsneed both the certificates from the root and the subordinate toverify signatures all the way to the root. Used in a hierarchal PKItopology.

PKCS Public Key Cryptography Standards, agreed to and implementedby vendors who want the ability to have compatibility with otherdevices in the PKI.

VI. Define Key Terms1. PKI - 2. CA - 3. subordinate CA - 4. root certificate - 5. identity certificate - 6. PKCS#7 - 7. PKCS#12 - 8. RSA - 9. digital signature - 10. public key - 11. X.509v3 - 12. CRL - 13. SCEP - 14. LDAP -

Page 21: ccna_security_ch18_fundamentals_public_key_infrastructure.odt

VII. Command Reference to Check Your Memory

Table 18-4 Command ReferenceCommand Description

Crypto key generate rsa Generate a public/private key pair on the ASA

Crypto ca authenticate Retrieve and installs the root certificate via SCEP

Crypto ca enroll Request and installs an identity certificate via SCEP