pki at scale using short-lived certificates · pki at scale using short-lived certificates bryan...

35
PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security

Upload: others

Post on 03-Nov-2019

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

PKI at Scale Using Short-Lived Certificates

Bryan D. Payne Engineering Manager, Platform Security

Page 2: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

weeks <6 months 6-12 months >1 year

*Notified via extortion attempt

2 weeks

3 weeks

1 month

3 months

4 months

8 months

17 months

13 months

Page 3: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

ElasticLoad

Balancers

Web Service

Web Service

Web Service

Web Service

. . .Internet Cloud / Data Center / Etc

Page 4: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Securely Deploy Certificate / Key

Communicate Securely

API & UIfor Certificate

Creation

Lemur

Get Certificate & Key

Public CA

Private CACloudCA

Seal SecretsMetatron

Deployment Management

Spinnaker

Version ControlGit

AMI

Server with TLSKaryon

Tomcat

Apache

MetatronClient with TLS

RibbonMetatron

Page 5: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Securely Deploy Certificate / Key

Communicate Securely

API & UIfor Certificate

Creation

Lemur

Get Certificate & Key

Public CA

Private CACloudCA

Seal SecretsMetatron

Deployment Management

Spinnaker

Version ControlGit

AMI

Server with TLSKaryon

Tomcat

Apache

MetatronClient with TLS

RibbonMetatron

Page 6: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Securely Deploy Certificate / Key

Communicate Securely

API & UIfor Certificate

Creation

Lemur

Get Certificate & Key

Public CA

Private CACloudCA

Seal SecretsMetatron

Deployment Management

Spinnaker

Version ControlGit

AMI

Server with TLSKaryon

Tomcat

Apache

MetatronClient with TLS

RibbonMetatron

Page 7: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Revocation Is Hard

Page 8: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

CRL (rfc2459)

OCSP (rfc2560)

OCSP stapling (rfc6066)

OCSP must staple (draft-hallambaker-muststaple-00)

Page 9: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

CRL: Certificate Revocation List

Browser WebServer

(Content)

WebServer(CRL)

CertificateAuthority

Update

Internet

CRLCache

1: TLS Handshake2

: Ch

eck

CR

L

Page 10: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

CRL (rfc2459)

OCSP (rfc2560)

OCSP stapling (rfc6066)

OCSP must staple (draft-hallambaker-muststaple-00)

Page 11: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

OCSP: Online Certificate Status Protocol

Browser

WebServer

(Content)

OCSPResponder

CertificateAuthority

Update

Internet

1: TLS Handshake

2: Get Certificate Status

Page 12: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

CRL (rfc2459)

OCSP (rfc2560)

OCSP stapling (rfc6066)

OCSP must staple (draft-hallambaker-muststaple-00)

Page 13: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

OCSP Stapling

Browser

WebServer

(Content)

CertificateAuthority

Update

Internet

1: TLS Handshake

2: Return Certificate Status

OCSPResponder

Page 14: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

CRL (rfc2459)

OCSP (rfc2560)

OCSP stapling (rfc6066)

OCSP must staple (draft-hallambaker-muststaple-00)

Page 15: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

OCSP must-staple

OCSP staple

OCSP CRL

Java

C

Python

JavaScript

M Georgiev et al., “The most dangerous code in the world: validating SSL certificates in non-browser software”, In Proceedings of ACM CCS, 2012.

Page 16: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks
Page 17: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Photo Credit: Kayamon (CC BY-SA 3.0) https://en.wikipedia.org/wiki/File:Penny_Harvest_Field_2007.jpg

Page 18: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Short-Lived Certificates

• R Rivest, “Can We Eliminate Certificate Revocation Lists?”, In Proceedings of Financial Cryptography, 1998.

• E Topalovic et al., “Towards Short-Lived Certificates”, In Proceedings of IEEE Oakland Web 2.0 Security and Privacy (W2SP), 2012.

6 months

3 months

1 month

1 week

4 days

4 Hours

Page 19: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Photo Credit: Bhernandez (CC BY 2.0) https://www.flickr.com/photos/kennyuhh/2917293212

Page 20: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks
Page 21: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

AWS HMAC Generation

Not real secret keys, sorry.

Lifecycle of AccessKeyID and SecretKey is of utmost interest here.

AKIAIOSFODNN7EXAMPLE:iXKQe8qXbhnN0jUe7JGVqFNXMmTxP5pI6example

DELETE\n\n\nTue, 27 Mar 2007 21:20:26 +0000\n/johnsmith/photos/puppy.jpg

