81
IMPLEMENTING HTTPS, TLS AND SCLOGON Ondřej Ševeček | PM Windows Server | GOPAS a.s. | MCM: Directory Services | MVP: Enterprise Security | [email protected] | www.sevecek.com | DOMAIN CONTROLLER CERTIFICATE AND LDAPS Implementing HTTPS and TLS

[email protected] | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

IMPLEMENTING HTTPS, TLS AND SCLOGON

Ondřej Ševeček | PM Windows Server | GOPAS a.s. | MCM: Directory Services | MVP: Enterprise Security |[email protected] | www.sevecek.com |

DOMAIN CONTROLLER CERTIFICATE AND LDAPS

Implementing HTTPS and TLS

Page 2: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Publish the Kerberos Authentication template in CA

Pulse computer autoenrollment cycle on a DC to let it enroll for the certificate if none is present yet

Page 3: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Verify the DC certificate has been issued from the Kerberos Authentication template and by the correct CA

Verify the DC certificate parameters

Page 4: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Verify the DC certificate parameters

Verify LDAPS connection from a client computer with LDP tool, use TCP 636 port only

Page 5: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Change template parameters to include Subject name

Reenroll all certificate holders to update even valid clients (increments major version of the template)

Page 6: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Pulse autoenrollment on the DC to update the certificate

HTTPS SERVER TLS CERTIFICATE

Implementing HTTPS and TLS

Page 7: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Certificate template management

Duplicate Web Server template

Page 8: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Verify that the template is of computer type

Expiration and Compatibility

Page 9: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Request handling and Cryptography

Certificate purpose in case of TLS server certificates

Encryption

usable for RSA key exchange

any SSL/TLS version with RSA server certificate

Signature

usable for (EC)DH key agreement with PFS

for RSA server certificate, it requires TLS 1.1+

Page 10: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Subject and Issuance policy

EKU and Key Usage

Page 11: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Security - Read and Enroll permissions

Add the template to issuing CA

Page 12: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

On WFE1 verify the rootCA is trusted

Display Physical certificate stores in the console

Page 13: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Verify origin of the two trusted root CAs

Start the Request new certicate wizard

Page 14: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Select the custom web server certificate template

Reasons for other certificate templates invisibilityShow all templates - permissions

Page 15: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Reasons for other certificate templates invisibilityShow all templates – not published by a CA

The specified role was not configured for the application.This type of certificate can be issued only to a user

Page 16: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Subject and SAN values, Friendly name and private key options

Key usage and EKU

Page 17: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Enrollment pending

Self-signed certificate request stored locally together with its private key

Page 18: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Investigate the pending certificate request in CA

Issue the certificate

Page 19: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Issued certificate serial number and other parameters

SAN and CDP (CRL distribution points)

Page 20: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

On WFE1 pulse computer auto-enrollment

Export the certificate into CER file

Page 21: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Verify the web server's certificate URL paths (CDP, AIA)

Verify the web server's certificate revocation and validity

Page 22: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Bind the TLS certificate within IIS web site

HTTP.SYS binding (no DS mapper)

Page 23: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Require TLS to limit downgrade attacks

From Client7 verify the TLS/HTTPS connection and certificate validity

Page 24: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

ECDSA certificate template

ECDSA certificate issuedsmaller key, 10 times faster cryptography

Page 25: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

ECDH certificate template and the issued certificate

ECDH key usage extension

Page 26: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Combinations recap

RSA key exchange encrypted key transport

RSA certificate Key Encipherment

(EC)DH key agreement public transport signed

DSA certificate Digital Signature

RSA certificate Digital Signature

ECC+ECDSA certificate Digital Signature

ECC+ECDH certificate (e.g. not supported in Chrome) Key Agreement

Upgrade signature algorithm

Page 27: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Current IE/Edge/Chrome/FireFox compatibility

RSA Signature + Encryption

ECDSA Signature

IIS ECDSA-256, ECDSA-384 only

RootCA SHA1

SubordinateCAs SHA256+ (I/E/F eat SHA1)

LeafCert SHA256+

TLS CLIENT AUTHENTICATION CERTIFICATE

Implementing HTTPS and TLS

Page 28: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Issuing CA must be NTAuth super-trusted

Issuing CA must be NTAuth super-trusted

Page 29: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Require TLS client certificate on IIS web site, disable HTTP authentication

Enable DS mapper server-wide

Page 30: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

HTTP.SYS binding (with DS mapper)IIS requests client certificate (TLS renego)

Or do not disable Windows Authentication and enforce client certificate on HTTP.SYS

NETSH HTTP ADD SSLCERT

ipport | hostnameport

certhash

appid={4dc3e181-e14b-4a21-b022-59fc669b0914}

clientcertnegotiation=enable

dsmapperusage=enable

verifyclientcertrevocation=enable

Page 31: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Duplicate User certificate template

Verify the template is of user type

Page 32: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Validity periods and Compatibility

Request handling and Cryptography

Page 33: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Subject and Issuance requirements

EKU as Client AuthenticationKey usage as Digital Signature

Page 34: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Verify the template is of User type, Enroll and Autoenroll permissions

