GMP v22.4

Greenbone Management Protocol (GMP) version 22.4

Protocol

class GMPv224

A class implementing the Greenbone Management Protocol (GMP) version 22.4

Example

from gvm.protocols.gmp import GMPv224 as GMP

with GMP(connection) as gmp:
    resp = gmp.get_tasks()
__init__(*args, **kwargs)

Create a new GMPv224 instance.

Parameters:
  • connection – Connection to use to talk with the remote daemon. See gvm.connections for possible connection types.

  • transform

    Optional transform callable to convert response data. After each request the callable gets passed the plain response data which can be used to check the data and/or conversion into different representations like a xml dom.

    See gvm.transforms for existing transforms.

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) – Username

  • password (str) – Password

clone_alert(alert_id)

Clone an existing alert

Parameters:

alert_id (str | UUID) – UUID of the alert to clone from

clone_audit(audit_id)

Clone an existing audit

Parameters:

audit_id (str | UUID) – UUID of the audit to clone

clone_credential(credential_id)

Clone an existing credential

Parameters:

credential_id (str | UUID) – UUID of the credential to clone

clone_filter(filter_id)

Clone a filter

Parameters:

filter_id (str | UUID) – ID of the filter to clone

clone_group(group_id)

Clone an existing group

Parameters:

group_id (str | UUID) – UUID of an existing group to clone from

clone_note(note_id)

Clone an existing note

Parameters:

note_id (str | UUID) – UUID of an existing note to clone from

clone_override(override_id)

Clone an existing override

Parameters:

override_id (str | UUID) – UUID of an existing override to clone from

clone_permission(permission_id)

Clone an existing permission

Parameters:

permission_id (str | UUID) – UUID of an existing permission to clone from

clone_policy(policy_id)

Clone a policy from an existing one

Parameters:

policy_id (str | UUID) – UUID of the existing policy

clone_port_list(port_list_id)

Clone an existing port list

Parameters:

port_list_id (str | UUID) – UUID of an existing port list to clone from

clone_report_format(report_format_id)

Clone a report format from an existing one

Parameters:

report_format_id (str | UUID | ReportFormatType) – UUID of the existing report format or ReportFormatType (enum)

clone_role(role_id)

Clone an existing role

Parameters:

role_id (str | UUID) – UUID of an existing role to clone from

clone_scan_config(config_id)

Clone a scan config from an existing one

Parameters:

config_id (str | UUID) – UUID of the existing scan config

clone_scanner(scanner_id)

Clone an existing scanner

Parameters:

scanner_id (str | UUID) – UUID of an existing scanner

clone_schedule(schedule_id)

Clone an existing schedule

Parameters:

schedule_id (str | UUID) – UUID of an existing schedule to clone from

clone_tag(tag_id)

Clone an existing tag

Parameters:

tag_id (str | UUID) – UUID of an existing tag to clone from

clone_target(target_id)

Clone an existing target.

Parameters:

target_id (str | UUID) – UUID of an existing target to clone.

clone_task(task_id)

Clone an existing task

Parameters:

task_id (str | UUID) – UUID of existing task to clone from

clone_ticket(ticket_id)

Clone an existing ticket

Parameters:

ticket_id (str | UUID) – UUID of an existing ticket to clone from

clone_tls_certificate(tls_certificate_id)

Modifies an existing TLS certificate.

Parameters:

tls_certificate_id (str | UUID) – The UUID of an existing TLS certificate

clone_user(user_id)

Clone an existing user.

Parameters:

