Skip to content

Commit f11b8a9

Browse files
committed
comprehensive sshd tests with Goss.
1 parent 82a002c commit f11b8a9

File tree

1 file changed

+55
-28
lines changed

1 file changed

+55
-28
lines changed
Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,96 @@
11
---
2+
23
file:
3-
/etc/issue:
4+
/etc/ssh/ssh_config:
45
exists: true
56
mode: "0644"
67
owner: root
78
group: root
89
filetype: file
9-
contains: []
10-
/etc/issue.net:
10+
contains:
11+
- HashKnownHosts yes
12+
/etc/ssh/ssh_host_ecdsa_key:
13+
exists: true
14+
mode: "0640"
15+
owner: root
16+
group: ssh_keys
17+
filetype: file
18+
contains:
19+
- '-----BEGIN EC PRIVATE KEY-----'
20+
- '-----END EC PRIVATE KEY-----'
21+
/etc/ssh/ssh_host_ecdsa_key.pub:
1122
exists: true
1223
mode: "0644"
1324
owner: root
1425
group: root
1526
filetype: file
16-
contains: []
17-
/etc/motd:
27+
contains:
28+
- 'ecdsa-sha2-nistp256 '
29+
/etc/ssh/ssh_host_ed25519_key:
30+
exists: true
31+
mode: "0640"
32+
owner: root
33+
group: ssh_keys
34+
filetype: file
35+
contains:
36+
- '-----BEGIN OPENSSH PRIVATE KEY-----'
37+
- '-----END OPENSSH PRIVATE KEY-----'
38+
/etc/ssh/ssh_host_ed25519_key.pub:
1839
exists: true
1940
mode: "0644"
2041
owner: root
2142
group: root
2243
filetype: file
23-
contains: []
24-
/etc/ssh/authorized_keys:
44+
contains:
45+
- 'ssh-ed25519 '
46+
/etc/ssh/ssh_host_rsa_key:
2547
exists: true
26-
mode: "0711"
48+
mode: "0640"
2749
owner: root
28-
group: root
29-
filetype: directory
30-
contains: []
31-
/etc/ssh/moduli:
50+
group: ssh_keys
51+
filetype: file
52+
contains:
53+
- '-----BEGIN RSA PRIVATE KEY-----'
54+
- '-----END RSA PRIVATE KEY-----'
55+
/etc/ssh/ssh_host_rsa_key.pub:
3256
exists: true
3357
mode: "0644"
3458
owner: root
3559
group: root
3660
filetype: file
37-
contains: []
61+
contains:
62+
- 'ssh-rsa '
3863
/etc/ssh/sshd_config:
3964
exists: true
4065
mode: "0600"
4166
owner: root
4267
group: root
4368
filetype: file
44-
contains: []
45-
package:
46-
firewalld:
47-
installed: true
69+
contains:
70+
- Ciphers aes256-ctr,aes192-ctr,aes128-ctr
71+
- HostKey /etc/ssh/ssh_host_rsa_key
72+
- HostKey /etc/ssh/ssh_host_ed25519_key
73+
- PasswordAuthentication no
74+
- PermitEmptyPasswords no
75+
- PermitRootLogin no
76+
- PermitUserEnvironment no
77+
- PrintLastLog yes
78+
- PubkeyAuthentication yes
79+
- UsePAM yes
4880
port:
49-
tcp:ftp:
50-
listening: false
51-
ip: []
52-
tcp:telnet:
53-
listening: false
54-
ip: []
81+
tcp:22:
82+
listening: true
83+
ip:
84+
- 0.0.0.0
5585
service:
56-
firewalld:
57-
enabled: true
58-
running: true
5986
sshd:
6087
enabled: true
6188
running: true
6289
user:
6390
sshd:
6491
exists: true
92+
uid: 74
93+
gid: 74
6594
groups:
6695
- sshd
6796
home: /var/empty/sshd
@@ -70,7 +99,5 @@ group:
7099
sshd:
71100
exists: true
72101
process:
73-
firewalld:
74-
running: true
75102
sshd:
76103
running: true

0 commit comments

Comments
 (0)