Host Based Access Control (short hbac) is a good way to limit access to specific hosts from specific users / groups using specifig services. A small example can be seen at the end of my blogpost about spacewalk and freeipa as authentication source (link).
Add a hbac-rule:
[archy@ipa01 ~]$ ipa hbacrule-add nfs-access
Add a user: [archy@ipa01 ~]$ ipa hbacrule-add-user --users=archy nfs-access
Add a group:
[archy@ipa01 ~]$ ipa hbacrule-add-user --groups=admins nfs-access
Add a host:
[archy@ipa01 ~]$ ipa hbacrule-add-host --hosts=stor01.archyslife.lan nfs-access
Add a group of hosts
[archy@ipa01 ~]$ ipa hbacrule-add-host --hostgroups=storage-servers nfs-access
Add a service:
[archy@ipa01 ~]$ ipa hbacrule-add-service --hbacsvcs=nfs nfs-access
Add a servicegroup:
[archy@ipa01 ~]$ ipa hbacrule-add-service --hbacsvcgroups=storage nfs-access
Removing a hbac-rule:
[archy@ipa01 ~]$ ipa hbacrule-del nfs-access
Removing a user:
[archy@ipa01 ~]$ ipa hbacrule-remove-user --users=archy nfs-access
Removing a group:
[archy@ipa01 ~]$ ipa hbacrule-remove-user --groups=admins nfs-access
Removing a host from a rule:
[archy@ipa01 ~]$ ipa hbacrule-remove-host --hosts=stor01.archyslife.lan nfs-access
Removing a group of hosts:
[archy@ipa01 ~]$ ipa hbacrule-remove-host --hostgroups=storage-servers nfs-access
Removing a service:
[archy@ipa01 ~]$ ipa hbacrule-remove-service --hbacsvcs=nfs nfs-access
Removing a servicegroup:
[archy@ipa01 ~]$ ipa hbacrule-remove-service --hbacsvcgroups=storage nfs-access
Disabling a hbac-rule:
[archy@ipa01 ~]$ ipa hbacrule-disable nfs-access
Enabling a hbac-rule
[archy@ipa01 ~]$ ipa hbacrule-enable nfs-access
Return all hbac-rules:
[archy@ipa01 ~]$ ipa hbacrule-find
Show a specific hbac-rule:
[archy@ipa01 ~]$ ipa hbacrule-show nfs-access
Adding a service to work with:
[archy@ipa01 ~]$ ipa hbacsvc-add --desc=nfs nfs
Removing a service:
[archy@ipa01 ~]$ ipa hbacsvc-del nfs
Listing all services:
[archy@ipa01 ~]$ ipa hbacsvc-find
Adding a servicegroup:
[archy@ipa01 ~]$ ipa hbacsvcgroup-add storage
Deleting a servicegroup: [archy@ipa01 ~]$ ipa hbacsvcgroup-del storage
Listing all servicegroups:
[archy@ipa01 ~]$ ipa hbacsvcgroup-find
Editing a servicegroup:
[archy@ipa01 ~]$ ipa hbacsvcgroup-mod --desc="group for storage-services" storage
Printing out a summary of informations for a group:
[archy@ipa01 ~]$ ipa hbacsvcgroup-show storage
Adding services to the servicegroup:
[archy@ipa01 ~]$ ipa hbacsvcgroup-add-member --hbacsvcs={nfs,smb} storage
Removing services from the servicegroup:
[archy@ipa01 ~]$ ipa hbacsvcgroup-remove-member --hbacsvcs=smb storage
Comments
Post a Comment