user_id (str | UUID) – UUID of the user to be cloned.

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_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 Alert

  • condition (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 (dict[str, str] | None) – Data that defines the condition

  • event_data (dict[str, str] | None) – Data that defines the event

  • method_data (dict[str, str] | None) – Data that defines the method

  • filter_id (str | UUID | None) – Filter to apply when executing alert

  • comment (str | None) – Comment for the alert

create_audit(name, policy_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 audit

Parameters:
  • name (str) – Name of the new audit

  • policy_id (str | UUID) – UUID of policy to use by the audit

  • target_id (str | UUID) – UUID of target to be scanned

  • scanner_id (str | UUID) – UUID of scanner to use for scanning the target

  • comment (str | None) – Comment for the audit

  • alterable (bool | None) – Whether the task should be alterable

  • alert_ids (list[str | UUID] | None) – List of UUIDs for alerts to be applied to the audit

  • hosts_ordering (HostsOrdering | str | None) – The order hosts are scanned in

  • schedule_id (str | None) – UUID of a schedule when the audit should be run.

  • schedule_periods (int | None) – A limit to the number of times the audit will be scheduled, or 0 for no limit

  • observers (list[str | UUID] | None) – List of names or ids of users which should be allowed to observe this audit

  • preferences (dict[str, str] | None) – Name/Value pairs of scanner preferences.

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 task

  • comment (str | None) – Comment for the task

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, public_key=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 + SSH-Key

  • Client Certificates

  • SNMPv1 or SNMPv2c protocol

  • S/MIME Certificate

  • OpenPGP Key

  • Password only

Parameters:
  • name (str) – Name of the new credential

  • credential_type (CredentialType | str) – The credential type.

  • comment (str | None) – Comment for the credential

  • allow_insecure (bool | None) – Whether to allow insecure use of the credential

  • certificate (str | None) – Certificate for the credential. Required for client-certificate and smime credential types.

  • key_phrase (str | None) – Key passphrase for the private key. Used for the username+ssh-key credential type.

  • private_key (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 (str | None) – Username for the credential. Required for username+password, username+ssh-key and snmp credential type.

  • password (str | None) – Password for the credential. Used for username+password and snmp credential types.

  • community (str | None) – The SNMP community

  • auth_algorithm (SnmpAuthAlgorithm | str | None) – The SNMP authentication algorithm. Required for snmp credential type.

  • privacy_algorithm (SnmpPrivacyAlgorithm | str | None) – The SNMP privacy algorithm

  • privacy_password (str | None) – The SNMP privacy password

  • public_key (str | None) – PGP public key in armor plain text format. Required for pgp credential type.

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,
)

Creating a PGP credential

Note

A compatible public pgp key file can be exported with GnuPG via

$ gpg --armor --export alice@cyb.org > alice.asc
with open('path/to/pgp.key.asc') as f:
    key = f.read()

gmp.create_credential(
    name='PGP Credential',
    credential_type=CredentialType.PGP_ENCRYPTION_KEY,
    public_key=key,
)

Creating a S/MIME credential

with open('path/to/smime-cert') as f:
    cert = f.read()

gmp.create_credential(
    name='SMIME Credential',
    credential_type=CredentialType.SMIME_CERTIFICATE,
    certificate=cert,
)

Creating a Password-Only credential

gmp.create_credential(
    name='Password-Only Credential',
    credential_type=CredentialType.PASSWORD_ONLY,
    password='foo',
)
create_filter(name, *, filter_type=None, comment=None, term=None)

Create a new filter

Parameters:
  • name (str) – Name of the new filter

  • filter_type (FilterType | None) – Filter for entity type

  • comment (str | None) – Comment for the filter

  • term (str | None) – Filter term e.g. ‘name=foo’

create_group(name, *, comment=None, special=False, users=None)

Create a new group

Parameters:
  • name (str) – Name of the new group

  • comment (str | None) – Comment for the group

  • special (bool | None) – Create permission giving members full access to each other’s entities

  • users (list[str] | None) – List of user names to be in the group

create_host(name, *, comment=None)

Create a new host host

Parameters:
  • name (str) – Name for the new host host

  • comment (str | None) – Comment for the new host host

create_note(text, nvt_oid, *, days_active=None, hosts=None, port=None, result_id=None, severity=None, task_id=None)

Create a new note

Parameters:
  • text (str) – Text of the new note

  • nvt_id – OID of the nvt to which note applies

  • days_active (int | None) – Days note will be active. -1 on always, 0 off

  • hosts (list[str] | None) – A list of host addresses

  • port (str | None) – Port to which the override applies, needs to be a string in the form {number}/{protocol}

  • result_id (str | UUID | None) – UUID of a result to which note applies

  • severity (Real | None) – Severity to which note applies

  • task_id (str | UUID | None) – UUID of task to which note applies

create_override(text, nvt_oid, *, days_active=None, hosts=None, port=None, result_id=None, severity=None, new_severity=None, task_id=None)

Create a new override

Parameters:
  • text (str) – Text of the new override

  • nvt_id – OID of the nvt to which override applies

  • days_active (int | None) – Days override will be active. -1 on always, 0 off

  • hosts (list[str] | None) – A list of host addresses

  • port (str | None) – Port to which the override applies, needs to be a string in the form {number}/{protocol}

  • result_id (str | UUID | None) – UUID of a result to which override applies

  • severity (Real | None) – Severity to which override applies

  • new_severity (Real | None) – New severity for result

  • task_id (str | UUID | None) – UUID of task to which override applies

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 permission

  • subject_id (str | UUID) – UUID of subject to whom the permission is granted

  • subject_type (PermissionSubjectType | str) – Type of the subject user, group or role

  • comment (str | None) – Comment for the permission

  • resource_id (str | None) – UUID of entity to which the permission applies

  • resource_type (EntityType | str | None) – Type of the resource. For Super permissions user, group or role

create_policy(name, *, policy_id=None, comment=None)

Create a new policy

Parameters:
  • name (str) – Name of the new policy

  • policy_id (str | UUID | None) – UUID of an existing policy as base. By default the empty policy is used.

  • comment (str | None) – A comment on the policy

create_port_list(name, port_range, *, comment=None)

Create a new port list

Parameters:
  • name (str) – Name of the new port list

  • port_range (str) – Port list ranges e.g. “T: 1-1234” for tcp port 1 - 1234

  • comment (str | None) – Comment for the port list

create_port_range(port_list_id, start, end, port_range_type, *, comment=None)

Create new port range

Parameters:
  • port_list_id (str | UUID) – UUID of the port list to which to add the range

  • start (int) – The first port in the range

  • end (int) – The last port in the range

  • port_range_type (str | PortRangeType) – The type of the ports: TCP, UDP, …

  • comment (str | None) – Comment for the port range

create_role(name, *, comment=None, users=None)

Create a new role

Parameters:
  • name (str) – Name of the role

  • comment (str | None) – Comment for the role

  • users (list[str] | None) – List of user names to add to the role

create_scan_config(config_id, name, *, comment=None)

Create a new scan config

Parameters:
  • config_id (str | UUID) – UUID of the existing scan config

  • name (str) – Name of the new scan config

  • comment (str | None) – A comment on the config

create_scanner(name, host, port, scanner_type, credential_id, *, ca_pub=None, comment=None)

Create a new scanner

Parameters:
  • name (str) – Name of the new scanner

  • host (str) – Hostname or IP address of the scanner

  • port (str | int) – Port of the scanner

  • scanner_type (ScannerType) – Type of the scanner

  • credential_id (str) – UUID of client certificate credential for the scanner

  • ca_pub (str | None) – Certificate of CA to verify scanner certificate

  • comment (str | None) – Comment for the scanner

create_schedule(name, icalendar, timezone, *, comment=None)

Create a new schedule based in iCalendar data.

Example

Requires https://pypi.org/project/icalendar/

import pytz

from datetime import datetime

from icalendar import Calendar, Event

cal = Calendar()

cal.add('prodid', '-//Foo Bar//')
cal.add('version', '2.0')

event = Event()
event.add('dtstamp', datetime.now(tz=pytz.UTC))
event.add('dtstart', datetime(2020, 1, 1, tzinfo=pytz.utc))

cal.add_component(event)

gmp.create_schedule(
    name="My Schedule",
    icalendar=cal.to_ical(),
    timezone='UTC'
)
Parameters:
  • name (str) – Name of the new schedule

  • icalendar (str) – iCalendar (RFC 5545) based data.

  • timezone (str) – Timezone to use for the icalendar events e.g Europe/Berlin. If the datetime values in the icalendar data are missing timezone information this timezone gets applied. Otherwise the datetime values from the icalendar data are displayed in this timezone

  • comment (str | None) – Comment on schedule.

create_tag(name, resource_type, *, resource_filter=None, resource_ids=None, value=None, comment=None, active=None)

Create a tag

Parameters:
  • name (str) – Name of the tag. A full tag name consisting of namespace and predicate e.g. foo:bar.

  • resource_type (EntityType) – Entity type the tag is to be attached to.

  • resource_filter (str | None) – Filter term to select resources the tag is to be attached to. Only one of resource_filter or resource_ids can be provided.

  • resource_ids (list[str | UUID] | None) – IDs of the resources the tag is to be attached to. Only one of resource_filter or resource_ids can be provided.

  • value (str | None) – Value associated with the tag.

  • comment (str | None) – Comment for the tag.

  • active (bool | None) – Whether the tag should be active.

create_target(name, *, 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, allow_simultaneous_ips=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 target

  • asset_hosts_filter (str | None) – Filter to select target host from assets hosts

  • hosts (list[str] | None) – List of hosts addresses to scan

  • exclude_hosts (list[str] | None) – List of hosts addresses to exclude from scan

  • comment (str | None) – Comment for the target

  • ssh_credential_id (str | UUID | None) – UUID of a ssh credential to use on target

  • ssh_credential_port (int | str | None) – The port to use for ssh credential

  • smb_credential_id (str | UUID | None) – UUID of a smb credential to use on target

  • snmp_credential_id (str | UUID | None) – UUID of a snmp credential to use on target

  • esxi_credential_id (str | UUID | None) – UUID of a esxi credential to use on target

  • alive_test (str | AliveTest | None) – Which alive test to use

  • allow_simultaneous_ips (bool | None) – Whether to scan multiple IPs of the same host simultaneously

  • reverse_lookup_only (bool | None) – Whether to scan only hosts that have names

  • reverse_lookup_unify (bool | None) – Whether to scan only one IP when multiple IPs have the same name.

  • port_range (str | None) – Port range for the target

  • port_list_id (str | UUID | None) – UUID of the port list to use on target

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 scan task

Parameters:
  • name (str) – Name of the new task

  • config_id (str | UUID) – UUID of config to use by the task

  • target_id (str | UUID) – UUID of target to be scanned

  • scanner_id (str | UUID) – UUID of scanner to use for scanning the target

  • comment (str | None) – Comment for the task

  • alterable (bool | None) – Whether the task should be alterable

  • alert_ids (Sequence[str | UUID] | None) – List of UUIDs for alerts to be applied to the task

  • hosts_ordering (HostsOrdering | None) – The order hosts are scanned in

  • schedule_id (str | UUID | None) – UUID of a schedule when the task should be run.

  • schedule_periods (int | None) – A limit to the number of times the task will be scheduled, or 0 for no limit

  • observers (Sequence[str] | None) – List of names or ids of users which should be allowed to observe this task

  • preferences (Mapping[str, SupportsStr] | None) – Name/Value pairs of scanner preferences.

create_ticket(*, result_id, assigned_to_user_id, note, comment=None)

Create a new ticket

Parameters:
  • result_id (str | UUID) – UUID of the result the ticket applies to

  • assigned_to_user_id (str | UUID) – UUID of a user the ticket should be assigned to

  • note (str) – A note about opening the ticket

  • comment (str | None) – Comment for the ticket

create_tls_certificate(name, certificate, *, comment=None, trust=None)

Create a new TLS certificate

Parameters:
  • name (str) – Name of the TLS certificate, defaulting to the MD5 fingerprint.

  • certificate (str) – The Base64 encoded certificate data (x.509 DER or PEM).

  • comment (str | None) – Comment for the TLS certificate.

  • trust (bool | None) – Whether the certificate is trusted.

create_user(name, *, password=None, hosts=None, hosts_allow=False, role_ids=None)

Create a new user

Parameters:
  • name (str) – Name of the user

  • password (str | None) – Password of the user

  • hosts (list[str] | None) – A list of host addresses (IPs, DNS names)

  • hosts_allow (bool | None) – If True allow only access to passed hosts otherwise deny access. Default is False for deny hosts.

  • role_ids (list[str | UUID] | None) – A list of role UUIDs for the user

delete_alert(alert_id, *, ultimate=False)

Delete an existing alert

Parameters:
  • alert_id (str | UUID) – UUID of the alert to delete

  • ultimate (bool | None) – Whether to remove entirely or to the trashcan.

delete_audit(audit_id, *, ultimate=False)

Delete an existing audit

Parameters:
  • audit_id (str | UUID) – UUID of the audit to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_credential(credential_id, *, ultimate=False)

Delete an existing credential

Parameters:
  • credential_id (str | UUID) – UUID of the credential to delete

  • ultimate (bool | None) – Whether to remove entirely or to the trashcan.

delete_filter(filter_id, *, ultimate=False)

Deletes an existing filter

Parameters:
  • filter_id (str | UUID) – UUID of the filter to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_group(group_id, *, ultimate=False)

Deletes an existing group

Parameters:
  • group_id (str | UUID) – UUID of the group to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_host(host_id)

Deletes an existing host

Parameters:

host_id (str | UUID) – UUID of the single host to delete.

delete_note(note_id, *, ultimate=False)

Delete an existing note

Parameters:
  • note_id (str | UUID) – UUID of the note to be deleted.

  • ultimate (bool | None) – Whether to remove entirely or to the trashcan.

delete_operating_system(operating_system_id)

Deletes an existing operating system

Parameters:

operating_system_id (str | UUID) – UUID of the single operating_system to delete.

delete_override(override_id, *, ultimate=False)

Delete an existing override

Parameters:
  • override_id (str | UUID) – UUID of an existing override to delete

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_permission(permission_id, *, ultimate=False)

Deletes an existing permission

Parameters:
  • permission_id (str | UUID) – UUID of the permission to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_policy(policy_id, *, ultimate=False)

Deletes an existing policy

Parameters:
  • policy_id (str | UUID) – UUID of the policy to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_port_list(port_list_id, *, ultimate=False)

Delete an existing port list

Parameters:
  • port_list_id (str | UUID) – UUID of the port list to be deleted.

  • ultimate (bool) – Whether to remove entirely, or to the trashcan.

delete_port_range(port_range_id)

Delete an existing port range

Parameters:

port_range_id (str | UUID) – UUID of the port range to be deleted.

delete_report(report_id)

Deletes an existing report

Parameters:

report_id (str | UUID) – UUID of the report to be deleted.

delete_report_format(report_format_id, *, ultimate=False)

Deletes an existing report format

Parameters:
  • report_format_id (str | UUID | ReportFormatType) – UUID of the report format to be deleted. or ReportFormatType (enum)

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_role(role_id, *, ultimate=False)

Deletes an existing role

Parameters:
  • role_id (str) – UUID of the role to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_scan_config(config_id, *, ultimate=False)

Deletes an existing config

Parameters:
  • config_id (str | UUID) – UUID of the config to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_scanner(scanner_id, ultimate=False)

Delete an existing scanner

Parameters:

scanner_id (str | UUID) – UUID of an existing scanner

delete_schedule(schedule_id, *, ultimate=False)

Deletes an existing schedule

Parameters:
  • schedule_id (str | UUID) – UUID of the schedule to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_tag(tag_id, *, ultimate=False)

Deletes an existing tag

Parameters:
  • tag_id (str | UUID) – UUID of the tag to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_target(target_id, *, ultimate=False)

Delete an existing target.

Parameters:
  • target_id (str | UUID) – UUID of an existing target to delete.

  • ultimate (bool | None) – Whether to remove entirely or to the trashcan.

delete_task(task_id, *, ultimate=False)

Deletes an existing task

Parameters:
  • task_id (str | UUID) – UUID of the task to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_ticket(ticket_id, *, ultimate=False)

Deletes an existing ticket

Parameters:
  • ticket_id (str | UUID) – UUID of the ticket to be deleted.

  • ultimate (bool | None) – Whether to remove entirely, or to the trashcan.

delete_tls_certificate(tls_certificate_id)

Deletes an existing tls certificate

Parameters:

tls_certificate_id (str | UUID) – UUID of the tls certificate to be deleted.

delete_user(user_id=None, *, name=None, inheritor_id=None, inheritor_name=None)

Delete an existing user

Either user_id or name must be passed.

Parameters:
  • user_id (str | UUID | None) – UUID of the task to be deleted.

  • name (str | None) – The name of the user to be deleted.

  • inheritor_id (str | UUID | None) – The UUID of the inheriting user or “self”. Overrides inheritor_name.

  • inheritor_name (str | None) – The name of the inheriting user.

describe_auth()

Describe authentication methods

Returns a list of all used authentication methods if such a list is available.

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

get_aggregates(resource_type, *, filter_string=None, filter_id=None, sort_criteria=None, data_columns=None, group_column=None, subgroup_column=None, text_columns=None, first_group=None, max_groups=None, mode=None, **kwargs)

Request aggregated information on a resource / entity type

Additional arguments can be set via the kwargs parameter for backward compatibility with older versions of python-gvm, but are not validated.

Parameters:
  • resource_type (EntityType | str) – The entity type to gather data from

  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • sort_criteria (Iterable[dict[str, str | SortOrder | AggregateStatistic]] | None) – List of sort criteria (dicts that can contain a field, stat and order)

  • data_columns (Iterable[str] | None) – List of fields to aggregate data from

  • group_column (str | None) – The field to group the entities by

  • subgroup_column (str | None) – The field to further group the entities inside groups by

  • text_columns (Iterable[str] | None) – List of simple text columns which no statistics are calculated for

  • first_group (int | None) – The index of the first aggregate group to return

  • max_groups (int | None) – The maximum number of aggregate groups to return, -1 for all

  • mode (int | None) – Special mode for aggregation

get_alert(alert_id, *, tasks=None)

Request a single alert

Parameters:
  • alert_id (str | UUID) – UUID of an existing alert

  • tasks (bool | None) – Whether to include the tasks using the alert

get_alerts(*, filter_string=None, filter_id=None, trash=None, tasks=None)

Request a list of alerts

Parameters:
  • filter – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – True to request the alerts in the trashcan

  • tasks (bool | None) – Whether to include the tasks using the alerts

get_audit(audit_id)

Request a single audit

Parameters:

audit_id (str | UUID) – UUID of an existing audit

get_audits(*, filter_string=None, filter_id=None, trash=None, details=None, schedules_only=None)

Request a list of audits

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get the trashcan audits instead

  • details (bool | None) – Whether to include full audit details

  • schedules_only (bool | None) – Whether to only include id, name and schedule details

get_cert_bund_advisories(*, filter_string=None, filter_id=None, name=None, details=None)

Request a list of CERT-BUND Advisories

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • name (str | None) – Name or identifier of the requested information

  • details (bool | None) – Whether to include information about references to this information

get_cert_bund_advisory(cert_id)

Request a single CERT-BUND Advisory

Parameters:

cert_id (str | UUID) – ID of an existing CERT-BUND Advisory

get_cpe(cpe_id)

Request a single CPE

Parameters:

cpe_id (str) – ID of an existing CPE

get_cpes(*, filter_string=None, filter_id=None, name=None, details=None)

Request a list of CPEs

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • name (str | None) – Name or identifier of the requested information

  • details (bool | None) – Whether to include information about references to this information

get_credential(credential_id, *, scanners=None, targets=None, credential_format=None)

Request a single credential

Parameters:
  • credential_id (str) – UUID of an existing credential

  • scanners (bool | None) – Whether to include a list of scanners using the credentials

  • targets (bool | None) – Whether to include a list of targets using the credentials

  • credential_format (CredentialFormat | str | None) – One of “key”, “rpm”, “deb”, “exe” or “pem”

get_credentials(*, filter_string=None, filter_id=None, scanners=None, trash=None, targets=None)

Request a list of credentials

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | None) – UUID of an existing filter to use for the query

  • scanners (bool | None) – Whether to include a list of scanners using the credentials

  • trash (bool | None) – Whether to get the trashcan credentials instead

  • targets (bool | None) – Whether to include a list of targets using the credentials

get_cve(cve_id)

Request a single CVE

Parameters:

cve_id (str) – ID of an existing CVE

get_cves(*, filter_string=None, filter_id=None, name=None, details=None)

Request a list of CVEs

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • name (str | None) – Name or identifier of the requested information

  • details (bool | None) – Whether to include information about references to this information

get_dfn_cert_advisories(*, filter_string=None, filter_id=None, name=None, details=None)

Request a list of DFN-CERT Advisories

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • name (str | None) – Name or identifier of the requested information

  • details (bool | None) – Whether to include information about references to this information

get_dfn_cert_advisory(cert_id)

Request a single DFN-CERT Advisory

Parameters:

cert_id (str | UUID) – ID of an existing DFN-CERT Advisory

get_feed(feed_type)

Request a single feed

Parameters:

feed_type (FeedType | str) – Type of single feed to get: NVT, CERT or SCAP

get_feeds()

Request the list of feeds

get_filter(filter_id, *, alerts=None)

Request a single filter

Parameters:
  • filter_id (str | UUID) – UUID of an existing filter

  • alerts (bool | None) – Whether to include list of alerts that use the filter.

get_filters(*, filter_string=None, filter_id=None, trash=None, alerts=None)

Request a list of filters

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get the trashcan filters instead

  • alerts (bool | None) – Whether to include list of alerts that use the filter.

get_group(group_id)

Request a single group

Parameters:

group_id (str | UUID) – UUID of an existing group

get_groups(*, filter_string=None, filter_id=None, trash=None)

Request a list of groups

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get the trashcan groups instead

get_host(host_id, *, details=None)

Request a single host

Parameters:
  • host_id (str | UUID) – UUID of an existing host

  • details (bool | None) – Whether to include additional information (e.g. tags)

get_hosts(*, filter_string=None, filter_id=None, details=None)

Request a list of hosts

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • details (bool | None) – Whether to include additional information (e.g. tags)

get_info(info_id, info_type)

Request a single secinfo

Parameters:
  • info_id (str | UUID) – ID of an existing secinfo

  • info_type (InfoType) – Type must be either CERT_BUND_ADV, CPE, CVE, DFN_CERT_ADV, OVALDEF, NVT

get_info_list(info_type, *, filter_string=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 or NVT

  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | None) – UUID of an existing filter to use for the query

  • name (str | None) – Name or identifier of the requested information

  • details (bool | None) – Whether to include information about references to this information

get_note(note_id)

Request a single note

Parameters:

note_id (str | UUID) – UUID of an existing note

get_notes(*, filter_string=None, filter_id=None, details=None, result=None)

Request a list of notes

Parameters:
  • filter_string (str | None) – Filter notes by a string

  • filter_string – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • details (bool | None) – Add info about connected results and tasks

  • result (bool | None) – Return the details of possible connected results.

get_nvt(nvt_id, *, extended=None)

Request a single NVT

Parameters:
  • nvt_id (str) – ID of an existing NVT

  • extended (bool | None) – Whether to receive extended NVT information (calls get_nvts, instead of get_info)

get_nvt_families(*, sort_order=None)

Request a list of nvt families

Parameters:

sort_order (str | None) – Sort order

get_nvt_preference(name, *, nvt_oid=None)

Request a nvt preference

Parameters:
  • name (str) – name of a particular preference

  • nvt_oid (str | None) – OID of nvt

  • config_id – UUID of scan config of which to show preference values

get_nvt_preferences(*, nvt_oid=None)

Request a list of preferences

The preference element includes just the name and value, with the NVT and type built into the name.

Parameters:

nvt_oid (str | None) – OID of nvt

get_nvts(*, filter_string=None, filter_id=None, name=None, details=None, extended=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:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | None) – UUID of an existing filter to use for the query

  • name (str | None) – Name or identifier of the requested information

  • details (bool | None) – Whether to include information about references to this information

  • extended (bool | None) – Whether to receive extended NVT information (calls get_nvts, instead of get_info)

  • preferences (bool | None) – Whether to include NVT preferences (only for extended)

  • preference_count (bool | None) – Whether to include preference count (only for extended)

  • timeout (bool | None) – Whether to include the special timeout preference (only for extended)

  • config_id (str | None) – UUID of scan config to which to limit the NVT listing (only for extended)

  • preferences_config_id (str | None) – UUID of scan config to use for preference values (only for extended)

  • family (str | None) – Family to which to limit NVT listing (only for extended)

  • sort_order (str | None) – Sort order (only for extended)

  • sort_field (str | None) – Sort field (only for extended)

get_operating_system(operating_system_id, *, details=None)

Request a single operating system

Parameters:
  • operating_system_id (str | UUID) – UUID of an existing operating_system

  • details (bool | None) – Whether to include additional information (e.g. tags)

get_operating_systems(*, filter_string=None, filter_id=None, details=None)

Request a list of operating systems

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • details (bool | None) – Whether to include additional information (e.g. tags)

get_override(override_id)

Request a single override

Parameters:

override_id (str | UUID) – UUID of an existing override

get_overrides(*, filter_string=None, filter_id=None, details=None, result=None)

Request a list of overrides

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • details (bool | None) – Whether to include full details

  • result (bool | None) – Whether to include results using the override

get_permission(permission_id)

Request a single permission

Parameters:

permission_id (str | UUID) – UUID of an existing permission

get_permissions(*, filter_string=None, filter_id=None, trash=None)

Request a list of permissions

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get permissions in the trashcan instead

get_policies(*, audits=None, filter_string=None, filter_id=None, details=None, families=None, preferences=None, trash=None)

Request a list of policies

Parameters:
  • audits (bool | None) – Whether to get audits using the policy

  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • details (bool | None) – Whether to get families, preferences, nvt selectors and tasks.

  • families (bool | None) – Whether to include the families if no details are requested

  • preferences (bool | None) – Whether to include the preferences if no details are requested

  • trash (bool | None) – Whether to get the trashcan audits instead

get_policy(policy_id, *, audits=None)

Request a single policy

Parameters:
  • policy_id (str | UUID) – UUID of an existing policy

  • audits (bool | None) – Whether to get audits using this policy

get_port_list(port_list_id)

Request a single port list

Parameters:

port_list_id (str | UUID) – UUID of an existing port list

get_port_lists(*, filter_string=None, filter_id=None, details=None, targets=None, trash=None)

Request a list of port lists

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • details (bool | None) – Whether to include full port list details

  • targets (bool | None) – Whether to include targets using this port list

  • trash (bool | None) – Whether to get port lists in the trashcan instead

static get_protocol_version()

Return the supported GMP version as major, minor version tuple

get_report(report_id, *, filter_string=None, filter_id=None, delta_report_id=None, report_format_id=None, ignore_pagination=None, details=True)

Request a single report

Parameters:
  • report_id (str | UUID) – UUID of an existing report

  • filter_string (str | None) – Filter term to use to filter results in the report

  • filter_id (str | None) – UUID of filter to use to filter results in the report

  • delta_report_id (str | UUID | None) – UUID of an existing report to compare report to.

  • report_format_id (str | ReportFormatType | None) – UUID of report format to use or ReportFormatType (enum)

  • ignore_pagination (bool | None) – Whether to ignore the filter terms “first” and “rows”.

  • details (bool | None) – Request additional report information details defaults to True

get_report_format(report_format_id)

Request a single report format

Parameters:

report_format_id (str | UUID | ReportFormatType) – UUID of an existing report format or ReportFormatType (enum)

get_report_formats(*, filter_string=None, filter_id=None, trash=None, alerts=None, params=None, details=None)

Request a list of report formats

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get the trashcan report formats instead

  • alerts (bool | None) – Whether to include alerts that use the report format

  • params (bool | None) – Whether to include report format parameters

  • details (bool | None) – Include report format file, signature and parameters

get_reports(*, filter_string=None, filter_id=None, note_details=None, override_details=None, ignore_pagination=None, details=None)

Request a list of reports

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • note_details (bool | None) – If notes are included, whether to include note details

  • override_details (bool | None) – If overrides are included, whether to include override details

  • ignore_pagination (bool | None) – Whether to ignore the filter terms “first” and “rows”.

  • details (bool | None) – Whether to exclude results

get_result(result_id)

Request a single result

Parameters:

result_id (str | UUID) – UUID of an existing result

get_results(*, filter_string=None, filter_id=None, task_id=None, note_details=None, override_details=None, details=None)

Request a list of results

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | None) – UUID of an existing filter to use for the query

  • task_id (str | None) – UUID of task for note and override handling

  • note_details (bool | None) – If notes are included, whether to include note details

  • override_details (bool | None) – If overrides are included, whether to include override details

  • details (bool | None) – Whether to include additional details of the results

get_role(role_id)

Request a single role

Parameters:

role_id (str | UUID) – UUID of an existing role

get_roles(*, filter_string=None, filter_id=None, trash=None)

Request a list of roles

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get the trashcan roles instead

get_scan_config(config_id, *, tasks=None)

Request a single scan config

Parameters:
  • config_id (str | UUID) – UUID of an existing scan config

  • tasks (bool | None) – Whether to get tasks using this config

get_scan_config_nvt(nvt_oid)

Request a single nvt

Parameters:

nvt_oid (str) – OID of an existing nvt

get_scan_config_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 (bool | None) – Whether to include full details

  • preferences (bool | None) – Whether to include nvt preferences

  • preference_count (bool | None) – Whether to include preference count

  • timeout (bool | None) – Whether to include the special timeout preference

  • config_id (str | UUID | None) – UUID of scan config to which to limit the NVT listing

  • preferences_config_id (str | UUID | None) – UUID of scan config to use for preference values

  • family (str | None) – Family to which to limit NVT listing

  • sort_order (str | None) – Sort order

  • sort_field (str | None) – Sort field

get_scan_config_preference(name, *, nvt_oid=None, config_id=None)

Request a nvt preference

Parameters:
  • name (str) – name of a particular preference

  • nvt_oid (str | None) – OID of nvt

  • config_id (str | UUID | None) – UUID of scan config of which to show preference values

get_scan_config_preferences(*, nvt_oid=None, config_id=None)

Request a list of scan_config 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. If the command includes a config_id and an nvt_oid, the preferences for the given nvt in the config will be shown.

Parameters:
  • nvt_oid (str | None) – OID of nvt

  • config_id (str | UUID | None) – UUID of scan config of which to show preference values

get_scan_configs(*, filter_string=None, filter_id=None, trash=None, details=None, families=None, preferences=None, tasks=None)

Request a list of scan configs

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get the trashcan scan configs instead

  • details (bool | None) – Whether to get config families, preferences, nvt selectors and tasks.

  • families (bool | None) – Whether to include the families if no details are requested

  • preferences (bool | None) – Whether to include the preferences if no details are requested

  • tasks (bool | None) – Whether to get tasks using this config

get_scanner(scanner_id)

Request a single scanner

Parameters:

scanner_id (str | UUID) – UUID of an existing scanner

get_scanners(*, filter_string=None, filter_id=None, trash=None, details=None)

Request a list of scanners

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get the trashcan scanners instead

  • details (bool | None) – Whether to include extra details like tasks using this scanner

get_schedule(schedule_id, *, tasks=None)

Request a single schedule

Parameters:
  • schedule_id (str | UUID) – UUID of an existing schedule

  • tasks (bool | None) – Whether to include tasks using the schedules

get_schedules(*, filter_string=None, filter_id=None, trash=None, tasks=None)

Request a list of schedules

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get the trashcan schedules instead

  • tasks (bool | None) – Whether to include tasks using the schedules

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 (str | None) – A string describing the required system report

  • duration (int | None) – The number of seconds into the past that the system report should include

  • start_time (str | None) – The start of the time interval the system report should include in ISO time format

  • end_time (str | None) – The end of the time interval the system report should include in ISO time format

  • brief (bool | None) – Whether to include the actual system reports

  • slave_id (str | UUID | None) – UUID of GMP scanner from which to get the system reports

get_tag(tag_id)

Request a single tag

Parameters:

tag_id (str | UUID) – UUID of an existing tag

get_tags(*, filter_string=None, filter_id=None, trash=None, names_only=None)

Request a list of tags

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get tags from the trashcan instead

  • names_only (bool | None) – Whether to get only distinct tag names

get_target(target_id, *, tasks=None)

Request a single target.

Parameters:
  • target_id (str | UUID) – UUID of the target to request.

  • tasks (bool | None) – Whether to include list of tasks that use the target

get_targets(*, filter_string=None, filter_id=None, trash=None, tasks=None)

Request a list of targets.

Parameters:
  • filter_string (str | None) – Filter term to use for the query.

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query.

  • trash (bool | None) – Whether to include targets in the trashcan.

  • tasks (bool | None) – Whether to include list of tasks that use the target.

get_task(task_id)

Request a single task

Parameters:

task_id (str | UUID) – UUID of an existing task

get_tasks(*, filter_string=None, filter_id=None, trash=None, details=None, schedules_only=None, ignore_pagination=None)

Request a list of tasks

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – Whether to get the trashcan tasks instead

  • details (bool | None) – Whether to include full task details

  • schedules_only (bool | None) – Whether to only include id, name and schedule details

  • ignore_pagination (bool | None) – Whether to ignore pagination settings (filter terms “first” and “rows”). Default is False.

get_ticket(ticket_id)

Request a single ticket

Parameters:

ticket_id (str | UUID) – UUID of an existing ticket

get_tickets(*, trash=None, filter_string=None, filter_id=None)

Request a list of tickets

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • trash (bool | None) – True to request the tickets in the trashcan

get_tls_certificate(tls_certificate_id)

Request a single TLS certificate

Parameters:

tls_certificate_id (str | UUID) – UUID of an existing TLS certificate

get_tls_certificates(*, filter_string=None, filter_id=None, include_certificate_data=None, details=None)

Request a list of TLS certificates

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

  • include_certificate_data (bool | None) – Whether to include the certificate data in the response

  • details (bool | None) – Whether to include additional details of the tls certificates

get_user(user_id)

Request a single user

Parameters:

user_id (str | UUID) – UUID of the user to be requested.

get_user_setting(setting_id)

Request a single user setting

Parameters:

setting_id (str | UUID) – UUID of an existing setting

get_user_settings(*, filter_string=None)

Request a list of user settings

Parameters:

filter_string (str | None) – Filter term to use for the query

get_users(*, filter_string=None, filter_id=None)

Request a list of users

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

get_version()

Get the Greenbone Vulnerability Management Protocol (GMP) version used by the remote gvmd.

get_vulnerabilities(*, filter_string=None, filter_id=None)

Request a list of vulnerabilities

Parameters:
  • filter_string (str | None) – Filter term to use for the query

  • filter_id (str | UUID | None) – UUID of an existing filter to use for the query

get_vulnerability(vulnerability_id)

Request a single vulnerability

Parameters:

vulnerability_id (str | UUID) – ID of an existing vulnerability

help(*, help_format=None, brief=None)

Get the help text

Parameters:
  • help_format (HelpFormat | str | None) – Format of of the help: “html”, “rnc”, “text” or “xml

  • brief (bool | None) – If True help is brief

import_policy(policy)

Import a policy from XML

Parameters:

policy (str) – Policy XML as string to import. This XML must contain a <get_configs_response> root element.

import_report(report, task_id, *, 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 (str | UUID) – UUID of task to import report to

  • in_asset – Whether to create or update assets using the report

import_report_format(report_format)

Import a report format from XML

Parameters:

report_format (str) – Report format XML as string to import. This XML must contain a <get_report_formats_response> root element.

import_scan_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.

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

Returns:

True if a connection to the remote server has been established.

Return type:

bool

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)

Modify an existing alert.

Parameters:
  • alert_id (str | UUID) – UUID of the alert to be modified.

  • name (str | None) – Name of the Alert.

  • condition (AlertCondition | str | 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 (dict[str, str] | None) – Data that defines the condition

  • event (AlertEvent | str | 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 (dict | None) – Data that defines the event

  • method (AlertMethod | str | 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 (dict[str, str] | None) – Data that defines the method

  • filter_id (str | UUID | None) – Filter to apply when executing alert

  • comment (str | None) – Comment for the alert

modify_audit(audit_id, *, name=None, policy_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 audit.

Parameters:
  • audit_id (str | UUID) – UUID of audit to modify.

  • name (str | None) – The name of the audit.

  • policy_id (str | UUID | None) – UUID of policy to use by the audit

  • target_id (str | UUID | None) – UUID of target to be scanned

  • scanner_id (str | UUID | None) – UUID of scanner to use for scanning the target

  • comment (str | None) – The comment on the audit.

  • alert_ids (list[str | UUID] | None) – List of UUIDs for alerts to be applied to the audit

  • hosts_ordering (HostsOrdering | str | None) – The order hosts are scanned in

  • schedule_id (str | UUID | None) – UUID of a schedule when the audit should be run.

  • schedule_periods (int | None) – A limit to the number of times the audit will be scheduled, or 0 for no limit.

  • observers (list[str | UUID] | None) – List of names or ids of users which should be allowed to observe this audit

  • preferences (dict[str, str] | None) – Name/Value pairs of scanner preferences.

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[str, str]) – The new auth config.

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, public_key=None)

Modifies an existing credential.

Parameters:
  • credential_id (str) – UUID of the credential

  • name (str | None) – Name of the credential

  • comment (str | None) – Comment for the credential

  • allow_insecure (bool | None) – Whether to allow insecure use of the credential

  • certificate (str | None) – Certificate for the credential

  • key_phrase (str | None) – Key passphrase for the private key

  • private_key (str | None) – Private key to use for login

  • login (str | None) – Username for the credential

  • password (str | None) – Password for the credential

  • auth_algorithm (SnmpAuthAlgorithm | str | None) – The authentication algorithm for SNMP

  • community (str | None) – The SNMP community

  • privacy_algorithm (SnmpPrivacyAlgorithm | str | None) – The privacy algorithm for SNMP

  • privacy_password (str | None) – The SNMP privacy password

  • public_key (str | None) – PGP public key in armor plain text format

modify_filter(filter_id, *, comment=None, name=None, term=None, filter_type=None)

Modifies an existing filter.

Parameters:
  • filter_id (str | UUID) – UUID of the filter to be modified

  • comment (str | None) – Comment on filter.

  • name (str | None) – Name of filter.

  • term (str | None) – Filter term.

  • filter_type (FilterType | None) – Resource type filter applies to.

modify_group(group_id, *, comment=None, name=None, users=None)

Modifies an existing group.

Parameters:
  • group_id (str | UUID) – UUID of group to modify.

  • comment (str | None) – Comment on group.

  • name (str | None) – Name of group.

  • users (list[str] | None) – List of user names to be in the group

modify_host(host_id, *, comment=None)

Modifies an existing host.

Parameters:
  • host_id (str | UUID) – UUID of the host to be modified.

  • comment (str | None) – Comment for the host. Not passing a comment arguments clears the comment for this host.

modify_note(note_id, text, *, days_active=None, hosts=None, port=None, result_id=None, severity=None, task_id=None)

Modify a note

Parameters:
  • note_id (str | UUID) – The UUID of the note to modify

  • text (str) – Text of the note

  • days_active (int | None) – Days note will be active. -1 on always, 0 off

  • hosts (list[str] | None) – A list of host addresses

  • port (str | None) – Port to which the override applies, needs to be a string in the form {number}/{protocol}

  • result_id (str | UUID | None) – UUID of a result to which note applies

  • severity (Real | None) – Severity to which note applies

  • task_id (str | UUID | None) – UUID of task to which note applies

modify_operating_system(operating_system_id, *, comment=None)

Modifies an existing operating system.

Parameters:
  • operating_system_id (str | UUID) – UUID of the operating_system to be modified.

  • comment (str | None) – Comment for the operating_system. Not passing a comment arguments clears the comment for this operating system.

modify_override(override_id, text, *, days_active=None, hosts=None, port=None, result_id=None, severity=None, new_severity=None, task_id=None)

Modify an existing override.

Parameters:
  • override_id (str | UUID) – UUID of override to modify.

  • text (str) – The text of the override.

  • days_active (int | None) – Days override will be active. -1 on always, 0 off.

  • hosts (list[str] | None) – A list of host addresses

  • port (str | None) – Port to which the override applies, needs to be a string in the form {number}/{protocol}

  • result_id (str | UUID | None) – Result to which override applies.

  • severity (Real | None) – Severity to which override applies.

  • new_severity (Real | None) – New severity score for result.

  • task_id (str | UUID | None) – Task to which override applies.

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) – UUID of permission to be modified.

  • comment (str | None) – The comment on the permission.

  • name (str | None) – Permission name, currently the name of a command.

  • subject_id (str | UUID | None) – UUID of subject to whom the permission is granted

  • subject_type (PermissionSubjectType | str | None) – Type of the subject user, group or role

  • resource_id (str | UUID | None) – UUID of entity to which the permission applies

  • resource_type (EntityType | str | None) – Type of the resource. For Super permissions user, group or role

modify_policy_set_comment(policy_id, comment=None)

Modifies the comment of an existing policy

Parameters:
  • policy_id (str | UUID) – UUID of policy to modify.

  • comment (str | None) – Comment to set on a policy. Default is an empty comment and the previous comment will be removed.

modify_policy_set_family_selection(policy_id, families, *, auto_add_new_families=True)

Selected the NVTs of a policy at a family level.

Parameters:
  • policy_id (str | UUID) – UUID of policy to modify.

  • families (Sequence[tuple[str, bool, bool]]) – A list of tuples with the first entry being the name of the NVT family selected, second entry a boolean indicating whether new NVTs should be added to the family automatically, and third entry a boolean indicating whether all nvts from the family should be included.

  • auto_add_new_families (bool | None) – Whether new families should be added to the policy automatically. Default: True.

modify_policy_set_name(policy_id, name)

Modifies the name of an existing policy

Parameters:
  • policy_id (str | UUID) – UUID of policy to modify.

  • name (str) – New name for the policy.

modify_policy_set_nvt_preference(policy_id, name, nvt_oid, *, value=None)

Modifies the nvt preferences of an existing policy.

Parameters:
  • policy_id (str | UUID) – UUID of policy to modify.

  • name (str) – Name for preference to change.

  • nvt_oid (str) – OID of the NVT associated with preference to modify

  • value (str | None) – New value for the preference. None to delete the preference and to use the default instead.

modify_policy_set_nvt_selection(policy_id, family, nvt_oids)

Modifies the selected nvts of an existing policy

The manager updates the given family in the policy to include only the given NVTs.

Parameters:
  • policy_id (str | UUID) – UUID of policy to modify.

  • family (str) – Name of the NVT family to include NVTs from

  • nvt_oids (Sequence[str]) – List of NVTs to select for the family.

modify_policy_set_scanner_preference(policy_id, name, *, value=None)

Modifies the scanner preferences of an existing policy

Parameters:
  • policy_id (str | UUID) – UUID of policy to modify.

  • name (str) – Name of the scanner preference to change

  • value (str | None) – New value for the preference. None to delete the preference and to use the default instead.

modify_port_list(port_list_id, *, comment=None, name=None)

Modify an existing port list.

Parameters:
  • port_list_id (str | UUID) – UUID of port list to modify.

  • name (str | None) – Name of port list.

  • comment (str | None) – Comment on port list.

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 | ReportFormatType) – UUID of report format to modify or ReportFormatType (enum)

  • active (bool | None) – Whether the report format is active.

  • name (str | None) – The name of the report format.

  • summary (str | None) – A summary of the report format.

  • param_name (str | None) – The name of the param.

  • param_value (str | None) – The value of the param.

modify_role(role_id, *, comment=None, name=None, users=None)

Modifies an existing role.

Parameters:
  • role_id (str | UUID) – UUID of role to modify.

  • comment (str | None) – Name of role.

  • name (str | None) – Comment on role.

  • users (list[str] | None) – List of user names.

modify_scan_config_set_comment(config_id, *, comment=None)

Modifies the comment of an existing scan config

Parameters:
  • config_id (str | UUID) – UUID of scan config to modify.

  • comment (str | None) – Comment to set on a config. Default is an empty comment and the previous comment will be removed.

modify_scan_config_set_family_selection(config_id, families, *, auto_add_new_families=True)

Selected the NVTs of a scan config at a family level.

Parameters:
  • config_id (str | UUID) – UUID of scan config to modify.

  • families (list[tuple[str, bool, bool]]) – A list of tuples (str, bool, bool): str: the name of the NVT family selected, bool: add new NVTs to the family automatically, bool: include all NVTs from the family

  • auto_add_new_families (bool | None) – Whether new families should be added to the scan config automatically. Default: True.

modify_scan_config_set_name(config_id, name)

Modifies the name of an existing scan config

Parameters:
  • config_id (str | UUID) – UUID of scan config to modify.

  • name (str) – New name for the config.

modify_scan_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) – UUID of scan config to modify.

  • name (str) – Name for nvt preference to change.

  • nvt_oid (str) – OID of the NVT associated with preference to modify

  • value (str | None) – New value for the preference. None to delete the preference and to use the default instead.

