GMP v7¶
Module for communication with gvmd in Greenbone Management Protocol version 7
Enums¶
-
class
gvm.protocols.gmpv7.
AlertCondition
(value)¶ Enum for alert condition types
-
ALWAYS
= 'Always'¶
-
FILTER_COUNT_AT_LEAST
= 'Filter count at least'¶
-
FILTER_COUNT_CHANGED
= 'Filter count changed'¶
-
SEVERITY_AT_LEAST
= 'Severity at least'¶
-
-
class
gvm.protocols.gmpv7.
AlertEvent
(value)¶ Enum for alert event types
-
NEW_SECINFO_ARRIVED
= 'New SecInfo arrived'¶
-
TASK_RUN_STATUS_CHANGED
= 'Task run status changed'¶
-
UPDATED_SECINFO_ARRIVED
= 'Updated SecInfo arrived'¶
-
-
class
gvm.protocols.gmpv7.
AlertMethod
(value)¶ Enum for alert method type
-
EMAIL
= 'Email'¶
-
HTTP_GET
= 'HTTP Get'¶
-
SCP
= 'SCP'¶
-
SEND
= 'Send'¶
-
SMB
= 'SMB'¶
-
SNMP
= 'SNMP'¶
-
SOURCEFIRE_CONNECTOR
= 'Sourcefire Connector'¶
-
START_TASK
= 'Start Task'¶
-
SYSLOG
= 'Syslog'¶
-
VERINICE_CONNECTOR
= 'verinice Connector'¶
-
-
class
gvm.protocols.gmpv7.
AliveTest
(value)¶ Enum for choosing an alive test
-
APR_PING
= 'ARP Ping'¶
-
ARP_PING
= 'ARP Ping'¶
-
CONSIDER_ALIVE
= 'Consider Alive'¶
-
ICMP_AND_ARP_PING
= 'ICMP & ARP Ping'¶
-
ICMP_AND_TCP_ACK_SERVICE_PING
= 'ICMP & TCP-ACK Service Ping'¶
-
ICMP_PING
= 'ICMP Ping'¶
-
ICMP_TCP_ACK_SERVICE_AND_ARP_PING
= 'ICMP, TCP-ACK Service & ARP Ping'¶
-
SCAN_CONFIG_DEFAULT
= 'Scan Config Default'¶
-
TCP_ACK_SERVICE_AND_ARP_PING
= 'TCP-ACK Service & ARP Ping'¶
-
TCP_ACK_SERVICE_PING
= 'TCP-ACK Service Ping'¶
-
TCP_SYN_SERVICE_PING
= 'TCP-SYN Service Ping'¶
-
-
class
gvm.protocols.gmpv7.
AssetType
(value)¶ “Enum for asset types
-
HOST
= 'host'¶
-
OPERATING_SYSTEM
= 'os'¶
-
-
class
gvm.protocols.gmpv7.
CredentialFormat
(value)¶ Enum for credential format
-
DEB
= 'deb'¶
-
EXE
= 'exe'¶
-
KEY
= 'key'¶
-
PEM
= 'pem'¶
-
RPM
= 'rpm'¶
-
-
class
gvm.protocols.gmpv7.
CredentialType
(value)¶ Enum for credential types
-
CLIENT_CERTIFICATE
= 'cc'¶
-
SNMP
= 'snmp'¶
-
USERNAME_PASSWORD
= 'up'¶
-
USERNAME_SSH_KEY
= 'usk'¶
-
-
class
gvm.protocols.gmpv7.
EntityType
(value)¶ Enum for entity types
-
AGENT
= 'agent'¶
-
ALERT
= 'alert'¶
-
ASSET
= 'asset'¶
-
CERT_BUND_ADV
= 'cert_bund_adv'¶
-
CPE
= 'cpe'¶
-
CREDENTIAL
= 'credential'¶
-
CVE
= 'cve'¶
-
DFN_CERT_ADV
= 'dfn_cert_adv'¶
-
FILTER
= 'filter'¶
-
GROUP
= 'group'¶
-
HOST
= 'host'¶
-
INFO
= 'info'¶
-
NOTE
= 'note'¶
-
NVT
= 'nvt'¶
-
OPERATING_SYSTEM
= 'os'¶
-
OVALDEF
= 'ovaldef'¶
-
OVERRIDE
= 'override'¶
-
PERMISSION
= 'permission'¶
-
PORT_LIST
= 'port_list'¶
-
REPORT
= 'report'¶
-
REPORT_FORMAT
= 'report_format'¶
-
RESULT
= 'result'¶
-
ROLE
= 'role'¶
-
SCANNER
= 'scanner'¶
-
SCAN_CONFIG
= 'config'¶
-
SCHEDULE
= 'schedule'¶
-
TAG
= 'tag'¶
-
TARGET
= 'target'¶
-
TASK
= 'task'¶
-
USER
= 'user'¶
-
-
class
gvm.protocols.gmpv7.
FeedType
(value)¶ Enum for feed types
-
CERT
= 'CERT'¶
-
NVT
= 'NVT'¶
-
SCAP
= 'SCAP'¶
-
-
class
gvm.protocols.gmpv7.
FilterType
(value)¶ Enum for filter types
-
AGENT
= 'agent'¶
-
ALERT
= 'alert'¶
-
ALL_SECINFO
= 'secinfo'¶
-
ASSET
= 'asset'¶
-
CREDENTIAL
= 'credential'¶
-
FILTER
= 'filter'¶
-
GROUP
= 'group'¶
-
HOST
= 'host'¶
-
NOTE
= 'note'¶
-
OPERATING_SYSTEM
= 'os'¶
-
OVERRIDE
= 'override'¶
-
PERMISSION
= 'permission'¶
-
PORT_LIST
= 'port_list'¶
-
REPORT
= 'report'¶
-
REPORT_FORMAT
= 'report_format'¶
-
RESULT
= 'result'¶
-
ROLE
= 'role'¶
-
SCAN_CONFIG
= 'config'¶
-
SCHEDULE
= 'schedule'¶
-
TAG
= 'tag'¶
-
TARGET
= 'target'¶
-
TASK
= 'task'¶
-
USER
= 'user'¶
-
-
class
gvm.protocols.gmpv7.
HostsOrdering
(value)¶ Enum for host ordering during scans
-
RANDOM
= 'random'¶
-
REVERSE
= 'reverse'¶
-
SEQUENTIAL
= 'sequential'¶
-
-
class
gvm.protocols.gmpv7.
InfoType
(value)¶ Enum for info types
-
ALLINFO
= 'ALLINFO'¶
-
CERT_BUND_ADV
= 'CERT_BUND_ADV'¶
-
CPE
= 'CPE'¶
-
CVE
= 'CVE'¶
-
DFN_CERT_ADV
= 'DFN_CERT_ADV'¶
-
NVT
= 'NVT'¶
-
OVALDEF
= 'OVALDEF'¶
-
-
class
gvm.protocols.gmpv7.
PermissionSubjectType
(value)¶ Enum for permission subject type
-
GROUP
= 'group'¶
-
ROLE
= 'role'¶
-
USER
= 'user'¶
-
-
class
gvm.protocols.gmpv7.
ScannerType
(value)¶ Enum for scanner type
-
CVE_SCANNER_TYPE
= '3'¶
-
GMP_SCANNER_TYPE
= '4'¶
-
OPENVAS_SCANNER_TYPE
= '2'¶
-
OSP_SCANNER_TYPE
= '1'¶
-
-
class
gvm.protocols.gmpv7.
SeverityLevel
(value)¶ Enum for severity levels
-
ALARM
= 'Alarm'¶
-
DEBUG
= 'Debug'¶
-
HIGH
= 'High'¶
-
LOG
= 'Log'¶
-
LOW
= 'Low'¶
-
MEDIUM
= 'Medium'¶
-
-
class
gvm.protocols.gmpv7.
SnmpAuthAlgorithm
(value)¶ Enum for SNMP auth algorithm
-
MD5
= 'md5'¶
-
SHA1
= 'sha1'¶
-
Protocol¶
-
class
gvm.protocols.gmpv7.
Gmp
(connection, *, transform=None)¶ -
authenticate
(username, password)¶ Authenticate to gvmd.
The generated authenticate command will be send to server. Afterwards the response is read, transformed and returned.
- Parameters
username (
str
) – Usernamepassword (
str
) – Password
- Return type
Any
- Returns
Transformed response from server.
-
clone_agent
(agent_id)¶ Clone an existing agent
- Parameters
agent_id (
str
) – UUID of an existing agent to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_alert
(alert_id)¶ Clone an existing alert
- Parameters
alert_id (
str
) – UUID of an existing alert to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_config
(config_id)¶ Clone a scan config from an existing one
- Parameters
config_id (
str
) – UUID of the existing scan config- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_credential
(credential_id)¶ Clone an existing credential
- Parameters
credential_id (
str
) – UUID of an existing credential to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_filter
(filter_id)¶ Clone an existing filter
- Parameters
filter_id (
str
) – UUID of an existing filter to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_group
(group_id)¶ Clone an existing group
- Parameters
group_id (
str
) – UUID of an existing group to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_note
(note_id)¶ Clone an existing note
- Parameters
note_id (
str
) – UUID of an existing note to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_override
(override_id)¶ Clone an existing override
- Parameters
override_id (
str
) – UUID of an existing override to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_permission
(permission_id)¶ Clone an existing permission
- Parameters
permission_id (
str
) – UUID of an existing permission to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_port_list
(port_list_id)¶ Clone an existing port list
- Parameters
port_list_id (
str
) – UUID of an existing port list to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_role
(role_id)¶ Clone an existing role
- Parameters
role_id (
str
) – UUID of an existing role to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_scanner
(scanner_id)¶ Clone an existing scanner
- Parameters
scanner_id (
str
) – UUID of an existing scanner to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_schedule
(schedule_id)¶ Clone an existing schedule
- Parameters
schedule_id (
str
) – UUID of an existing schedule to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_tag
(tag_id)¶ Clone an existing tag
- Parameters
tag_id (
str
) – UUID of an existing tag to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_target
(target_id)¶ Clone an existing target
- Parameters
target_id (
str
) – UUID of an existing target to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_task
(task_id)¶ Clone an existing task
- Parameters
task_id (
str
) – UUID of existing task to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
clone_user
(user_id)¶ Clone an existing user
- Parameters
user_id (
str
) – UUID of existing user to clone from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
connect
()¶ Initiates a protocol connection
Normally connect is not called directly. Either it is called automatically when sending a protocol command or when using a with statement.
-
create_agent
(installer, signature, name, *, comment=None, howto_install=None, howto_use=None)¶ Create a new agent
- Parameters
installer (
str
) – A base64 encoded file that installs the agent on a target machinesignature (
str
) – A detached OpenPGP signature of the installername (
str
) – A name for the agentcomment (
Optional
[str
,None
]) – A comment for the agenthowto_install (
Optional
[str
,None
]) – A file that describes how to install the agenthowto_use (
Optional
[str
,None
]) – A file that describes how to use the agent
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_alert
(name, condition, event, method, *, method_data=None, event_data=None, condition_data=None, filter_id=None, comment=None)¶ Create a new alert
- Parameters
name (
str
) – Name of the new Alertcondition (
AlertCondition
) – The condition that must be satisfied for the alert to occur; if the event is either ‘Updated SecInfo arrived’ or ‘New SecInfo arrived’, condition must be ‘Always’. Otherwise, condition can also be on of ‘Severity at least’, ‘Filter count changed’ or ‘Filter count at least’.event (
AlertEvent
) – The event that must happen for the alert to occur, one of ‘Task run status changed’, ‘Updated SecInfo arrived’ or ‘New SecInfo arrived’method (
AlertMethod
) – The method by which the user is alerted, one of ‘SCP’, ‘Send’, ‘SMB’, ‘SNMP’, ‘Syslog’ or ‘Email’; if the event is neither ‘Updated SecInfo arrived’ nor ‘New SecInfo arrived’, method can also be one of ‘Start Task’, ‘HTTP Get’, ‘Sourcefire Connector’ or ‘verinice Connector’.condition_data (
Optional
[dict
,None
]) – Data that defines the conditionevent_data (
Optional
[dict
,None
]) – Data that defines the eventmethod_data (
Optional
[dict
,None
]) – Data that defines the methodfilter_id (
Optional
[int
,None
]) – Filter to apply when executing alertcomment (
Optional
[str
,None
]) – Comment for the alert
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_config
(config_id, name, *, comment=None)¶ Create a new scan config from an existing one
- Parameters
config_id (
str
) – UUID of the existing scan configname (
str
) – Name of the new scan configcomment (
Optional
[str
,None
]) – A comment on the config
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_container_task
(name, *, comment=None)¶ Create a new container task
A container task is a “meta” task to import and view reports from other systems.
- Parameters
name (
str
) – Name of the taskcomment (
Optional
[str
,None
]) – Comment for the task
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_credential
(name, credential_type, *, comment=None, allow_insecure=None, certificate=None, key_phrase=None, private_key=None, login=None, password=None, auth_algorithm=None, community=None, privacy_algorithm=None, privacy_password=None)¶ Create a new credential
Create a new credential e.g. to be used in the method of an alert.
Currently the following credential types are supported:
Username + Password
Username + private SSH-Key
Client Certificates
SNMPv1 or SNMPv2c protocol
- Parameters
name (
str
) – Name of the new credentialcredential_type (
CredentialType
) – The credential type.comment (
Optional
[str
,None
]) – Comment for the credentialallow_insecure (
Optional
[bool
,None
]) – Whether to allow insecure use of the credentialcertificate (
Optional
[str
,None
]) – Certificate for the credential. Required for cc credential type.key_phrase (
Optional
[str
,None
]) – Key passphrase for the private key. Used for the usk credential type.private_key (
Optional
[str
,None
]) – Private key to use for login. Required for usk credential type. Also used for the cc credential type. The supported key types (dsa, rsa, ecdsa, …) and formats (PEM, PKC#12, OpenSSL, …) depend on your installed GnuTLS version.login (
Optional
[str
,None
]) – Username for the credential. Required for up, usk and snmp credential type.password (
Optional
[str
,None
]) – Password for the credential. Used for up and snmp credential types.community (
Optional
[str
,None
]) – The SNMP community.auth_algorithm (
Optional
[SnmpAuthAlgorithm
,None
]) – The SNMP authentication algorithm. Required for snmp credential type.privacy_algorithm (
Optional
[SnmpPrivacyAlgorithm
,None
]) – The SNMP privacy algorithm.privacy_password (
Optional
[str
,None
]) – The SNMP privacy password
Examples
Creating a Username + Password credential
gmp.create_credential( name='UP Credential', credential_type=CredentialType.USERNAME_PASSWORD, login='foo', password='bar', )
Creating a Username + SSH Key credential
with open('path/to/private-ssh-key') as f: key = f.read() gmp.create_credential( name='USK Credential', credential_type=CredentialType.USERNAME_SSH_KEY, login='foo', key_phrase='foobar', private_key=key, )
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_filter
(name, *, make_unique=None, filter_type=None, comment=None, term=None)¶ Create a new filter
- Parameters
name (
str
) – Name of the new filtermake_unique (
Optional
[bool
,None
]) –filter_type (
Optional
[FilterType
,None
]) – Filter for entity typecomment (
Optional
[str
,None
]) – Comment for the filterterm (
Optional
[str
,None
]) – Filter term e.g. ‘name=foo’
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_group
(name, *, comment=None, special=False, users=None)¶ Create a new group
- Parameters
name (
str
) – Name of the new groupcomment (
Optional
[str
,None
]) – Comment for the groupspecial (
Optional
[bool
,None
]) – Create permission giving members full access to each other’s entitiesusers (
Optional
[List
[str
],None
]) – List of user names to be in the group
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_host
(name, *, comment=None)¶ Create a new host asset
- Parameters
name (
str
) – Name for the new host assetcomment (
Optional
[str
,None
]) – Comment for the new host asset
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_note
(text, nvt_oid, *, seconds_active=None, hosts=None, port=None, result_id=None, severity=None, task_id=None, threat=None)¶ Create a new note
- Parameters
text (
str
) – Text of the new notenvt_id – OID of the nvt to which note applies
seconds_active (
Optional
[int
,None
]) – Seconds note will be active. -1 on always, 0 offhosts (
Optional
[List
[str
],None
]) – A list of hosts addressesport (
Optional
[int
,None
]) – Port to which the note appliesresult_id (
Optional
[str
,None
]) – UUID of a result to which note appliesseverity (
Optional
[Real
,None
]) – Severity to which note appliestask_id (
Optional
[str
,None
]) – UUID of task to which note appliesthreat (
Optional
[SeverityLevel
,None
]) – Severity level to which note applies. Will be converted to severity.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_override
(text, nvt_oid, *, seconds_active=None, hosts=None, port=None, result_id=None, severity=None, new_severity=None, task_id=None, threat=None, new_threat=None)¶ Create a new override
- Parameters
text (
str
) – Text of the new overridenvt_id – OID of the nvt to which override applies
seconds_active (
Optional
[int
,None
]) – Seconds override will be active. -1 on always, 0 offhosts (
Optional
[List
[str
],None
]) – A list of host addressesport (
Optional
[int
,None
]) – Port to which the override appliesresult_id (
Optional
[str
,None
]) – UUID of a result to which override appliesseverity (
Optional
[Real
,None
]) – Severity to which override appliesnew_severity (
Optional
[Real
,None
]) – New severity for resulttask_id (
Optional
[str
,None
]) – UUID of task to which override appliesthreat (
Optional
[SeverityLevel
,None
]) – Severity level to which override applies. Will be converted to severity.new_threat (
Optional
[SeverityLevel
,None
]) – New severity level for results. Will be converted to new_severity.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_permission
(name, subject_id, subject_type, *, resource_id=None, resource_type=None, comment=None)¶ Create a new permission
- Parameters
name (
str
) – Name of the new permissionsubject_id (
str
) – UUID of subject to whom the permission is grantedsubject_type (
PermissionSubjectType
) – Type of the subject user, group or rolecomment (
Optional
[str
,None
]) – Comment for the permissionresource_id (
Optional
[str
,None
]) – UUID of entity to which the permission appliesresource_type (
Optional
[EntityType
,None
]) – Type of the resource. For Super permissions user, group or role
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_port_list
(name, port_range, *, comment=None)¶ Create a new port list
- Parameters
name (
str
) – Name of the new port listport_range (
str
) – Port list ranges e.g. “T: 1-1234” for tcp port 1 - 1234comment (
Optional
[str
,None
]) – Comment for the port list
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_port_range
(port_list_id, start, end, port_range_type, *, comment=None)¶ Create new port range
- Parameters
port_list_id (
str
) – UUID of the port list to which to add the rangestart (
int
) – The first port in the rangeend (
int
) – The last port in the rangeport_range_type (
PortRangeType
) – The type of the ports: TCP, UDP, …comment (
Optional
[str
,None
]) – Comment for the port range
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_role
(name, *, comment=None, users=None)¶ Create a new role
- Parameters
name (
str
) – Name of the rolecomment (
Optional
[str
,None
]) – Comment for the roleusers (
Optional
[List
[str
],None
]) – List of user names to add to the role
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_scanner
(name, host, port, scanner_type, credential_id, *, ca_pub=None, comment=None)¶ Create a new scanner
- Parameters
name (
str
) – Name of the scannerhost (
str
) – The host of the scannerport (
int
) – The port of the scannerscanner_type (
ScannerType
) – Type of the scanner.credential_id (
str
) – UUID of client certificate credential for the scannerca_pub (
Optional
[str
,None
]) – Certificate of CA to verify scanner certificatecomment (
Optional
[str
,None
]) – Comment for the scanner
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_schedule
(name, *, comment=None, first_time_minute=None, first_time_hour=None, first_time_day_of_month=None, first_time_month=None, first_time_year=None, duration=None, duration_unit=None, period=None, period_unit=None, timezone=None)¶ Create a new schedule
- Parameters
name (
str
) – Name of the schedulecomment (
Optional
[str
,None
]) – Comment for the schedulefirst_time_minute (
Optional
[int
,None
]) – First time minute the schedule will run. Must be an integer >= 0.first_time_hour (
Optional
[int
,None
]) – First time hour the schedule will run. Must be an integer >= 0.first_time_day_of_month (
Optional
[int
,None
]) – First time day of month the schedule will run. Must be an integer > 0 <= 31.first_time_month (
Optional
[int
,None
]) – First time month the schedule will run. Must be an integer >= 1 <= 12.first_time_year (
Optional
[int
,None
]) – First time year the schedule will run. Must be an integer >= 1970.duration (
Optional
[int
,None
]) – How long the Manager will run the scheduled task for until it gets paused if not finished yet. Must be an integer > 0.duration_unit (
Optional
[TimeUnit
,None
]) – Unit of the duration. One of second, minute, hour, day, week, month, year, decade. Required if duration is set.period (
Optional
[int
,None
]) – How often the Manager will repeat the scheduled task. Must be an integer > 0.period_unit (
Optional
[TimeUnit
,None
]) – Unit of the period. One of second, minute, hour, day, week, month, year, decade. Required if period is set.timezone (
Optional
[str
,None
]) – The timezone the schedule will follow
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_tag
(name, resource_type, *, resource_id=None, value=None, comment=None, active=None)¶ Create a new tag
- Parameters
name (
str
) – Name of the tag. A full tag name consisting of namespace and predicate e.g. foo:bar.resource_id (
Optional
[str
,None
]) – ID of the resource the tag is to be attached to.resource_type (
EntityType
) – Entity type the tag is to be attached tovalue (
Optional
[str
,None
]) – Value associated with the tagcomment (
Optional
[str
,None
]) – Comment for the tagactive (
Optional
[bool
,None
]) – Whether the tag should be active
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_target
(name, *, make_unique=None, asset_hosts_filter=None, hosts=None, comment=None, exclude_hosts=None, ssh_credential_id=None, ssh_credential_port=None, smb_credential_id=None, esxi_credential_id=None, snmp_credential_id=None, alive_test=None, reverse_lookup_only=None, reverse_lookup_unify=None, port_range=None, port_list_id=None)¶ Create a new target
- Parameters
name (
str
) – Name of the targetmake_unique (
Optional
[bool
,None
]) – Append a unique suffix if the name already existsasset_hosts_filter (
Optional
[str
,None
]) – Filter to select target host from assets hostshosts (
Optional
[List
[str
],None
]) – List of hosts addresses to scanexclude_hosts (
Optional
[List
[str
],None
]) – List of hosts addresses to exclude from scancomment (
Optional
[str
,None
]) – Comment for the targetssh_credential_id (
Optional
[str
,None
]) – UUID of a ssh credential to use on targetssh_credential_port (
Optional
[int
,None
]) – The port to use for ssh credentialsmb_credential_id (
Optional
[str
,None
]) – UUID of a smb credential to use on targetsnmp_credential_id (
Optional
[str
,None
]) – UUID of a snmp credential to use on targetesxi_credential_id (
Optional
[str
,None
]) – UUID of a esxi credential to use on targetalive_test (
Optional
[AliveTest
,None
]) – Which alive test to usereverse_lookup_only (
Optional
[bool
,None
]) – Whether to scan only hosts that have namesreverse_lookup_unify (
Optional
[bool
,None
]) – Whether to scan only one IP when multiple IPs have the same name.port_range (
Optional
[str
,None
]) – Port range for the targetport_list_id (
Optional
[str
,None
]) – UUID of the port list to use on target
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_task
(name, config_id, target_id, scanner_id, *, alterable=None, hosts_ordering=None, schedule_id=None, alert_ids=None, comment=None, schedule_periods=None, observers=None, preferences=None)¶ Create a new task
- Parameters
name (
str
) – Name of the taskconfig_id (
str
) – UUID of scan config to use by the tasktarget_id (
str
) – UUID of target to be scannedscanner_id (
str
) – UUID of scanner to use for scanning the targetcomment (
Optional
[str
,None
]) – Comment for the taskalterable (
Optional
[bool
,None
]) – Whether the task should be alterablealert_ids (
Optional
[List
[str
],None
]) – List of UUIDs for alerts to be applied to the taskhosts_ordering (
Optional
[HostsOrdering
,None
]) – The order hosts are scanned inschedule_id (
Optional
[str
,None
]) – UUID of a schedule when the task should be run.schedule_periods (
Optional
[int
,None
]) – A limit to the number of times the task will be scheduled, or 0 for no limitobservers (
Optional
[List
[str
],None
]) – List of names or ids of users which should be allowed to observe this taskpreferences (
Optional
[dict
,None
]) – Name/Value pairs of scanner preferences.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
create_user
(name, *, password=None, hosts=None, hosts_allow=False, ifaces=None, ifaces_allow=False, role_ids=None)¶ Create a new user
- Parameters
name (
str
) – Name of the userpassword (
Optional
[str
,None
]) – Password of the userhosts (
Optional
[List
[str
],None
]) – A list of host addresses (IPs, DNS names)hosts_allow (
Optional
[bool
,None
]) – If True allow only access to passed hosts otherwise deny access. Default is False for deny hosts.ifaces (
Optional
[List
[str
],None
]) – A list of interface namesifaces_allow (
Optional
[bool
,None
]) – If True allow only access to passed interfaces otherwise deny access. Default is False for deny interfaces.role_ids (
Optional
[List
[str
],None
]) – A list of role UUIDs for the user
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
delete_agent
(agent_id, *, ultimate=False)¶ Deletes an existing agent
- Parameters
agent_id (
str
) – UUID of the agent to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_alert
(alert_id, *, ultimate=False)¶ Deletes an existing alert
- Parameters
alert_id (
str
) – UUID of the alert to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_asset
(*, asset_id=None, report_id=None)¶ Deletes an existing asset
- Parameters
asset_id (
Optional
[str
,None
]) – UUID of the single asset to delete.report_id (
Optional
[str
,None
]) – UUID of report from which to get all assets to delete.
- Return type
Any
-
delete_config
(config_id, *, ultimate=False)¶ Deletes an existing config
- Parameters
config_id (
str
) – UUID of the config to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_credential
(credential_id, *, ultimate=False)¶ Deletes an existing credential
- Parameters
credential_id (
str
) – UUID of the credential to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_filter
(filter_id, *, ultimate=False)¶ Deletes an existing filter
- Parameters
filter_id (
str
) – UUID of the filter to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_group
(group_id, *, ultimate=False)¶ Deletes an existing group
- Parameters
group_id (
str
) – UUID of the group to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_note
(note_id, *, ultimate=False)¶ Deletes an existing note
- Parameters
note_id (
str
) – UUID of the note to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely,or to the trashcan.
- Return type
Any
-
delete_override
(override_id, *, ultimate=False)¶ Deletes an existing override
- Parameters
override_id (
str
) – UUID of the override to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_permission
(permission_id, *, ultimate=False)¶ Deletes an existing permission
- Parameters
permission_id (
str
) – UUID of the permission to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_port_list
(port_list_id, *, ultimate=False)¶ Deletes an existing port list
- Parameters
port_list_id (
str
) – UUID of the port list to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_port_range
(port_range_id)¶ Deletes an existing port range
- Parameters
port_range_id (
str
) – UUID of the port range to be deleted.- Return type
Any
-
delete_report
(report_id)¶ Deletes an existing report
- Parameters
report_id (
str
) – UUID of the report to be deleted.- Return type
Any
-
delete_report_format
(report_format_id, *, ultimate=False)¶ Deletes an existing report format
- Parameters
report_format_id (
str
) – UUID of the report format to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_role
(role_id, *, ultimate=False)¶ Deletes an existing role
- Parameters
role_id (
str
) – UUID of the role to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_scanner
(scanner_id, *, ultimate=False)¶ Deletes an existing scanner
- Parameters
scanner_id (
str
) – UUID of the scanner to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_schedule
(schedule_id, *, ultimate=False)¶ Deletes an existing schedule
- Parameters
schedule_id (
str
) – UUID of the schedule to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_tag
(tag_id, *, ultimate=False)¶ Deletes an existing tag
- Parameters
tag_id (
str
) – UUID of the tag to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_target
(target_id, *, ultimate=False)¶ Deletes an existing target
- Parameters
target_id (
str
) – UUID of the target to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_task
(task_id, *, ultimate=False)¶ Deletes an existing task
- Parameters
task_id (
str
) – UUID of the task to be deleted.ultimate (
Optional
[bool
,None
]) – Whether to remove entirely, or to the trashcan.
- Return type
Any
-
delete_user
(user_id=None, *, name=None, inheritor_id=None, inheritor_name=None)¶ Deletes an existing user
Either user_id or name must be passed.
- Parameters
user_id (
Optional
[str
,None
]) – UUID of the task to be deleted.name (
Optional
[str
,None
]) – The name of the user to be deleted.inheritor_id (
Optional
[str
,None
]) – The ID of the inheriting user or “self”. Overrides inheritor_name.inheritor_name (
Optional
[str
,None
]) – The name of the inheriting user.
- Return type
Any
-
describe_auth
()¶ Describe authentication methods
Returns a list of all used authentication methods if such a list is available.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
disconnect
()¶ Disconnect the connection
Ends and closes the connection.
-
empty_trashcan
()¶ Empty the trashcan
Remove all entities from the trashcan. Attention: this command can not be reverted
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_agent
(agent_id)¶ Request a single agent
- Parameters
agent_id (
str
) – UUID of an existing agent- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_agents
(*, filter=None, filter_id=None, trash=None, details=None, format=None)¶ Request a list of agents
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – True to request the agents in the trashcandetails (
Optional
[bool
,None
]) – Whether to include agents packageinformation when no format was providedformat (
Optional
[str
,None
]) – One of “installer”, “howto_install” or “howto_use”
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_aggregates
(resource_type, **kwargs)¶ Request aggregated information on a resource type
Additional arguments can be set via the kwargs parameter, but are not yet validated.
- Parameters
resource_type (
EntityType
) – The entity type to gather data from- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_alert
(alert_id, *, tasks=None)¶ Request a single alert
- Parameters
alert_id (
str
) – UUID of an existing alert- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_alerts
(*, filter=None, filter_id=None, trash=None, tasks=None)¶ Request a list of alerts
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – True to request the alerts in the trashcantasks (
Optional
[bool
,None
]) – Whether to include the tasks using the alerts
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_asset
(asset_id, asset_type)¶ Request a single asset
- Parameters
asset_id (
str
) – UUID of an existing assetasset_type (
AssetType
) – Either ‘os’ or ‘host’
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_assets
(asset_type, *, filter=None, filter_id=None)¶ Request a list of assets
- Parameters
asset_type (
AssetType
) – Either ‘os’ or ‘host’filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the query
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_config
(config_id, *, tasks=None)¶ Request a single scan config
- Parameters
config_id (
str
) – UUID of an existing scan configtasks (
Optional
[bool
,None
]) – Whether to get tasks using this config
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_configs
(*, filter=None, filter_id=None, trash=None, details=None, families=None, preferences=None, tasks=None)¶ Request a list of scan configs
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get the trashcan scan configs insteaddetails (
Optional
[bool
,None
]) – Whether to get config families, preferences, nvt selectors and tasks.families (
Optional
[bool
,None
]) – Whether to include the families if no details are requestedpreferences (
Optional
[bool
,None
]) – Whether to include the preferences if no details are requestedtasks (
Optional
[bool
,None
]) – Whether to get tasks using this config
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_credential
(credential_id, *, scanners=None, targets=None, credential_format=None)¶ Request a single credential
- Parameters
credential_id (
str
) – UUID of an existing credentialscanners (
Optional
[bool
,None
]) – Whether to include a list of scanners using the credentialstargets (
Optional
[bool
,None
]) – Whether to include a list of targets using the credentialscredential_format (
Optional
[CredentialFormat
,None
]) – One of “key”, “rpm”, “deb”, “exe” or “pem”
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_credentials
(*, filter=None, filter_id=None, scanners=None, trash=None, targets=None)¶ Request a list of credentials
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the queryscanners (
Optional
[bool
,None
]) – Whether to include a list of scanners using the credentialstrash (
Optional
[bool
,None
]) – Whether to get the trashcan credentials insteadtargets (
Optional
[bool
,None
]) – Whether to include a list of targets using the credentials
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_feed
(feed_type)¶ Request a single feed
- Parameters
feed_type (
Optional
[FeedType
,None
]) – Type of single feed to get: NVT, CERT or SCAP- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_feeds
()¶ Request the list of feeds
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_filter
(filter_id, *, alerts=None)¶ Request a single filter
- Parameters
filter_id (
str
) – UUID of an existing filteralerts (
Optional
[bool
,None
]) – Whether to include list of alerts that use the filter.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_filters
(*, filter=None, filter_id=None, trash=None, alerts=None)¶ Request a list of filters
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get the trashcan filters insteadalerts (
Optional
[bool
,None
]) – Whether to include list of alerts that use the filter.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_group
(group_id)¶ Request a single group
- Parameters
group_id (
str
) – UUID of an existing group- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_groups
(*, filter=None, filter_id=None, trash=None)¶ Request a list of groups
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get the trashcan groups instead
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_info
(info_id, info_type)¶ Request a single secinfo
- Parameters
info_id (
str
) – UUID of an existing secinfoinfo_type (
InfoType
) – Type must be either CERT_BUND_ADV, CPE, CVE, DFN_CERT_ADV, OVALDEF, NVT or ALLINFO
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_info_list
(info_type, *, filter=None, filter_id=None, name=None, details=None)¶ Request a list of security information
- Parameters
info_type (
InfoType
) – Type must be either CERT_BUND_ADV, CPE, CVE, DFN_CERT_ADV, OVALDEF, NVT or ALLINFOfilter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the queryname (
Optional
[str
,None
]) – Name or identifier of the requested informationdetails (
Optional
[bool
,None
]) – Whether to include information about references to this information
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_note
(note_id)¶ Request a single note
- Parameters
note_id (
str
) – UUID of an existing note- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_notes
(*, filter=None, filter_id=None, details=None, result=None)¶ Request a list of notes
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querydetails (
Optional
[bool
,None
]) – Add info about connected results and tasksresult (
Optional
[bool
,None
]) – Return the details of possible connected results.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_nvt
(nvt_oid)¶ Request a single nvt
- Parameters
nvt_oid (
str
) – OID of an existing nvt- Returns
The response. See
send_command()
for details.
-
get_nvt_families
(*, sort_order=None)¶ Request a list of nvt families
- Parameters
sort_order (
Optional
[str
,None
]) – Sort order- Returns
The response. See
send_command()
for details.
-
get_nvts
(*, details=None, preferences=None, preference_count=None, timeout=None, config_id=None, preferences_config_id=None, family=None, sort_order=None, sort_field=None)¶ Request a list of nvts
- Parameters
details (
Optional
[bool
,None
]) – Whether to include full detailspreferences (
Optional
[bool
,None
]) – Whether to include nvt preferencespreference_count (
Optional
[bool
,None
]) – Whether to include preference counttimeout (
Optional
[bool
,None
]) – Whether to include the special timeout preferenceconfig_id (
Optional
[str
,None
]) – UUID of scan config to which to limit the NVT listingpreferences_config_id (
Optional
[str
,None
]) – UUID of scan config to use for preference valuesfamily (
Optional
[str
,None
]) – Family to which to limit NVT listingsort_order (
Optional
[str
,None
]) – Sort ordersort_field (
Optional
[str
,None
]) – Sort field
- Returns
The response. See
send_command()
for details.
-
get_override
(override_id)¶ Request a single override
- Parameters
override_id (
str
) – UUID of an existing override- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_overrides
(*, filter=None, filter_id=None, details=None, result=None)¶ Request a list of overrides
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querydetails (
Optional
[bool
,None
]) – Whether to include full detailsresult (
Optional
[bool
,None
]) – Whether to include results using the override
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_permission
(permission_id)¶ Request a single permission
- Parameters
permission_id (
str
) – UUID of an existing permission- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_permissions
(*, filter=None, filter_id=None, trash=None)¶ Request a list of permissions
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get permissions in the trashcan instead
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_port_list
(port_list_id)¶ Request a single port list
- Parameters
port_list_id (
str
) – UUID of an existing port list- Returns
The response. See
send_command()
for details.
-
get_port_lists
(*, filter=None, filter_id=None, details=None, targets=None, trash=None)¶ Request a list of port lists
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querydetails (
Optional
[bool
,None
]) – Whether to include full port list detailstargets (
Optional
[bool
,None
]) – Whether to include targets using this port listtrash (
Optional
[bool
,None
]) – Whether to get port lists in the trashcan instead
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_preference
(name, *, nvt_oid=None, config_id=None)¶ Request a nvt preference
- Parameters
name (
str
) – name of a particular preferencenvt_oid (
Optional
[str
,None
]) – OID of nvtconfig_id (
Optional
[str
,None
]) – UUID of scan config of which to show preference values
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_preferences
(*, nvt_oid=None, config_id=None)¶ Request a list of preferences
When the command includes a config_id attribute, the preference element includes the preference name, type and value, and the NVT to which the preference applies. Otherwise, the preference element includes just the name and value, with the NVT and type built into the name.
- Parameters
nvt_oid (
Optional
[str
,None
]) – OID of nvtconfig_id (
Optional
[str
,None
]) – UUID of scan config of which to show preference values
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
static
get_protocol_version
()¶ Determine the Greenbone Management Protocol version.
- Return type
tuple
- Returns
Implemented version of the Greenbone Management Protocol
-
get_report
(report_id, *, filter=None, filter_id=None, delta_report_id=None, report_format_id=None, ignore_pagination=None, details=None)¶ Request a single report
- Parameters
report_id (
str
) – UUID of an existing reportfilter (
Optional
[str
,None
]) – Filter term to use to filter results in the reportfilter_id (
Optional
[str
,None
]) – UUID of filter to use to filter results in the reportdelta_report_id (
Optional
[str
,None
]) – UUID of an existing report to compare report to.report_format_id (
Optional
[str
,None
]) – UUID of report format to useignore_pagination (
Optional
[bool
,None
]) – Whether to ignore the filter terms “first” and “rows”.details (
Optional
[bool
,None
]) – Request additional report information details
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_report_format
(report_format_id)¶ Request a single report format
- Parameters
report_format_id (
str
) – UUID of an existing report format- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_report_formats
(*, filter=None, filter_id=None, trash=None, alerts=None, params=None, details=None)¶ Request a list of report formats
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get the trashcan report formats insteadalerts (
Optional
[bool
,None
]) – Whether to include alerts that use the report formatparams (
Optional
[bool
,None
]) – Whether to include report format parametersdetails (
Optional
[bool
,None
]) – Include report format file, signature and parameters
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_reports
(*, filter=None, filter_id=None, note_details=None, override_details=None, details=None)¶ Request a list of reports
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querynote_details (
Optional
[bool
,None
]) – If notes are included, whether to include note detailsoverride_details (
Optional
[bool
,None
]) – If overrides are included, whether to include override detailsdetails (
Optional
[bool
,None
]) – Whether to exclude results
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_result
(result_id)¶ Request a single result
- Parameters
result_id (
str
) – UUID of an existing result- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_results
(*, filter=None, filter_id=None, task_id=None, note_details=None, override_details=None, details=None)¶ Request a list of results
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytask_id (
Optional
[str
,None
]) – UUID of task for note and override handlingnote_details (
Optional
[bool
,None
]) – If notes are included, whether to include note detailsoverride_details (
Optional
[bool
,None
]) – If overrides are included, whether to include override detailsdetails (
Optional
[bool
,None
]) – Whether to include additional details of the results
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_role
(role_id)¶ Request a single role
- Parameters
role_id (
str
) – UUID of an existing role- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_roles
(*, filter=None, filter_id=None, trash=None)¶ Request a list of roles
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get the trashcan roles instead
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_scanner
(scanner_id)¶ Request a single scanner
- Parameters
scanner_id (
str
) – UUID of an existing scanner- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_scanners
(*, filter=None, filter_id=None, trash=None, details=None)¶ Request a list of scanners
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get the trashcan scanners insteaddetails (
Optional
[bool
,None
]) – Whether to include extra details like tasks using this scanner
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_schedule
(schedule_id, *, tasks=None)¶ Request a single schedule
- Parameters
schedule_id (
str
) – UUID of an existing scheduletasks (
Optional
[bool
,None
]) – Whether to include tasks using the schedules
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_schedules
(*, filter=None, filter_id=None, trash=None, tasks=None)¶ Request a list of schedules
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get the trashcan schedules insteadtasks (
Optional
[bool
,None
]) – Whether to include tasks using the schedules
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_setting
(setting_id)¶ Request a single setting
- Parameters
setting_id (
str
) – UUID of an existing setting- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_settings
(*, filter=None)¶ Request a list of user settings
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the query- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_system_reports
(*, name=None, duration=None, start_time=None, end_time=None, brief=None, slave_id=None)¶ Request a list of system reports
- Parameters
name (
Optional
[str
,None
]) – A string describing the required system reportduration (
Optional
[int
,None
]) – The number of seconds into the past that the system report should includestart_time (
Optional
[str
,None
]) – The start of the time interval the system report should include in ISO time formatend_time (
Optional
[str
,None
]) – The end of the time interval the system report should include in ISO time formatbrief (
Optional
[bool
,None
]) – Whether to include the actual system reportsslave_id (
Optional
[str
,None
]) – UUID of GMP scanner from which to get the system reports
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_tag
(tag_id)¶ Request a single tag
- Parameters
tag_id (
str
) – UUID of an existing tag- Return type
Any
- Returns
The response. See
send_command()
for details.
Request a list of tags
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get tags from the trashcan insteadnames_only (
Optional
[bool
,None
]) – Whether to get only distinct tag names
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_target
(target_id, *, tasks=None)¶ Request a single target
- Parameters
target_id (
str
) – UUID of an existing targettasks (
Optional
[bool
,None
]) – Whether to include list of tasks that use the target
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_targets
(*, filter=None, filter_id=None, trash=None, tasks=None)¶ Request a list of targets
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get the trashcan targets insteadtasks (
Optional
[bool
,None
]) – Whether to include list of tasks that use the target
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_task
(task_id)¶ Request a single task
- Parameters
task_id (
str
) – UUID of an existing task- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_tasks
(*, filter=None, filter_id=None, trash=None, details=None, schedules_only=None)¶ Request a list of tasks
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the querytrash (
Optional
[bool
,None
]) – Whether to get the trashcan tasks insteaddetails (
Optional
[bool
,None
]) – Whether to include full task detailsschedules_only (
Optional
[bool
,None
]) – Whether to only include id, name and schedule details
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_user
(user_id)¶ Request a single user
- Parameters
user_id (
str
) – UUID of an existing user- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_users
(*, filter=None, filter_id=None)¶ Request a list of users
- Parameters
filter (
Optional
[str
,None
]) – Filter term to use for the queryfilter_id (
Optional
[str
,None
]) – UUID of an existing filter to use for the query
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
get_version
()¶ Get the Greenbone Manager Protocol version used by the remote gvmd
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
help
(*, format=None, help_type='')¶ Get the help text
- Parameters
format (
Optional
[str
,None
]) – One of “html”, “rnc”, “text” or “xmlhelp_type (
Optional
[str
,None
]) – One of “brief” or “”. Default “”
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
import_config
(config)¶ Import a scan config from XML
- Parameters
config (
str
) – Scan Config XML as string to import. This XML must contain a<get_configs_response>
root element.- Return type
Any
- Returns
The response. See
send_command()
for details.
-
import_report
(report, *, task_id=None, task_name=None, task_comment=None, in_assets=None)¶ Import a Report from XML
- Parameters
report (
str
) – Report XML as string to import. This XML must contain a<report>
root element.task_id (
Optional
[str
,None
]) – UUID of task to import report totask_name (
Optional
[str
,None
]) – Name of task to be created if task_id is not present. Either task_id or task_name must be passedtask_comment (
Optional
[str
,None
]) – Comment for task to be created if task_id is not presentin_asset – Whether to create or update assets using the report
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
is_authenticated
()¶ Checks if the user is authenticated
If the user is authenticated privileged GMP commands like get_tasks may be send to gvmd.
- Returns
True if an authenticated connection to gvmd has been established.
- Return type
bool
-
is_connected
()¶ Status of the current connection
- Return type
bool
- Returns
True if a connection to the remote server has been established.
-
modify_agent
(agent_id, *, name=None, comment=None)¶ Modifies an existing agent
- Parameters
agent_id (
str
) – UUID of the agent to be modified.name (
Optional
[str
,None
]) – Name of the new credentialcomment (
Optional
[str
,None
]) – Comment for the credential
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_alert
(alert_id, *, name=None, comment=None, filter_id=None, event=None, event_data=None, condition=None, condition_data=None, method=None, method_data=None)¶ Modifies an existing alert.
- Parameters
alert_id (
str
) – UUID of the alert to be modified.name (
Optional
[str
,None
]) – Name of the Alert.condition (
Optional
[AlertCondition
,None
]) – The condition that must be satisfied for the alert to occur. If the event is either ‘Updated SecInfo arrived’ or ‘New SecInfo arrived’, condition must be ‘Always’. Otherwise, condition can also be on of ‘Severity at least’, ‘Filter count changed’ or ‘Filter count at least’.condition_data (
Optional
[dict
,None
]) – Data that defines the conditionevent (
Optional
[AlertEvent
,None
]) – The event that must happen for the alert to occur, one of ‘Task run status changed’, ‘Updated SecInfo arrived’ or ‘New SecInfo arrived’event_data (
Optional
[dict
,None
]) – Data that defines the eventmethod (
Optional
[AlertMethod
,None
]) – The method by which the user is alerted, one of ‘SCP’, ‘Send’, ‘SMB’, ‘SNMP’, ‘Syslog’ or ‘Email’; if the event is neither ‘Updated SecInfo arrived’ nor ‘New SecInfo arrived’, method can also be one of ‘Start Task’, ‘HTTP Get’, ‘Sourcefire Connector’ or ‘verinice Connector’.method_data (
Optional
[dict
,None
]) – Data that defines the methodfilter_id (
Optional
[str
,None
]) – Filter to apply when executing alertcomment (
Optional
[str
,None
]) – Comment for the alert
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_asset
(asset_id, comment='')¶ Modifies an existing asset.
- Parameters
asset_id (
str
) – UUID of the asset to be modified.comment (
Optional
[str
,None
]) – Comment for the asset.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_auth
(group_name, auth_conf_settings)¶ Modifies an existing auth.
- Parameters
group_name (
str
) – Name of the group to be modified.auth_conf_settings (
dict
) – The new auth config.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_config
(config_id, selection=None, **kwargs)¶ Modifies an existing scan config.
DEPRECATED. Please use modify_config_set_ methods instead.
modify_config has four modes to operate depending on the selection.
- Parameters
config_id (
str
) – UUID of scan config to modify.selection (
Optional
[str
,None
]) – one of ‘scan_pref’, ‘nvt_pref’, ‘nvt_selection’ or ‘family_selection’name – New name for preference.
value – New value for preference.
nvt_oids – List of NVTs associated with preference to modify.
family – Name of family to modify.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_config_set_comment
(config_id, comment='')¶ Modifies the comment of an existing scan config
- Parameters
config_id (
str
) – UUID of scan config to modify.comment (
Optional
[str
,None
]) – Comment to set on a config. Default: ‘’
- Return type
Any
-
modify_config_set_family_selection
(config_id, families, *, auto_add_new_families=True, auto_add_new_nvts=True)¶ Selected the NVTs of a scan config at a family level.
- Parameters
config_id (
str
) – UUID of scan config to modify.families (
List
[str
]) – List of NVT family names to select.auto_add_new_families (
Optional
[bool
,None
]) – Whether new families should be added to the scan config automatically. Default: True.auto_add_new_nvts (
Optional
[bool
,None
]) – Whether new NVTs in the selected families should be added to the scan config automatically. Default: True.
- Return type
Any
-
modify_config_set_name
(config_id, name)¶ Modifies the name of an existing scan config
- Parameters
config_id (
str
) – UUID of scan config to modify.name (
str
) – New name for the config.
- Return type
Any
-
modify_config_set_nvt_preference
(config_id, name, nvt_oid, *, value=None)¶ Modifies the nvt preferences of an existing scan config.
- Parameters
config_id (
str
) – UUID of scan config to modify.name (
str
) – Name for preference to change.nvt_oid (
str
) – OID of the NVT associated with preference to modifyvalue (
Optional
[str
,None
]) – New value for the preference. None to delete the preference and to use the default instead.
- Return type
Any
-
modify_config_set_nvt_selection
(config_id, family, nvt_oids)¶ Modifies the selected nvts of an existing scan config
The manager updates the given family in the config to include only the given NVTs.
- Parameters
config_id (
str
) – UUID of scan config to modify.family (
str
) – Name of the NVT family to include NVTs fromnvt_oids (
List
[str
]) – List of NVTs to select for the family.
- Return type
Any
-
modify_config_set_scanner_preference
(config_id, name, *, value=None)¶ Modifies the scanner preferences of an existing scan config
- Parameters
config_id (
str
) – UUID of scan config to modify.name (
str
) – Name of the scanner preference to changevalue (
Optional
[str
,None
]) – New value for the preference. None to delete the preference and to use the default instead.
- Return type
Any
-
modify_credential
(credential_id, *, name=None, comment=None, allow_insecure=None, certificate=None, key_phrase=None, private_key=None, login=None, password=None, auth_algorithm=None, community=None, privacy_algorithm=None, privacy_password=None)¶ Modifies an existing credential.
- Parameters
credential_id (
str
) – UUID of the credentialname (
Optional
[str
,None
]) – Name of the credentialcomment (
Optional
[str
,None
]) – Comment for the credentialallow_insecure (
Optional
[bool
,None
]) – Whether to allow insecure use of the credentialcertificate (
Optional
[str
,None
]) – Certificate for the credentialkey_phrase (
Optional
[str
,None
]) – Key passphrase for the private keyprivate_key (
Optional
[str
,None
]) – Private key to use for loginlogin (
Optional
[str
,None
]) – Username for the credentialpassword (
Optional
[str
,None
]) – Password for the credentialauth_algorithm (
Optional
[SnmpAuthAlgorithm
,None
]) – The SNMP auth algorithm.community (
Optional
[str
,None
]) – The SNMP communityprivacy_algorithm (
Optional
[SnmpPrivacyAlgorithm
,None
]) – The SNMP privacy algorithm.privacy_password (
Optional
[str
,None
]) – The SNMP privacy password
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_filter
(filter_id, *, comment=None, name=None, term=None, filter_type=None)¶ Modifies an existing filter.
- Parameters
filter_id (
str
) – UUID of the filter to be modifiedcomment (
Optional
[str
,None
]) – Comment on filter.name (
Optional
[str
,None
]) – Name of filter.term (
Optional
[str
,None
]) – Filter term.filter_type (
Optional
[FilterType
,None
]) – Filter type the filter applies to.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_group
(group_id, *, comment=None, name=None, users=None)¶ Modifies an existing group.
- Parameters
group_id (
str
) – UUID of group to modify.comment (
Optional
[str
,None
]) – Comment on group.name (
Optional
[str
,None
]) – Name of group.users (
Optional
[List
[str
],None
]) – List of user names to be in the group
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_note
(note_id, text, *, seconds_active=None, hosts=None, port=None, result_id=None, severity=None, task_id=None, threat=None)¶ Modifies an existing note.
- Parameters
note_id (
str
) – UUID of note to modify.text (
str
) – The text of the note.seconds_active (
Optional
[int
,None
]) – Seconds note will be active. -1 on always, 0 off.hosts (
Optional
[List
[str
],None
]) – A list of hosts addressesport (
Optional
[int
,None
]) – Port to which note applies.result_id (
Optional
[str
,None
]) – Result to which note applies.severity (
Optional
[Real
,None
]) – Severity to which note applies.task_id (
Optional
[str
,None
]) – Task to which note applies.threat (
Optional
[SeverityLevel
,None
]) – Threat level to which note applies. Will be converted to severity.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_override
(override_id, text, *, seconds_active=None, hosts=None, port=None, result_id=None, severity=None, new_severity=None, task_id=None, threat=None, new_threat=None)¶ Modifies an existing override.
- Parameters
override_id (
str
) – UUID of override to modify.text (
str
) – The text of the override.seconds_active (
Optional
[int
,None
]) – Seconds override will be active. -1 on always, 0 off.hosts (
Optional
[List
[str
],None
]) – A list of host addressesport (
Optional
[int
,None
]) – Port to which override applies.result_id (
Optional
[str
,None
]) – Result to which override applies.severity (
Optional
[Real
,None
]) – Severity to which override applies.new_severity (
Optional
[Real
,None
]) – New severity score for result.task_id (
Optional
[str
,None
]) – Task to which override applies.threat (
Optional
[SeverityLevel
,None
]) – Threat level to which override applies. Will be converted to severity.new_threat (
Optional
[SeverityLevel
,None
]) – New threat level for results. Will be converted to new_severity.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_permission
(permission_id, *, comment=None, name=None, resource_id=None, resource_type=None, subject_id=None, subject_type=None)¶ Modifies an existing permission.
- Parameters
permission_id (
str
) – UUID of permission to be modified.comment (
Optional
[str
,None
]) – The comment on the permission.name (
Optional
[str
,None
]) – Permission name, currently the name of a command.subject_id (
Optional
[str
,None
]) – UUID of subject to whom the permission is grantedsubject_type (
Optional
[PermissionSubjectType
,None
]) – Type of the subject user, group or roleresource_id (
Optional
[str
,None
]) – UUID of entity to which the permission appliesresource_type (
Optional
[EntityType
,None
]) – Type of the resource. For Super permissions user, group or role
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_port_list
(port_list_id, *, comment=None, name=None)¶ Modifies an existing port list.
- Parameters
port_list_id (
str
) – UUID of port list to modify.name (
Optional
[str
,None
]) – Name of port list.comment (
Optional
[str
,None
]) – Comment on port list.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_report_format
(report_format_id, *, active=None, name=None, summary=None, param_name=None, param_value=None)¶ Modifies an existing report format.
- Parameters
report_format_id (
str
) – UUID of report format to modify.active (
Optional
[bool
,None
]) – Whether the report format is active.name (
Optional
[str
,None
]) – The name of the report format.summary (
Optional
[str
,None
]) – A summary of the report format.param_name (
Optional
[str
,None
]) – The name of the param.param_value (
Optional
[str
,None
]) – The value of the param.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_role
(role_id, *, comment=None, name=None, users=None)¶ Modifies an existing role.
- Parameters
role_id (
str
) – UUID of role to modify.comment (
Optional
[str
,None
]) – Name of role.name (
Optional
[str
,None
]) – Comment on role.users (
Optional
[List
[str
],None
]) – List of user names.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_scanner
(scanner_id, *, scanner_type=None, host=None, port=None, comment=None, name=None, ca_pub=None, credential_id=None)¶ Modifies an existing scanner.
- Parameters
scanner_id (
str
) – UUID of scanner to modify.scanner_type (
Optional
[ScannerType
,None
]) – New type of the Scanner.host (
Optional
[str
,None
]) – Host of the scanner.port (
Optional
[int
,None
]) – Port of the scanner.comment (
Optional
[str
,None
]) – Comment on scanner.name (
Optional
[str
,None
]) – Name of scanner.ca_pub (
Optional
[str
,None
]) – Certificate of CA to verify scanner’s certificate.credential_id (
Optional
[str
,None
]) – UUID of the client certificate credential for the Scanner.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_schedule
(schedule_id, *, comment=None, name=None, first_time_minute=None, first_time_hour=None, first_time_day_of_month=None, first_time_month=None, first_time_year=None, duration=None, duration_unit=None, period=None, period_unit=None, timezone=None)¶ Modifies an existing schedule.
- Parameters
schedule_id (
str
) – UUID of schedule to modify.name (
Optional
[str
,None
]) – Name of the schedulecomment (
Optional
[str
,None
]) – Comment for the schedulefirst_time_minute (
Optional
[int
,None
]) – First time minute the schedule will run. Must be an integer >= 0.first_time_hour (
Optional
[int
,None
]) – First time hour the schedule will run. Must be an integer >= 0.first_time_day_of_month (
Optional
[int
,None
]) – First time day of month the schedule will run. Must be an integer > 0 <= 31.first_time_month (
Optional
[int
,None
]) – First time month the schedule will run. Must be an integer >= 1 <= 12.first_time_year (
Optional
[int
,None
]) – First time year the schedule will runduration (
Optional
[int
,None
]) – How long the Manager will run the scheduled task for until it gets paused if not finished yet.duration_unit (
Optional
[TimeUnit
,None
]) – Unit of the duration. One of second, minute, hour, day, week, month, year, decade. Required if duration is set.period (
Optional
[int
,None
]) – How often the Manager will repeat the scheduled task. Must be an integer > 0.period_unit (
Optional
[TimeUnit
,None
]) – Unit of the period. One of second, minute, hour, day, week, month, year, decade. Required if period is set.timezone (
Optional
[str
,None
]) – The timezone the schedule will follow
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_setting
(setting_id=None, name=None, value=None)¶ Modifies an existing setting.
- Parameters
setting_id (
Optional
[str
,None
]) – UUID of the setting to be changed.name (
Optional
[str
,None
]) – The name of the setting. Either setting_id or name must be passed.value (
Optional
[str
,None
]) – The value of the setting.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_tag
(tag_id, *, comment=None, name=None, value=None, active=None, resource_id=None, resource_type=None)¶ Modifies an existing tag.
- Parameters
tag_id (
str
) – UUID of the tag.comment (
Optional
[str
,None
]) – Comment to add to the tag.name (
Optional
[str
,None
]) – Name of the tag.value (
Optional
[str
,None
]) – Value of the tag.active (
Optional
[bool
,None
]) – Whether the tag is active.resource_id (
Optional
[str
,None
]) – ID of the resource to which to attach the tag. Required if resource_type is set.resource_type (
Optional
[EntityType
,None
]) – Type of the resource to which to attach the tag. Required if resource_id is set.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_target
(target_id, *, name=None, comment=None, hosts=None, exclude_hosts=None, ssh_credential_id=None, ssh_credential_port=None, smb_credential_id=None, esxi_credential_id=None, snmp_credential_id=None, alive_test=None, reverse_lookup_only=None, reverse_lookup_unify=None, port_list_id=None)¶ Modifies an existing target.
- Parameters
target_id (
str
) – ID of target to modify.comment (
Optional
[str
,None
]) – Comment on target.name (
Optional
[str
,None
]) – Name of target.hosts (
Optional
[List
[str
],None
]) – List of target hosts.exclude_hosts (
Optional
[List
[str
],None
]) – A list of hosts to exclude.ssh_credential_id (
Optional
[str
,None
]) – UUID of SSH credential to use on target.ssh_credential_port (
Optional
[bool
,None
]) – The port to use for ssh credentialsmb_credential_id (
Optional
[str
,None
]) – UUID of SMB credential to use on target.esxi_credential_id (
Optional
[str
,None
]) – UUID of ESXi credential to use on target.snmp_credential_id (
Optional
[str
,None
]) – UUID of SNMP credential to use on target.port_list_id (
Optional
[str
,None
]) – UUID of port list describing ports to scan.alive_test (
Optional
[AliveTest
,None
]) – Which alive tests to use.reverse_lookup_only (
Optional
[bool
,None
]) – Whether to scan only hosts that have names.reverse_lookup_unify (
Optional
[bool
,None
]) – Whether to scan only one IP when multiple IPs have the same name.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_task
(task_id, *, name=None, config_id=None, target_id=None, scanner_id=None, alterable=None, hosts_ordering=None, schedule_id=None, schedule_periods=None, comment=None, alert_ids=None, observers=None, preferences=None)¶ Modifies an existing task.
- Parameters
task_id (
str
) – UUID of task to modify.name (
Optional
[str
,None
]) – The name of the task.config_id (
Optional
[str
,None
]) – UUID of scan config to use by the tasktarget_id (
Optional
[str
,None
]) – UUID of target to be scannedscanner_id (
Optional
[str
,None
]) – UUID of scanner to use for scanning the targetcomment (
Optional
[str
,None
]) – The comment on the task.alert_ids (
Optional
[List
[str
],None
]) – List of UUIDs for alerts to be applied to the taskhosts_ordering (
Optional
[HostsOrdering
,None
]) – The order hosts are scanned inschedule_id (
Optional
[str
,None
]) – UUID of a schedule when the task should be run.schedule_periods (
Optional
[int
,None
]) – A limit to the number of times the task will be scheduled, or 0 for no limit.observers (
Optional
[List
[str
],None
]) – List of names or ids of users which should be allowed to observe this taskpreferences (
Optional
[dict
,None
]) – Name/Value pairs of scanner preferences.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
modify_user
(user_id=None, name=None, *, new_name=None, password=None, role_ids=None, hosts=None, hosts_allow=False, ifaces=None, ifaces_allow=False)¶ Modifies an existing user.
- Parameters
user_id (
Optional
[str
,None
]) – UUID of the user to be modified. Overrides name element argument.name (
Optional
[str
,None
]) – The name of the user to be modified. Either user_id or name must be passed.new_name (
Optional
[str
,None
]) – The new name for the user.password (
Optional
[str
,None
]) – The password for the user.roles_id – List of roles UUIDs for the user.
hosts (
Optional
[List
[str
],None
]) – User access rules: List of hosts.hosts_allow (
Optional
[bool
,None
]) – If True, allow only listed, otherwise forbid listed.ifaces (
Optional
[List
[str
],None
]) – User access rules: List of ifaces.ifaces_allow (
Optional
[bool
,None
]) – If True, allow only listed, otherwise forbid listed.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
move_task
(task_id, *, slave_id=None)¶ Move an existing task to another GMP slave scanner or the master
- Parameters
task_id (
str
) – UUID of the task to be movedslave_id (
Optional
[str
,None
]) – UUID of slave to reassign the task to, empty for master.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
restore
(entity_id)¶ Restore an entity from the trashcan
- Parameters
entity_id (
str
) – ID of the entity to be restored from the trashcan- Return type
Any
- Returns
The response. See
send_command()
for details.
-
resume_task
(task_id)¶ Resume an existing stopped task
- Parameters
task_id (
str
) – UUID of the task to be resumed- Return type
Any
- Returns
The response. See
send_command()
for details.
-
send_command
(cmd)¶ Send a command to the remote server
If the class is not connected to the server yet the connection will be established automatically.
- Parameters
cmd (str) – Command as string to be send over the connection to the server.
- Returns
The actual returned type depends on the set transform.
Per default - if no transform is set explicitly - the response is returned as string.
- Return type
any
-
start_task
(task_id)¶ Start an existing task
- Parameters
task_id (
str
) – UUID of the task to be started- Return type
Any
- Returns
The response. See
send_command()
for details.
-
stop_task
(task_id)¶ Stop an existing running task
- Parameters
task_id (
str
) – UUID of the task to be stopped- Return type
Any
- Returns
The response. See
send_command()
for details.
-
sync_cert
()¶ Request a synchronization with the CERT feed service
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
sync_config
()¶ Request an OSP config synchronization with scanner
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
sync_feed
()¶ Request a synchronization with the NVT feed service
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
sync_scap
()¶ Request a synchronization with the SCAP feed service
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
test_alert
(alert_id)¶ Run an alert
Invoke a test run of an alert
- Parameters
alert_id (
str
) – UUID of the alert to be tested- Return type
Any
- Returns
The response. See
send_command()
for details.
-
trigger_alert
(alert_id, report_id, *, filter=None, filter_id=None, report_format_id=None, delta_report_id=None)¶ Run an alert by ignoring its event and conditions
The alert is triggered to run immediately with the provided filtered report by ignoring the even and condition settings.
- Parameters
alert_id (
str
) – UUID of the alert to be runreport_id (
str
) – UUID of the report to be provided to the alertfilter (
Optional
[str
,None
]) – Filter term to use to filter results in the reportfilter_id (
Optional
[str
,None
]) – UUID of filter to use to filter results in the reportreport_format_id (
Optional
[str
,None
]) – UUID of report format to usedelta_report_id (
Optional
[str
,None
]) – UUID of an existing report to compare report to.
- Return type
Any
- Returns
The response. See
send_command()
for details.
-
verify_agent
(agent_id)¶ Verify an existing agent
Verifies the trust level of an existing agent. It will be checked whether signature of the agent currently matches the agent. This includes the agent installer file. It is not verified if the agent works as expected by the user.
- Parameters
agent_id (
str
) – UUID of the agent to be verified- Return type
Any
- Returns
The response. See
send_command()
for details.
-
verify_report_format
(report_format_id)¶ Verify an existing report format
Verifies the trust level of an existing report format. It will be checked whether the signature of the report format currently matches the report format. This includes the script and files used to generate reports of this format. It is not verified if the report format works as expected by the user.
- Parameters
report_format_id (
str
) – UUID of the report format to be verified- Return type
Any
- Returns
The response. See
send_command()
for details.
-
verify_scanner
(scanner_id)¶ Verify an existing scanner
Verifies if it is possible to connect to an existing scanner. It is not verified if the scanner works as expected by the user.
- Parameters
scanner_id (
str
) – UUID of the scanner to be verified- Return type
Any
- Returns
The response. See
send_command()
for details.
-