Commit graph

378 commits

Author SHA1 Message Date
Sebastian Gumprich
346ead4455 fix spelling
Signed-off-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
2024-05-30 15:07:27 +02:00
Sebastian Gumprich
f3a1fcc16a fix spelling
Signed-off-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
2024-05-30 15:01:33 +02:00
debbabi
00443de508
add ssh_pubkey_authentication variable (#749)
Signed-off-by: debbabi <dbassem@gmail.com>
2024-03-20 13:24:27 +01:00
schurzi
72eb74a85f Prettified Code! 2024-01-15 13:51:25 +00:00
Sebastian Gumprich
e5cc9bbf43 restructure readme to move known problems up top
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@telekom.de>
2024-01-12 09:30:48 +01:00
Martin Schurz
422fb940a9 manually fix remaining problems
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-12-06 15:27:21 +01:00
Martin Schurz
54f9ef42a1 don't try to restart audit in check mode
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-22 00:45:38 +01:00
Martin Schurz
25acb76c05 reload systemd after installation
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-21 23:59:22 +01:00
Martin Schurz
0f6b8e4a3a use full service name for handler
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-21 23:04:41 +01:00
Martin Schurz
20dd04c9cb split notify, add tmp options for arch
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-21 21:58:58 +01:00
Martin Schurz
60d10811d4 add separate handlers for audit restart
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-21 21:45:05 +01:00
Aki Kanellis
a15159d072 Make disabling unused filesystems idempotent
The `os_unused_filesystems` was lacking sorting, making the task not
idempotent. This was especially apparent and random in Molecule tests
when this collection was added as a dependency.

Signed-off-by: Aki Kanellis <hello@akikanellis.com>
2023-11-19 19:57:31 +00:00
dev-sec CI
2c91f89903 update nginx_hardening readme 2023-11-16 14:33:13 +00:00
dev-sec CI
9c848839d9 update mysql_hardening readme 2023-11-16 14:20:48 +00:00
dev-sec CI
1b69855d51 update os_hardening readme 2023-11-16 14:20:47 +00:00
dev-sec CI
512e31f1ae update ssh_hardening readme 2023-11-16 14:20:44 +00:00
Sebastian Gumprich
2db75b53c1
make it possible to configure more then yes and no for PermitTunnel (#715)
This is a breaking change, since the default variable is now a string instead of a bool

Signed-off-by: Sebastian Gumprich <sebastian.gumprich@telekom.de>
2023-11-16 15:20:22 +01:00
schurzi
0371a2690b Prettified Code! 2023-11-16 11:35:10 +00:00
Martin Schurz
adda83572a fix mixup, add custom test badge
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-16 12:10:41 +01:00
Martin Schurz
01bde49fbc update badges
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-16 11:30:38 +01:00
schurzi
3d98cbf67b
add testing and support for current versions of Fedora and FreeBSD (#709)
* add testing and support for current versions of Fedora and FreeBSD

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* add waivers for FreeBSD

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* use original fedora images

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* also harden /home mount

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* also harden /tmp mount

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* test mock efi directory

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* remove mock

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* umount efi

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* add /tmp to special mountpoints

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* set options for /tmp mount

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* create /tmp mount

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* create /tmp mount and mount it ...

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* make fewer changes to default test run

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* use correct Ansible var

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

---------

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-16 09:14:03 +01:00
Martin Schurz
bf177add07 one last time ...
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:37:26 +01:00
Martin Schurz
fb22b242fe better compare for utf8
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:37:25 +01:00
Martin Schurz
0c8c96a535 collate for opensuse
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:37:25 +01:00
Martin Schurz
2f5360225b extend role check
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:37:25 +01:00
Martin Schurz
35df355248 add tests for roles
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:37:25 +01:00
Martin Schurz
ec8811acdf use like to coerce collation
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:37:25 +01:00
Martin Schurz
6681e0b319 correct query
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:37:25 +01:00
Martin Schurz
79dc1d5474 check mode for status var
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:37:25 +01:00
Martin Schurz
8f516018b6 trigger workflow
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:37:25 +01:00
Martin Schurz
216b56f468 lint
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:36:26 +01:00
Martin Schurz
36715017d7 use separate task for role detection
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-11 15:36:26 +01:00
Martin Schurz
2c18d3afda use if for role detection
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
2023-11-11 15:34:34 +01:00
Sebastian Gumprich
bd721317d2 try to fix IS_ROLE
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
2023-11-11 15:34:34 +01:00
Sebastian Gumprich
92e6cad463 try to fix IS_ROLE
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
2023-11-11 15:34:34 +01:00
Sebastian Gumprich
66adae0faa try to fix IS_ROLE
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
2023-11-11 15:34:34 +01:00
Sebastian Gumprich
dc583422bc try to fix IS_ROLE
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
2023-11-11 15:34:33 +01:00
Sebastian Gumprich
4c5a5deec6 try to fix IS_ROLE
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
2023-11-11 15:34:33 +01:00
Sebastian Gumprich
a6892904bf try to fix IS_ROLE
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
2023-11-11 15:34:33 +01:00
Sebastian Gumprich
8d5143b5d7 try to fix IS_ROLE
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
2023-11-11 15:34:33 +01:00
Sebastian Gumprich
0bf528d83b do not try to drop roles in mysql hardening
There's a new feature in mariadb 10.1 (https://mariadb.org/grant-to-public-in-mariadb/) and mysql 8 (need to verify).

    MariaDB has quite a complex privilege system. Most of it is based on the SQL Standard spec; however we do have some specific MariaDB extensions. GRANT ... TO PUBLIC (MDEV-5215) is a standard feature that is now available as a preview in MariaDB 10.11.0. It is related to ROLES and DEFAULT ROLE, but it covers a different use case.

    ROLES are effectively “privilege packages” that you can enable and disable as a user. One can also set which “privilege package” will be enabled at connect time by setting a DEFAULT ROLE per user. This is all quite useful, however it is missing one key feature. For a DBA, it would be quite useful to state only once that all users need to have a certain set of privileges. This is where GRANT ... TO PUBLIC comes in.

Some more information here: https://mariadb.org/wp-content/uploads/2018/07/MariaDB-Roles-Tampere-Unconference-2018.pdf

This role is shown as a user, it has however a new is_role-flag.

MariaDB [(none)]> select user, host, is_role from mysql.user;
+-----------------------+-----------+---------+
| User                  | Host      | is_role |
+-----------------------+-----------+---------+
| mariadb.sys           | localhost | N       |
| root                  | localhost | N       |
| mysql                 | localhost | N       |
| PUBLIC                |           | Y       |
| monitoring            | %         | N       |
| monitoring            | localhost | N       |
| galera_mariadb_backup | %         | N       |
+-----------------------+-----------+---------+

Since this "user" does not have a password or authentication_string, the ansible-role tries to delete it but fails.

Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
2023-11-11 15:34:33 +01:00
schurzi
da017fa880
Gather facts when os_hardening role is executed with tags (#708)
* Gather facts when os_hardening role is executed with tags

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* better when condition

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

---------

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-11-01 15:54:52 +01:00
dev-sec CI
ac7ef8aae6 update os_hardening readme 2023-10-26 08:43:45 +00:00
dev-sec CI
27a1f6e5e8 update ssh_hardening readme 2023-10-26 08:43:40 +00:00
dev-sec CI
e84b407c44 update nginx_hardening readme 2023-10-26 08:43:39 +00:00
Moritz
8252b82764
fix: roles-readme action default value (#706)
* fix: default value for push-branch

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* docs(ssh_hardening): meta arguments desc

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: split checkout for forked repos in pull requests

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: push not on pr and added diff

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

---------

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
2023-10-26 10:43:10 +02:00
Moritz
1b0576695e
feat: workflow for roles readme (#705)
* chore: added aar_doc config

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* feat: added initial state of roles readme workflow

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: runs on

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: install poetry

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* feat: loop over all roles and install peotry with pip

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: working dir for poetry run

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: cli path

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* chore: scale down matrix loop for testing

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: poetry run for py execution command

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: work dir for poetry run

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: cli.py path

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: roles path

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* feat: push readme

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: on push branch master

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: uncomment other roles

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* chore: limit trigger to master and arguments

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: push branch name

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* refactor: simplify steps

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* style: linting and styling

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* chore: trigger for pull request

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: push only if ref is master

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* chore: output diff of generated README

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: push readme in pull request

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* docs: role var description text

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: aar_doc roles path

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: git diff

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: fetch all history and changed diff branch

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: run diff only for pr

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: remove fetch-depth and switch to normal diff

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: remove diff and set push-branch

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: head_ref with default ref_name for push-branch

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

---------

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
2023-10-25 15:10:02 +02:00
rndmh3ro
a08a057f7b Prettified Code! 2023-10-23 10:24:09 +00:00
Sebastian Gumprich
787ac9bd54
fix some wrong defaults and types in the readmes (#703)
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@telekom.de>
2023-10-23 12:23:49 +02:00
schurzi
9c2f12561a
update links to new Ansible Galaxy (#702)
* update links to new Ansible Galaxy

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

* remove dead link

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>

---------

Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
2023-10-16 20:56:13 +02:00