Skip to content

Commit

Permalink
Fix: Fix scan config creation from CERT-Bunds.
Browse files Browse the repository at this point in the history
Replace the deprecated method modify_scan_config
  • Loading branch information
a-h-abdelsalam authored and greenbonebot committed Jul 30, 2024
1 parent 94d6a4f commit 33cbfb3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/cfg-gen-for-certs.gmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ def create_scan_config(gmp, cert_bund_name):

# Modify the config with the nvts oid
for family, nvt_oid in nvt_dict.items():
gmp.modify_scan_config(
config_id=config_id, nvt_oids=nvt_oid, family=family
)
try:
gmp.modify_scan_config_set_nvt_selection(
config_id=config_id, nvt_oids=nvt_oid, family=family
)
except GvmError as gvmerr:
print(f"{gvmerr=}")

# This nvts must be present to work
family = "Port scanners"
nvts = ["1.3.6.1.4.1.25623.1.0.14259", "1.3.6.1.4.1.25623.1.0.100315"]
gmp.modify_scan_config(
gmp.modify_scan_config_set_nvt_selection(
config_id=config_id, nvt_oids=nvts, family=family
)

Expand Down

0 comments on commit 33cbfb3

Please sign in to comment.