Scan

Scans

class cloudpassage.Scan(session)

Initializing the Scan class:

Parameters:session (cloudpassage.HaloSession) – This will define how you interact with the Halo API, including proxy settings and API keys used for authentication.
findings(scan_id, findings_id)

Get FIM, CSM, and SVA findings details by scan and findings ID

Parameters:
  • scan_id (str) – ID of scan_id
  • findings_id (str) – ID of findings to retrieve
Returns:

Dictionary object descrbing findings

Return type:

dict

initiate_scan(server_id, scan_type)

Initiate a scan on a specific server.

Parameters:
  • server_id (str) – ID of server to be scanned
  • scan_type – Type of scan to be run.
Returns:

Dictionary describing command created as a result of this call Failure throws an exception.

Return type:

dict

last_scan_results(server_id, scan_type)

Get the results of scan_type performed on server_id.

Parameters:
  • server_id (str) – ID of server
  • scan_type (str) – Type of scan to filter results for
Valid scan types:
sca - Configuration scan csm - Configuration scan (same as sca) svm - Software vulnerability scan sva - Software vulnerability scan (same as svm) fim - File integrity monitoring scan
Returns:Dictionary object describing last scan results
Return type:dict
scan_details(scan_id)

Get detailed scan information

Parameters:scan_id (str) – ID of scan
Returns:Dictionary object describing scan details
Return type:dict
scan_history(**kwargs)

Get a list of historical scans.

Keyword Arguments:
 
  • server_id (str) – Id of server
  • module (str or list) – sca, fim, svm, sam
  • status (str or list) – queued, pending, running, completed_clean,
  • completed_with_errors, failed
  • since (str) – ISO 8601 formatted string representing the starting date and time for query
  • until (str) – ISO 8601 formatted string representing the ending date and time for query
  • max_pages (int) – maximum number of pages to fetch. Default: 20.
Returns:

List of scan objects

Return type:

list

CVE Exceptions

class cloudpassage.CveException(session)

Initializing the CveException class:

Parameters:session (cloudpassage.HaloSession) – This will define how you interact with the Halo API, including proxy settings and API keys used for authentication.
describe(policy_id)

Get the detailed configuration of a policy

Parameters:policy_id (str) – ID of the policy to retrieve detailed configuration information for
Returns:dictionary object representing the entire, detailed, policy
Return type:dict
list_all()

Lists all policies of this type.

Returns:List of policies (represented as dictionary-type objects)
Return type:list

Note

This query is limited to 30 pages.