SSH Discovery
- class SSHDiscovery(api)
Bases:
_ClientWorkBase
- create(name, scan_default_paths=True, host_key_paths=None, user_key_paths=None, user_or_host_paths=None, exclude_paths=None, scan_mounted_fs=False, minimize_resources=False, max_filesize='1048576', log_threshold='Info', attributes=None, get_if_already_exists=True)
- Parameters
name (str) – The name of the client work
scan_default_paths (bool) – scan all of the default paths for ssh keys
host_key_paths (List[str]) – A list of paths to scan for host keys
user_key_paths (List[str]) – A list of paths to scan for user keys
user_or_host_paths (List[str]) – A list of paths to scan for both host and user keys
exclude_paths (List[str]) – A list of paths to exclude from scan
scan_mounted_fs (bool) – Scan file systems mounted via NFS/CIFS/NTFS junction points (defaults to False)
minimize_resources (bool) – Minimizes resource usage during scan (defaults to False)
max_filesize (int) – Ignore files larger than this size (defaults to 1MB)
log_threshold (str) – Set the logging level (defaults to INFO)
attributes (dict) – Additional attributes to apply to the object.
get_if_already_exists (bool) – If the objects already exists, just return it as is.
- Returns
Config Object of the client work.
- delete(work)
Deletes the client work.
- Parameters
work (Union[config.Object, str]) – Config Object or name of the client work.
- disable(work)
Disables the client work.
- Parameters
work (Union[config.Object, str]) – Config Object or name of the client work.
- enable(work)
Enables the client work.
- Parameters
work (Union[config.Object, str]) – Config Object or name of the client work.
- get(name, raise_error_if_not_exists=True)
- Parameters
name (str) – The name of the client work.
raise_error_if_not_exists (bool) – Raise an exception if the client work does not exist.
- Returns
Config Object of the client work.
- list()
Lists all client work.
- Returns
List of Config Object of all client work.
- schedule(work, start_time=None, daily=False, hourly=False, on_receipt=False, every_30_minutes=False, days_of_week=None, days_of_month=None, randomize_minutes=0, full_scan=False)
Note
Only one of daily, hourly, on_receipt, every_30_minutes, days_of_week or days_of_month can be set.
Schedules the SSH Discovery work to run.
- Parameters
work (Union[config.Object, str]) – Config Object or name of the client work.
start_time (int) – The 24-hour UTC hour format (i.e. 20 = 8PM UTC) for the job to start.
daily (bool) – Runs the client work daily
hourly (bool) – Runs the client work hourly
on_receipt (bool) – Runs the client work on_receipt
every_30_minutes (bool) – Runs the client work every 30 minutes
days_of_week (List[str]) – Runs the client work on specific days of the week. It is a Zero-based index of the days of the week (i.e. Sunday = ‘0’).
days_of_month (List[str]) – Runs the client work on specific days of the month.
randomize_minutes (int) – Randomize the given minutes for agent to send data back to the server
full_scan (bool) – Reset the cache and perform a full scan (resend all the data to the server)
- unschedule(work)
Removes any scheduling for the client work, but does not delete the client work.
- Parameters
work (Union[config.Object, str]) – Config Object or name of the client work.