checkmate5 5.1.0.dev1__py3-none-any.whl → 5.1.0.dev3__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.
- checkmate/contrib/plugins/all/aigraphcodescan/analyzer.py +1 -0
- checkmate/settings/defaults.py +0 -28
- {checkmate5-5.1.0.dev1.dist-info → checkmate5-5.1.0.dev3.dist-info}/METADATA +1 -1
- {checkmate5-5.1.0.dev1.dist-info → checkmate5-5.1.0.dev3.dist-info}/RECORD +8 -57
- checkmate/contrib/plugins/all/opengrep/__init__.py +0 -0
- checkmate/contrib/plugins/all/opengrep/analyzer.py +0 -150
- checkmate/contrib/plugins/all/opengrep/issues_data.py +0 -5
- checkmate/contrib/plugins/all/opengrep/opengrep_manylinux_x86 +0 -0
- checkmate/contrib/plugins/all/opengrep/setup.py +0 -13
- checkmate/contrib/plugins/cve/__init__.py +0 -0
- checkmate/contrib/plugins/cve/text4shell/__init__.py +0 -0
- checkmate/contrib/plugins/cve/text4shell/analyzer.py +0 -64
- checkmate/contrib/plugins/cve/text4shell/issues_data.py +0 -8
- checkmate/contrib/plugins/cve/text4shell/setup.py +0 -13
- checkmate/contrib/plugins/golang/__init__.py +0 -0
- checkmate/contrib/plugins/golang/gostaticcheck/__init__.py +0 -0
- checkmate/contrib/plugins/golang/gostaticcheck/analyzer.py +0 -94
- checkmate/contrib/plugins/golang/gostaticcheck/issues_data.py +0 -1246
- checkmate/contrib/plugins/golang/gostaticcheck/setup.py +0 -13
- checkmate/contrib/plugins/iac/__init__.py +0 -0
- checkmate/contrib/plugins/iac/kubescape/__init__.py +0 -0
- checkmate/contrib/plugins/iac/kubescape/analyzer.py +0 -115
- checkmate/contrib/plugins/iac/kubescape/issues_data.py +0 -636
- checkmate/contrib/plugins/iac/kubescape/setup.py +0 -14
- checkmate/contrib/plugins/iac/tfsec/__init__.py +0 -0
- checkmate/contrib/plugins/iac/tfsec/analyzer.py +0 -92
- checkmate/contrib/plugins/iac/tfsec/issues_data.py +0 -1917
- checkmate/contrib/plugins/iac/tfsec/setup.py +0 -13
- checkmate/contrib/plugins/java/__init__.py +0 -0
- checkmate/contrib/plugins/java/semgrepjava/__init__.py +0 -0
- checkmate/contrib/plugins/java/semgrepjava/analyzer.py +0 -96
- checkmate/contrib/plugins/java/semgrepjava/issues_data.py +0 -5
- checkmate/contrib/plugins/java/semgrepjava/setup.py +0 -13
- checkmate/contrib/plugins/javascript/__init__.py +0 -0
- checkmate/contrib/plugins/javascript/semgrepeslint/__init__.py +0 -0
- checkmate/contrib/plugins/javascript/semgrepeslint/analyzer.py +0 -95
- checkmate/contrib/plugins/javascript/semgrepeslint/issues_data.py +0 -6
- checkmate/contrib/plugins/javascript/semgrepeslint/setup.py +0 -13
- checkmate/contrib/plugins/perl/__init__.py +0 -0
- checkmate/contrib/plugins/perl/graudit/__init__.py +0 -0
- checkmate/contrib/plugins/perl/graudit/analyzer.py +0 -70
- checkmate/contrib/plugins/perl/graudit/issues_data.py +0 -8
- checkmate/contrib/plugins/perl/graudit/setup.py +0 -13
- checkmate/contrib/plugins/python/__init__.py +0 -0
- checkmate/contrib/plugins/python/bandit/__init__.py +0 -0
- checkmate/contrib/plugins/python/bandit/analyzer.py +0 -74
- checkmate/contrib/plugins/python/bandit/issues_data.py +0 -426
- checkmate/contrib/plugins/python/bandit/setup.py +0 -13
- checkmate/contrib/plugins/ruby/__init__.py +0 -0
- checkmate/contrib/plugins/ruby/brakeman/__init__.py +0 -0
- checkmate/contrib/plugins/ruby/brakeman/analyzer.py +0 -96
- checkmate/contrib/plugins/ruby/brakeman/issues_data.py +0 -518
- checkmate/contrib/plugins/ruby/brakeman/setup.py +0 -13
- {checkmate5-5.1.0.dev1.dist-info → checkmate5-5.1.0.dev3.dist-info}/WHEEL +0 -0
- {checkmate5-5.1.0.dev1.dist-info → checkmate5-5.1.0.dev3.dist-info}/entry_points.txt +0 -0
- {checkmate5-5.1.0.dev1.dist-info → checkmate5-5.1.0.dev3.dist-info}/licenses/LICENSE.txt +0 -0
- {checkmate5-5.1.0.dev1.dist-info → checkmate5-5.1.0.dev3.dist-info}/top_level.txt +0 -0
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from .analyzer import GostaticcheckAnalyzer
|
|
2
|
-
from .issues_data import issues_data
|
|
3
|
-
|
|
4
|
-
analyzers = {
|
|
5
|
-
'gostaticcheck':
|
|
6
|
-
{
|
|
7
|
-
'name': 'gostaticcheck',
|
|
8
|
-
'title': 'gostaticcheck',
|
|
9
|
-
'class': GostaticcheckAnalyzer,
|
|
10
|
-
'language': 'golang',
|
|
11
|
-
'issues_data': issues_data,
|
|
12
|
-
},
|
|
13
|
-
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
from checkmate.lib.analysis.base import BaseAnalyzer
|
|
5
|
-
|
|
6
|
-
import logging
|
|
7
|
-
import os
|
|
8
|
-
import tempfile
|
|
9
|
-
import json
|
|
10
|
-
import subprocess
|
|
11
|
-
|
|
12
|
-
logger = logging.getLogger(__name__)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class KubescapeAnalyzer(BaseAnalyzer):
|
|
16
|
-
|
|
17
|
-
def __init__(self, *args, **kwargs):
|
|
18
|
-
super(KubescapeAnalyzer, self).__init__(*args, **kwargs)
|
|
19
|
-
try:
|
|
20
|
-
result = subprocess.check_output(
|
|
21
|
-
["kubescape", "version"],stderr=subprocess.DEVNULL).strip()
|
|
22
|
-
except subprocess.CalledProcessError:
|
|
23
|
-
logger.error(
|
|
24
|
-
"Cannot initialize kubescape analyzer: Executable is missing, please install it.")
|
|
25
|
-
raise
|
|
26
|
-
|
|
27
|
-
def summarize(self, items):
|
|
28
|
-
pass
|
|
29
|
-
|
|
30
|
-
def analyze(self, file_revision):
|
|
31
|
-
issues = []
|
|
32
|
-
tmpdir = "/tmp/"+file_revision.project.pk
|
|
33
|
-
|
|
34
|
-
if not os.path.exists(os.path.dirname(tmpdir+"/"+file_revision.path)):
|
|
35
|
-
try:
|
|
36
|
-
os.makedirs(os.path.dirname(tmpdir+"/"+file_revision.path))
|
|
37
|
-
except OSError as exc: # Guard against race condition
|
|
38
|
-
if exc.errno != errno.EEXIST:
|
|
39
|
-
raise
|
|
40
|
-
|
|
41
|
-
result = subprocess.check_output(["rsync -r . "+tmpdir+" --exclude .git"],shell=True).strip()
|
|
42
|
-
|
|
43
|
-
f = open(tmpdir+"/"+file_revision.path, "wb")
|
|
44
|
-
|
|
45
|
-
fout = tempfile.NamedTemporaryFile(suffix=".json", delete=False)
|
|
46
|
-
result = {}
|
|
47
|
-
try:
|
|
48
|
-
with f:
|
|
49
|
-
try:
|
|
50
|
-
f.write(file_revision.get_file_content())
|
|
51
|
-
except UnicodeDecodeError:
|
|
52
|
-
pass
|
|
53
|
-
try:
|
|
54
|
-
result = subprocess.check_output(["kubescape",
|
|
55
|
-
"scan",
|
|
56
|
-
f.name,
|
|
57
|
-
"--format",
|
|
58
|
-
"json",
|
|
59
|
-
"--format-version",
|
|
60
|
-
"v2",
|
|
61
|
-
"--output",
|
|
62
|
-
fout.name],
|
|
63
|
-
stderr=subprocess.DEVNULL).strip()
|
|
64
|
-
except subprocess.CalledProcessError as e:
|
|
65
|
-
if e.returncode == 1:
|
|
66
|
-
result = e.output
|
|
67
|
-
pass
|
|
68
|
-
elif e.returncode == 3:
|
|
69
|
-
result = []
|
|
70
|
-
pass
|
|
71
|
-
else:
|
|
72
|
-
#print((e.returncode))
|
|
73
|
-
result = e.output
|
|
74
|
-
pass
|
|
75
|
-
|
|
76
|
-
with open(fout.name, "r") as f:
|
|
77
|
-
try:
|
|
78
|
-
result = json.load(f)
|
|
79
|
-
except ValueError as e:
|
|
80
|
-
result['warnings'] = []
|
|
81
|
-
pass
|
|
82
|
-
json_result = result
|
|
83
|
-
|
|
84
|
-
try:
|
|
85
|
-
|
|
86
|
-
for issue in json_result['results']:
|
|
87
|
-
for control in issue['controls']:
|
|
88
|
-
controlkey = control['controlID']
|
|
89
|
-
sev = json_result['summaryDetails']['controls'][controlkey]['scoreFactor']
|
|
90
|
-
if sev>=7:
|
|
91
|
-
severity = "High"
|
|
92
|
-
elif sev>=4 and sev>=6:
|
|
93
|
-
severity = "Medium"
|
|
94
|
-
else:
|
|
95
|
-
severity = "Warning"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
line = 1
|
|
99
|
-
location = (((line, None),
|
|
100
|
-
(line, None)),)
|
|
101
|
-
|
|
102
|
-
issues.append({
|
|
103
|
-
'code': control['controlID'],
|
|
104
|
-
'severity': severity,
|
|
105
|
-
'location': location,
|
|
106
|
-
'data': control['name'],
|
|
107
|
-
'file': file_revision.path,
|
|
108
|
-
'line': line,
|
|
109
|
-
'fingerprint': self.get_fingerprint_from_code(file_revision, location, extra_data=control['name'])
|
|
110
|
-
})
|
|
111
|
-
except:
|
|
112
|
-
pass
|
|
113
|
-
|
|
114
|
-
finally:
|
|
115
|
-
return {'issues': issues}
|