Commit Graph

14 Commits

Author SHA1 Message Date
Kevin Fenzi
9af79d19ee handlers: fix another name change
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-01-24 14:11:11 -08:00
Kevin Fenzi
6e1ab9cd21 ipa / client: setup nopasswd sudo groups for maintainer test
For the maintainer_tests instances we just want to allow anyone with
shell access ability to sudo with no password. In this case asking for
password/tokens could provide a MITM attack vector. This matches up with
the way they were setup before with fas2.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-04-21 16:18:47 +00:00
Nils Philippsen
3abcb2d011 ipa/client: clean sss caches on changes
SSSD caches information, some types for hours by default. When changing
anything in IPA pertaining to a host this role is applied to, clean out
the caches on the host so the changes are effective immediately.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-03-19 09:27:51 +00:00
Nils Philippsen
2e6819354f ipa/client: Don't trip over undefined group vars
With set_facts, if an element of a list is undefined, the containing
fact variable becomes a string. Something Sirius Cybernetics Corporation
something something.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-02-16 19:20:29 +01:00
Nils Philippsen
109865606a ipa/client: Don't divulge secrets
The `ipa_server_admin_passwords` contains the passwords of the admin
users of all IPA servers affected in a play. Don't loop over them
directly to avoid divulging them in the logs or on the console.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-02-16 14:19:04 +01:00
Nils Philippsen
5521d83040 ipa/client: Deal with hosts without IPA settings
Don't attempt to loop over undefined variables. This can happen if the
relevant `ipa_*` variables aren't defined for any host in the play.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-02-16 14:16:40 +01:00
Nils Philippsen
193aefa78e ipa/client: Don't log IPA admin password
Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-02-12 18:18:26 +01:00
Nils Philippsen
3d1c5218f7 ipa/client: Combine operations on the IPA server
The reason for this is to avoid having to do the same or similar things
over and over again for each host in the play, especially since these
operations are delegated to the IPA server, i.e. had to run sequentially
host after host in order to avoid race conditions.

To achieve this, the IPA client related group variables are prepared in
suitable structures in `prepare-ipa-info.yml` and consumed by
`common.yml`, `hbac.yml` and `sudo.yml`, which do most operations in one
go per e.g. host group on the affected IPA server(s).

Additionally:
- Remove compat for legacy `fas_client_groups`, only check for its
  presence and warn.
- Remove the prepared but masked out task to manage password-less sudo
  access.
- Make yamllint a little happier on the changed files.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-02-12 14:25:25 +00:00
Nils Philippsen
705b35530e ipa/client: Disable password-less sudo task
Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-01-22 17:39:28 +01:00
Nils Philippsen
d48d5c00b8 ipa/client: Use host groups for HBAC and sudo rules
Creating individual HBAC and sudo rules in IPA would quickly become
unwieldy.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-01-22 16:05:16 +00:00
Nils Philippsen
17174c37b9 ipa/client: Make checking for groups more robust
The `ipa` command needs a valid Kerberos ticket for the IPA admin user
which might be present or not. This probably worked most of the time
because other tasks in the playbook acquired a ticket as a side effect.

Use `getent group ...` instead which doesn't query IPA directly. This
has the additional benefit that it verifies the groups in question are
POSIX groups, which is what we want for shell access and sudo.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-01-22 16:05:16 +00:00
Nils Philippsen
8f453535dc ipa/client: Improve naming HBAC, sudo rules
Rename:
- "group/sysadmin-main" to "usergroup/sysadmin-main" to prepare for
  using host groups
- "sudo/all" to "all-users/sudo" likewise to make it apparent that it's
  about users and to put the resource last to which access is granted

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-01-22 16:05:16 +00:00
Nils Philippsen
71e625c0fd ipa/client: Set config tag in main playbook
This avoids having to add the tag to every individual task (or
forgetting it).

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-01-22 16:05:16 +00:00
Nils Philippsen
295564bfbc ipa/client: add site-wide & host-based sudo rules
This also uses HBAC to let all IPA accounts use the sudo command, so
what some user or group may use it for just has to be configured with
sudo rules in IPA.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-01-21 10:21:16 +00:00