Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up logs in Agent Nuclei #77

Merged
merged 5 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions agent/agent_nuclei.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Agent implementation for nuclei scanner."""

import dataclasses
import ipaddress
import json
Expand Down Expand Up @@ -151,7 +152,7 @@ def process(self, message: m.Message) -> None:
Returns:

"""
logger.info("processing message of selector : %s", message.selector)
logger.debug("processing message of selector : %s", message.selector)
if self._is_target_already_processed(message) is True:
return

Expand All @@ -175,7 +176,7 @@ def process(self, message: m.Message) -> None:
if self.args.get("use_default_templates", True):
self._run_command(targets)
self._mark_target_as_processed(message)
logger.info("Done processing message of selector : %s", message.selector)
logger.debug("Done processing message of selector : %s", message.selector)

def _parse_output(self) -> None:
"""Parse Nuclei Json output and emit the findings as vulnerabilities"""
Expand Down
1 change: 1 addition & 0 deletions agent/formatters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module exposing functionalities to format technical details of the findings before emitting them."""

from typing import Any, Callable


Expand Down
3 changes: 2 additions & 1 deletion agent/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Helper for nuclei Agent to complete the scan."""

import ipaddress
import logging
from typing import Tuple, cast, Optional
Expand Down Expand Up @@ -82,7 +83,7 @@ def build_vuln_location(
- VulnerabilityLocation.
"""
if matched_at is None or matched_at == "":
logger.info("Matched at value is absent.")
logger.debug("Matched at value is absent.")
return None
metadata = []
target = parse.urlparse(matched_at)
Expand Down
1 change: 1 addition & 0 deletions agent/vpn/wg_vpn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Enable VPN connection through wireguard."""

import pathlib
import subprocess
import logging
Expand Down
1 change: 1 addition & 0 deletions tests/agent_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unittests for nuclei class."""

import subprocess
from unittest import mock

Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pytest fixture for the nuclei agent_nuclei."""

import pathlib
import random
import json
Expand Down
1 change: 1 addition & 0 deletions tests/formatters_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit test for the findings formatters."""

from pytest_mock import plugin

from agent import formatters
Expand Down
1 change: 1 addition & 0 deletions tests/vpn/vpn_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for the VPN configuration."""

from pytest_mock import plugin

from agent.vpn import wg_vpn
Expand Down
Loading