What is certificate pinning and give an example.
Write a PostgreSQL query that evaluates each TLS connection event against the certificate pin configured for its endpoint and hostname. A connection is allowed only when its observed fingerprint matches an active pin during the connection time.
event_id, endpoint_id, hostname, connected_at, observed_fingerprint, and pinning_decision.ALLOWED and non-matches REJECTED, and order by connected_at, then event_id.| Column | Type | Description |
|---|---|---|
| pin_idPK | INT | Unique certificate pin identifier |
| endpoint_id | INT | Endpoint associated with the pin |
| hostname | VARCHAR(255) | TLS hostname covered by the pin |
| pinned_fingerprint | VARCHAR(128) | Expected certificate fingerprint |
| active_from | TIMESTAMP | Timestamp when the pin becomes active |
| active_to | TIMESTAMP | Exclusive timestamp when the pin expires |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique TLS connection event identifier |
| endpoint_id | INT | Endpoint that initiated the connection |
| hostname | VARCHAR(255) | Requested TLS hostname |
| connected_at | TIMESTAMP | Connection timestamp |
| observed_fingerprint | VARCHAR(128) | Fingerprint presented by the server |