pki

OCSP Responder Monitoring und die Nonce

Written by  on Februar 18, 2016

Eine Nonce, aus dem Englichen für „Number ONCE“, ist eine Nummer die nur ein Mal verwendet werden soll. Diese Nummer wird vom OCSP Client generiert, mit der Anfrage mitgeschickt. Der OCSP Responder muss den Wert in der signierten Antwort mitschicken, zur Bestätigung dass es sich tatsächlich um die entsprechende Antwort auf die Anfrage handelt. Das dient einerseits als Schutz vor einer Replay Attacke, hat aber auch den „Nachteil“ dass die Antwort nicht gecached werden kann. Und genau das ist für ein Monitoring von Vorteil, weil damit erkannt werden kann, ob tatsächlich neue OCSP Responses erzeugt werden, und nicht nur irgendwelche Antworten aus einem Cache fallen.
In RFC5019 heißt es zur Nonce beim OCSP Responder, dass sich der Client nicht alleine auf den Nonce verlassen darf, sondern im Zweifelsfall auch noch den Timestamp prüfen muss.

Clients that opt to include a nonce in the request SHOULD NOT reject a corresponding OCSPResponse solely on the basis of the nonexistent expected nonce, but MUST fall back to validating the OCSPResponse based on time. Clients that do not include a nonce in the request MUST ignore any nonce that may be present in the response.

Microsoft zu OCSP, Nonce und Cache

Allow Nonce requests. This option instructs the Online Responder to inspect and process an OCSP request nonce extension. If a nonce extension is included in the OCSP request and this option is selected, the Online Responder will ignore any cached OCSP response and will create a new response that includes the nonce provided in the request. If this option is disabled and a request that includes a nonce extension is received, the Online Responder will reject the request with an „unauthorized“ error.

Microsoft sagt in der gleichen Quelle übrigens, dass Microsoft Clients mit aktuellem Stand keine Nonce unterstützen

The Microsoft OCSP client does not support the nonce extension.

Ocsp Responder Caching

Written by  on Februar 5, 2016

Dreht man einen Microsoft OCSP Responder ab, schlägt das Monitoring darauf nicht an. Warum?

Weil die OCSP Responses vom IIS gecached werden und zwar für so lange wie auch die CRL noch gültig wäre!

Response caching. After a request is received and a certificate serial number is extracted, the Online Responder Web proxy will check the local cache for a valid response. The cache is implemented as part of the ISAPI extension and is an in-memory cache. If a client request generates a cache fault, the Online Responder Web proxy will make a request to the Online Responder service for a response. The cache item validity period is set to the CRL validity period from which the response was generated or to the signing key validity, whichever is shorter.

Zusätzlich wird noch für 120 Sekunden gecached.

In addition to the OCSP ISAPI extension caching, the IIS HTTP.SYS library performs caching for 120 seconds. Multiple requests to the Online Responder in that time period will be served with the HTTP.SYS-cached response.

Online Responder Installation, Configuration, and Troubleshooting Guide

Authentifizierung

Written by  on Januar 19, 2016

Weil hier auch so schön der Nutzen von CAs erklärt wird – aus c’t Netzwerke 2016

… gerade die Authentifizierung der Kommunikationspartner ist bei jeglicher Art von Verschlüsselung die große Herausforderung. Dabei geht es nicht nur um den Austausch von Schlüsseln, sonder um die Frage, ob das Material tatsächlich zu der Nutzerkennung und Person gehört, die man erreichen möchte.
Am einfachsten ist eine zuverlässige Authentifizierung, wenn sich beide Kommunikationspartner physisch begegnen und ihre öffentlichen Schlüssel persönlich austauschen.
Ist dies nicht möglich, kann man eine dritte (möglichst unabhängige) Instanz mit der Authentifizierung beauftragen. Das ist bei den gängigen x.509 Zertifikaten der Fall. Jedoch müssen beide Kommunikationspartner dem Herausgeber der Zertifikate vertrauen, also der Certificate Authority (CA).

wget isn’t checking CRLs?

Written by  on Dezember 1, 2015

Just a wild theory, but wget is not checking for revoked certificates.
How did I come to this conclusion – and how did I try to verify that?

First some infos about versions – which may be rather important on that topic.

wget --version
GNU Wget 1.15 built on linux-gnu.
openssl version
OpenSSL 1.0.1f 6 Jan 2014

