Hello, I have setup a bastion host with an IPA client in order to control access to the bastion host by groups. I have users in different groups, but I just got word that people outside the group / HBAC rule can access and login with their IPA credentials. Everything seems okay with the configuration. I have uninstalled and re-installed the client, generating a new SSSD config file, yet the user still accessing the bastion host. Thoughts?
Hi,
On Wed, May 10, 2023 at 1:37 PM Omar Pagan via FreeIPA-users < freeipa-users@lists.fedorahosted.org> wrote:
Hello, I have setup a bastion host with an IPA client in order to control access to the bastion host by groups. I have users in different groups, but I just got word that people outside the group / HBAC rule can access and login with their IPA credentials. Everything seems okay with the configuration. I have uninstalled and re-installed the client, generating a new SSSD config file, yet the user still accessing the bastion host. Thoughts?
Can you show the full list of hbac rules obtained with *ipa hbacrule-find*? You can also try to diagnose using for instance *ipa hbactest --user <user> --host <host>* *--service ssh* as it should show which rule allows access.
flo
FreeIPA-users mailing list -- freeipa-users@lists.fedorahosted.org To unsubscribe send an email to freeipa-users-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahoste... Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
from: ipa hbacrule-find ``` $ ipa hbacrule-find -------------------- 7 HBAC rules matched -------------------- Rule name: admins_allow_all Host category: all Service category: all Enabled: True
Rule name: allow_all User category: all Host category: all Service category: all Description: Allow all users to access any host from any host Enabled: True
Rule name: allow_systemd-user User category: all Host category: all Description: Allow pam_systemd to run user@.service to create a system user session Enabled: True
Rule name: cpaac-bastion Service category: all Description: Allow users to ssh into cpaac bastion Enabled: True
Rule name: darc_admins_hbac Service category: all Enabled: True
Rule name: deepcore-bastion Enabled: True
Rule name: shared-services-hbac Service category: all Description: HBAC for access to the shared-services host server group servers Enabled: True ---------------------------- Number of entries returned 7 ---------------------------- ```
for the test user: ``` $ ipa hbactest --user vi031827 --host cpaac-bastion --service ssh -------------------- Access granted: True -------------------- Matched rules: admins_allow_all Matched rules: allow_all Not matched rules: allow_systemd-user Not matched rules: cpaac-bastion Not matched rules: darc_admins_hbac Not matched rules: deepcore-bastion Not matched rules: shared-services-hbac ``` even though that user is not part of the `cpaac-bastion` rule, he is still getting access that's the one I don't get.
okay, I think the rule `Matched rules: allow_all` was causing the issue... I tested after disabling that rule and its working now. How can we close this ticket?
so, after disabling the `allow_all` I'm having issues... this user is allowed in the `deepcore-bastion` rule, but he's getting denied:
[root @ ldap01] ~ $ ipa hbactest --user gr031529 --host deepcore-bastion.uaap.maxar.com --service ssh --------------------- Access granted: False --------------------- Not matched rules: admins_allow_all Not matched rules: allow_systemd-user Not matched rules: cpaac-bastion Not matched rules: darc_admins_hbac Not matched rules: deepcore-bastion Not matched rules: shared-services-hbac
[root @ ldap01] ~ $ ipa hbacrule-show deepcore-bastion Rule name: deepcore-bastion Enabled: True User Groups: deepcore, amod-bastion Hosts: deepcore-bastion.uaap.maxar.com
[root @ ldap01] ~ $ ipa group-show amod-bastion Group name: amod-bastion Description: Group to allow users to ssh to the amod-bastion GID: 1571800140 Member users: gr031529, ma032574, om008569 Member of HBAC rule: deepcore-bastion
[root @ ldap01] ~ $ ipa hbactest --user gr031529 --host cpaac-bastion --service ssh -------------------- Access granted: True -------------------- Matched rules: allow_all Not matched rules: admins_allow_all Not matched rules: allow_systemd-user Not matched rules: cpaac-bastion Not matched rules: darc_admins_hbac Not matched rules: deepcore-bastion Not matched rules: shared-services-hbac
IPA doesn't seem to be recognizing the `deepcore-bastion` rule for any of the users... its only using the allow_all which at that point is not filtering by groups or rules, am I doing something wrong here?
Omar Pagan via FreeIPA-users wrote:
[root @ ldap01] ~ $ ipa hbacrule-show deepcore-bastion Rule name: deepcore-bastion Enabled: True User Groups: deepcore, amod-bastion Hosts: deepcore-bastion.uaap.maxar.com
[root @ ldap01] ~ $ ipa group-show amod-bastion Group name: amod-bastion Description: Group to allow users to ssh to the amod-bastion GID: 1571800140 Member users: gr031529, ma032574, om008569 Member of HBAC rule: deepcore-bastion
[root @ ldap01] ~ $ ipa hbactest --user gr031529 --host cpaac-bastion --service ssh
Access granted: True
Matched rules: allow_all Not matched rules: admins_allow_all Not matched rules: allow_systemd-user Not matched rules: cpaac-bastion Not matched rules: darc_admins_hbac Not matched rules: deepcore-bastion Not matched rules: shared-services-hbac
IPA doesn't seem to be recognizing the `deepcore-bastion` rule for any of the users... its only using the allow_all which at that point is not filtering by groups or rules, am I doing something wrong here?
I see two potential issues:
1. There isn't a service associated with the deepcore-bastion rule 2. The rule will only work on host deepcore-bastion.uaap.maxar.com and you're testing against cpaac-bastion
rob
[root @ ldap01] ~ $ ipa hbactest --user gr031529 --host deepcore-bastion.uaap.maxar.com --service ssh -------------------- Access granted: True -------------------- Matched rules: allow_all Not matched rules: admins_allow_all Not matched rules: allow_systemd-user Not matched rules: cpaac-bastion Not matched rules: darc_admins_hbac Not matched rules: deepcore-bastion Not matched rules: shared-services-hbac
[root @ ldap01] ~ $ ipa hbacrule-show deepcore-bastion Rule name: deepcore-bastion Enabled: True User Groups: deepcore, amod-bastion Hosts: deepcore-bastion.uaap.maxar.com HBAC Services: sshd
Even after adding the service to the rule, and testing against the correct host, it doesn't match the rule.
Hi,
On Mon, May 15, 2023 at 10:34 PM Omar Pagan via FreeIPA-users < freeipa-users@lists.fedorahosted.org> wrote:
[root @ ldap01] ~ $ ipa hbactest --user gr031529 --host deepcore-bastion.uaap.maxar.com --service ssh
The issue looks like a simple typo. Here the test is using *ssh* service...
Access granted: True
Matched rules: allow_all Not matched rules: admins_allow_all Not matched rules: allow_systemd-user Not matched rules: cpaac-bastion Not matched rules: darc_admins_hbac Not matched rules: deepcore-bastion Not matched rules: shared-services-hbac
[root @ ldap01] ~ $ ipa hbacrule-show deepcore-bastion Rule name: deepcore-bastion Enabled: True User Groups: deepcore, amod-bastion Hosts: deepcore-bastion.uaap.maxar.com HBAC Services: sshd
... but the rule is defined for *sshd* instead of *ssh*. HTH, flo
Even after adding the service to the rule, and testing against the correct host, it doesn't match the rule. _______________________________________________ FreeIPA-users mailing list -- freeipa-users@lists.fedorahosted.org To unsubscribe send an email to freeipa-users-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahoste... Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
freeipa-users@lists.fedorahosted.org