Should ssh-audit Scan for User Key Algorithms?
Maintainer thường phản hồi trong vòng 17 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start by reading the SSH authentication protocol details to determine whether user key signature algorithms can be discovered during an audit; the issue names no project files or tests. The examples show that host key algorithms do not establish which algorithms user authentication uses. Done would mean determining whether ssh-audit can reliably scan these algorithms and what information it can report.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I was recently working on a project where GoAnywhere Managed File Transfer was used as an SFTP file transfer client. I noticed a feature that I've never seen in a file transfer client before which is the ability to configure the RSA Key Signature Algorithm that's used when authentication is performed with an RSA key pair (instead of a password).
This got me thinking about something...
The algorithm that's used in conjunction with a host key is not necessarily the same as the algorithm that's used in conjunction with a user key (for authentication). So for example, on an OpenSSH server instance you may have disabled ssh-rsa being used in conjunction with host keys but it can probably still be used in conjunction with user keys.
The question I'm uncertain about is from a security perspective is should we care which algorithms can potentially be used by a client or server in conjunction with user keys? If we should care about this then is it possible for ssh-audit to scan for this?
My understanding is that host key algorithms are easy to identify because they're advertised as part of the Key Exchange Initalization (SSH_MSG_KEXINIT). But I'm uncertain whether the algorithms used in conjunction with user keys are so easily identifiable?
See examples below demonstrating the effect of changing the RSA Key Signature Algorithm value in GoAnywhere Managed File Transfer:
EXAMPLES
Example 1: OpenSSH 8.2p1 on Ubuntu 20.04 LTS using WSL2
To prove that the host key algorithms have no influence on the the algorithms used in conjunction with a user key, the only enabled host key algorithm on both the client and the server was ecdsa-sha2-nistp256, see ssh-audit excerpts below:
--------------------------------------------------------------------------------
Client
======
# host-key algorithms
(key) ecdsa-sha2-nistp256 -- [fail] using weak elliptic curves
`- [warn] using weak random number generator could reveal the key
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Server
======
# host-key algorithms
(key) ecdsa-sha2-nistp256 -- [fail] using weak elliptic curves
`- [warn] using weak random number generator could reveal the key
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
--------------------------------------------------------------------------------
I performed the following tests where you can see the influence that GoAnywhere's 'RSA Key Signature Algorithm' setting has in the logs produced by OpenSSH.
(NB: OpenSSH server's LogLevel was set to DEBUG3 in /etc/ssh/sshd_config)
Test 1: 'RSA Key Signature Algorithm' in GoAnywhere set to 'ssh-rsa'
thecliguy@SANDBOX:~$ sudo tail -f /var/log/auth.log | grep userauth_pubkey
Nov 2 20:58:16 SANDBOX sshd[1423]: debug2: userauth_pubkey: valid user thecliguy querying public key ssh-rsa REDACTED [preauth]
Nov 2 20:58:16 SANDBOX sshd[1423]: debug1: userauth_pubkey: test pkalg ssh-rsa pkblob RSA SHA256:REDACTED [preauth]
Nov 2 20:58:16 SANDBOX sshd[1423]: debug2: userauth_pubkey: authenticated 0 pkalg ssh-rsa [preauth]
Nov 2 20:58:16 SANDBOX sshd[1423]: debug2: userauth_pubkey: valid user thecliguy attempting public key ssh-rsa REDACTED [preauth]
Nov 2 20:58:16 SANDBOX sshd[1423]: debug3: userauth_pubkey: have ssh-rsa signature for RSA SHA256:REDACTED [preauth]
Nov 2 20:58:16 SANDBOX sshd[1423]: debug2: userauth_pubkey: authenticated 1 pkalg ssh-rsa [preauth]
Test 2: 'RSA Key Signature Algorithm' in GoAnywhere set to 'rsa-sha2-256'
thecliguy@SANDBOX:~$ sudo tail -f /var/log/auth.log | grep userauth_pubkey
Nov 2 20:58:47 SANDBOX sshd[1504]: debug2: userauth_pubkey: valid user thecliguy querying public key rsa-sha2-256 REDACTED [preauth]
Nov 2 20:58:47 SANDBOX sshd[1504]: debug1: userauth_pubkey: test pkalg rsa-sha2-256 pkblob RSA SHA256:REDACTED [preauth]
Nov 2 20:58:47 SANDBOX sshd[1504]: debug2: userauth_pubkey: authenticated 0 pkalg rsa-sha2-256 [preauth]
Nov 2 20:58:47 SANDBOX sshd[1504]: debug2: userauth_pubkey: valid user thecliguy attempting public key rsa-sha2-256 REDACTED [preauth]
Nov 2 20:58:47 SANDBOX sshd[1504]: debug3: userauth_pubkey: have rsa-sha2-256 signature for RSA SHA256:REDACTED [preauth]
Nov 2 20:58:47 SANDBOX sshd[1504]: debug2: userauth_pubkey: authenticated 1 pkalg rsa-sha2-256 [preauth]
Test 3: 'RSA Key Signature Algorithm' in GoAnywhere set to 'rsa-sha2-512'
thecliguy@SANDBOX:~$ sudo tail -f /var/log/auth.log | grep userauth_pubkey
Nov 2 20:59:34 SANDBOX sshd[1619]: debug2: userauth_pubkey: valid user thecliguy querying public key rsa-sha2-512 REDACTED [preauth]
Nov 2 20:59:34 SANDBOX sshd[1619]: debug1: userauth_pubkey: test pkalg rsa-sha2-512 pkblob RSA SHA256:REDACTED [preauth]
Nov 2 20:59:34 SANDBOX sshd[1619]: debug2: userauth_pubkey: authenticated 0 pkalg rsa-sha2-512 [preauth]
Nov 2 20:59:34 SANDBOX sshd[1619]: debug2: userauth_pubkey: valid user thecliguy attempting public key rsa-sha2-512 REDACTED [preauth]
Nov 2 20:59:34 SANDBOX sshd[1619]: debug3: userauth_pubkey: have rsa-sha2-512 signature for RSA SHA256:REDACTED [preauth]
Nov 2 20:59:34 SANDBOX sshd[1619]: debug2: userauth_pubkey: authenticated 1 pkalg rsa-sha2-512 [preauth]
Example 2: CompleteFTP on Windows 10
To prove that the host key algorithms have no influence on the the algorithms used in conjunction with a user key, the only enabled host key algorithm on both the client and the server was ecdsa-sha2-nistp256, see ssh-audit excerpts below:
--------------------------------------------------------------------------------
# Client
# host-key algorithms
(key) ecdsa-sha2-nistp256 -- [fail] using weak elliptic curves
`- [warn] using weak random number generator could reveal the key
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
# Server
# host-key algorithms
(key) ecdsa-sha2-nistp256 -- [fail] using weak elliptic curves
`- [warn] using weak random number generator could reveal the key
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
--------------------------------------------------------------------------------
I performed the following tests where you can see the influence that GoAnywhere's 'RSA Key Signature Algorithm' setting has in the Diagnostics.log produced by CompleteFTP. It appears as though CompleteFTP only supports ssh-rsa therefore using 'rsa-sha2-256' and 'rsa-sha2-512' fail.
(NB: CompleteFTP's sever logging level was set to All)
Test 1: 'RSA Key Signature Algorithm' in GoAnywhere set to 'ssh-rsa'
2021-11-02 21:06:25,607 DEBUG SSHAuthService [Session.37:Default Site.5022:user?:127.0.0.1] ProcessPacket pt=SSH_MSG_USERAUTH_REQUEST
2021-11-02 21:06:25,607 DEBUG SSHAuthService [Session.37:Default Site.5022:user?:127.0.0.1] Auth request - user=thecliguy, service=ssh-connection, method=publickey
2021-11-02 21:06:25,607 DEBUG UserManager [Session.37:Default Site.5022:user?:127.0.0.1] GetSpecifiedUser: user=thecliguy
2021-11-02 21:06:25,607 DEBUG UserManager [Session.37:Default Site.5022:user?:127.0.0.1] GetUserByID: user=fghsdfgb-34te-46fg-n3df-45dfg56dfdfg
2021-11-02 21:06:25,607 DEBUG UserManager [Session.37:Default Site.5022:user?:127.0.0.1] Retrieved user from cache: fghsdfgb-34te-46fg-n3df-45dfg56dfdfg
2021-11-02 21:06:25,607 DEBUG UserSession [Session.37:Default Site.5022:thecliguy:127.0.0.1] Session user set to 'thecliguy'
2021-11-02 21:06:25,607 DEBUG PublicKeyAuthentication [Session.37:Default Site.5022:thecliguy:127.0.0.1] Client sent RSA public key
Test 2: 'RSA Key Signature Algorithm' in GoAnywhere set to 'rsa-sha2-256'
2021-11-02 21:09:39,960 DEBUG SSHAuthService [Session.39:Default Site.5022:user?:127.0.0.1] ProcessPacket pt=SSH_MSG_USERAUTH_REQUEST
2021-11-02 21:09:39,960 DEBUG SSHAuthService [Session.39:Default Site.5022:user?:127.0.0.1] Auth request - user=thecliguy, service=ssh-connection, method=publickey
2021-11-02 21:09:39,960 DEBUG UserManager [Session.39:Default Site.5022:user?:127.0.0.1] GetSpecifiedUser: user=thecliguy
2021-11-02 21:09:39,960 DEBUG UserManager [Session.39:Default Site.5022:user?:127.0.0.1] GetUserByID: user=fghsdfgb-34te-46fg-n3df-45dfg56dfdfg
2021-11-02 21:09:39,960 DEBUG UserManager [Session.39:Default Site.5022:user?:127.0.0.1] Retrieved user from cache: fghsdfgb-34te-46fg-n3df-45dfg56dfdfg
2021-11-02 21:09:39,960 DEBUG UserSession [Session.39:Default Site.5022:thecliguy:127.0.0.1] Session user set to 'thecliguy'
2021-11-02 21:09:39,960 WARN PublicKeyAuthentication [Session.39:Default Site.5022:thecliguy:127.0.0.1] Unknown public key algorithm rsa-sha2-256
Test 3: 'RSA Key Signature Algorithm' in GoAnywhere set to 'rsa-sha2-512'
2021-11-02 21:12:46,215 DEBUG SSHAuthService [Session.41:Default Site.5022:user?:127.0.0.1] ProcessPacket pt=SSH_MSG_USERAUTH_REQUEST
2021-11-02 21:12:46,215 DEBUG SSHAuthService [Session.41:Default Site.5022:user?:127.0.0.1] Auth request - user=thecliguy, service=ssh-connection, method=publickey
2021-11-02 21:12:46,215 DEBUG UserManager [Session.41:Default Site.5022:user?:127.0.0.1] GetSpecifiedUser: user=thecliguy
2021-11-02 21:12:46,215 DEBUG UserManager [Session.41:Default Site.5022:user?:127.0.0.1] GetUserByID: user=fghsdfgb-34te-46fg-n3df-45dfg56dfdfg
2021-11-02 21:12:46,215 DEBUG UserManager [Session.41:Default Site.5022:user?:127.0.0.1] Retrieved user from cache: fghsdfgb-34te-46fg-n3df-45dfg56dfdfg
2021-11-02 21:12:46,215 DEBUG UserSession [Session.41:Default Site.5022:thecliguy:127.0.0.1] Session user set to 'thecliguy'
2021-11-02 21:12:46,215 WARN PublicKeyAuthentication [Session.41:Default Site.5022:thecliguy:127.0.0.1] Unknown public key algorithm rsa-sha2-512
- Ngôn ngữ chính
- Python
- Star
- 4.3k
- Fork
- 233
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jtesta/ssh-audit
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 17 ngày
-
Wrong algorithm recommendation for OpenSSH 10.6Có thể đã có người làm @rylena đã nhận 14 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
jtesta/ssh-audit#393 · 1 reaction ·
Maintainer thường phản hồi trong vòng 17 ngày
-
hardening guide: Debian 14Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 17 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 17 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 52/100
jtesta/ssh-audit#396 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 17 ngày
Tất cả issue của jtesta/ssh-audit
Issue tương tự
-
test_real_pandoc_failure_is_one_path_free_line fails on macOS CI with current Homebrew pandocĐang mởbug TAG: unit tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
learningequality/ricecooker#898 ·
-
task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
freelawproject/litigant-portal#1285 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
jmespath/jmespath.py#401 ·
-
least_squares returns a nonfinite objective for an invalid initial residualCó thể đã có người làm @sylvesterkaczmarek đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
google-deepmind/mujoco#4023 ·
Maintainer thường phản hồi trong vòng 11 ngày
-
Five Australian birds: Red-capped Parrot, Red-winged Fairywren, Gilbert’s Honeyeater, Western Spinebill, Western WattlebirdCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
arnegiacomo/fugleramme#427 ·
Maintainer thường phản hồi trong vòng 1 ngày