Este contenido no está disponible en el idioma seleccionado.
Chapter 12. Configuring RBAC policies
12.1. Overview of RBAC policies Copiar enlaceEnlace copiado en el portapapeles!
Role-based access control (RBAC) policies in OpenStack Networking allow granular control over shared neutron networks. OpenStack Networking uses a RBAC table to control sharing of neutron networks among projects, allowing an administrator to control which projects are granted permission to attach instances to a network.
As a result, cloud administrators can remove the ability for some projects to create networks and can instead allow them to attach to pre-existing networks that correspond to their project.
12.2. Creating RBAC policies Copiar enlaceEnlace copiado en el portapapeles!
This example procedure demonstrates how to use a role-based access control (RBAC) policy to grant a project access to a shared network.
View the list of available networks:
openstack network list
$ openstack network list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
View the list of projects:
openstack project list
$ openstack project list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a RBAC entry for the
web-servers
network that grants access to the auditors project (4b0b98f8c6c040f38ba4f7146e8680f5
):- Example
openstack network rbac create --type network --target-project 4b0b98f8c6c040f38ba4f7146e8680f5 --action access_as_shared web-servers
$ openstack network rbac create --type network --target-project 4b0b98f8c6c040f38ba4f7146e8680f5 --action access_as_shared web-servers
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
As a result, users in the auditors project can connect instances to the web-servers
network.
12.3. Reviewing RBAC policies Copiar enlaceEnlace copiado en el portapapeles!
To review RBAC policies, follow these steps:
Procedure
Run the
openstack network rbac list
command to retrieve the ID of your existing role-based access control (RBAC) policies:openstack network rbac list
$ openstack network rbac list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Run the
openstack network rbac-show
command to view the details of a specific RBAC entry:- Example
openstack network rbac show 314004d0-2261-4d5e-bda7-0181fcf40709
$ openstack network rbac show 314004d0-2261-4d5e-bda7-0181fcf40709
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.4. Deleting RBAC policies Copiar enlaceEnlace copiado en el portapapeles!
To delete RBAC policies, follow these steps:
Run the
openstack network rbac list
command to retrieve the ID of your existing role-based access control (RBAC) policies:openstack network rbac list
$ openstack network rbac list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Run the
openstack network rbac delete
command to delete the RBAC, using the ID of the RBAC that you want to delete:- Example
openstack network rbac delete 314004d0-2261-4d5e-bda7-0181fcf40709
$ openstack network rbac delete 314004d0-2261-4d5e-bda7-0181fcf40709 Deleted rbac_policy: 314004d0-2261-4d5e-bda7-0181fcf40709
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.5. Granting RBAC policy access for external networks Copiar enlaceEnlace copiado en el portapapeles!
You can grant role-based access control (RBAC) policy access to external networks (networks with gateway interfaces attached) using the --action access_as_external
parameter.
Complete the steps in the following example procedure to create a RBAC for the web-servers network and grant access to the engineering project (c717f263785d4679b16a122516247deb):
Create a new RBAC policy using the
--action access_as_external
option:- Example
openstack network rbac create --type network --target-project \ c717f263785d4679b16a122516247deb --action access_as_external \ web-servers
$ openstack network rbac create --type network --target-project \ c717f263785d4679b16a122516247deb --action access_as_external \ web-servers
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow As a result, users in the engineering project are able to view the network or connect instances to it:
openstack network list
$ openstack network list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
+--------------------------------------+-------------+------------------------------------------------------+ | id | name | subnets | +--------------------------------------+-------------+------------------------------------------------------+ | 6e437ff0-d20f-4483-b627-c3749399bdca | web-servers | fa273245-1eff-4830-b40c-57eaeac9b904 192.168.10.0/24 | +--------------------------------------+-------------+------------------------------------------------------+
+--------------------------------------+-------------+------------------------------------------------------+ | id | name | subnets | +--------------------------------------+-------------+------------------------------------------------------+ | 6e437ff0-d20f-4483-b627-c3749399bdca | web-servers | fa273245-1eff-4830-b40c-57eaeac9b904 192.168.10.0/24 | +--------------------------------------+-------------+------------------------------------------------------+
Copy to Clipboard Copied! Toggle word wrap Toggle overflow