s_schultchen

IPA HBAC problems

Jul 1st, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. # this is the group (and ad mapping group) of the test user:
  2.  
  3. [[email protected] ~]$ ipa group_show 'org_-_uk_core_it'
  4. Group name: org_-_uk_core_it
  5. GID: 1517232518
  6. Member groups: org_-_uk_core_it_external
  7. Member of Sudo rule: org_-_uk_core_it|auto_r_etcd_test|all
  8. Member of HBAC rule: test_user_test, systems_datacenter|all|all
  9.  
  10. [[email protected] ~]$ ipa group_show 'org_-_uk_core_it_external'
  11. Group name: org_-_uk_core_it_external
  12. External member: org - uk core [email protected]
  13. Member of groups: org_-_uk_core_it
  14. Indirect Member of Sudo rule: org_-_uk_core_it|auto_r_etcd_test|all
  15. Indirect Member of HBAC rule: test_user_test, systems_datacenter|all|all
  16.  
  17. # this is the new HBAC rule.
  18.  
  19. [[email protected] ~]$ ipa hbacrule_show test_user_test
  20. Rule name: test_user_test
  21. Host category: all
  22. Enabled: TRUE
  23. User Groups: org_-_uk_core_it
  24. Services: sshd, sudo, sudo-i
  25.  
  26. # This is an old HBAC rule
  27. [[email protected] ~]$ ipa hbacrule_show 'systems_datacenter|all|all'
  28. Rule name: systems_datacenter|all|all
  29. Host category: all
  30. Enabled: TRUE
  31. User Groups: ad_org_-_unix_team
  32. Services: sshd, sudo, sudo-i
  33.  
  34.  
  35. # hbactest finds no rule that would allow [email protected] to access etcdtest-2.test.nj.dc.linux.example.com
  36. [[email protected] ~]$ ipa hbactest --user [email protected] --host etcdtest-2.test.nj.dc.linux.example.com --service sshd |egrep '(Access granted|Matched rules)'
  37. Access granted: False
  38.  
  39. # if specifing --rules test_user_test hbactest recongnizes that this rule would allow access to etcdtest-2.test.nj.dc.linux.example.com
  40. [[email protected] ~]$ ipa hbactest --user [email protected] --host etcdtest-2.test.nj.dc.linux.example.com --service sshd --rules test_user_test |egrep '(Access granted|Matched rules)'
  41. Access granted: True
  42. Matched rules: test_user_test
  43.  
  44. # lets add the usergroup org_-_uk_core_it to the old HBAC rule
  45. [[email protected] ~]$ ipa hbacrule-add-user 'systems_datacenter|all|all' --groups 'org_-_uk_core_it'
  46. Rule name: systems_datacenter|all|all
  47. Host category: all
  48. Enabled: TRUE
  49. User Groups: ad_org_-_unix_team, org_-_uk_core_it
  50. Services: sshd, sudo, sudo-i
  51. -------------------------
  52. Number of members added 1
  53. -------------------------
  54.  
  55. # hbac test now grants access by matched rule systems_datacenter|all|all
  56. [[email protected] ~]$ ipa hbactest --user [email protected] --host etcdtest-2.test.nj.dc.linux.example.com --service sshd|egrep '(Access granted|Matched rules)'
  57. Access granted: True
  58. Matched rules: systems_datacenter|all|all
  59.  
  60.  
  61. info:
  62.  
  63. linux.example.com: is the IPA REALM
  64. pc.example.com: is an AD REALM (trusted by linux.example.com)
  65. [email protected]: is an AD user
Add Comment
Please, Sign In to add comment