Commit Graph

79 Commits

Author SHA1 Message Date
Kevin Fenzi
cf5ca54701 ipa: exclude the ipa postgres user in favor of local one
We have a postgres user in ipa to prevent people from making an account
with that name, but we need/want to use a local version of this on
database servers, not the ipa one. We need the local one because the ipa
one is locked and this prevents database backups from working.
(Locked accounts can't run cron jobs).

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2023-06-07 16:52:25 -07:00
Kevin Fenzi
6720b82d01 ipa/client: try and sort this so it does not change from run to run
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2023-04-04 13:03:37 -07:00
Kevin Fenzi
4df0d9e28f ipa/client: hbac check Set this to not be changed since it's a check
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2023-04-04 13:02:46 -07:00
Kevin Fenzi
25484cc0a1 ipa / hbac: lower case sudo group
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2023-02-14 12:24:19 -08:00
Kevin Fenzi
e2a5be9575 put nolog back
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2023-02-13 15:39:35 -08:00
Kevin Fenzi
d943c375e6 temp disable nolog here to gather debugging info
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2023-02-13 15:21:40 -08:00
Kevin Fenzi
e42b099606 ipa / client: try not double delegating
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2023-02-13 15:12:51 -08:00
Kevin Fenzi
e2fdd2826a temp disable nolog here to gather debugging info
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2023-02-13 15:00:22 -08:00
Kevin Fenzi
527d8cda18 sssd: exclude rabbitmq user also
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-10-03 16:12:55 -07:00
Kevin Fenzi
3c960624f4 fas2: good bye! You served long and well
Remove fas2 and all the checks that depended on it.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-07-01 12:09:36 -07:00
Kevin Fenzi
35a977170e ipa: set nolog back on
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-05-19 17:11:23 -07:00
Kevin Fenzi
a8851731d0 Revert "Revert "ipa/client: temp remove nolog""
This reverts commit 04bd033a9b.
2022-05-19 11:05:34 -07:00
Kevin Fenzi
04bd033a9b Revert "ipa/client: temp remove nolog"
This reverts commit 6bb9f0a4ea.
2022-05-19 11:00:04 -07:00
Kevin Fenzi
6bb9f0a4ea ipa/client: temp remove nolog
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-05-19 10:58:23 -07:00
Kevin Fenzi
51e1424f5d ipa/client: add a debug for ipa_servers
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-05-19 10:01:19 -07:00
Kevin Fenzi
1a069052f0 ipa/client: add mirrormanager user/group to ipa excludes
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-07-16 08:15:15 -07:00
František Zatloukal
9f273622e0 Blockerbugs: force to use local user instead of the ipa one 2021-06-09 19:14:13 +02:00
Kevin Fenzi
48e22151ae ipa/client: flush handlers at the end of ipa/client
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-24 15:24:40 -07:00
Kevin Fenzi
cd50797995 ipa / client: actually install the ignore conf file as .conf instead of .conf.j2
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-24 14:54:35 -07:00
Kevin Fenzi
52a197735b ipa/client: split out these groups
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-22 10:36:20 -07:00
Kevin Fenzi
1c6dfc82fd ipa/client: no comment in this jinja2 sadly, just make this a normal comment
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-22 10:26:50 -07:00
Kevin Fenzi
24ae7d3d16 ipa / client: rework the excluded local users from sssd
There's a real user 'mock' who we want to allow on ipsilon (so they can
login to anything) and people02 (so they can get to their people space),
but no where else, since we ened the local mock user on places like
builders, etc.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-21 12:51:32 -07:00
Tomas Hrcka
fb395d74a2 Update sssd config to filter users bodhi and ftpsync
Signed-off-by: Tomas Hrcka <thrcka@redhat.com>
2021-05-13 20:59:17 +00:00
Kevin Fenzi
0cf61ae919 ipa / client: do not exclude mock ipa user on people02
We have a legit user who has the 'mock' account. So, we allow the ipa
one to override on people02 (since they have a shell account there), but
keep the filer everywhere else where we may run 'mock' the command.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-05 16:04:32 -07:00
Kevin Fenzi
8d20a480c2 ipa/client: add apache to ignore for sssd
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-04 14:34:22 -07:00
Kevin Fenzi
6e6dbc0581 ipa/client: ignore 'mock' ipa/fas user and use local one.
There's a actual legit person with a fas account of 'mock'
We don't want to use their account, we want to use the local mock user
instead.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-04 13:16:34 -07: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
Kevin Fenzi
cc736849e2 ipa/client: split out prod and stg ipa user/group ignore file
We need to also add mock to sssd ignore groups/users, but for now since
we are frozen, only do this in staging. After freeze, we should merge
this back into one file.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-04-08 17:15:51 -07:00
Nils Philippsen
05f399851e ipa/client: Don't apply hosts role on non-VPN hosts
We don't want a custom /etc/hosts installed on every host, so bring back
the conditional.

