|
48 | 48 | end
|
49 | 49 |
|
50 | 50 | it 'disables weak kexs' do
|
| 51 | + expect(chef_run).not_to render_file('/etc/ssh/ssh_config') |
| 52 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group14-sha1\b/) |
| 53 | + expect(chef_run).not_to render_file('/etc/ssh/ssh_config') |
| 54 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group-exchange-sha1\b/) |
51 | 55 | expect(chef_run).not_to render_file('/etc/ssh/ssh_config')
|
52 | 56 | .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group1-sha1\b/)
|
53 | 57 | end
|
|
102 | 106 | end
|
103 | 107 |
|
104 | 108 | it 'allows weak kexs on the client' do
|
| 109 | + expect(chef_run).to render_file('/etc/ssh/ssh_config') |
| 110 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group14-sha1\b/) |
| 111 | + expect(chef_run).to render_file('/etc/ssh/ssh_config') |
| 112 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group-exchange-sha1\b/) |
105 | 113 | expect(chef_run).to render_file('/etc/ssh/ssh_config')
|
106 | 114 | .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group1-sha1\b/)
|
107 | 115 | end
|
|
119 | 127 | end
|
120 | 128 |
|
121 | 129 | it 'does not allow weak kexs on the client' do
|
| 130 | + expect(chef_run).not_to render_file('/etc/ssh/ssh_config') |
| 131 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group14-sha1\b/) |
| 132 | + expect(chef_run).not_to render_file('/etc/ssh/ssh_config') |
| 133 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group-exchange-sha1\b/) |
122 | 134 | expect(chef_run).not_to render_file('/etc/ssh/ssh_config')
|
123 | 135 | .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group1-sha1\b/)
|
124 | 136 | end
|
|
170 | 182 | end
|
171 | 183 |
|
172 | 184 | it 'still does not allow weak kexs' do
|
| 185 | + expect(chef_run).not_to render_file('/etc/ssh/ssh_config') |
| 186 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group14-sha1\b/) |
| 187 | + expect(chef_run).not_to render_file('/etc/ssh/ssh_config') |
| 188 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group-exchange-sha1\b/) |
173 | 189 | expect(chef_run).not_to render_file('/etc/ssh/ssh_config')
|
174 | 190 | .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group1-sha1\b/)
|
175 | 191 | end
|
|
194 | 210 | end
|
195 | 211 |
|
196 | 212 | it 'allows weak kexs on the client' do
|
| 213 | + expect(chef_run).to render_file('/etc/ssh/ssh_config') |
| 214 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group14-sha1\b/) |
| 215 | + expect(chef_run).to render_file('/etc/ssh/ssh_config') |
| 216 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group-exchange-sha1\b/) |
197 | 217 | expect(chef_run).to render_file('/etc/ssh/ssh_config')
|
198 | 218 | .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group1-sha1\b/)
|
199 | 219 | end
|
|
235 | 255 | end
|
236 | 256 |
|
237 | 257 | it 'still does not allow weak kexs' do
|
| 258 | + expect(chef_run).not_to render_file('/etc/ssh/ssh_config') |
| 259 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group14-sha1\b/) |
| 260 | + expect(chef_run).not_to render_file('/etc/ssh/ssh_config') |
| 261 | + .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group-exchange-sha1\b/) |
238 | 262 | expect(chef_run).not_to render_file('/etc/ssh/ssh_config')
|
239 | 263 | .with_content(/KexAlgorithms [^#]*\bdiffie-hellman-group1-sha1\b/)
|
240 | 264 | end
|
|
0 commit comments