modify_scan_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) – UUID of scan config to modify.

  • family (str) – Name of the NVT family to include NVTs from

  • nvt_oids (tuple[str] | list[str]) – List of NVTs to select for the family.

modify_scan_config_set_scanner_preference(config_id, name, *, value=None)

Modifies the scanner preferences of an existing scan config

Parameters:
  • config_id (str | UUID) – UUID of scan config to modify.

  • name (str) – Name of the scanner preference to change

  • value (str | None) – New value for the preference. None to delete the preference and to use the default instead.

modify_scanner(scanner_id, *, name=None, host=None, port=None, scanner_type=None, credential_id=None, ca_pub=None, comment=None)

Modify an existing scanner

Parameters:
  • scanner_id (str | UUID) – UUID of the scanner to modify

  • name (str | None) – New name of the scanner

  • host (str | None) – New hostname or IP address of the scanner

  • port (int | None) – New port of the scanner

  • scanner_type (ScannerType | None) – New type of the scanner

  • credential_id (str | UUID | None) – New UUID of client certificate credential for the scanner

  • ca_pub (str | None) – New certificate of CA to verify scanner certificate

  • comment (str | None) – New comment for the scanner

modify_schedule(schedule_id, *, name=None, icalendar=None, timezone=None, comment=None)

Modifies an existing schedule

