-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(integrations): Tenable nessus scans (#767)
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Generic interface for Tenable Nessus via pyTenable. | ||
https://github.com/tenable/pyTenable/blob/main/tests/nessus/conftest.py | ||
""" | ||
|
||
from tenable.nessus import Nessus | ||
|
||
from tracecat_registry import RegistrySecret, registry, secrets | ||
|
||
tenable_secret = RegistrySecret( | ||
name="tenable_nessus", | ||
keys=["TENNABLE_ACCESS_KEY", "TENNABLE_SECRET_KEY"], | ||
) | ||
"""Tenable Nessus secret. | ||
- name: `tenable_nessus` | ||
- keys: | ||
- `TENNABLE_ACCESS_KEY` | ||
- `TENNABLE_SECRET_KEY` | ||
""" | ||
|
||
|
||
@registry.register( | ||
default_title="Call Nessus API", | ||
description="Call any Nessus API using the pyTenable library", | ||
display_group="Tenabl Nessus", | ||
doc_url="https://pytenable.readthedocs.io/en/stable/api/nessus/index.html", | ||
namespace="integrations.tenable_nessus", | ||
secrets=[tenable_secret], | ||
) | ||
async def call_api(object_name: str, method_name: str, params: dict) -> dict: | ||
nessus = Nessus( | ||
access_key=secrets.get("TENNABLE_ACCESS_KEY"), | ||
secret_key=secrets.get("TENNABLE_SECRET_KEY"), | ||
) | ||
return await getattr(getattr(nessus, object_name), method_name)(**params) |
25 changes: 25 additions & 0 deletions
25
registry/tracecat_registry/templates/tenable_nessus/list_vulnerabilities.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
type: action | ||
definition: | ||
title: List Tenable Nessus scans | ||
description: List vulnerability scans from a Tenable Nessus instance | ||
display_group: Tenable Nessus | ||
doc_url: https://pytenable.readthedocs.io/en/stable/api/nessus/scans.html#tenable.nessus.scans.ScansAPI.details | ||
namespace: integrations.tenable_nessus | ||
name: list_vulnerabilities | ||
expects: | ||
scan_id: | ||
type: int | ||
description: Maximum number of scans to return | ||
default: 100 | ||
api_domain: | ||
type: str | ||
description: API domain to call | ||
steps: | ||
- ref: list_vulnerabilities | ||
action: integrations.tenable_nessus.call_api | ||
args: | ||
object_name: scans | ||
method_name: list | ||
params: | ||
scan_id: ${{ inputs.scan_id }} | ||
returns: ${{ steps.list_vulnerabilities.result }} |