Check about the current certificate, like mine here at https://www.höllrigl.at -> you’ll see a certificate from „StartCom Class 1 Primary Intermediate Server CA“ CA and a CRL at http://crl.startssl.com/crt1-crl.crl

So I’m checking about where to find the CRL and get a nice list

# dig crl.startssl.com +short
www.startssl.com.edgesuite.net.
a1603.g1.akamai.net.
92.122.206.27
92.122.206.10

So let’s see if we find some traffic that goes there – first I tried a ping:

# tcpdump -i eth0 host crl.startssl.com
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
21:34:23.967704 IP 192.168.3.1 > a92-122-206-10.deploy.akamaitechnologies.com: ICMP echo request, id 18687, seq 1, length 64
21:34:24.016819 IP a92-122-206-10.deploy.akamaitechnologies.com > 192.168.3.1: ICMP echo reply, id 18687, seq 1, length 64

Next thing, fetch that URL with wget

# wget https://www.höllrigl.at
--2015-11-30 21:35:46--  https://www.xn--hllrigl-90a.at/
Resolving www.höllrigl.at (www.xn--hllrigl-90a.at)... 193.239.248.170, 2a04:5540:1:41::10
Connecting to www.höllrigl.at (www.xn--hllrigl-90a.at)|193.239.248.170|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.2’

    [ <=>                                                                                                                                                                                             ] 29,620      --.-K/s   in 0.05s

2015-11-30 21:35:48 (594 KB/s) - ‘index.html.2’ saved [29620]

Now I’d like to show to you the dumped packages in tcpdump – but there are none.
Other strong indicators are, that there only started to be a ‚–crl-file=file‘ option to wget starting with 1.16, which allows you to check your certificate against a locally stored CRL file.

Symmetrisch vs. Asymmetrisch

Written by  on Oktober 28, 2015

Beispiele für symmetrische Verschlüsselungsalgorithmen

  • Data Encryption Standard (DES)
  • Rivest’s Cipher version 2 (RC2) (40 bit)
  • RC2 (128 bit)
  • RC4
  • Triple DES (3DES)
  • Advanced Encryption Standard (AES)

Beispiele für asymmetrische Verschlüsselungsalgorithmen

  • Diffie-Hellman Key Agreement
  • Rivest Shamir Adleman (RSA)
  • Digital Signature Algorithm (DSA)

Windows Server® 2008 PKI and Certificate Security (PRO-Other)

Wie wird die Gültigkeit von X.509v3 Zertifikaten überprüft?

Written by  on Oktober 26, 2015

Es gibt zumindest 3 Stellen, an denen Infos zu finden sind, ob ein X.509v3 Zertifikat noch gültig ist.
Verwirrend ist eigentlich nur, dass unter Windows alle Begriffe zwanghaft eingedeutscht wurden.

  • CDP (CRL Distribution Point), auf deutsch „Sperrlisten-Verteilunspunkt“
  • Wird die CRL vom CDP heruntergeladen gibt es unter „Freshest CRL“, auf deutsch „Aktuellste Sperrliste“ einen Eintrag für die Delta CRL, d.h. falls es eine gibt
  • AIA (Authority Information Access) auf deutsch „Zugriff auf Stelleninformation“ enthält den Pfad zum OCSP (Online Certificate Status Protocol) Responder

Zitat des Tages

Written by  on September 17, 2015

The main point to remember is that a Microsoft CA cannot issue a certificate that exceeds the remaining lifetime on the CA certificate.

Windows Server 2008 PKI and Certificate Security

Zitat des Tages

Written by  on September 16, 2015

Danke Captain Obvious
1888434

Windows Server 2008 PKI and Certificate Security

Was steht in der CRL

Written by  on September 12, 2015

Die CRL enthält die Seriennummern von gesperrten noch gültigen Zertifikaten.

A base CRL contains the serial numbers of all certificates revoked on a CA that are still time valid, as well as the reason for each revocation.

Windows Server 2008 PKI and Certificate Security

openssl genrsa

Written by  on Mai 16, 2015

Und noch eine alte Notiz von mir – mal eben schnell einen Key und CSR anlegen Beispiel:

openssl genrsa -out ~/höllrigl.at.ssl/höllrigl.at.key 2048
openssl req -new -sha256 -key ~/höllrigl.at.ssl/höllrigl.at.key -out ~/höllrigl.at.ssl/höllrigl.at.csr