Parameters:
  • schedule_id (str | UUID) – UUID of the schedule to be modified

  • name (str | None) – Name of the schedule

  • icalendar (str | None) – iCalendar (RFC 5545) based data.

  • timezone (str | None) – Timezone to use for the icalendar events e.g Europe/Berlin. If the datetime values in the icalendar data are missing timezone information this timezone gets applied. Otherwise the datetime values from the icalendar data are displayed in this timezone

  • comment (str | None) – Comment on schedule.

modify_tag(tag_id, *, comment=None, name=None, value=None, active=None, resource_action=None, resource_type=None, resource_filter=None, resource_ids=None)

Modifies an existing tag.

Parameters:
  • tag_id (str | UUID) – UUID of the tag.

  • comment (str | None) – Comment to add to the tag.

  • name (str | None) – Name of the tag.

  • value (str | None) – Value of the tag.

  • active (bool | None) – Whether the tag is active.

  • resource_action (str | None) – Whether to add or remove resources instead of overwriting. One of ‘’, ‘add’, ‘set’ or ‘remove’.

  • resource_type (EntityType | None) – Type of the resources to which to attach the tag. Required if resource_filter is set.

  • resource_filter (str | None) – Filter term to select resources the tag is to be attached to.

  • resource_ids (list[str | UUID] | None) – IDs of the resources to which to attach the tag.

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, allow_simultaneous_ips=None, reverse_lookup_only=None, reverse_lookup_unify=None, port_list_id=None)

