Groups

The following methods allow for interaction into the Tenable Security Center Group API. These items are typically seen under the User Groups section of Tenable Security Center.

Methods available on sc.groups:

class GroupAPI(api: APISession)[source]
create(name, **kw)[source]

Creates a group.

group: create

Parameters:
  • name (str) – The name of the user group

  • asset_lists (list, optional) – List of asset list ids to allow this group to access.

  • audit_files (list, optional) – List of audit file ids to allow this group to access.

  • dashboards (list, optional) – List of dashboard ids to allow this group to access.

  • lce_ids (list, optional) – List of LCE ionstance ids to allow this group to access.

  • query_ids (list, optional) – List of query ids to allow this group to access.

  • report_cards (list, optional) – List of report card ids to allow this group to access.

  • repos (list, optional) – List of repository ids to allow this group to access.

  • scan_creds (list, optional) – List of scanning credential ids to allow this group to access.

  • scan_policies (list, optional) – List of scan policy ids to allow this group to access.

  • viewable (list, optional) – List of asset list ids to use for the purposes of restricting what members of this group can see within Tenable Security Center.

Returns:

The newly created group.

Return type:

dict

Examples

>>> group = sc.groups.create('New Group')
delete(id)[source]

Removes a group.

group: delete

Parameters:

id (int) – The numeric identifier for the group to remove.

Returns:

An empty response.

Return type:

str

Examples

>>> sc.groups.delete(1)
details(id, fields=None)[source]

Returns the details for a specific group.

group: details

Parameters:
  • id (int) – The identifier for the group.

  • fields (list, optional) – A list of attributes to return.

Returns:

The group resource record.

Return type:

dict

Examples

>>> group = sc.groups.details(1)
>>> pprint(group)
edit(id, **kw)[source]

Edits a group.

group: edit

Parameters:
  • asset_lists (list, optional) – List of asset list ids to allow this group to access.

  • audit_files (list, optional) – List of audit file ids to allow this group to access.

  • dashboards (list, optional) – List of dashboard ids to allow this group to access.

  • lce_ids (list, optional) – List of LCE ionstance ids to allow this group to access.

  • name (str, optional) – The name of the user group

  • query_ids (list, optional) – List of query ids to allow this group to access.

  • report_cards (list, optional) – List of report card ids to allow this group to access.

  • repos (list, optional) – List of repository ids to allow this group to access.

  • scan_creds (list, optional) – List of scanning credential ids to allow this group to access.

  • scan_policies (list, optional) – List of scan policy ids to allow this group to access.

  • viewable (list, optional) – List of asset list ids to use for the purposes of restricting what members of this group can see within Tenable Security Center.

Returns:

The newly updated group.

Return type:

dict

Examples

>>> group = sc.groups.edit()
list(fields=None)[source]

Retrieves the list of group definitions.

group: list

Parameters:

fields (list, optional) – A list of attributes to return for each group.

Returns:

A list of group resources.

Return type:

list

Examples

>>> for group in sc.groups.list():
...     pprint(group)