Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH audit events and contexts #28

Merged
merged 8 commits into from
Jun 29, 2023
39 changes: 39 additions & 0 deletions docs/logging-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,45 @@ and TLS probe points.
| `tls::key_exchange_algorithm` | uint16 | Key exchange mode: ECDHE(0), DHE(1), PSK(2), ECDHE-PSK(3), DHE-PSK(4) |
| `tls::group` | uint16 | Groups used in the handshake (as in IANA [registry][iana-tls-supported-groups]) |

##### SSH context names

| name | description |
|------------------------|----------------------------------------|
| `ssh::handshake_client`| SSH handshake for client |
| `ssh::handshake_server`| SSH handshake for server |
| `ssh::client_key` | SSH client key signature/verification |
| `ssh::server_key` | SSH server key signature/verification |
| `ssh::key_exchange` | SSH key exchange |

Example of SSH context tree:

- `ssh::handshake_client`
- `ssh::ident_string` = `SSH-2.0-OpenSSH_8.8`
beldmit marked this conversation as resolved.
Show resolved Hide resolved
- `ssh::client key`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

underscore instead of space

Suggested change
- `ssh::client key`
- `ssh::client_key`

I assume the events should come in order they happen during the ssh session so the client key operation should happen only after the key_exchange is finished.

The hostkey verification happens as part of the key exchange though so it is a question whether it should be part of that context or somehow separately.

In any case, this is a context so it should have again some events attached for example:

Suggested change
- `ssh::client key`
- `ssh::client_key`
- `ssh::key_algorithm` = `rsa-sha2-256`
- `ssh::rsa_bits` = `2048`

- `ssh::key_exchange`
- `ssh::kex_algorithm` = `curve25519-sha256`
- `ssh::c2s_cipher` = `[email protected]`
beldmit marked this conversation as resolved.
Show resolved Hide resolved

##### SSH keys

All the keys except `rsa_bits` have `string` type.
We distinguish server and client values by the context we are in. We log all relevant events in both contexts.

| key | description | example |
|---------------------------------|--------------------------------------------------|----------------------------|
| `ssh::ident_string` | Software identification string | `SSH-2.0-OpenSSH_8.8` |
beldmit marked this conversation as resolved.
Show resolved Hide resolved
| `ssh::key_algorithm` | Key used in handshake | `ssh-ed25519` |
beldmit marked this conversation as resolved.
Show resolved Hide resolved
| `ssh::rsa_bits` | Key bits (RSA only) | 2048 |
| `ssh::cert_signature_algorithm` | If cert is used, signature algorithm of the cert | `ecdsa-sha2-nistp521` |
| `ssh::kex_algorithm` | Negotiated key exchange algorithm | `curve25519-sha256` |
| `ssh::kex_group` | Group used for key exchange | moduli+bits or group name. |
| `ssh::c2s_cipher` | Data cipher algorithm | `[email protected]` |
| `ssh::s2c_cipher` | | |
| `ssh::c2s_mac` | Data integrity algorithm | Omitted for "implicit" |
| `ssh::s2c_mac` | | |
| `ssh::c2s_compression` | Data compression algorithm | Omitted for "none" |
| `ssh::s2c_compression` | | |
beldmit marked this conversation as resolved.
Show resolved Hide resolved

### CBOR based logging format definition

The recommended format of storing events is to use a sequence of
Expand Down