control sshd-14 fails on Amazon Linux#91
Open
jonasduarte wants to merge 1 commit intodev-sec:masterfrom
jonasduarte:master
Open
control sshd-14 fails on Amazon Linux#91jonasduarte wants to merge 1 commit intodev-sec:masterfrom jonasduarte:master
jonasduarte wants to merge 1 commit intodev-sec:masterfrom
jonasduarte:master
Conversation
…fig” with the value "/etc/ssh/ssh_host_rsa_key", causing the control sshd-14 to fail. To get it fixed I added a condition on the code block that set the valid_algorithms on the file ssh_crypto.rb, stating that when inspec.os[:name] returns ’amazon’, alg = alg53.
chris-rock
reviewed
Aug 16, 2017
| alg66 | ||
| end | ||
| when 'amazon' | ||
| alg = alg53 |
Member
There was a problem hiding this comment.
Do we need to distinguish between versions? I assume newer versions support the same as RHEL 7
Author
There was a problem hiding this comment.
I just checked the following version and all of them set the value "/etc/ssh/ssh_host_rsa_key" to the parameter HostKey on the file “/etc/ssh/sshd_config”. It seems to be the default to Amazon Linux.
Amazon Linux AMI release 2017.03
Amazon Linux AMI release 2016.03
Amazon Linux AMI release 2014.09
Amazon Linux AMI release 2012.09
Member
There was a problem hiding this comment.
@jonasduarte I checked this params on Amazon Linux AMI 2017.09.0.20170930 x86_64 HVM and this immages supports the alg66. I think we should distinguish between the version.
[ec2-user@ip-172-31-11-144 ~]$ ls -la /etc/ssh/sshd_config
-rw-r--r-- 1 root root 3934 Nov 1 09:25 /etc/ssh/sshd_config
[ec2-user@ip-172-31-11-144 ~]$ ls -la /etc/ssh/
total 620
drwxr-xr-x 2 root root 4096 Nov 1 09:25 .
drwxr-xr-x 78 root root 4096 Nov 1 09:25 ..
-rw-r--r-- 1 root root 581843 Aug 25 00:33 moduli
-rw-r--r-- 1 root root 2346 Aug 25 00:33 ssh_config
-rw-r--r-- 1 root root 3934 Nov 1 09:25 sshd_config
-rw------- 1 root root 668 Nov 1 09:25 ssh_host_dsa_key
-rw-r--r-- 1 root root 611 Nov 1 09:25 ssh_host_dsa_key.pub
-rw------- 1 root root 227 Nov 1 09:25 ssh_host_ecdsa_key
-rw-r--r-- 1 root root 183 Nov 1 09:25 ssh_host_ecdsa_key.pub
-rw-r----- 1 root ssh_keys 387 Nov 1 09:25 ssh_host_ed25519_key
-rw-r--r-- 1 root root 82 Nov 1 09:25 ssh_host_ed25519_key.pub
-rw------- 1 root root 1675 Nov 1 09:25 ssh_host_rsa_key
-rw-r--r-- 1 root root 403 Nov 1 09:25 ssh_host_rsa_key.pub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Amazon Linux set the parameter HostKey on the file “/etc/ssh/sshd_config” with the value "/etc/ssh/ssh_host_rsa_key", causing the control sshd-14 to fail.
To get it fixed I added a condition on the code block that set the valid_algorithms on the file ssh_crypto.rb, stating that when inspec.os[:name] returns ’amazon’, alg = alg53.