Modify an existing target.

Parameters:
  • target_id (str | UUID) – UUID of target to modify.

  • comment (str | None) – Comment on target.

  • name (str | None) – Name of target.

  • hosts (list[str] | None) – List of target hosts.

  • exclude_hosts (list[str] | None) – A list of hosts to exclude.

  • ssh_credential_id (str | UUID | None) – UUID of SSH credential to use on target.

  • ssh_credential_port (int | str | None) – The port to use for ssh credential

  • smb_credential_id (str | UUID | None) – UUID of SMB credential to use on target.

  • esxi_credential_id (str | UUID | None) – UUID of ESXi credential to use on target.

  • snmp_credential_id (str | UUID | None) – UUID of SNMP credential to use on target.

  • port_list_id (str | UUID | None) – UUID of port list describing ports to scan.

  • alive_test (str | AliveTest | None) – Which alive tests to use.

  • allow_simultaneous_ips (bool | None) – Whether to scan multiple IPs of the same host simultaneously

  • reverse_lookup_only (bool | None) – Whether to scan only hosts that have names.

  • reverse_lookup_unify (bool | None) – Whether to scan only one IP when multiple IPs have the same name.

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) – UUID of task to modify.

  • name (str | None) – The name of the task.

  • config_id (str | UUID | None) – UUID of scan config to use by the task

  • target_id (str | UUID | None) – UUID of target to be scanned

  • scanner_id (str | UUID | None) – UUID of scanner to use for scanning the target

  • comment (str | None) – The comment on the task.

  • alert_ids (Sequence[str | UUID] | None) – List of UUIDs for alerts to be applied to the task

  • hosts_ordering (HostsOrdering | None) – The order hosts are scanned in

  • schedule_id (str | UUID | None) – UUID of a schedule when the task should be run.

  • schedule_periods (int | None) – A limit to the number of times the task will be scheduled, or 0 for no limit.

  • observers (Sequence[str] | None) – List of names or ids of users which should be allowed to observe this task

  • preferences (Mapping[str, SupportsStr] | None) – Name/Value pairs of scanner preferences.

