mirror of https://github.com/jtesta/ssh-audit.git
Compare commits
4 Commits
3c31934ac7
...
d7f8bf3e6d
Author | SHA1 | Date |
---|---|---|
Joe Testa | d7f8bf3e6d | |
Joe Testa | 3d403b1d70 | |
Joe Testa | 9fae870260 | |
Damian Szuberski | 20873db596 |
|
@ -191,6 +191,7 @@ For convenience, a web front-end on top of the command-line tool is available at
|
|||
- Snap builds are now architecture-independent.
|
||||
- Changed Docker base image from `python:3-slim` to `python:3-alpine`, resulting in a 59% reduction in image size; credit [Daniel Thamdrup](https://github.com/dallemon).
|
||||
- Custom policies now support the `allow_algorithm_subset_and_reordering` directive to allow targets to pass with a subset and/or re-ordered list of host keys, kex, ciphers, and MACs. This allows for the creation of a baseline policy where targets can optionally implement stricter controls; partial credit [yannik1015](https://github.com/yannik1015).
|
||||
- Custom policies now support the `allow_larger_keys` directive to allow targets to pass with larger host keys, CA keys, and Diffie-Hellman keys. This allows for the creation of a baseline policy where targets can optionally implement stricter controls; partial credit [Damian Szuberski](https://github.com/szubersk).
|
||||
- Added 1 new key exchange algorithm: `gss-nistp384-sha384-*`.
|
||||
|
||||
### v3.1.0 (2023-12-20)
|
||||
|
|
|
@ -790,6 +790,9 @@ run_custom_policy_test "config2" "test15" "${PROGRAM_RETVAL_GOOD}"
|
|||
# Failing test with algorithm subset matching.
|
||||
run_custom_policy_test "config2" "test16" "${PROGRAM_RETVAL_FAILURE}"
|
||||
|
||||
# Passing test with larger key matching.
|
||||
run_custom_policy_test "config2" "test17" "${PROGRAM_RETVAL_GOOD}"
|
||||
|
||||
# Failing test for built-in OpenSSH 8.0p1 server policy (RSA host key size is 3072 instead of 4096).
|
||||
run_builtin_policy_test "Hardened OpenSSH Server v8.0 (version 4)" "8.0p1" "test1" "-o HostKeyAlgorithms=rsa-sha2-512,rsa-sha2-256,ssh-ed25519 -o KexAlgorithms=curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256 -o Ciphers=chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr -o MACs=hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com" "${PROGRAM_RETVAL_FAILURE}"
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ class Policy:
|
|||
self._dh_modulus_sizes: Optional[Dict[str, int]] = None
|
||||
self._server_policy = True
|
||||
self._allow_algorithm_subset_and_reordering = False
|
||||
self._allow_larger_keys = False
|
||||
self._errors: List[Any] = []
|
||||
|
||||
self._name_and_version: str = ''
|
||||
|
@ -114,7 +115,7 @@ class Policy:
|
|||
key = key.strip()
|
||||
val = val.strip()
|
||||
|
||||
if key not in ['name', 'version', 'banner', 'compressions', 'host keys', 'optional host keys', 'key exchanges', 'ciphers', 'macs', 'client policy', 'host_key_sizes', 'dh_modulus_sizes', 'allow_algorithm_subset_and_reordering'] and not key.startswith('hostkey_size_') and not key.startswith('cakey_size_') and not key.startswith('dh_modulus_size_'):
|
||||
if key not in ['name', 'version', 'banner', 'compressions', 'host keys', 'optional host keys', 'key exchanges', 'ciphers', 'macs', 'client policy', 'host_key_sizes', 'dh_modulus_sizes', 'allow_algorithm_subset_and_reordering', 'allow_larger_keys'] and not key.startswith('hostkey_size_') and not key.startswith('cakey_size_') and not key.startswith('dh_modulus_size_'):
|
||||
raise ValueError("invalid field found in policy: %s" % line)
|
||||
|
||||
if key in ['name', 'banner']:
|
||||
|
@ -209,6 +210,8 @@ class Policy:
|
|||
self._server_policy = False
|
||||
elif key == 'allow_algorithm_subset_and_reordering' and val.lower() == 'true':
|
||||
self._allow_algorithm_subset_and_reordering = True
|
||||
elif key == 'allow_larger_keys' and val.lower() == 'true':
|
||||
self._allow_larger_keys = True
|
||||
|
||||
if self._name is None:
|
||||
raise ValueError('The policy does not have a name field.')
|
||||
|
@ -296,9 +299,12 @@ name = "Custom Policy (based on %s on %s)"
|
|||
# The version of this policy (displayed in the output during scans). Not parsed, and may be any value, including strings.
|
||||
version = 1
|
||||
|
||||
# When false, host keys, kex, ciphers, and MAC lists must match exactly. When true, the target host may support a subset of the specified algorithms and/or algorithms may appear in a different order; this is useful for specifying a baseline and allowing some hosts the option to implement stricter controls.
|
||||
# When false, host keys, kex, ciphers, and MAC lists must match exactly. When true, the target host may support a subset of the specified algorithms and/or algorithms may appear in a different order; this feature is useful for specifying a baseline and allowing some hosts the option to implement stricter controls.
|
||||
allow_algorithm_subset_and_reordering = false
|
||||
|
||||
# When false, host keys, CA keys, and Diffie-Hellman key sizes must exactly match what's specified in this policy. When true, target systems are allowed to have larger keys; this feature is useful for specifying a baseline and allowing some hosts the option to implement stricter controls.
|
||||
allow_larger_keys = false
|
||||
|
||||
# The banner that must match exactly. Commented out to ignore banners, since minor variability in the banner is sometimes normal.
|
||||
# banner = "%s"
|
||||
|
||||
|
@ -367,11 +373,12 @@ macs = %s
|
|||
hostkey_types = list(self._hostkey_sizes.keys())
|
||||
hostkey_types.sort() # Sorted to make testing output repeatable.
|
||||
for hostkey_type in hostkey_types:
|
||||
expected_hostkey_size = self._hostkey_sizes[hostkey_type]['hostkey_size']
|
||||
expected_hostkey_size = cast(int, self._hostkey_sizes[hostkey_type]['hostkey_size'])
|
||||
server_host_keys = kex.host_keys()
|
||||
if hostkey_type in server_host_keys:
|
||||
actual_hostkey_size = server_host_keys[hostkey_type]['hostkey_size']
|
||||
if actual_hostkey_size != expected_hostkey_size:
|
||||
actual_hostkey_size = cast(int, server_host_keys[hostkey_type]['hostkey_size'])
|
||||
if (self._allow_larger_keys and actual_hostkey_size < expected_hostkey_size) or \
|
||||
(not self._allow_larger_keys and actual_hostkey_size != expected_hostkey_size):
|
||||
ret = False
|
||||
self._append_error('Host key (%s) sizes' % hostkey_type, [str(expected_hostkey_size)], None, [str(actual_hostkey_size)])
|
||||
|
||||
|
@ -387,7 +394,8 @@ macs = %s
|
|||
ret = False
|
||||
self._append_error('CA signature type', [expected_ca_key_type], None, [actual_ca_key_type])
|
||||
# Ensure that the actual and expected signature sizes match.
|
||||
elif actual_ca_key_size != expected_ca_key_size:
|
||||
elif (self._allow_larger_keys and actual_ca_key_size < expected_ca_key_size) or \
|
||||
(not self._allow_larger_keys and actual_ca_key_size != expected_ca_key_size):
|
||||
ret = False
|
||||
self._append_error('CA signature size (%s)' % actual_ca_key_type, [str(expected_ca_key_size)], None, [str(actual_ca_key_size)])
|
||||
|
||||
|
@ -446,7 +454,8 @@ macs = %s
|
|||
expected_dh_modulus_size = self._dh_modulus_sizes[dh_modulus_type]
|
||||
if dh_modulus_type in kex.dh_modulus_sizes():
|
||||
actual_dh_modulus_size = kex.dh_modulus_sizes()[dh_modulus_type]
|
||||
if expected_dh_modulus_size != actual_dh_modulus_size:
|
||||
if (self._allow_larger_keys and actual_dh_modulus_size < expected_dh_modulus_size) or \
|
||||
(not self._allow_larger_keys and actual_dh_modulus_size != expected_dh_modulus_size):
|
||||
ret = False
|
||||
self._append_error('Group exchange (%s) modulus sizes' % dh_modulus_type, [str(expected_dh_modulus_size)], None, [str(actual_dh_modulus_size)])
|
||||
|
||||
|
|
|
@ -62,7 +62,8 @@ class SSH2_KexDB: # pylint: disable=too-few-public-methods
|
|||
WARN_TAG_SIZE_96 = 'using small 96-bit tag size'
|
||||
|
||||
INFO_DEFAULT_OPENSSH_CIPHER = 'default cipher since OpenSSH 6.9'
|
||||
INFO_DEFAULT_OPENSSH_KEX_64_TO_89 = 'default key exchange from OpenSSH 6.4 to 8.9'
|
||||
INFO_DEFAULT_OPENSSH_KEX_65_TO_73 = 'default key exchange from OpenSSH 6.5 to 7.3'
|
||||
INFO_DEFAULT_OPENSSH_KEX_74_TO_89 = 'default key exchange from OpenSSH 7.4 to 8.9'
|
||||
INFO_DEFAULT_OPENSSH_KEX_90 = 'default key exchange since OpenSSH 9.0'
|
||||
INFO_DEPRECATED_IN_OPENSSH88 = 'deprecated in OpenSSH 8.8: https://www.openssh.com/txt/release-8.8'
|
||||
INFO_DISABLED_IN_DBEAR67 = 'disabled in Dropbear SSH 2015.67'
|
||||
|
@ -82,8 +83,8 @@ class SSH2_KexDB: # pylint: disable=too-few-public-methods
|
|||
# Format: 'algorithm_name': [['version_first_appeared_in'], [reason_for_failure1, reason_for_failure2, ...], [warning1, warning2, ...], [info1, info2, ...]]
|
||||
'kex': {
|
||||
'Curve25519SHA256': [[]],
|
||||
'curve25519-sha256': [['7.4,d2018.76'], [], [], [INFO_DEFAULT_OPENSSH_KEX_64_TO_89]],
|
||||
'curve25519-sha256@libssh.org': [['6.4,d2013.62,l10.6.0'], [], [], [INFO_DEFAULT_OPENSSH_KEX_64_TO_89]],
|
||||
'curve25519-sha256': [['7.4,d2018.76'], [], [], [INFO_DEFAULT_OPENSSH_KEX_74_TO_89]],
|
||||
'curve25519-sha256@libssh.org': [['6.4,d2013.62,l10.6.0'], [], [], [INFO_DEFAULT_OPENSSH_KEX_65_TO_73]],
|
||||
'curve448-sha512': [[]],
|
||||
'curve448-sha512@libssh.org': [[]],
|
||||
'diffie-hellman-group14-sha1': [['3.9,d0.53,l10.6.0'], [FAIL_SHA1], [WARN_2048BIT_MODULUS]],
|
||||
|
@ -223,7 +224,7 @@ class SSH2_KexDB: # pylint: disable=too-few-public-methods
|
|||
'null': [[], [FAIL_PLAINTEXT]],
|
||||
'pgp-sign-dss': [[], [FAIL_1024BIT_MODULUS]],
|
||||
'pgp-sign-rsa': [[], [FAIL_1024BIT_MODULUS]],
|
||||
'rsa-sha2-256': [['7.2']],
|
||||
'rsa-sha2-256': [['7.2,d2020.79']],
|
||||
'rsa-sha2-256-cert-v01@openssh.com': [['7.8']],
|
||||
'rsa-sha2-512': [['7.2']],
|
||||
'rsa-sha2-512-cert-v01@openssh.com': [['7.8']],
|
||||
|
@ -242,7 +243,7 @@ class SSH2_KexDB: # pylint: disable=too-few-public-methods
|
|||
'ssh-dss-sha256@ssh.com': [[], [FAIL_1024BIT_MODULUS]],
|
||||
'ssh-dss-sha384@ssh.com': [[], [FAIL_1024BIT_MODULUS]],
|
||||
'ssh-dss-sha512@ssh.com': [[], [FAIL_1024BIT_MODULUS]],
|
||||
'ssh-ed25519': [['6.5,l10.7.0']],
|
||||
'ssh-ed25519': [['6.5,d2020.79,l10.7.0']],
|
||||
'ssh-ed25519-cert-v01@openssh.com': [['6.5']],
|
||||
'ssh-ed448': [[]],
|
||||
'ssh-ed448-cert-v01@openssh.com': [[], [], [], [INFO_NEVER_IMPLEMENTED_IN_OPENSSH]],
|
||||
|
@ -335,7 +336,7 @@ class SSH2_KexDB: # pylint: disable=too-few-public-methods
|
|||
'cast128-ecb': [[], [FAIL_CAST], [WARN_CIPHER_MODE]],
|
||||
'cast128-ofb': [[], [FAIL_CAST], [WARN_CIPHER_MODE]],
|
||||
'chacha20-poly1305': [[], [], [], [INFO_DEFAULT_OPENSSH_CIPHER]],
|
||||
'chacha20-poly1305@openssh.com': [['6.5'], [], [], [INFO_DEFAULT_OPENSSH_CIPHER]],
|
||||
'chacha20-poly1305@openssh.com': [['6.5,d2020.79'], [], [], [INFO_DEFAULT_OPENSSH_CIPHER]],
|
||||
'crypticore128@ssh.com': [[], [FAIL_UNPROVEN]],
|
||||
'des-cbc': [[], [FAIL_DES], [WARN_CIPHER_MODE, WARN_BLOCK_SIZE]],
|
||||
'des-cfb': [[], [FAIL_DES], [WARN_CIPHER_MODE, WARN_BLOCK_SIZE]],
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
"algorithm": "curve25519-sha256",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||
]
|
||||
}
|
||||
|
@ -105,7 +105,7 @@
|
|||
"algorithm": "curve25519-sha256@libssh.org",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
[0;36m# key exchange algorithms[0m
|
||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
||||
[0;31m(kex) ecdh-sha2-nistp521 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||
[0;31m(kex) ecdh-sha2-nistp384 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"errors": [],
|
||||
"host": "localhost",
|
||||
"passed": true,
|
||||
"policy": "Docker policy: test17 (version 1)"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
Host: localhost:2222
|
||||
Policy: Docker policy: test17 (version 1)
|
||||
Result: [0;32m✔ Passed[0m
|
|
@ -40,7 +40,7 @@
|
|||
"notes": {
|
||||
"info": [
|
||||
"default cipher since OpenSSH 6.9",
|
||||
"available since OpenSSH 6.5"
|
||||
"available since OpenSSH 6.5, Dropbear SSH 2020.79"
|
||||
],
|
||||
"warn": [
|
||||
"vulnerable to the Terrapin attack (CVE-2023-48795), allowing message prefix truncation"
|
||||
|
@ -115,7 +115,7 @@
|
|||
"algorithm": "curve25519-sha256",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||
]
|
||||
}
|
||||
|
@ -124,7 +124,7 @@
|
|||
"algorithm": "curve25519-sha256@libssh.org",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||
]
|
||||
}
|
||||
|
@ -229,7 +229,7 @@
|
|||
"keysize": 3072,
|
||||
"notes": {
|
||||
"info": [
|
||||
"available since OpenSSH 7.2"
|
||||
"available since OpenSSH 7.2, Dropbear SSH 2020.79"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -264,7 +264,7 @@
|
|||
"algorithm": "ssh-ed25519",
|
||||
"notes": {
|
||||
"info": [
|
||||
"available since OpenSSH 6.5"
|
||||
"available since OpenSSH 6.5, Dropbear SSH 2020.79"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[0;36m# general[0m
|
||||
[0;32m(gen) banner: SSH-2.0-OpenSSH_8.0[0m
|
||||
[0;32m(gen) software: OpenSSH 8.0[0m
|
||||
[0;32m(gen) compatibility: OpenSSH 7.4+, Dropbear SSH 2018.76+[0m
|
||||
[0;32m(gen) compatibility: OpenSSH 7.4+, Dropbear SSH 2020.79+[0m
|
||||
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
||||
|
||||
[0;36m# security[0m
|
||||
|
@ -12,9 +12,9 @@
|
|||
|
||||
[0;36m# key exchange algorithms[0m
|
||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
||||
[0;31m(kex) ecdh-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||
[0;31m(kex) ecdh-sha2-nistp384 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||
|
@ -33,18 +33,18 @@
|
|||
|
||||
[0;36m# host-key algorithms[0m
|
||||
[0;32m(key) rsa-sha2-512 (3072-bit) -- [info] available since OpenSSH 7.2[0m
|
||||
[0;32m(key) rsa-sha2-256 (3072-bit) -- [info] available since OpenSSH 7.2[0m
|
||||
[0;32m(key) rsa-sha2-256 (3072-bit) -- [info] available since OpenSSH 7.2, Dropbear SSH 2020.79[0m
|
||||
[0;31m(key) ssh-rsa (3072-bit) -- [fail] using broken SHA-1 hash algorithm[0m
|
||||
`- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
|
||||
`- [info] deprecated in OpenSSH 8.8: https://www.openssh.com/txt/release-8.8
|
||||
[0;31m(key) ecdsa-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||
[0;33m `- [warn] using weak random number generator could reveal the key[0m
|
||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5[0m
|
||||
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79[0m
|
||||
|
||||
[0;36m# encryption algorithms (ciphers)[0m
|
||||
[0;33m(enc) chacha20-poly1305@openssh.com -- [warn] vulnerable to the Terrapin attack (CVE-2023-48795), allowing message prefix truncation[0m
|
||||
`- [info] available since OpenSSH 6.5
|
||||
`- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79
|
||||
`- [info] default cipher since OpenSSH 6.9
|
||||
[0;32m(enc) aes128-ctr -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52[0m
|
||||
[0;32m(enc) aes192-ctr -- [info] available since OpenSSH 3.7[0m
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
"notes": {
|
||||
"info": [
|
||||
"default cipher since OpenSSH 6.9",
|
||||
"available since OpenSSH 6.5"
|
||||
"available since OpenSSH 6.5, Dropbear SSH 2020.79"
|
||||
],
|
||||
"warn": [
|
||||
"vulnerable to the Terrapin attack (CVE-2023-48795), allowing message prefix truncation"
|
||||
|
@ -105,7 +105,7 @@
|
|||
"algorithm": "curve25519-sha256",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||
]
|
||||
}
|
||||
|
@ -114,7 +114,7 @@
|
|||
"algorithm": "curve25519-sha256@libssh.org",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||
]
|
||||
}
|
||||
|
@ -209,7 +209,7 @@
|
|||
"algorithm": "ssh-ed25519",
|
||||
"notes": {
|
||||
"info": [
|
||||
"available since OpenSSH 6.5"
|
||||
"available since OpenSSH 6.5, Dropbear SSH 2020.79"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[0;36m# general[0m
|
||||
[0;32m(gen) banner: SSH-2.0-OpenSSH_8.0[0m
|
||||
[0;32m(gen) software: OpenSSH 8.0[0m
|
||||
[0;32m(gen) compatibility: OpenSSH 7.4+, Dropbear SSH 2018.76+[0m
|
||||
[0;32m(gen) compatibility: OpenSSH 7.4+, Dropbear SSH 2020.79+[0m
|
||||
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
||||
|
||||
[0;36m# security[0m
|
||||
|
@ -12,9 +12,9 @@
|
|||
|
||||
[0;36m# key exchange algorithms[0m
|
||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
||||
[0;31m(kex) ecdh-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||
[0;31m(kex) ecdh-sha2-nistp384 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||
|
@ -32,12 +32,12 @@
|
|||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||
|
||||
[0;36m# host-key algorithms[0m
|
||||
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5[0m
|
||||
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79[0m
|
||||
[0;32m(key) ssh-ed25519-cert-v01@openssh.com (256-bit cert/256-bit ssh-ed25519 CA) -- [info] available since OpenSSH 6.5[0m
|
||||
|
||||
[0;36m# encryption algorithms (ciphers)[0m
|
||||
[0;33m(enc) chacha20-poly1305@openssh.com -- [warn] vulnerable to the Terrapin attack (CVE-2023-48795), allowing message prefix truncation[0m
|
||||
`- [info] available since OpenSSH 6.5
|
||||
`- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79
|
||||
`- [info] default cipher since OpenSSH 6.9
|
||||
[0;32m(enc) aes128-ctr -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52[0m
|
||||
[0;32m(enc) aes192-ctr -- [info] available since OpenSSH 3.7[0m
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
"notes": {
|
||||
"info": [
|
||||
"default cipher since OpenSSH 6.9",
|
||||
"available since OpenSSH 6.5"
|
||||
"available since OpenSSH 6.5, Dropbear SSH 2020.79"
|
||||
],
|
||||
"warn": [
|
||||
"vulnerable to the Terrapin attack (CVE-2023-48795), allowing message prefix truncation"
|
||||
|
@ -105,7 +105,7 @@
|
|||
"algorithm": "curve25519-sha256",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||
]
|
||||
}
|
||||
|
@ -114,7 +114,7 @@
|
|||
"algorithm": "curve25519-sha256@libssh.org",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||
]
|
||||
}
|
||||
|
@ -135,7 +135,7 @@
|
|||
"algorithm": "ssh-ed25519",
|
||||
"notes": {
|
||||
"info": [
|
||||
"available since OpenSSH 6.5"
|
||||
"available since OpenSSH 6.5, Dropbear SSH 2020.79"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[0;36m# general[0m
|
||||
[0;32m(gen) banner: SSH-2.0-OpenSSH_8.0[0m
|
||||
[0;32m(gen) software: OpenSSH 8.0[0m
|
||||
[0;32m(gen) compatibility: OpenSSH 7.4+, Dropbear SSH 2018.76+[0m
|
||||
[0;32m(gen) compatibility: OpenSSH 7.4+, Dropbear SSH 2020.79+[0m
|
||||
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
||||
|
||||
[0;36m# security[0m
|
||||
|
@ -12,18 +12,18 @@
|
|||
|
||||
[0;36m# key exchange algorithms[0m
|
||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
||||
[0;32m(kex) diffie-hellman-group-exchange-sha256 (4096-bit) -- [info] available since OpenSSH 4.4[0m
|
||||
[0;32m `- [info] OpenSSH's GEX fallback mechanism was triggered during testing. Very old SSH clients will still be able to create connections using a 2048-bit modulus, though modern clients will use 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).[0m
|
||||
|
||||
[0;36m# host-key algorithms[0m
|
||||
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5[0m
|
||||
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79[0m
|
||||
|
||||
[0;36m# encryption algorithms (ciphers)[0m
|
||||
[0;33m(enc) chacha20-poly1305@openssh.com -- [warn] vulnerable to the Terrapin attack (CVE-2023-48795), allowing message prefix truncation[0m
|
||||
`- [info] available since OpenSSH 6.5
|
||||
`- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79
|
||||
`- [info] default cipher since OpenSSH 6.9
|
||||
[0;32m(enc) aes256-gcm@openssh.com -- [info] available since OpenSSH 6.2[0m
|
||||
[0;32m(enc) aes128-gcm@openssh.com -- [info] available since OpenSSH 6.2[0m
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"notes": {
|
||||
"info": [
|
||||
"default cipher since OpenSSH 6.9",
|
||||
"available since OpenSSH 6.5"
|
||||
"available since OpenSSH 6.5, Dropbear SSH 2020.79"
|
||||
],
|
||||
"warn": [
|
||||
"vulnerable to the Terrapin attack (CVE-2023-48795), allowing message prefix truncation"
|
||||
|
@ -43,7 +43,7 @@
|
|||
"algorithm": "curve25519-sha256",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||
]
|
||||
}
|
||||
|
@ -52,7 +52,7 @@
|
|||
"algorithm": "curve25519-sha256@libssh.org",
|
||||
"notes": {
|
||||
"info": [
|
||||
"default key exchange from OpenSSH 6.4 to 8.9",
|
||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||
]
|
||||
}
|
||||
|
@ -75,7 +75,7 @@
|
|||
"algorithm": "ssh-ed25519",
|
||||
"notes": {
|
||||
"info": [
|
||||
"available since OpenSSH 6.5"
|
||||
"available since OpenSSH 6.5, Dropbear SSH 2020.79"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
[0;36m# general[0m
|
||||
[0;32m(gen) software: TinySSH noversion[0m
|
||||
[0;32m(gen) compatibility: OpenSSH 8.0-8.4, Dropbear SSH 2018.76+[0m
|
||||
[0;32m(gen) compatibility: OpenSSH 8.0-8.4, Dropbear SSH 2020.79+[0m
|
||||
[0;32m(gen) compression: disabled[0m
|
||||
|
||||
[0;36m# key exchange algorithms[0m
|
||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.4 to 8.9[0m
|
||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
||||
[0;33m(kex) sntrup4591761x25519-sha512@tinyssh.org -- [warn] using experimental algorithm[0m
|
||||
`- [info] available since OpenSSH 8.0
|
||||
`- [info] the sntrup4591761 algorithm was withdrawn, as it may not provide strong post-quantum security
|
||||
|
||||
[0;36m# host-key algorithms[0m
|
||||
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5[0m
|
||||
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79[0m
|
||||
|
||||
[0;36m# encryption algorithms (ciphers)[0m
|
||||
[0;33m(enc) chacha20-poly1305@openssh.com -- [warn] vulnerable to the Terrapin attack (CVE-2023-48795), allowing message prefix truncation[0m
|
||||
`- [info] available since OpenSSH 6.5
|
||||
`- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79
|
||||
`- [info] default cipher since OpenSSH 6.9
|
||||
|
||||
[0;36m# message authentication code algorithms[0m
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
# Docker policy: test17
|
||||
#
|
||||
|
||||
name = "Docker policy: test17"
|
||||
version = 1
|
||||
allow_larger_keys = true
|
||||
banner = "SSH-2.0-OpenSSH_8.0"
|
||||
compressions = none, zlib@openssh.com
|
||||
host keys = rsa-sha2-512, rsa-sha2-256, ssh-rsa, ecdsa-sha2-nistp256, ssh-ed25519
|
||||
key exchanges = curve25519-sha256, curve25519-sha256@libssh.org, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group-exchange-sha256, diffie-hellman-group16-sha512, diffie-hellman-group18-sha512, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1
|
||||
ciphers = chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com
|
||||
macs = umac-64-etm@openssh.com, umac-128-etm@openssh.com, hmac-sha2-256-etm@openssh.com, hmac-sha2-512-etm@openssh.com, hmac-sha1-etm@openssh.com, umac-64@openssh.com, umac-128@openssh.com, hmac-sha2-256, hmac-sha2-512, hmac-sha1
|
||||
host_key_sizes = {"ssh-rsa": {"hostkey_size": 2048}, "rsa-sha2-256": {"hostkey_size": 2048}, "rsa-sha2-512": {"hostkey_size": 2048}, "ssh-ed25519": {"hostkey_size": 256}}
|
||||
dh_modulus_sizes = {"diffie-hellman-group-exchange-sha256": 2048}
|
|
@ -297,7 +297,7 @@ macs = mac_alg1, mac_alg2, mac_alg3'''
|
|||
pol_data = pol_data.replace(date.today().strftime('%Y/%m/%d'), '[todays date]')
|
||||
|
||||
# Instead of writing out the entire expected policy--line by line--just check that it has the expected hash.
|
||||
assert hashlib.sha256(pol_data.encode('ascii')).hexdigest() == '4b504b799f6b964a20ccbe8af7edd26c7b5f0e0b98070e754ea41dccdace33b4'
|
||||
assert hashlib.sha256(pol_data.encode('ascii')).hexdigest() == 'fb84bce442cff2bce9bf653d6373a8a938e3bfcfbd1e876f51a08c1842df3cff'
|
||||
|
||||
|
||||
def test_policy_evaluate_passing_1(self):
|
||||
|
|
Loading…
Reference in New Issue