AccessKeyID and SecretKey

HMAC-SHA-1

Customer Request

lx3byBScXR6KzyMaifNkardMwNk

Digest Verified by AWS

Page 22: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Circa 2012: AWS SDKs Introduce the Provider Paradigm

// provider paradigm dynamically asks for keys every time AWSCredentialsProvider prov = new AWSCredentialsProvider(){

public AWSCredentials getCredentials(){

RESTfulObj AWSKey = RESTService.get(“server/getAWSKey”);

return new BasicAWSCredentials( AWSKey.getAccessID(), AWSKey.getSecretKey());

}

};

AmazonSimpleDBClient client = new AmazonSimpleDBClient(prov);

client.listDomains();

The client object in the above code example no longer caches keys.

Page 23: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

On Instance Credentials

$curl http://169.254.169.254/latest/meta-data/iam/security-credentials/role

{

"Code" : "Success",

"LastUpdated" : "2015-09-17T01:29:49Z",

"Type" : "AWS-HMAC",

"AccessKeyId" : "ASIAIL6IJJCXLEXAMPLE",

"SecretAccessKey" : "iXKQe8qXbhnN0jUe7JGVqFNXMmTxP5pI6example",

"Token" : "...",

"Expiration" : "2015-09-17T07:47:45Z"

}

Page 24: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Alice

Alice

Bob

Bob

ID Proof + Credential Request

New Short-Lived Credential

Validate ID

Generate Credential

Page 25: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Don’t use short-lived cred to get

updated cred!

Alice

Alice

Bob

Bob

ID Proof + Credential Request

New Short-Lived Credential

Validate ID

Generate Credential

Page 26: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Linux Kernel (with AppArmor or SELinux)

CredentialManagement

ProcessService with TLS

Short-LivedCertificate and

Key Files

(write)

(read)

TLS Session

System IdentityCredentials

(TPM or SGX)

Credential RenewalProtocol

Page 27: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Linux Kernel (with AppArmor or SELinux)

CredentialManagement

ProcessService with TLS

Short-LivedCertificate and

Key Files

(write)

(read)

TLS Session

System IdentityCredentials

(TPM or SGX)

Credential RenewalProtocol

Loading new certificatesinto service…

• Send signal to service • Restart service • Design service to reload

certificates periodically

Page 28: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

How to load a new certificate and private key?

Zero downtime?

Apache graceful restart Maybe

Nginx reload Yes

Tomcat restart No

HAProxy reload No

Stunnel HUP No

Ghostunnel SIGUSR1 Yes

Page 29: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Develop & Deploy Code

Communicate Securely

Provision Credentials at Startup

API & UIfor Certificate

Creation

Lemur Public CA

Private CACloudCAInitialize

SecretsMetatron

Deployment Management

Spinnaker

Version ControlGit

AMI

Server with TLSKaryon

Tomcat

Nginx

MetatronClient with TLS

RibbonMetatron

Page 30: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Develop & Deploy Code

Communicate Securely

Provision Credentials at Startup

API & UIfor Certificate

Creation

Lemur Public CA

Private CACloudCAInitialize

SecretsMetatron

Deployment Management

Spinnaker

Version ControlGit

AMI

Server with TLSKaryon

Tomcat

Nginx

MetatronClient with TLS

RibbonMetatron

Page 31: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Develop & Deploy Code

Communicate Securely

Provision Credentials at Startup

API & UIfor Certificate

Creation

Lemur Public CA

Private CACloudCAInitialize

SecretsMetatron

Deployment Management

Spinnaker

Version ControlGit

AMI

Server with TLSKaryon

Tomcat

Nginx

MetatronClient with TLS

RibbonMetatron

Page 32: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Develop & Deploy Code

Communicate Securely

Provision Credentials at Startup

API & UIfor Certificate

Creation

Lemur Public CA

Private CACloudCAInitialize

SecretsMetatron

Deployment Management

Spinnaker

Version ControlGit

AMI

Server with TLSKaryon

Tomcat

Nginx

MetatronClient with TLS

RibbonMetatron

Page 33: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Long-Lived Certificates

Short-Lived Certificates

• Improve attack detection, in practice

• Retrofit your applications to support revocation

• Refresh certificates

• Update server / client to support graceful reloading of certificates

Page 34: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

From Vision to Reality…

Page 35: PKI at Scale Using Short-Lived Certificates · PKI at Scale Using Short-Lived Certificates Bryan D. Payne Engineering Manager, Platform Security. weeks

Questions?

[email protected] http://bryanpayne.org

[PS… I’m hiring!]