Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions framework/python/src/test_orc/test_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ def _run_test_module(self, module):
device_test_dir = os.path.join(self._root_path, RUNTIME_DIR,
device.mac_addr.replace(":", ""))

root_certs_dir = os.path.join(self._root_path,DEVICE_ROOT_CERTS)


container_runtime_dir = os.path.join(device_test_dir, module.name)
os.makedirs(container_runtime_dir, exist_ok=True)

Expand Down Expand Up @@ -293,6 +296,10 @@ def _run_test_module(self, module):
source=device_monitor_capture,
type="bind",
read_only=True),
Mount(target="/testrun/root_certs",
source=root_certs_dir,
type="bind",
read_only=True)
],
environment={
"HOST_USER": self._host_user,
Expand Down
10 changes: 10 additions & 0 deletions modules/test/nmap/conf/module_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@
{
"number": 80,
"type": "udp"
},
{
"number": 443,
"type": "tcp",
"allowed": true
},
{
"number": 443,
"type": "udp",
"allowed": true
}
]
}
Expand Down
9 changes: 6 additions & 3 deletions modules/test/nmap/python/src/nmap_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@ def _check_results(self, ports, services):
for open_port, open_port_info in self._scan_results.items():

for port in ports:

allowed = True if 'allowed' in port and port['allowed'] else False
if (int(open_port_info["number"]) == int(port["number"]) and
open_port_info["tcp_udp"] == port["type"] and
open_port_info["state"] == "open"):
LOGGER.debug("Found open port: " + str(port["number"]) +
"/" + open_port_info["tcp_udp"] +
" = " + open_port_info["state"])
match_ports.append(open_port_info["number"] + "/" +
if not allowed:
match_ports.append(open_port_info["number"] + "/" +
open_port_info["tcp_udp"])

if (open_port_info["service"] in services and
Expand All @@ -167,7 +168,9 @@ def _check_results(self, ports, services):
LOGGER.debug("Found service " + open_port_info["service"] +
" on port " + str(open_port) + "/" +
open_port_info["tcp_udp"])
match_ports.append(open_port_info["number"] + "/" +

if not allowed:
match_ports.append(open_port_info["number"] + "/" +
open_port_info["tcp_udp"])

return match_ports
Expand Down
4 changes: 0 additions & 4 deletions modules/test/tls/tls.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,5 @@ RUN pip3 install -r /testrun/python/requirements.txt
# Create a directory inside the container to store the root certificates
RUN mkdir -p /testrun/root_certs

# Copy over all the local certificates for device signature
# checks if the folder exists
COPY $CERTS_DIR /testrun/root_certs