modify_ticket(ticket_id, *, status=None, note=None, assigned_to_user_id=None, comment=None)

Modify a single ticket

Parameters:
  • ticket_id (str | UUID) – UUID of an existing ticket

  • status (TicketStatus | str | None) – New status for the ticket

  • note (str | None) – Note for the status change. Required if status is set.

  • assigned_to_user_id (str | UUID | None) – UUID of the user the ticket should be assigned to

  • comment (str | None) – Comment for the ticket

modify_tls_certificate(tls_certificate_id, *, name=None, comment=None, trust=None)

Modifies an existing TLS certificate.

Parameters:
  • tls_certificate_id (str | UUID) – UUID of the TLS certificate to be modified.

  • name (str | None) – Name of the TLS certificate, defaulting to the MD5 fingerprint

  • comment (str | None) – Comment for the TLS certificate.

  • trust (bool | None) – Whether the certificate is trusted.

modify_user(user_id, *, name=None, comment=None, password=None, auth_source=None, role_ids=None, hosts=None, hosts_allow=False, group_ids=None)

Modify an existing user.

Most of the fields need to be supplied for changing a single field even if no change is wanted for those. Else empty values are inserted for the missing fields instead.

Parameters:
  • user_id (str | UUID) – UUID of the user to be modified.

  • name (str | None) – The new name for the user.

  • comment (str | None) – Comment on the user.

  • password (str | None) – The password for the user.

  • auth_source (UserAuthType | None) – Source allowed for authentication for this user.

  • roles_id – List of roles UUIDs for the user.

  • hosts (list[str] | None) – User access rules: List of hosts.

  • hosts_allow (bool | None) – Defines how the hosts list is to be interpreted. If False (default) the list is treated as a deny list. All hosts are allowed by default except those provided by the hosts parameter. If True the list is treated as a allow list. All hosts are denied by default except those provided by the hosts parameter.

  • group_ids (list[str | UUID] | None) – List of group UUIDs for the user.

