Server Management

Server

class nessus.Server(uri, api)
load()

Requests the current Nessus server load and platform type.

Permissions:

  • authenticated: Yes
  • administrator: No
preferences(**kwargs)

Requests or update the Nessus server advanced settings.

Parameters:kwargs – settings name and value to change (e.g. checks_read_timeout=5)

Permissions:

  • authenticated: Yes
  • administrator: Yes

Example:

>>> from nessus import API
>>> nessus = API('https://127.0.0.1:8834', username='user', password='pass')
>>> print nessus.server.preferences()
{
  "xmlrpc_listen_port": "8834",
  "auto_update_delay": "24",
  "nasl_log_type": "none",
  "log_whole_attack": "no",
  "optimize_test": "yes",
  (...)
}
>>> nessus.server.preferences(xmlrpc_listen_port=8845)
>>> print nessus.server.preferences()
{
  "xmlrpc_listen_port": "8845",
  "auto_update_delay": "24",
  "nasl_log_type": "none",
  "log_whole_attack": "no",
  "optimize_test": "yes",
  (...)
}
>>> print nessus.server.preferences()['xmlrpc_listen_port']
8845
register(code)

Registers the Nessus server with Tenable Network Security using the plugin feed registration code.

Parameters:code – a Nessus plugin feed registration code

Permissions:

  • authenticated: No
  • administrator: No
restart()

Directs the Nessus server to restart.

This function is only valid during the initial installation and registration process.

Permissions:

  • authenticated: No
  • administrator: No
securesettings(**kwargs)

Requests or update the Nessus server settings

Proxy information, User-Agent, and custom update host.

Parameters:kwargs – settings name and value to change (e.g. proxy='example.com')

Permissions:

  • authenticated: Yes
  • administrator: Yes

Example:

>>> from nessus import API
>>> nessus = API('https://127.0.0.1:8834', username='user', password='pass')
>>> print nessus.server.securesettings()
{u'proxysettings': {u'proxy_password': None, u'proxy_port': u'8080', (...)
>>> nessus.server.securesettings(proxy_port='8081')
>>> print nessus.server.securesettings()
{u'proxysettings': {u'proxy_password': None, u'proxy_port': u'8081', (...)
>>> print nessus.server.securesettings()['proxysettings']['proxy_port']
8081
update()

Directs the Nessus server to force a plugin update.

Note that if the server is not yet registered, then authentication is not required. Once the server is registered with a Nessus Feed ID, then the request must be made as an authenticated administrator.

Permissions:

  • authenticated: Yes
  • administrator: Yes

Preferences

class nessus.Preferences(uri, api)
list()

List of settings from the nessusd.conf file.

Permissions:

  • authenticated: Yes
  • administrator: No

Example:

>>> from nessus import API
>>> nessus = API('https://127.0.0.1:8834', username='user', password='pass')
>>> print nessus.preferences.list()
{
  "listen_port": "1241",
  "max_hosts": "80",
  "auto_update": "yes",
  "throttle_scan": "yes",
  (...)
}