Publish the certificate template in CAPulse auto-enrollment on the Client7

Page 35: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Verify certificate presence with MMC and PowerShell

Prompt for client certificate selection when only one certificate exists

Page 36: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Verify Internet Explorer behavior

ADVANCED OPERATIONS WITH CLIENT CERTIFICATES

Implementing HTTPS and TLS

Page 37: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Enroll for another user certificate manually

Expand details of the certificate request

Page 38: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Mark private key exportableSpecify friendly name

Verify IE behavior with more compliant certificates

Page 39: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Export the certificate with its private key into PFX file

Switch user to Kamil and verify successful autoenrollment of his cert

Page 40: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Import the other PFX file

Try logon with different user identity certificate with IE

Page 41: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

No certificates published in AD

82

PRIVATE KEY STORAGE

Enterprise PKI

Page 42: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Private Key Storage

Users CSP: %APPDATA%\Roaming\Microsoft\Crypto\RSA

CNG: %APPDATA%\Roaming\Microsoft\Crypto\Keys

SYSTEM/Network Service/Local Service CSP: %ALLUSERPROFILE%\AppData\Microsoft\Crypto

CNG SYSTEM: %ALLUSERPROFILE%\AppData\Microsoft\Crypto\Sy

stemKeys

CNG Network/Local Service: %WINDIR%\ServiceProfiles\

83

Private Key Storage

Smart Card, Hardware Security Module (HSM)

CERTUTIL -scinfo

Strong Private Key Protection!

requires user consent

encrypted with password in the storage

84

Page 43: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

User Profile%USERPROFILE%\AppData\Roaming

User Password

Private Keys in Software CSPs (basic)

85

Private Key #1

User Password

Private Key #2

User Password

Private Key #3

User Profile%USERPROFILE%\AppData\Roaming

Profile Key

Private Keys in Software CSPs (better)

86

Private Key #1

Profile Key

Private Key #2

Profile Key

Private Key #3

User Password

Profile Key

Page 44: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Profile Key

Private Keys in Software CSPs

87

Private Key

Private Key

Private Key

User Password

Profile Key

AD User Account

Profile Key

Extended Protection for Keys

Require user interaction only

Requre additional “PIN”

key encrypted on disk with the PIN

88

Page 45: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Deleting private keys

You are not responsible for private keys after their expiration/revocation

except for data/backup decryption

Rather delete document/code signing private keys to prevent after-expiration fakes

Request new certificate and enable Strong private key protection

Page 46: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Specify the password and grant permission when using the private key

Request strong protection on template and autoenroll for the certificate

Page 47: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Strong private key protection user experience during auto-enrollment

System cryptography: Force strong key protection for user keys stored on the computer – User must enter a password

Page 48: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

TPM private key storage

TPM protection only no PIN no smart card logon (no Kerberos PKINIT) hardware bound, non-exportable, attestation KSP: Microsoft Platform Crypto Provider

TPM virtual smart card PIN smart card logon (Kerberos PKINIT) more cards for testing removable cards/tokens hardware bound, non-exportable CSP: Microsoft Base Smart Card Crypto Provider KSP: Microsoft Smart Card Key Storage Provider

Virtual TPM smart cards (TPMVSCMGR)

Page 49: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

More TPM cards

98

KERBEROS PKINIT – SMART CARD LOGON

Enterprise PKI

Page 50: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Smart Card Logon EKU

Allow signature-only keys valid for logon GPO

Page 51: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Integrated GUI unblock

AdminKey unblock response calculator (only when no PUK)

Page 52: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

103

CREDENTIALS ROAMING

Enterprise PKI

Problems with roaming users

Local profiles

enroll automatically for the same templates on several workstations

especially problematic for encryption keys

Roaming profiles

lost with profile deletion (automatic)

offline nature if logged on simultaneously on several machines

Page 53: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Solution for roaming users

Smart cards

Credentials roaming

Credential roaming

Saves private keys and certificates into Active Directory

excluded from roaming profiles

Accessible by the user and administrators

identity theft!

Remains on workstations wherever the user logs on

Cannot be considered a backup

users can delete certificates

106

Page 54: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Enable credential roaming

Update group policy and pulse auto-enrollment on client

gpupdate

certutil -user -pulse

Page 55: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Consumption in AD

msPKIAccountCredentials

msPKIDPAPIMasterKeys RSA 2048 = 4500 B + 4500 B

RSA 4096 = 7500 + 5300 B

Normal certificate publishing userCertificate attribute

maximum of <800 certificates (FFL 2000)

maximum of <1200 certificates (FFL 2003+)

DER binary encoded certificate (1500 B or 1750 B)

CERTIFICATE LIFECYCLE

Implementing HTTPS

Page 56: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Request certificate with new key

Allow renewal based on ownership of previous still valid certificate

Page 57: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Renew certificate with new key

Renewal requests and “old certificate” field in CA

The certificate renewalrequest is signed with the previous certificate

Page 58: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Autoenrollment renewal and old key archiving

Autoenrollmentrenewal always at least at 80% of certificate expiration, or sooner according to template settings

