Skip to content

Commit

Permalink
Drop auto-fp AP-297
Browse files Browse the repository at this point in the history
  • Loading branch information
y0urself committed Feb 23, 2024
1 parent 5c16e1a commit 8b45528
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
1 change: 0 additions & 1 deletion scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ This script can test different methods of the gmp API.
|`--showlog` | Include log messages in output.
| `--show-ports` | Include port of given vulnerable nvt in output.
| `--scanend` | Include timestamp of scan end in output.
| `--autofp {0,1,2}` | Trust vendor security updates for automatic false positive filtering (`0=No`, `1=full match`, `2=partial`).
| `-e`, `--empty-as-unknown` | Respond with `UNKNOWN` on empty results.
| `-I MAX_RUNNING_INSTANCES`, `--max-running-instances MAX_RUNNING_INSTANCES` | Set the maximum simultaneous processes of check-gmp
| `--hostname [HOSTNAME]`
Expand Down
25 changes: 9 additions & 16 deletions scripts/check-gmp.gmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from datetime import datetime, timedelta, tzinfo
from pathlib import Path
from typing import Any, Tuple
from xml.etree import ElementTree

from gvm.protocols.gmp import Gmp
from lxml import etree
Expand Down Expand Up @@ -604,17 +603,18 @@ def status(gmp: Gmp, report_manager: ReportManager, script_args: Namespace):
* Overrides
"""
params_used = (
f"task={script_args.task} autofp={script_args.autofp} "
f"task={script_args.task}"
f"overrides={script_args.overrides} "
f"apply_overrides={script_args.apply_overrides}"
)
filter_string = f'permission=any owner=any rows=1 name="{script_args.task}"'
filter_string = f'permission=any owner=any name="{script_args.task}"'
print("Getting task with filter_string='{filter_string}'")

if script_args.task:
task: str = gmp.get_tasks(filter_string=filter_string)
task: etree.Element = gmp.get_tasks(filter_string=filter_string)
if script_args.trend:
trend = task.xpath("task/trend/text()")
trend: str = task.find("task/trend").text
# trend = task.xpath("task/trend/text()")

if not trend:
end_session(
Expand Down Expand Up @@ -670,7 +670,7 @@ def status(gmp: Gmp, report_manager: ReportManager, script_args: Namespace):
report_id=last_report_id,
filter_string=(
"sort-reverse=id result_hosts_only=1 min_cvss_base= "
f"min_qod= levels=hmlgd autofp={script_args.autofp} "
f"min_qod= levels=hmlgd "
"notes=0 "
f"apply_overrides={script_args.apply_overrides} "
f"overrides={script_args.overrides} first=1 rows=-1 "
Expand All @@ -694,7 +694,9 @@ def status(gmp: Gmp, report_manager: ReportManager, script_args: Namespace):


def filter_report(
report_manager: ReportManager, report: ElementTree, script_args
report_manager: ReportManager,
report: etree.ElementTree,
script_args: Namespace,
):
"""Filter out the information in a report
Expand Down Expand Up @@ -1230,15 +1232,6 @@ def _parse_args(args: Namespace) -> Namespace:
help="Include timestamp of scan end in output. Default: False",
)

parser.add_argument(
"--autofp",
type=int,
choices=[0, 1, 2],
default=0,
help="Trust vendor security updates for automatic false positive"
" filtering (0=No, 1=full match, 2=partial).",
)

parser.add_argument(
"-e",
"--empty-as-unknown",
Expand Down

0 comments on commit 8b45528

Please sign in to comment.