Current Session

The following methods allow for interaction with the Tenable Security Center CurrentOrganization API and the CurrentUser API.

Methods available on sc.current:

class CurrentSessionAPI(api: restfly.session.APISession)[source]
associate_cert()[source]

Associates the certificate passed to the server with the current user’s account. This allows for authentication via certificate in subsequent logins.

Returns

The updated user record.

Return type

dict

Examples

>>> sc.current.associate_cert()
org(fields=None)[source]

Returns the organization of the current session.

current-organization

Parameters

fields (list, optional) – The list of fields that are desired to be returned. For details on what fields are available, please refer to the details on the request within the organization list API doc.

Returns

The organization record.

Return type

dict

Examples

>>> org = sc.current.org()
user(fields=None)[source]

Returns the user of the current session.

current-user

Parameters

fields (list, optional) – The list of fields that are desired to be returned. For details on what fields are available, please refer to the details on the request within the organization list API doc.

Returns

The user record.

Return type

dict

Examples

>>> user = sc.current.user()