Improves commit 7a2024398f.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-04-02 00:13:18 +02:00
Nils Philippsen
7a2024398f hosts: do the right thing for VPN hosts
Move the vpn ./. base logic from the ipa/client role into the hosts
role, so that applying the latter doesn't apply the base profile on VPN
hosts.

Fixes: fedora-infrastructure#9822

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-04-01 16:31:59 +02:00
Kevin Fenzi
f3eb7ccaf8 ipa / client / sssd: ignore the named user in ipa as well to make named work on nameservers
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-03-31 17:09:02 -07:00
Stephen Smoogen
14d9cbde02 put the task in a job which will run on the right system 2021-03-27 12:40:47 -04:00
Stephen Smoogen
48dc00ae84 Add a deep clean which restarts sssd and then cleans the cache in case of major config file changes 2021-03-27 12:28:48 -04:00
Stephen Smoogen
f7519b408b Allow sssd to ignore special users
Currently /etc/nsswitch.conf has configurations like

passwd:     sss files
shadow:     files sss
group:      sss files

The problem is that to make sure that certain users could not be
created in IPA (like nobody root etc), they were already created but
in a restricted group. In order to allow sss to work for postfix, nfs,
nobody and such, the sssd.conf needs to ignore them in the nss
section. This adds a file which will do that.

Signed-off-by: Stephen Smoogen <smooge@smoogespace.com>
2021-03-27 12:20:35 -04:00
Nils Philippsen
f9abb293c0 ipa/client: only warn about essential vars missing
If either `ipa_client_shell_groups` and `ipa_client_sudo_groups` are
unset or empty, sysadmin-main will still be able to login and sudo.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-03-25 20:22:30 +00:00
Stephen Smoogen
a781368708 Add a --no-ssh to the ipa-client-install so that sshconfigs on clients are not altered.
Signed-off-by: Stephen Smoogen <smooge@smoogespace.com>
2021-03-25 11:37:24 -04:00
Nils Philippsen
46b3fb9390 ipa/client: Revamp combining shell groups
The previous implementation didn't work because of a chicken-and-egg
problem: To add the batcave shell groups to those specifically for
bastion, it needs to look them up, but they aren't set yet (probably
because `batcave` comes after `bastion`).

Now, one can (optionally) set `ipa_client_shell_groups_inherit_from`, a
list of Ansible group names whose `ipa_client_shell_groups` will be
combined with that of the host itself. This is more robust because it's
done late, after variables are set from the inventory.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-03-25 13:53:21 +01:00
Stephen Smoogen
34728c85cd put in clean up scripts to remove fas-client cron job which bollocks systems 2021-03-25 07:17:53 -04:00
Nils Philippsen
bcfe96b710 ipa/client: Enable VPN hosts to talk to IPA
This requires the canonical names of IPA servers to be mapped to their
IP addresses on the VPN as well as specifying the IPA server explicitly
when enrolling clients.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-03-24 18:19:11 +01:00
Nils Philippsen
28cc2e8d93 ipa/client: specify ipa server when enrolling VPN hosts
This is needed for clients that cannot access the internal DNS
where IPA servers are announced.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-03-24 18:18:55 +01:00
Nils Philippsen
23e6678997 ipa/client: cease masking tasks for prod hosts
Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-03-24 13:44:32 +01: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
b78fbabd71 ipa/client: repair nsswitch.conf post-FAS
The `fas_client` role installed a version of nsswitch.conf which doesn't
delegate to sss. For some reason, ipa-client-install doesn't ensure this
is brought back. This prepends `sss` to lines where it would be missing
otherwise. Also, run the cleanup tasks before the enrollment task.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-03-09 17:04:09 +00:00
Nils Philippsen
23a7607dab ipa/client: fix adding hosts to host groups
Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-03-09 17:54:29 +01:00
Nils Philippsen
c43010514c ipa/client: Fix warning about legacy vars
This needs to be run per every host in the play.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-03-05 17:12:32 +01:00
Nils Philippsen
c2530541f1 ipa/client: Ignore hosts still hooked up with FAS
This is necessary because:

- The ipa/client role is pulled in if only one host is in the play which
  uses it.
- The prepare-ipa-info tasks operate on all hosts in the play in order
  to gather together operations on the IPA server which would otherwise
  be (potentially, unnecessarily) repeated for many hosts in the play
  and which have to be serialized to avoid race conditions when changing
  data in IPA.

For now, we set `primary_auth_source` to `fas` for `all`, and to `ipa`
for the `staging` group. We can set this to `ipa` for individual host
groups in prod to enable this piece meal while we roll out the change.

Fixes: https://pagure.io/fedora-infrastructure/issue/9674

Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-02-22 10:26:00 -05: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
c394c808e6 ipa/client: Deal better with unset IPA variables
Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-02-16 15:37:12 +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