Commit graph

27 commits

Author SHA1 Message Date
schurzi
8e4c22d8d9
remove FQCN from roles in examples (#404)
Ansible does not work with FQCN and collections sepcified for including
roles. It is currently expecting to only get the role name in this
context.

Verified with Ansible 2.10.5

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
2021-02-17 11:34:37 +01:00
Martin Schurz
64713ce75d add default for new variable
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
2021-02-15 11:17:01 +01:00
Maxim Burgerhout
54c8e6aedb Split off ssh_gssapi_delegation into own variable
Signed-off-by: Maxim Burgerhout <maxim@wzzrd.com>
2021-02-14 22:07:33 +01:00
Maxim Burgerhout
8baab7516e Extend GSSAPI configuration support to ssh_config
Previously, the ssh_gssapi_support variable only toggled the GSSAPI
settings in sshd_config.

Through this change, setting ssh_gssapi_support to true also enables
support in ssh_config.

It enables both authentication and credential delegation.

Signed-off-by: Maxim Burgerhout <maxim@wzzrd.com>
2021-02-12 13:10:35 +01:00
Norman Ziegner
f035053381
Only set default for ssh host key files when hardening the server (#393)
Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
2021-02-09 10:01:41 +01:00
Norman Ziegner
614662b99d
Add variable to specify host rsa key size (#394)
Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
2021-02-09 09:44:55 +01:00
schurzi
4b0819349d
use fqcn for community.crypto.openssh_keypair module (#389)
tihis fixes a problem with Ansible 2.9 where the default openssh_keypair
is not supporting every option we need

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
2021-02-05 19:44:23 +01:00
Maximilian Praeger
4399d3f885 removed: unneccessary conditional
Signed-off-by: Maximilian Praeger <mpraeger@users.noreply.github.com>
2021-01-22 07:24:54 +01:00
Maximilian Praeger
6b55b9619c added: comment for HostCertificate
Signed-off-by: Maximilian Praeger <mpraeger@users.noreply.github.com>
2021-01-22 07:24:54 +01:00
Maximilian Praeger
8f7bae533c fixed: add empty line after HostCertificate loop
Signed-off-by: Maximilian Praeger <mpraeger@users.noreply.github.com>
2021-01-22 07:24:54 +01:00
Maximilian Praeger
9853c7ea45 added: defaults for ssh_host_certificates
Signed-off-by: Maximilian Praeger <mpraeger@users.noreply.github.com>
2021-01-22 07:24:54 +01:00
Maximilian Praeger
6e9247bde3 added: support for HostCertificate in sshd conf file
Signed-off-by: Maximilian Praeger <mpraeger@users.noreply.github.com>
2021-01-22 07:24:53 +01:00
Sina Tak Tehrani
ef31838fa2
Regenerate RSA key with size 4096 bits (#376)
* regenerate RSA key with size 4096 bits

Signed-off-by: Sina Tak Tehrani <ssttehrani@gmail.com>

* fixed lint problem

Signed-off-by: Sina Tak Tehrani <ssttehrani@gmail.com>

* fixed E301 lint error

Signed-off-by: Sina Tak Tehrani <ssttehrani@gmail.com>

* added host keys related vars

Signed-off-by: Sina Tak Tehrani <ssttehrani@gmail.com>

* used openssh_keypair module

Signed-off-by: Sina Tak Tehrani <ssttehrani@gmail.com>

* changed RSA private key mode to 0640

Signed-off-by: Sina Tak Tehrani <ssttehrani@gmail.com>

* specified condition to prevent wrong file mode on debian-based OS

Signed-off-by: Sina Tak Tehrani <ssttehrani@gmail.com>
2021-01-21 13:38:48 +01:00
Martin Schurz
0600cdae75 add "role" to comment
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
2021-01-20 11:23:40 +01:00
Farid Joubbi
254b62d980 Added comment on top of template about which role modified the resulting file. https://github.com/dev-sec/ansible-collection-hardening/issues/345
Signed-off-by: Farid Joubbi <farid@joubbi.se>
2021-01-19 14:05:33 +01:00
schurzi
d83ad9e6a9
Merge pull request #368 from dev-sec/max_startups
reduce maximum unauthenticated ssh sessions
2021-01-11 20:49:29 +01:00
Farid Joubbi
5675589e01
Sorted sysctl values and lists in READMEs alphabetically (No functional changes). (#371)
* Add s's for consistency.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Sort lists alphabetically.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Sorted sysctl_config alphabetically.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Sort removed protocols.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Added dots in variable descriptions for the sake of consistency.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Added dots in variable descriptions for the sake of consistency.

Signed-off-by: Farid Joubbi <farid@joubbi.se>
2021-01-08 20:45:50 +01:00
Martin Schurz
168af7fb6f reduce maximum unauthenticated ssh sessions
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
2021-01-03 00:21:26 +01:00
schurzi
a75e2c028b
change inclusion of os specific defaults (#353)
* change inclusion of os specific defaults

we now include the os specific options into a separate variable and
merge this with the default ansible namespace, when the corresponding
keys do not already exist (eg. are defined by default oder by user)

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* simplify check for os specific variables

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* add test for variable override

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* move tests to verify stage

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* correct grep

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* linting

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* fix typo

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* Revert "Merge pull request #351 from sprat/fix-umask"

This reverts commit 9e8e0bc8fb, reversing
changes made to 98c7553016.

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* move immutable ssh vars to internal vars

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* move vars to OS files

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* change default handling for all roles

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* fix issues

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* add documentation

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>

* Update main.yml

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
2020-12-20 20:46:57 +01:00
Farid Joubbi
83e29b01f5
Removed Protocol statement in later versions of sshd, since the code … (#342)
* Removed Protocol statement in later versions of sshd, since the code for SSH-1 has been removed in sshd.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Prettified the generated ssh_config. No functional changes, removed spaces and orphan comments.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Removed Protocol statement in later versions of sshd, since the code for SSH-1 has been removed in sshd.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Removed blank lines and prettified ssh_config.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Added note about setting sshd_authenticationmethods if ssh_server_password_login.

Signed-off-by: Farid Joubbi <farid@joubbi.se>

* Backticked true.

Signed-off-by: Farid Joubbi <farid@joubbi.se>
2020-12-16 19:29:33 +01:00
Sylvain Prat
43ec139d24
Fix #348: make ssh configuration files paths configurable (#350)
Signed-off-by: Sylvain Prat <sylvain.prat@gmail.com>
2020-12-16 19:24:44 +01:00
Farid Joubbi
91424ac209
Improvements of comments in opensshd.conf.j2 #338 (#339)
* Fixed some comments that had issues. See #338

* Cut some long comments into two rows for easier reading.

Signed-off-by: joubbi <farid@joubbi.se>
2020-12-12 20:35:38 +01:00
szEvEz
13b09a0f23
Improve README for ssh_hardening (#335)
Signed-off-by: szEvEz <szivos.john@gmail.com>
2020-11-24 12:29:46 +01:00
Sebastian Gumprich
d857830979 minor readme fixes
Signed-off-by: Sebastian Gumprich <github@gumpri.ch>
2020-11-09 20:49:07 +01:00
rndmh3ro
c94d973527 Prettified Code! 2020-11-08 10:20:25 +00:00
Sebastian Gumprich
c8ada5c13c Merge branch 'migrate_os' into collection 2020-11-08 11:18:38 +01:00
Sebastian Gumprich
a46642ee92 merge ssh-hardening role into collection 2020-11-07 21:46:45 +01:00