laceworksdk.api.v2.cloud_activities

Lacework CloudActivities API wrapper.

Module Contents

Classes

CloudActivitiesAPI

A class used to represent the Cloud Activities API endpoint

class laceworksdk.api.v2.cloud_activities.CloudActivitiesAPI(session)[source]

Bases: laceworksdk.api.base_endpoint.BaseEndpoint

A class used to represent the Cloud Activities API endpoint

Get information about cloud activities for the integrated AWS cloud accounts in your Lacework instance.

property session

Get the HttpSession instance the object is using.

get(start_time=None, end_time=None, **request_params)[source]

A method to get cloud activities objects.

Parameters:
  • start_time (str) – A “%Y-%m-%dT%H:%M:%SZ” structured timestamp to begin from.

  • end_time (str) – A “%Y-%m-%dT%H:%M:%S%Z” structured timestamp to end at.

  • request_params (dict, optional) – Use to pass any additional parameters the API

Returns:

The requested cloud activity data.

Return type:

dict

get_pages(start_time=None, end_time=None, **request_params)[source]

A method to get an iterator of activities

A helper method that yields a generator which allows you to iterate through the resulting pages of activities. Call this instead of the “get” method if you don’t want to write your own code to get the paginated results.

Parameters:
  • start_time (str) – A “%Y-%m-%dT%H:%M:%SZ” structured timestamp to begin from.

  • end_time (str) – A “%Y-%m-%dT%H:%M:%S%Z” structured timestamp to end at.

  • request_params (dict, optional) – Use to pass any additional parameters the API

Yields:

dict – a generator which yields a dict of cloud activities.

get_data_items(start_time=None, end_time=None, **request_params)[source]

A method to get an iterator of activities

A helper method that yields a generator which allows you to iterate through the resulting pages of activities. Call this instead of the “get” method if you don’t want to write your own code to get the paginated results.

Parameters:
  • start_time (str) – A “%Y-%m-%dT%H:%M:%SZ” structured timestamp to begin from.

  • end_time (str) – A “%Y-%m-%dT%H:%M:%S%Z” structured timestamp to end at.

  • request_params (dict, optional) – Use to pass any additional parameters the API

Yields:

dict – a generator which yields multipe dicts of cloud activities.

search(json=None)[source]

A method to search cloud activities.

Parameters:

json (list of dicts) –

A list of dictionaries containing the desired search parameters:

  • field (str): The name of the data field to which the condition applies

  • expression (str): The comparison operator for the filter condition. Valid values are:

    ”eq”, “ne”, “in”, “not_in”, “like”, “ilike”, “not_like”, “not_ilike”, “not_rlike”, “rlike”, “gt”, “ge”, “lt”, “le”, “between”

  • value (str, optional): The value that the condition checks for in the specified field. Use this attribute

when using an operator that requires a single value.

  • values (list of str, optional): The values that the condition checks for in the specified field. Use this

attribute when using an operator that requires multiple values.

Yields:

dict – returns a generator which yields a page of objects at a time as returned by the Lacework API.