Skip to content

Commit

Permalink
Merge pull request #41 from cisagov/improvement/add_debug_option_to_s…
Browse files Browse the repository at this point in the history
…canner

Add a debug flag to the `ioc_scanner.py` stand-alone functionality
  • Loading branch information
mcdonnnj committed Jul 22, 2022
2 parents 6b4d0ef + 1d1061b commit 49e8191
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# These owners will be the default owners for everything in the
# repo. Unless a later match takes precedence, these owners will be
# requested for review when someone opens a pull request.
* @dav3r @felddy @mcdonnnj
* @dav3r @felddy @jsf9k @mcdonnnj

# These folks own any files in the .github directory at the root of
# the repository and any of its subdirectories.
Expand Down
2 changes: 1 addition & 1 deletion src/ioc_scan/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""This file defines the version of this module."""
__version__ = "1.3.0"
__version__ = "1.4.0"
15 changes: 14 additions & 1 deletion src/ioc_scan/ioc_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,22 @@ def main():
description="Indicators of compromise (IoC) scanning tool."
)
parser.add_argument(
"-f", "--file", dest="hashfile", help="Get IOC hashes from specified file."
"-d",
"--debug",
dest="debug_output",
action="store_true",
help="enable debug logging output",
)
parser.add_argument(
"-f", "--file", dest="hashfile", help="get IOC hashes from specified file"
)
args = parser.parse_args()

logging.basicConfig(
format="%(asctime)-15s %(levelname)s %(message)s",
level=logging.DEBUG if args.debug_output else logging.INFO,
)

if args.hashfile:
logging.debug("Reading hashes from '%s'.", args.hashfile)
with open(args.hashfile) as f:
Expand Down

0 comments on commit 49e8191

Please sign in to comment.