-
Notifications
You must be signed in to change notification settings - Fork 58
/
static_code_analysis.txt
100 lines (91 loc) · 4.42 KB
/
static_code_analysis.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Run started:2024-06-07 15:50:29.720919
Test results:
>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module.
Severity: Low Confidence: High
CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/blacklists/blacklist_imports.html#b403-import-pickle
Location: ./sdgym/benchmark.py:7:0
6 import os
7 import pickle
8 import tracemalloc
--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Severity: Low Confidence: High
CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b101_assert_used.html
Location: ./sdgym/benchmark.py:137:4
136 synthesizer = synthesizer_dict['synthesizer']
137 assert issubclass(synthesizer, BaselineSynthesizer), '`synthesizer` must be a synthesizer class'
138
--------------------------------------------------
>> Issue: [B608:hardcoded_sql_expressions] Possible SQL injection vector through string-based query construction.
Severity: Medium Confidence: Low
CWE: CWE-89 (https://cwe.mitre.org/data/definitions/89.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b608_hardcoded_sql_expressions.html
Location: ./sdgym/benchmark.py:591:23
590 # User data script to install the library
591 user_data_script = f"""#!/bin/bash
592 sudo apt update -y
593 sudo apt install python3-pip -y
594 echo "======== Install Dependencies ============"
595 sudo pip3 install sdgym
596 sudo pip3 install anyio
597 pip3 list
598 sudo apt install awscli -y
599 aws configure set aws_access_key_id {credentials.access_key}
600 aws configure set aws_secret_access_key {credentials.secret_key}
601 aws configure set region {session.region_name}
602 echo "======== Write Script ==========="
603 sudo touch ~/sdgym_script.py
604 echo "{script_content}" > ~/sdgym_script.py
605 echo "======== Run Script ==========="
606 sudo python3 ~/sdgym_script.py
607 echo "======== Complete ==========="
608 INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
609 aws ec2 terminate-instances --instance-ids $INSTANCE_ID
610 """
611
--------------------------------------------------
>> Issue: [B404:blacklist] Consider possible security implications associated with the subprocess module.
Severity: Low Confidence: High
CWE: CWE-78 (https://cwe.mitre.org/data/definitions/78.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/blacklists/blacklist_imports.html#b404-import-subprocess
Location: ./sdgym/utils.py:5:0
4 import os
5 import subprocess
6 import sys
--------------------------------------------------
>> Issue: [B603:subprocess_without_shell_equals_true] subprocess call - check for execution of untrusted input.
Severity: Low Confidence: High
CWE: CWE-78 (https://cwe.mitre.org/data/definitions/78.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b603_subprocess_without_shell_equals_true.html
Location: ./sdgym/utils.py:129:17
128 command = ['nvidia-smi', '--query-gpu=utilization.gpu', '--format=csv,noheader,nounits']
129 output = subprocess.run(command, stdout=subprocess.PIPE)
130 return len(output.stdout.decode().split())
--------------------------------------------------
>> Issue: [B603:subprocess_without_shell_equals_true] subprocess call - check for execution of untrusted input.
Severity: Low Confidence: High
CWE: CWE-78 (https://cwe.mitre.org/data/definitions/78.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b603_subprocess_without_shell_equals_true.html
Location: ./sdgym/utils.py:145:17
144 command = ['nvidia-smi', '--query-gpu=utilization.gpu', '--format=csv,noheader,nounits']
145 output = subprocess.run(command, stdout=subprocess.PIPE)
146 loads = np.array(output.stdout.decode().split()).astype(float)
--------------------------------------------------
Code scanned:
Total lines of code: 2634
Total lines skipped (#nosec): 0
Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0
Run metrics:
Total issues (by severity):
Undefined: 0
Low: 5
Medium: 1
High: 0
Total issues (by confidence):
Undefined: 0
Low: 1
Medium: 0
High: 5
Files skipped (0):