Skip to content

Commit 6de4a72

Browse files
committed
Released version 0.1.2
1 parent ee0af3b commit 6de4a72

File tree

8 files changed

+26
-22
lines changed

8 files changed

+26
-22
lines changed

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include readme.md
2+
include LICENSE
3+
include requirements.txt

hawk_scanner/commands/fs.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
from rich.console import Console
44
from hawk_scanner.internals import system
55
import os
6-
import re
7-
import time
8-
import yaml
96
import concurrent.futures
107

118
def process_file(file_path, key, results):

hawk_scanner/commands/mysql.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import argparse
2-
import yaml
31
import mysql.connector
42
from hawk_scanner.internals import system
53
import re

hawk_scanner/commands/redis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import argparse
21
import redis
32
import yaml
43
from hawk_scanner.internals import system

hawk_scanner/commands/s3.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import argparse
21
import boto3
32
import os
4-
import re
53
import time
64
import yaml
75
from hawk_scanner.internals import system

hawk_scanner/main.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def clear_screen():
2020

2121
console = Console()
2222

23+
## Now separate the results by data_source
24+
data_sources = ['s3', 'mysql', 'redis', 'firebase', 'gcs', 'fs']
25+
2326
def load_command_module(command):
2427
try:
2528
module = importlib.import_module(f"hawk_scanner.commands.{command}")
@@ -39,24 +42,25 @@ def execute_command(command, args):
3942

4043

4144
def main():
42-
## Now separate the results by data_source
43-
data_sources = ['s3', 'mysql', 'redis', 'firebase', 'gcs', 'fs']
44-
45+
data_sources_option = ['all'] + data_sources
4546
parser = argparse.ArgumentParser(description='CLI Command Executor')
46-
parser.add_argument('command', nargs='?', choices=data_sources, help='Command to execute')
47+
parser.add_argument('command', nargs='?', choices=data_sources_option, help='Command to execute')
4748
parser.add_argument('--json', help='Save output to json file')
4849
parser.add_argument('--debug', action='store_true', help='Enable debug mode')
4950

5051
args, extra_args = parser.parse_known_args()
5152
results = []
5253
if args.command:
53-
for data in execute_command(args.command, extra_args):
54-
results.append(data)
55-
else:
56-
commands = data_sources
57-
for command in commands:
58-
for data in execute_command(command, extra_args):
54+
if args.command == 'all':
55+
commands = data_sources
56+
for command in commands:
57+
for data in execute_command(command, extra_args):
58+
results.append(data)
59+
else:
60+
for data in execute_command(args.command, extra_args):
5961
results.append(data)
62+
else:
63+
system.print_error("Please provide a command to execute")
6064

6165
## GROUP results in grouped_results by datasource by key val
6266
grouped_results = {}

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ PyYAML
33
rich
44
mysql-connector-python
55
redis
6-
firebase-admin
6+
firebase-admin
7+
google-cloud-core
8+
google-cloud-storage

setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
from setuptools import setup, find_packages
22

3-
with open("README.md", "r") as f:
3+
with open("readme.md", "r") as f:
44
long_description = f.read()
55

6+
with open("requirements.txt") as f:
7+
requires = f.read().splitlines()
8+
69
setup(
710
name='hawk_scanner',
8-
version='0.1.1',
11+
version='0.1.2',
912
description='A powerful scanner to scan your Filesystem, S3, MySQL, Redis, Google Cloud Storage and Firebase storage for PII and sensitive data.',
1013
long_description=long_description,
1114
long_description_content_type="text/markdown",
@@ -21,7 +24,7 @@
2124
],
2225
},
2326
license='Apache License 2.0',
24-
install_requires=['pyyaml', 'rich', 'mysql-connector-python', 'redis', 'boto3'],
27+
install_requires=requires,
2528
extras_require={
2629
"dev": ["twine>=4.0.2"],
2730
},

0 commit comments

Comments
 (0)