Access-Control

The following methods allow for interaction into the Tenable Vulnerability Management API endpoints.

Methods available on tio.v3.access_control:

class AccessControlAPI(api: APISession)[source]
create(permission: Dict) Dict[source]

Creates a new permission

access-control: create

Parameters:

permission (dict) – the permission details object that needs to be created,

Returns:

The resource record for the new permission.

Return type:

dict

Example

>>> permission = {
...     "actions": ["CanView","CanEdit"],
...     "objects": [
...          {
...              "type": "Tag",
...              "uuid": "10bd7477-2961-402c-92fb-d7f6a8dc9399",
...              "name": "TGG,DE"
...          }
...     ],
...     "subjects": [
...          {
...              "name": "dummy_user@tenable.com",
...              "type": "User",
...              "uuid": "4f948c212-ae2c-4d0b-bab4-0fc1088a85bd"
...          }
...     ],
...     "name": "permission name"
... }
...
...  tio.access_control.create(permission)
delete(permission_uuid: UUID) Dict[source]

Delete the specified permission

access-control: delete

Parameters:

permission_uuid (str) – the uuid of the permission to remove

Return type:

dict

Examples

>>> tio.access_control.delete(
...     '4f948c22-ae2c-4d0b-bab4-0fc1088a85bd'
... )
details(uuid: UUID) Dict[source]

Retrieves the details of the specified permission.

access-control: details :param uuid: the uuid of the permission to retrieve :type uuid: str

Returns:

The resource record for the specified permission

Return type:

dict

Examples

Get specific permission details:
>>> tio.access_control.details(
...     '4f948c22-ae2c-4d0b-bab4-0fc1088a85bd'
... )
get_current_user_permission() Dict[source]

Retrieves current user permission details

access-control : current user permission

Returns:

The resource record for the current user permission.

Return type:

dict

Examples

Get specific user-group permission details:
>>> tio.access_control.get_current_user_permission(
...     '4f948c22-ae2c-4d0b-bab4-0fc1088a85bd'
... )
get_user_group_permission(user_group_uuid: UUID) Dict[source]

Retrieves user group permission details

access-control : user group permission

Parameters:

user_group_uuid (str) – the uuid of the user-group to retrieve

Returns:

The resource record for the user-group permission

Return type:

dict

Examples

Get specific user-group permission details:
>>> tio.access_control.get_user_group_permission(
...     '4f948c22-ae2c-4d0b-bab4-0fc1088a85bd'
... )
get_user_permission(user_uuid: UUID) Dict[source]

Retrieves user permission details

access-control: user permission

Parameters:

user_uuid (str) – the uuid of the user to retrieve

Returns:

The resource record for the user permissions

Return type:

dict

Examples

Get specific user permission details:
>>> tio.access_control.get_user_permission(
...     '4f948c22-ae2c-4d0b-bab4-0fc1088a85bd'
... )
list() List[source]

Returns a list of permissions in your container.

Returns:

List of permissions.

Return type:

list

Examples

>>> for permission in tio.access_control.list():
...     pprint(permission)
update(permission_uuid: UUID, permission: Dict) Dict[source]

update permission

access-control : update

Parameters:
  • permission_uuid (str) – permission uuid to be updated

  • permission (dict) – the permission details object that needs to be updated, permission details object example :

Returns:

Update successfully requested.

Return type:

None

Example

>>> payload = {
...     "actions": ["CanView","CanEdit"],
...     "objects": [
...          {
...               "type": "Tag",
...               "uuid": "10bd7477-2961-402c-92fb-d7f6a8dc9399",
...               "name": "TGG,DE"
...          }
...     ],
...     "subjects": [
...           {
...               "name": "dummy_user@tenable.com",
...               "type": "User",
...               "uuid": "4f948c212-ae2c-4d0b-bab4-0fc1088a85bd"
...           }
...     ],
...     "name": "permission name"
... }
>>>  permission_uuid_val = "212-ae2c-4d0b-bab4-0fc1088a85bd"
>>>  tio.v3.access_control.update(permission_uuid_val, payload)