Python3 bindings and CLI tools for Nexpose API version 3
Project description
Python3 bindings and CLI tools for the Nexpose API version 3.
cli programs
nsc-exporter
A Prometheus exporter for Nexpose scan console metrics.
A systemd service file is provided at etc/systemd/system/nexpose-exporter.service, and a sample env file at etc/defaults/nexpose-exporter.env. These will be relative to your virtualenv for a virtualenv install, relative to $HOME/.local for a pip install --user install, and (probably, depending on your OS) relative to /usr/local for a root pip install.
nsc-remove-old-reports
nsc-remove-old-sites
library usage
Basic usage:
import nexpose.nexpose as nexpose
login = nexpose.login(
base_url='https://localhost:3780',
user='some_nexpose_user',
password='secure_nexpose_password',
)
nexpose.engines(nlogin=login)
For argument parsing:
parser = nexposeargs.parser
parser.description = "My nexpose script"
parser.add_argument(
"-f",
"--foo",
help="foo argument",
action="store",
)
args = parser.parse_args()
base_url = ':'.join([args.baseurl, args.port])
login = nexpose.login(
base_url=base_url,
user=args.user,
password=args.password,
verify=args.verify,
)
alternatives
nexpose is the official python binding for Nexpose API versions 1.1 and 1.2
nexpose-rest is unofficial. It is auto-generated and thus far more comprehensive than nexpose-py.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.