modify_user_setting(*, setting_id=None, name=None, value=None)

Modifies an existing user setting.

Parameters:
  • setting_id (str | UUID | None) – UUID of the setting to be changed.

  • name (str | None) – The name of the setting. Either setting_id or name must be passed.

  • value (str | None) – The value of the setting.

move_task(task_id, *, slave_id=None)

Move an existing task to another GMP slave scanner or the master

Parameters:
  • task_id (str | UUID) – UUID of the task to be moved

  • slave_id (str | UUID | None) – UUID of the sensor to reassign the task to, empty for master.

restore_from_trashcan(entity_id)

Restore an entity from the trashcan

Parameters:

entity_id (str | UUID) – ID of the entity to be restored from the trashcan

resume_audit(audit_id)

Resume an existing stopped audit

Parameters:

audit_id (str | UUID) – UUID of the audit to be resumed

resume_task(task_id)

Resume an existing stopped task

Parameters:

task_id (str | UUID) – UUID of the task to be resumed

send_command(cmd)

Send a string command to the remote daemon and return the response as string

start_audit(audit_id)

Start an existing audit

Parameters:

audit_id (str | UUID) – UUID of the audit to be started

start_task(task_id)

Start an existing task

Parameters:

task_id (str | UUID) – UUID of the task to be started