Page 59: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Since Windows 7 and Windows 2008 R2 clients use autoenrollment for renewal of manual subjects as well

Manual IIS binding after renewal

Page 60: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Certificate lifecycle events since Windows 2012 R2

Certificate lifecycle events since Windows 2012 R2 (event 1001, CertificateServicesClient-Lifecycle-System)

Page 61: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

IIS automatic certificate rebinding since Windows 2012 R2

IIS automatic certificate rebinding since Windows 2012 R2

Page 62: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Revoke certificate

Revocation reasonsReason code Reason

Unspecified

Key compromise private key stolen or otherwise compromisedpolicy breach on private key such as fire or maintenance in the server room

CA compromise the same as with Key compromise on part of the private key of a CA

Change of affiliation although the purpose for which the certificate exists didn’t cease, the Subject does not fall under the original certification policy (certificate template) anymorefor instance – this CA issues certificates for people from Prague, but the employee moved to New York

Superseded the Subject received a new certificate for the same purpose under the same certification policy (certificate template)

Cease of operation the purpose for which the Subject would be using the certificate disappearedfor instance – the server does not run HTTPS anymore, thus the certificate is not necessary

Hold disabled temporarily, can be unrevokedconsider the fact it will disappear from CRL later and for ever

Page 63: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Always publish new CRL immediately to let clients which do not cache the CRL yet to update asap

GUI does not check CRL and does not display revoked certificates’ status. You must use CERTUTIL -verifyCERTUTIL -urlfetch -verify exported-cert.cer

Page 64: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

TLS FOR SQL SERVER

Implementing HTTPS and TLS

The need for trusted TLS certificate

No MITM possible

TLS self-signed + Kerberos

TLS trusted

MITM possible

TLS self-signed + NTLM

TLS self-signed + SQL authentication

Page 65: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Normally, SQL server creates a volatile self-signed TLS certificate (ID 26018)

Do not use KSP/CNG providers

Page 66: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Standalone instance uses computer’s DNS name

Clustered SQL server requires the cluster virtual name in the certificate

GUI requires Subject

Assign TLS certificate in the SQL server's configuration manager

Page 67: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

You can also force encryption on the SQL server side

SQL server will not start (error event ID 26014)

Page 68: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

SQL TLS certificate's private key must have read permission

Manage private key dialog for the certificate in Certificates console

Page 69: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Restart SQL server and verify application event log (ID 26013)

Verify certificate thumbprint in registry

HKLM\Software\Microsoft\Microsoft SQL Server\<instance>\MSSqlServer\SuperSocketNetLib

Certificate = REG_SZ = <certificate thumbprint>

SQL on failover cluster

GUI bug, does not work

create certificate for the cluster name

manually set the registry value

Page 70: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

You can also force encryption on the SQL server side

Enforce protocol encryption on the client with both the 64bit and 32bit CLICONFG and SysWow64\CLICONFG

Page 71: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Enforce protocol encryption on client through GPO in registry

HKLM\Software\Microsoft\Microsoft SQL Server\Client\SuperSocketNetLib

Encrypt = DWORD = 1

HKLM\Software\Wow6432Node\Microsoft\...

Automatic SQL server certificate selection

Page 72: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Modify default accounts on CA (CA 2012+, SQL on 2012+, use legacy CSP)

TLS FOR RDP

Implementing HTTPS and TLS

Page 73: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

When

non-domain machines

local accounts

IP address

no Kerberos

Autogenerated RDP certificate by default since Windows 2008 and Vista versus manual config on 2003 SP1

Page 74: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Certificate errors due to the non-trusted self-signed certificate

Yet on intranets the connection is authenticated with Kerberos regardless of the certificate. Requires domain account. Requires Windows 2008+, mstsc client 6+

Page 75: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

The self-signed automatically generated RDP server certificate

Define new template with both display and template names the same

Page 76: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Add and use new RDP EKU OID 1.3.6.1.4.1.311.54.1.2(Remote Desktop Authentication instead of Server Authentication)

Autoenroll permission is not necessary

Page 77: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Define server authentication certificate template in a GPO

Group Policy based RDP certificate visible on 2008 R2 GUI

Page 78: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Restart Remote Desktop Configuration service and verify registry value WinStations/TemplateCertificate

Event 1063, TerminalServices-RemoteConnectionsManager

Page 79: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Manually selected RDP certificateSSLCertificateSHA1Hash

RDP server identity verified by both the certificate and Kerberos

Page 80: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Possibility of downgrade attacks

MS

TS

C

RD

P S

erve

r

RDP Security Layer

Att

acke

r

RDP TLS

Certificate

Require TLS on RDP servers to limit downgrade attacks

Page 81: ondrej@sevecek.com | | IMPLEMENTING … · DSA certificate Digital Signature RSA certificate Digital Signature ECC+ECDSA certificate Digital Signature ECC+ECDH certificate (e.g. not

Require server authentication on clients to prevent downgrade attacks

THANK YOU!

Ondřej Ševeček | PM Windows Server | GOPAS a.s. | MCM: Directory Services | MVP: Enterprise Security |[email protected] | www.sevecek.com |