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
- Parameters:
permission (dict) – the permission details object that needs to be created,
- Returns:
The resource record for the new permission.
- Return type:
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
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:
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:
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:
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:
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:
Examples
>>> for permission in tio.access_control.list(): ... pprint(permission)
- update(permission_uuid: UUID, permission: Dict) → Dict[source]¶
update permission
- Parameters:
- Returns:
Update successfully requested.
- Return type:
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)