stop_audit(audit_id)

Stop an existing running audit

Parameters:

audit_id (str | UUID) – UUID of the audit to be stopped

stop_task(task_id)

Stop an existing running task

Parameters:

task_id (str | UUID) – UUID of the task to be stopped

test_alert(alert_id)

Run an alert

Invoke a test run of an alert

Parameters:

alert_id (str | UUID) – UUID of the alert to be tested

trigger_alert(alert_id, report_id, *, filter_string=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) – UUID of the alert to be run

  • report_id (str | UUID) – UUID of the report to be provided to the alert

  • filter – Filter term to use to filter results in the report

  • filter_id (str | UUID | None) – UUID of filter to use to filter results in the report

  • report_format_id (str | UUID | ReportFormatType | None) – UUID of report format to use or ReportFormatType (enum)

  • delta_report_id (str | UUID | None) – UUID of an existing report to compare report to.

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 | ReportFormatType) – UUID of the report format to be verified or ReportFormatType (enum)

verify_scanner(scanner_id)

Verify an existing scanner

Parameters:

scanner_id (str | UUID) – UUID of an existing scanner

Enums

class AlertCondition

Enum for alert condition types

ALWAYS = 'Always'
ERROR = 'Error'
FILTER_COUNT_AT_LEAST = 'Filter count at least'
FILTER_COUNT_CHANGED = 'Filter count changed'
SEVERITY_AT_LEAST = 'Severity at least'
SEVERITY_CHANGED = 'Severity changed'
__new__(value)
class AlertEvent

Enum for alert event types

ASSIGNED_TICKET_CHANGED = 'Assigned ticket changed'
NEW_SECINFO_ARRIVED = 'New SecInfo arrived'
OWNED_TICKET_CHANGED = 'Owned ticket changed'
TASK_RUN_STATUS_CHANGED = 'Task run status changed'
TICKET_RECEIVED = 'Ticket received'
UPDATED_SECINFO_ARRIVED = 'Updated SecInfo arrived'
__new__(value)
class AlertMethod

Enum for alert method type

ALEMBA_VFIRE = 'Alemba vFire'
EMAIL = 'Email'
HTTP_GET = 'HTTP Get'
SCP = 'SCP'
SEND = 'Send'
SMB = 'SMB'
SNMP = 'SNMP'
SOURCEFIRE_CONNECTOR = 'Sourcefire Connector'
START_TASK = 'Start Task'
SYSLOG = 'Syslog'
TIPPINGPOINT_SMS = 'TippingPoint SMS'
VERINICE_CONNECTOR = 'verinice Connector'
__new__(value)
class AliveTest

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'
__new__(value)
classmethod from_string(alive_test)

Convert an alive test string into a AliveTest instance

class CredentialFormat

Enum for credential format

DEB = 'deb'
EXE = 'exe'
KEY = 'key'
PEM = 'pem'
RPM = 'rpm'
__new__(value)
class CredentialType

Enum for credential types

CLIENT_CERTIFICATE = 'cc'
PASSWORD_ONLY = 'pw'
PGP_ENCRYPTION_KEY = 'pgp'
SMIME_CERTIFICATE = 'smime'
SNMP = 'snmp'
USERNAME_PASSWORD = 'up'
USERNAME_SSH_KEY = 'usk'
__new__(value)
class EntityType

Enum for entity types

ALERT = 'alert'
ASSET = 'asset'
AUDIT = 'audit'
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'
POLICY = 'policy'
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'
TICKET = 'ticket'
TLS_CERTIFICATE = 'tls_certificate'
USER = 'user'
VULNERABILITY = 'vuln'
__new__(value)
classmethod from_string(entity_type)

Convert a entity type string to an actual EntityType instance

Parameters:

entity_type (str | None) – Entity type string to convert to a EntityType

class FeedType

Enum for feed types

CERT = 'CERT'
GVMD_DATA = 'GVMD_DATA'
NVT = 'NVT'
SCAP = 'SCAP'
__new__(value)
class FilterType

Enum for filter types

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'
TICKET = 'ticket'
TLS_CERTIFICATE = 'tls_certificate'
USER = 'user'
VULNERABILITY = 'vuln'
__new__(value)
classmethod from_string(filter_type)

Convert a filter type string to an actual FilterType instance

Parameters:

filter_type (str) – Filter type string to convert to a FilterType

class HostsOrdering

Enum for host ordering during scans

RANDOM = 'random'
REVERSE = 'reverse'
SEQUENTIAL = 'sequential'
__new__(value)
class HelpFormat

Enum for the help format

HTML = 'html'
RNC = 'rnc'
TEXT = 'text'
XML = 'xml'
__new__(value)
class InfoType

Enum for info types

CERT_BUND_ADV = 'CERT_BUND_ADV'
CPE = 'CPE'
CVE = 'CVE'
DFN_CERT_ADV = 'DFN_CERT_ADV'
NVT = 'NVT'
OVALDEF = 'OVALDEF'
__new__(value)
class PermissionSubjectType

Enum for permission subject type

GROUP = 'group'
ROLE = 'role'
USER = 'user'
__new__(value)
class PortRangeType

Enum for port range type

TCP = 'TCP'
UDP = 'UDP'
__new__(value)
class ReportFormatType

Enum for builtin report formats

ANONYMOUS_XML = '5057e5cc-b825-11e4-9d0e-28d24461215b'
ARF = '910200ca-dc05-11e1-954f-406186ea4fc5'
CPE = '5ceff8ba-1f62-11e1-ab9f-406186ea4fc5'
CSV_HOSTS = '9087b18c-626c-11e3-8892-406186ea4fc5"'
CSV_RESULTS = 'c1645568-627a-11e3-a660-406186ea4fc5'
GCR_PDF = 'dc51a40a-c022-11e9-b02d-3f7ca5bdcb11'
GSR_HTML = 'ffa123c9-a2d2-409e-bbbb-a6c1385dbeaa'
GSR_PDF = '35ba7077-dc85-42ef-87c9-b0eda7e903b6'
GXCR_PDF = 'f0d348de-c022-11e9-bc4c-4bf1d5e1a8ca'
GXR_PDF = 'ebbc7f34-8ae5-11e1-b07b-001f29eadec8'
ITG = '77bd6c4a-1f62-11e1-abf0-406186ea4fc5'
LATEX = 'a684c02c-b531-11e1-bdc2-406186ea4fc5'
NBE = '9ca6fe72-1f62-11e1-9e7c-406186ea4fc5'
PDF = 'c402cc3e-b531-11e1-9163-406186ea4fc5'
SVG = '9e5e5deb-879e-4ecc-8be6-a71cd0875cdd'
TXT = 'a3810a62-1f62-11e1-9219-406186ea4fc5'
VERINICE_ISM = 'c15ad349-bd8d-457a-880a-c7056532ee15'
VERINICE_ITG = '50c9950a-f326-11e4-800c-28d24461215b'
XML = 'a994b278-1f62-11e1-96ac-406186ea4fc5'
__new__(value)
class ScannerType

Enum for scanner type

CVE_SCANNER_TYPE = '3'
GREENBONE_SENSOR_SCANNER_TYPE = '5'
OPENVAS_SCANNER_TYPE = '2'
__new__(value)
classmethod from_string(scanner_type)

Convert a scanner type string to an actual ScannerType instance

Parameters:

scanner_type (str | None) – Scanner type string to convert to a ScannerType

class SnmpAuthAlgorithm

Enum for SNMP auth algorithm

MD5 = 'md5'
SHA1 = 'sha1'
__new__(value)
class SnmpPrivacyAlgorithm

Enum for SNMP privacy algorithm

AES = 'aes'
DES = 'des'
__new__(value)
class TicketStatus

Enum for ticket status

CLOSED = 'Closed'
FIXED = 'Fixed'
OPEN = 'Open'
__new__(value)