Skip to content

Commit 23a2a04

Browse files
committed
Fix Docker process plugin; Fix Network plugin
1 parent 2ab1892 commit 23a2a04

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

DockerENT/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""DockerENT - Runtime Docker scanning framework."""
22

3-
__version__ = '0.1.12'
3+
__version__ = '0.1.14'

DockerENT/__main__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
"""
55
from DockerENT import config_parser
66
from DockerENT import controller
7-
import DockerENT
7+
from rich import print as rich_print
8+
89

910
import argparse
1011
import logging.config
1112
import os
1213
import signal
1314
import subprocess
1415
import sys
16+
import DockerENT
1517

1618

1719
def start():
@@ -115,21 +117,21 @@ def start():
115117

116118
def sigterm_handler(_signo, _stack_frame):
117119
"""Signal handler."""
118-
_log.info("Thanks for using DockerENT")
120+
rich_print("[bold green]Thanks for using DockerENT[/bold green]")
119121
sys.exit(0)
120122

121123
signal.signal(signal.SIGINT, sigterm_handler)
122124

123125
# Start DockerENT
124126
# If webapp, start Streamlit else cli application.
125127
if webapp:
126-
_log.info('Starting web application ...')
128+
rich_print('[bold green]Starting web application ...[/bold green]')
127129

128130
web_app_file_name = os.path.dirname(DockerENT.__file__) + '/web_app.py'
129131
web_app_cmd = "streamlit run " + web_app_file_name
130132

131133
with subprocess.Popen(web_app_cmd.split(" ")) as web_process:
132-
_log.info(web_process.stdout.read())
134+
rich_print(web_process.stdout.read())
133135

134136
else:
135137
controller.main(docker_containers=docker_containers,

DockerENT/docker_plugins/docker_process_info.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def scan(container, output_queue, audit=False, audit_queue=None):
3232
_log.info('Staring {} Plugin ...'.format(_plugin_name_))
3333

3434
api_client = docker.APIClient()
35-
container_obj = api_client.containers(container.short_id)
36-
top_result = api_client.top(container_obj[0])
35+
36+
top_result = api_client.top(container.short_id)
3737

3838
running_processes = {
3939
"Running_Processes": {
@@ -44,9 +44,8 @@ def scan(container, output_queue, audit=False, audit_queue=None):
4444
}
4545

4646
for option in running_processes.keys():
47-
top_result['Processes'].insert(0, top_result['Titles'])
4847
for result in top_result['Processes']:
49-
running_processes[option]['results'].append(result)
48+
running_processes[option]['results'].append(" ".join(result))
5049

5150
res[container.short_id] = {
5251
_plugin_name_: running_processes

DockerENT/web_app.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
"""Web App for DockerENT."""
2-
from DockerENT import scanner_workers
3-
from DockerENT.utils import utils
4-
52
import base64
63
import docker
74
import DockerENT
@@ -10,6 +7,10 @@
107
import pkgutil
118
import streamlit as ui
129

10+
import DockerENT
11+
import DockerENT.scanner_workers
12+
import DockerENT.utils
13+
1314
ui_sidebar = ui.sidebar
1415

1516

@@ -216,6 +217,7 @@ def docker_scan_executor(self,
216217
plugin,
217218
output_queue,
218219
audit_queue):
220+
219221
scanner_workers.executor(
220222
target=target,
221223
plugin=plugin,
@@ -287,6 +289,7 @@ def scan_dockers():
287289
with ui.spinner('**Scanning** dockers ..'):
288290
for i in AutoUpdateProgressBar(range(len(target_plugin)),
289291
docker_scan_progress_bar):
292+
290293
executor.docker_scan_executor(
291294
target=target_plugin[i][0].short_id,
292295
plugin=target_plugin[i][1],

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ six==1.15.0
2121
snowballstemmer==2.0.0
2222
typing-extensions==3.7.4.2
2323
urllib3==1.25.9
24-
websocket-client==0.57.0
24+
websocket-client==0.57.0
25+
DockerENT

0 commit comments

Comments
 (0)