codeaudit 0.9.2__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codeaudit/__about__.py +1 -1
- codeaudit/codeaudit.py +9 -11
- codeaudit/data/sastchecks.csv +9 -1
- codeaudit/issuevalidations.py +10 -4
- codeaudit/reporting.py +15 -11
- codeaudit/security_checks.py +1 -2
- codeaudit/simple.css +10 -6
- codeaudit/totals.py +1 -1
- {codeaudit-0.9.2.dist-info → codeaudit-1.0.0.dist-info}/METADATA +23 -27
- codeaudit-1.0.0.dist-info/RECORD +19 -0
- codeaudit-0.9.2.dist-info/RECORD +0 -19
- {codeaudit-0.9.2.dist-info → codeaudit-1.0.0.dist-info}/WHEEL +0 -0
- {codeaudit-0.9.2.dist-info → codeaudit-1.0.0.dist-info}/entry_points.txt +0 -0
- {codeaudit-0.9.2.dist-info → codeaudit-1.0.0.dist-info}/licenses/LICENSE.txt +0 -0
codeaudit/__about__.py
CHANGED
codeaudit/codeaudit.py
CHANGED
|
@@ -18,26 +18,23 @@ from codeaudit import __version__
|
|
|
18
18
|
from codeaudit.reporting import overview_report ,report_module_information ,file_scan_report , directory_scan_report , report_implemented_tests
|
|
19
19
|
|
|
20
20
|
codeaudit_ascii_art=r"""
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
| |___| (_) | (_| | __/ (_| | |_| | (_| | | |_
|
|
27
|
-
\_____\___/ \__,_|\___|\__,_|\__,_|\__,_|_|\__|
|
|
28
|
-
--------------------------------------------------
|
|
21
|
+
----------------------------------------------------
|
|
22
|
+
_ __ _
|
|
23
|
+
|_) \/_|_|_ _ __ / _ _| _ |_| _| o _|_
|
|
24
|
+
| / |_| |(_)| | \__(_)(_|(/_ | ||_|(_| | |_
|
|
25
|
+
----------------------------------------------------
|
|
29
26
|
"""
|
|
30
|
-
|
|
31
27
|
|
|
28
|
+
|
|
32
29
|
def display_version():
|
|
33
|
-
"""Prints the module version.
|
|
30
|
+
"""Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version]."""
|
|
34
31
|
print(f"version: {__version__}")
|
|
35
32
|
|
|
36
33
|
|
|
37
34
|
def display_help():
|
|
38
35
|
"""Shows detailed help for using codeaudit tool."""
|
|
39
36
|
print(codeaudit_ascii_art)
|
|
40
|
-
print("
|
|
37
|
+
print("Python Code Audit - A modern Python security source code analyzer based on distrust.\n")
|
|
41
38
|
print("Commands to evaluate Python source code:")
|
|
42
39
|
print('Usage: codeaudit COMMAND [PATH or FILE] [OUTPUTFILE] \n')
|
|
43
40
|
print('Depending on the command, a directory or file name must be specified. The output is a static HTML file to be examined in a browser. Specifying a name for the output file is optional.\n')
|
|
@@ -66,6 +63,7 @@ def main():
|
|
|
66
63
|
"filescan" : file_scan_report,
|
|
67
64
|
"directoryscan" : directory_scan_report,
|
|
68
65
|
"checks" : report_implemented_tests,
|
|
66
|
+
"version" : display_version,
|
|
69
67
|
"-help": display_help,
|
|
70
68
|
}
|
|
71
69
|
)
|
codeaudit/data/sastchecks.csv
CHANGED
|
@@ -12,8 +12,10 @@ Check on eval usage,eval,High,This function can executes arbitrary code.
|
|
|
12
12
|
Check on input statement,input,Low,Use of input requires strict sanitizing and validation.
|
|
13
13
|
Exception Handling,pass,Low,Too broad exception handling risk when not used correctly.
|
|
14
14
|
Exception Handling- Continue statement,continue,Low,Too broad exception handling risk when not used correctly.
|
|
15
|
-
Built-in Functions: Check for exec usage.,exec,High,This built-in function can execute code you do not want and
|
|
15
|
+
Built-in Functions: Check for exec usage.,exec,High,This built-in function can execute code you do not want. Check and refuse using dynamic contructs within exec you can not validate upfront.
|
|
16
16
|
Built-in Functions: Check on compile usage.,compile,High,It is possible to crash the Python interpreter when using this function.
|
|
17
|
+
Use of dynamic Imports,__import__,Medium,"Validate the what is imported and only allow of known, safe modules."
|
|
18
|
+
Use of dynamic Imports,importlib.import_module,Medium,"Validate the what is imported and only allow of known, safe modules."
|
|
17
19
|
Hash Check - md5,hashlib.md5,High,Use of insecure hashing algorithms detected.
|
|
18
20
|
Hash Check -sha1,hashlib.sha1,High,Use of insecure hashing algorithms detected.
|
|
19
21
|
Logging - configuration ,logging.config,Low,Potential security issues can arise with parsing objects and incorrect sanitizing.
|
|
@@ -54,10 +56,16 @@ Shelve module,shelve.open,High,Only loading a shelve from a trusted source is se
|
|
|
54
56
|
Multiprocessing ,connection.recv,High,Connection.recv() uses pickle
|
|
55
57
|
Multiprocessing ,multiprocessing.connection.Connection,High,Connection.recv() uses pickle
|
|
56
58
|
Zipfile,zipfile.ZipFile,High,Extracting files within a program should never be trusted by default. This issue is detected when the zipfile and/or tarfile module with an extraction method is used.
|
|
59
|
+
Gzip,gzip.open,Medium,Potential resource consumption if the file is untrusted.
|
|
60
|
+
bz2 use,bz2.open,Medium,Potential resource consumption if bz2 compressed file is untrusted.
|
|
61
|
+
bz2 class use,bz2.BZ2File,Medium,Potential risk with bz2 class when decompressing data from untrusted or unknown source.
|
|
62
|
+
lzma use,lzma.open,Medium,Potential risk with lzma when decompressing data from untrusted or unknown source.
|
|
63
|
+
lzma class use,lzma.LZMAFile,Medium,Potential risk with lzma class when decompressing data from untrusted or unknown source.
|
|
57
64
|
shutil,shutil.unpack_archive,Medium,Extracting files within a program should not be trusted by default.
|
|
58
65
|
shutil,shutil.copy,Medium,Information can be transfered without permission.
|
|
59
66
|
shutil,shutil.copy2,Medium,Information can be transfered without permission.
|
|
60
67
|
shutil,shutil.copytree,Medium,Information can be transfered without permission.
|
|
61
68
|
shutil,shutil.chown,Medium,Programs should not change access rights on files they do not own.
|
|
69
|
+
shutil,shutil.rmtree,Medium,Risk on path traversal attack.
|
|
62
70
|
HTTP servers: Check on usage.,http.server.BaseHTTPRequestHandler,High,Insecure for production use.
|
|
63
71
|
HTTP servers: Check on usage.,http.server.HTTPServer,High,Insecure for production use.
|
codeaudit/issuevalidations.py
CHANGED
|
@@ -35,8 +35,7 @@ def find_constructs(source_code, constructs_to_detect):
|
|
|
35
35
|
"""
|
|
36
36
|
with warnings.catch_warnings(): # Suppression of warnings
|
|
37
37
|
warnings.simplefilter("ignore", category=SyntaxWarning)
|
|
38
|
-
tree = ast.parse(source_code)
|
|
39
|
-
|
|
38
|
+
tree = ast.parse(source_code)
|
|
40
39
|
results = defaultdict(list)
|
|
41
40
|
seen = set() # (construct, lineno) pairs already counted
|
|
42
41
|
|
|
@@ -70,9 +69,16 @@ def find_constructs(source_code, constructs_to_detect):
|
|
|
70
69
|
full_resolved = resolved_prefix + full[len(prefix) :]
|
|
71
70
|
if full_resolved in constructs_to_detect:
|
|
72
71
|
construct = full_resolved
|
|
73
|
-
elif node.func.attr in ('extractall', 'extract') and 'tarfile' in core_modules:
|
|
74
|
-
#construct = full_resolved
|
|
72
|
+
elif node.func.attr in ('extractall', 'extract') and 'tarfile' in core_modules: #note only in combination with tarfile module or alias,see step1
|
|
75
73
|
construct = 'tarfile.TarFile'
|
|
74
|
+
elif node.func.attr in ('eval') and 'builtins' in core_modules: #catch obfuscating eval construct with builtins module
|
|
75
|
+
construct = 'eval'
|
|
76
|
+
elif node.func.attr in ('exec') and 'builtins' in core_modules: #catch obfuscating exec construct with builtins module
|
|
77
|
+
construct = 'exec'
|
|
78
|
+
elif node.func.attr in ('input') and 'builtins' in core_modules: #catch obfuscating construct with builtins module
|
|
79
|
+
construct = 'input'
|
|
80
|
+
elif node.func.attr in ('compile') and 'builtins' in core_modules: #catch obfuscating construct with builtins module
|
|
81
|
+
construct = 'compile'
|
|
76
82
|
elif isinstance(func, ast.Name):
|
|
77
83
|
resolved = alias_map.get(func.id, func.id)
|
|
78
84
|
if resolved in constructs_to_detect:
|
codeaudit/reporting.py
CHANGED
|
@@ -57,7 +57,7 @@ def overview_report(directory, filename=DEFAULT_OUTPUT_FILE):
|
|
|
57
57
|
df['Std-Modules'] = modules['Std-Modules']
|
|
58
58
|
df['External-Modules'] = modules['External-Modules']
|
|
59
59
|
overview_df = overview_count(df)
|
|
60
|
-
html = '<h1>' + f'
|
|
60
|
+
html = '<h1>' + f'Python Code Audit overview report' + '</h1><br>'
|
|
61
61
|
html += f'<p>Codeaudit overview scan of the directory:<b> {directory}</b></p>'
|
|
62
62
|
html += f'<h2>Summary</h2>'
|
|
63
63
|
html += overview_df.to_html(escape=True,index=False)
|
|
@@ -116,7 +116,7 @@ def file_scan_report(file_to_scan , filename=DEFAULT_OUTPUT_FILE):
|
|
|
116
116
|
scan_output = perform_validations(file_to_scan)
|
|
117
117
|
file_report_html = single_file_report(file_to_scan , scan_output)
|
|
118
118
|
name_of_file = get_filename_from_path(file_to_scan)
|
|
119
|
-
html = '<h1>
|
|
119
|
+
html = '<h1>Python Code Audit Report</h1>' #prepared to be embedded to display multiple reports, so <h2> used
|
|
120
120
|
html += f'<h2>Result of scan of file {name_of_file}</h2>'
|
|
121
121
|
html += '<p>' + f'Location of the file: {file_to_scan} </p>'
|
|
122
122
|
html += file_report_html
|
|
@@ -168,7 +168,7 @@ def single_file_report(filename , scan_output):
|
|
|
168
168
|
html += '<summary>Click to see details for used modules in this file.</summary>'
|
|
169
169
|
modules_found = get_imported_modules_by_file(filename)
|
|
170
170
|
html += dict_to_html(modules_found)
|
|
171
|
-
html += f'<p
|
|
171
|
+
html += f'<p>To check for <b>reported vulnerabilities</b> in external modules used by this file, use the command:<br><div class="code-box">codeaudit modulescan {filename}</div><br></p>'
|
|
172
172
|
html += '</details>'
|
|
173
173
|
return html
|
|
174
174
|
|
|
@@ -195,12 +195,16 @@ def directory_scan_report(directory_to_scan , filename=DEFAULT_OUTPUT_FILE):
|
|
|
195
195
|
exit(1)
|
|
196
196
|
|
|
197
197
|
collection_ok_files = [] # create a collection of files with no issues found
|
|
198
|
-
html = '<h1>
|
|
198
|
+
html = '<h1>Python Code Audit Report</h1>'
|
|
199
199
|
files_to_check = collect_python_source_files(directory_to_scan)
|
|
200
200
|
html += '<h2>Directory scan report</h2>'
|
|
201
201
|
html += f'<p>Below the result of the Codeaudit scan of the directory:<b> {directory_to_scan}</b></p>'
|
|
202
202
|
html += f'<p>Total Python files found: {len(files_to_check)}</p>'
|
|
203
|
-
|
|
203
|
+
number_of_files = len(files_to_check)
|
|
204
|
+
print(f'Number of files that are checked for security issues:{number_of_files}')
|
|
205
|
+
printProgressBar(0, number_of_files, prefix='Progress:', suffix='Complete', length=50)
|
|
206
|
+
for i,file_to_scan in enumerate(files_to_check):
|
|
207
|
+
printProgressBar(i + 1, number_of_files, prefix='Progress:', suffix='Complete', length=50)
|
|
204
208
|
scan_output = perform_validations(file_to_scan)
|
|
205
209
|
data = scan_output["result"]
|
|
206
210
|
if data:
|
|
@@ -231,7 +235,7 @@ def report_module_information(inputfile,reportname=DEFAULT_OUTPUT_FILE):
|
|
|
231
235
|
external_modules = used_modules['imported_modules']
|
|
232
236
|
l = len(external_modules)
|
|
233
237
|
printProgressBar(0, l, prefix='Progress:', suffix='Complete', length=50)
|
|
234
|
-
html = '<h1>
|
|
238
|
+
html = '<h1>Python Code Audit Report</h1>'
|
|
235
239
|
html += f'<h2>Module information for file {inputfile}</h2>'
|
|
236
240
|
html += dict_to_html(used_modules)
|
|
237
241
|
#Now vuln info per external module
|
|
@@ -274,7 +278,7 @@ def create_htmlfile(html_input,outputfile):
|
|
|
274
278
|
output += f'<style>\n{css_content}\n</style>'
|
|
275
279
|
output += '<script src="https://cdn.jsdelivr.net/npm/vega@5"></script>' # needed for altair plots
|
|
276
280
|
output += '<script src="https://cdn.jsdelivr.net/npm/vega-lite@5"></script>' # needed for altair plots
|
|
277
|
-
output += '<script src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script>' # needed for altair plots
|
|
281
|
+
output += '<script src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script>' # needed for altair plots
|
|
278
282
|
output += '</head><body>'
|
|
279
283
|
output += '<div class="container">'
|
|
280
284
|
output += html_input
|
|
@@ -284,7 +288,7 @@ def create_htmlfile(html_input,outputfile):
|
|
|
284
288
|
output += '<footer>'
|
|
285
289
|
output += '<hr>'
|
|
286
290
|
output += f'<p><small>This security report is created on: {timestamp_str}, with <a href="https://github.com/nocomplexity/codeaudit">codeaudit</a> version {code_audit_version} </small></p>'
|
|
287
|
-
output += '<p><small>Check the <a href="https://nocomplexity.com/documents/codeaudit/intro.html" target="_blank">documentation</a> for help on found issues. <a href="https://github.com/nocomplexity/codeaudit">Codeaudit</a> is made with ❤ by cyber security professionals who advocate for <a href="https://simplifysecurity.nocomplexity.com" target="_blank">
|
|
291
|
+
output += '<p><small>Check the <a href="https://nocomplexity.com/documents/codeaudit/intro.html" target="_blank">documentation</a> for help on found issues. <a href="https://github.com/nocomplexity/codeaudit">Codeaudit</a> is made with ❤ by cyber security professionals who advocate for <a href="https://simplifysecurity.nocomplexity.com" target="_blank">open simple cyber security solutions</a>. Join the community and <a href="https://nocomplexity.com/documents/codeaudit/CONTRIBUTE.html" target="_blank">contribute </a> to make this Python Security Code Audit tool better!</small></p>'
|
|
288
292
|
output += '</footer>'
|
|
289
293
|
output += '</div>' #base container
|
|
290
294
|
output += '</body></html>'
|
|
@@ -302,7 +306,7 @@ def create_htmlfile(html_input,outputfile):
|
|
|
302
306
|
file_url = f'file://{directory_for_output}/{filename_only}'
|
|
303
307
|
# Print the result
|
|
304
308
|
print("\n=====================================================================")
|
|
305
|
-
print(f'
|
|
309
|
+
print(f'Code Audit report file created!\nPaste the line below directly into your browser bar:\n\t{file_url}\n')
|
|
306
310
|
print("=====================================================================\n")
|
|
307
311
|
|
|
308
312
|
|
|
@@ -368,7 +372,7 @@ def get_info_on_test(error):
|
|
|
368
372
|
|
|
369
373
|
def report_implemented_tests(filename=DEFAULT_OUTPUT_FILE):
|
|
370
374
|
"""
|
|
371
|
-
|
|
375
|
+
Creates an HTML report of all implemented security checks.
|
|
372
376
|
|
|
373
377
|
This report provides a user-friendly overview of the static security checks
|
|
374
378
|
currently supported by codeaudit. It is intended to make it easier to review
|
|
@@ -389,7 +393,7 @@ def report_implemented_tests(filename=DEFAULT_OUTPUT_FILE):
|
|
|
389
393
|
df_checks = ast_security_checks()
|
|
390
394
|
df_checks['construct'] = df_checks['construct'].apply(replace_second_dot) #Make the validation column smaller - this is the simplest way! without using styling options from Pandas!
|
|
391
395
|
df_checks_sorted = df_checks.sort_values(by='construct')
|
|
392
|
-
html = '<h1>
|
|
396
|
+
html = '<h1>Python Code Audit Implemented validations</h1>' #prepared to be embedded to display multiple reports, so <h2> used
|
|
393
397
|
number_of_test = len(df_checks)
|
|
394
398
|
|
|
395
399
|
html += df_checks_sorted.to_html(escape=False,index=False)
|
codeaudit/security_checks.py
CHANGED
|
@@ -40,8 +40,7 @@ def ast_security_checks():
|
|
|
40
40
|
|
|
41
41
|
def perform_validations(sourcefile):
|
|
42
42
|
"""For now a list defined here in this file"""
|
|
43
|
-
checks = ast_security_checks()
|
|
44
|
-
#df = pd.DataFrame(security_validations)
|
|
43
|
+
checks = ast_security_checks()
|
|
45
44
|
constructs = checks['construct'].to_list()
|
|
46
45
|
|
|
47
46
|
source = read_in_source_file(sourcefile)
|
codeaudit/simple.css
CHANGED
|
@@ -190,11 +190,15 @@ footer {
|
|
|
190
190
|
font-family: Consolas, Monaco, 'Courier New', monospace;
|
|
191
191
|
font-size: 14px;
|
|
192
192
|
line-height: 1.5;
|
|
193
|
-
padding: 1em;
|
|
194
|
-
|
|
193
|
+
padding: 1em;
|
|
195
194
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
/* nocxdataframe for table css */
|
|
199
195
|
|
|
200
|
-
|
|
196
|
+
/* Styling for module check info */
|
|
197
|
+
.code-box {
|
|
198
|
+
background: #2d2d2d; /* black background */
|
|
199
|
+
color: white; /* white text */
|
|
200
|
+
padding: 12px; /* spacing inside the box */
|
|
201
|
+
border-radius: 6px; /* rounded corners (optional) */
|
|
202
|
+
font-family: "Courier New", Courier, monospace; /* terminal-style font */
|
|
203
|
+
width: fit-content; /* box size fits the text */
|
|
204
|
+
}
|
codeaudit/totals.py
CHANGED
|
@@ -155,7 +155,7 @@ def overview_per_file(python_file):
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
def overview_count(df):
|
|
158
|
-
"""returns a dataframe with simple overview
|
|
158
|
+
"""returns a dataframe with simple overview for all files"""
|
|
159
159
|
columns_to_sum = [
|
|
160
160
|
"Number_Of_Lines",
|
|
161
161
|
"AST_Nodes",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeaudit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Simplified static security checks for Python
|
|
5
5
|
Project-URL: Documentation, https://github.com/nocomplexity/codeaudit#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/nocomplexity/codeaudit/issues
|
|
@@ -31,29 +31,27 @@ Description-Content-Type: text/markdown
|
|
|
31
31
|
[](https://pypi.org/project/codeaudit)
|
|
32
32
|
[](https://pypi.org/project/codeaudit)
|
|
33
33
|
[](https://www.bestpractices.dev/projects/10970)
|
|
34
|
+
[](https://pepy.tech/projects/codeaudit)
|
|
34
35
|
|
|
35
|
-
Python
|
|
36
|
+
Python Code Audit - A modern Python source code analyzer based on distrust.
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
Python Code Audit is a tool to find **security issues** in Python code. This static application security testing (SAST) tool has **great** features to simplify the necessary security tasks and make it fun and easy.
|
|
38
39
|
|
|
39
40
|
This tool is created for:
|
|
40
|
-
*
|
|
41
|
-
* Anyone who loves to create
|
|
42
|
-
* Anyone who wants
|
|
41
|
+
* Users of Python programs who want to known the security risks of the used Python code.
|
|
42
|
+
* Anyone who loves to create Python programs and want to deliver Python code without vulnerabilities. So this tool is not only professional programs, but also occasional Python programmers. Creating secure software is very difficult. This program with the extensive documentation is your friendly security colleague!
|
|
43
|
+
* Anyone who wants a simple way to get fast insight in possible security risks with Python packages or Python files.
|
|
43
44
|
|
|
44
45
|
|
|
45
|
-
> [!WARNING]
|
|
46
|
-
> Python Codeaudit is currently in *beta status*. Consider [contributing](CONTRIBUTING.md) to make Codeaudit the coolest open source Python SAST tool. Codeaudit is currently in a thorough testing phase. Use Python Codeaudit now and contribute to make it better!
|
|
47
|
-
|
|
48
46
|
## Features
|
|
49
47
|
|
|
50
|
-
Python
|
|
48
|
+
Python Code Audit has the following features:
|
|
51
49
|
|
|
52
50
|
* **Vulnerability Detection**: Identifies security vulnerabilities in Python files, essential for package security research.
|
|
53
51
|
|
|
54
52
|
* **Complexity & Statistics**: Reports security-relevant complexity using a fast, lightweight [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) count via Python's AST.
|
|
55
53
|
|
|
56
|
-
* **Module Usage & External Vulnerabilities**: Detects used modules and reports vulnerabilities
|
|
54
|
+
* **Module Usage & External Vulnerabilities**: Detects used modules and reports known vulnerabilities for used external modules.
|
|
57
55
|
|
|
58
56
|
* **Inline Issue Reporting**: Shows potential security issues with line numbers and code snippets.
|
|
59
57
|
|
|
@@ -62,7 +60,7 @@ Python Codeaudit has the following features:
|
|
|
62
60
|
|
|
63
61
|
|
|
64
62
|
> [!IMPORTANT]
|
|
65
|
-
> Python
|
|
63
|
+
> Python Code Audit uses the Python's Abstract Syntax Tree (AST) to get robust and reliable result. Using the Python AST makes contextual Vulnerability Detection possible and false positive are minimized.
|
|
66
64
|
|
|
67
65
|
|
|
68
66
|
## Installation
|
|
@@ -77,7 +75,7 @@ or use:
|
|
|
77
75
|
pip install -U codeaudit
|
|
78
76
|
```
|
|
79
77
|
|
|
80
|
-
If you have installed
|
|
78
|
+
If you have installed Python `codeaudit` in the past and want to make sure you use the latest new validations and features.
|
|
81
79
|
|
|
82
80
|
## Usage
|
|
83
81
|
|
|
@@ -90,16 +88,13 @@ codeaudit
|
|
|
90
88
|
This will show all commands:
|
|
91
89
|
|
|
92
90
|
```text
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
| |___| (_) | (_| | __/ (_| | |_| | (_| | | |_
|
|
99
|
-
\_____\___/ \__,_|\___|\__,_|\__,_|\__,_|_|\__|
|
|
100
|
-
--------------------------------------------------
|
|
91
|
+
----------------------------------------------------
|
|
92
|
+
_ __ _
|
|
93
|
+
|_) \/_|_|_ _ __ / _ _| _ |_| _| o _|_
|
|
94
|
+
| / |_| |(_)| | \__(_)(_|(/_ | ||_|(_| | |_
|
|
95
|
+
----------------------------------------------------
|
|
101
96
|
|
|
102
|
-
|
|
97
|
+
Python Code Audit - A modern Python security source code analyzer based on distrust.
|
|
103
98
|
|
|
104
99
|
Commands to evaluate Python source code:
|
|
105
100
|
Usage: codeaudit COMMAND [PATH or FILE] [OUTPUTFILE]
|
|
@@ -108,14 +103,15 @@ Depending on the command, a directory or file name must be specified. The output
|
|
|
108
103
|
|
|
109
104
|
Commands:
|
|
110
105
|
overview Reports Complexity and statistics per Python file from a directory.
|
|
111
|
-
modulescan Reports module information per file.
|
|
112
|
-
filescan Reports potential security issues for a single Python file.
|
|
113
106
|
directoryscan Reports potential security issues for all Python files found in a directory.
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
filescan Reports potential security issues for a single Python file.
|
|
108
|
+
modulescan Reports module information per file.
|
|
109
|
+
checks Creates an HTML report of all implemented security checks.
|
|
110
|
+
version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
|
|
116
111
|
|
|
117
|
-
Use the
|
|
112
|
+
Use the Codeaudit documentation to check the security of Python programs and make your Python programs more secure!
|
|
118
113
|
Check https://simplifysecurity.nocomplexity.com/
|
|
114
|
+
|
|
119
115
|
```
|
|
120
116
|
|
|
121
117
|
## Example
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
codeaudit/__about__.py,sha256=AYtzx9ZrNDKvd0GU8vABzU9bqhe7Wo-GYBY5FzypjPs,144
|
|
2
|
+
codeaudit/__init__.py,sha256=YGs6qU0BVHPGtXCS-vfBDLO4TOfJDLTWMgaFDTmi_Iw,157
|
|
3
|
+
codeaudit/altairplots.py,sha256=YFXrJxBjN44Mr2JEGad8h_KjSOYuyzt4YE8JyQr9Kj8,2183
|
|
4
|
+
codeaudit/checkmodules.py,sha256=_oMbidp0iKUYF8yOieFIIiCMQ3nl6qC-OhNDnYclf0Q,4895
|
|
5
|
+
codeaudit/codeaudit.py,sha256=TF9hn3B8GVUJ04aI4mGKArD62akmhhPzPLzN8A1UYhg,3545
|
|
6
|
+
codeaudit/complexitycheck.py,sha256=A3_a5v-U0YQr80pWQwSVvOsY_eQtqwNkQf9Txr9mNtQ,3722
|
|
7
|
+
codeaudit/filehelpfunctions.py,sha256=eM-B9JeF3Krx2vaefaqLrCAl-lrtec_fy0NbTkj7a3s,3846
|
|
8
|
+
codeaudit/htmlhelpfunctions.py,sha256=-SMsyfF7TRIfJkrUqoJuh7AoG1RVrYFsZfFljoxVHXc,3246
|
|
9
|
+
codeaudit/issuevalidations.py,sha256=-WdaXT_R-P9w0JbQpJ5ngVoVhG9Yee2ri0aH5SoC1Ao,6404
|
|
10
|
+
codeaudit/reporting.py,sha256=-xWgpuccGYCaXVTNJSqfv2xwCdseuQD6SgDk55BrUMs,21824
|
|
11
|
+
codeaudit/security_checks.py,sha256=wEO_A054zXmLccWGREi6cNADa4IgoOPxHsq-Je5iMIY,2167
|
|
12
|
+
codeaudit/simple.css,sha256=7auhDAUwjdluFIyoCskl-Vfh503prXKqftQrmo0-e_g,3565
|
|
13
|
+
codeaudit/totals.py,sha256=V809eImKZepsKqKMNr0lNfJ0ILf7qFjS_NrU-veVpm0,6358
|
|
14
|
+
codeaudit/data/sastchecks.csv,sha256=RlyJvDdEDeuACNV-gpQFg8R0_PhikNyV6jzxbbHGu04,7828
|
|
15
|
+
codeaudit-1.0.0.dist-info/METADATA,sha256=AsqTlXkkec74FsAsTClcy7Gmz45zUguzAcDxCmn4HGs,6820
|
|
16
|
+
codeaudit-1.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
17
|
+
codeaudit-1.0.0.dist-info/entry_points.txt,sha256=7w6I8zii62nJHIIF30CRP5g1z8enMqF1pZEDdlw4HcQ,55
|
|
18
|
+
codeaudit-1.0.0.dist-info/licenses/LICENSE.txt,sha256=-5gWaMGKJ54oX8TYP7oeg2zITdTapzyWl9PP0tispuA,34674
|
|
19
|
+
codeaudit-1.0.0.dist-info/RECORD,,
|
codeaudit-0.9.2.dist-info/RECORD
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
codeaudit/__about__.py,sha256=-OcKgQZdiaIfag-0pWz8xuMH01f-FH-JoMrw5piCMUg,144
|
|
2
|
-
codeaudit/__init__.py,sha256=YGs6qU0BVHPGtXCS-vfBDLO4TOfJDLTWMgaFDTmi_Iw,157
|
|
3
|
-
codeaudit/altairplots.py,sha256=YFXrJxBjN44Mr2JEGad8h_KjSOYuyzt4YE8JyQr9Kj8,2183
|
|
4
|
-
codeaudit/checkmodules.py,sha256=_oMbidp0iKUYF8yOieFIIiCMQ3nl6qC-OhNDnYclf0Q,4895
|
|
5
|
-
codeaudit/codeaudit.py,sha256=XuQenCtifhUAJGXYh-DxpyLB2lbmCZhHxoPwpzBp4Fg,3608
|
|
6
|
-
codeaudit/complexitycheck.py,sha256=A3_a5v-U0YQr80pWQwSVvOsY_eQtqwNkQf9Txr9mNtQ,3722
|
|
7
|
-
codeaudit/filehelpfunctions.py,sha256=eM-B9JeF3Krx2vaefaqLrCAl-lrtec_fy0NbTkj7a3s,3846
|
|
8
|
-
codeaudit/htmlhelpfunctions.py,sha256=-SMsyfF7TRIfJkrUqoJuh7AoG1RVrYFsZfFljoxVHXc,3246
|
|
9
|
-
codeaudit/issuevalidations.py,sha256=Pcl6Xrpak1SDJq7liuYx2Nb0inNeq6s131dF-L40S5w,5607
|
|
10
|
-
codeaudit/reporting.py,sha256=gmRbhoC3mwws1eXWypyUZKeMPm3wcvDqj3aoSaWEfIE,21333
|
|
11
|
-
codeaudit/security_checks.py,sha256=n_FMF2b--vpkX3E4wvFcXr9pJO-_sdUq2NHuj6mvMvw,2208
|
|
12
|
-
codeaudit/simple.css,sha256=QyqcZKLqj4JXByTskabrOEJYfn2L2o8XfTLyeO1RxeI,3210
|
|
13
|
-
codeaudit/totals.py,sha256=yN_IepZte4H5Rk7T8UzJFc_SL4RtzYV_Z1tEC9hEyXg,6357
|
|
14
|
-
codeaudit/data/sastchecks.csv,sha256=qo2B-nR_6eOI0ycASSNvU0jTmclax3OScgybucXQY10,6981
|
|
15
|
-
codeaudit-0.9.2.dist-info/METADATA,sha256=R3ZRlWehkSpMezvrMMJPV4Cl_FeDreLsMivLB2vK8Qs,6953
|
|
16
|
-
codeaudit-0.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
17
|
-
codeaudit-0.9.2.dist-info/entry_points.txt,sha256=7w6I8zii62nJHIIF30CRP5g1z8enMqF1pZEDdlw4HcQ,55
|
|
18
|
-
codeaudit-0.9.2.dist-info/licenses/LICENSE.txt,sha256=-5gWaMGKJ54oX8TYP7oeg2zITdTapzyWl9PP0tispuA,34674
|
|
19
|
-
codeaudit-0.9.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|