socketsecurity 0.0.85__tar.gz → 0.0.87__tar.gz
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.
- {socketsecurity-0.0.85/socketsecurity.egg-info → socketsecurity-0.0.87}/PKG-INFO +1 -1
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/__init__.py +1 -1
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/git_interface.py +7 -3
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/github.py +4 -2
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/socketcli.py +19 -3
- {socketsecurity-0.0.85 → socketsecurity-0.0.87/socketsecurity.egg-info}/PKG-INFO +1 -1
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/LICENSE +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/README.md +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/pyproject.toml +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/setup.cfg +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/__init__.py +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/gitlab.py +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/issues.py +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/licenses.py +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity.egg-info/SOURCES.txt +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity.egg-info/dependency_links.txt +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity.egg-info/entry_points.txt +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity.egg-info/requires.txt +0 -0
- {socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity.egg-info/top_level.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__author__ = 'socket.dev'
|
|
2
|
-
__version__ = '0.0.
|
|
2
|
+
__version__ = '0.0.87'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from git import Repo
|
|
2
|
+
from socketsecurity.core import log
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class Git:
|
|
@@ -10,10 +11,13 @@ class Git:
|
|
|
10
11
|
self.repo = Repo(path)
|
|
11
12
|
assert self.repo
|
|
12
13
|
self.head = self.repo.head
|
|
13
|
-
self.
|
|
14
|
-
self.commit = self.reference.commit
|
|
14
|
+
self.commit = self.head.commit
|
|
15
15
|
self.repo_name = self.repo.remotes.origin.url.split('.git')[0].split('/')[-1]
|
|
16
|
-
|
|
16
|
+
try:
|
|
17
|
+
self.branch = self.head.reference
|
|
18
|
+
except Exception as error:
|
|
19
|
+
self.branch = None
|
|
20
|
+
log.debug(error)
|
|
17
21
|
self.author = self.commit.author
|
|
18
22
|
self.commit_sha = self.commit.binsha
|
|
19
23
|
self.commit_message = self.commit.message
|
|
@@ -95,14 +95,16 @@ def do_request(
|
|
|
95
95
|
except Exception as error:
|
|
96
96
|
response = {
|
|
97
97
|
"error": error,
|
|
98
|
-
"response": response.text
|
|
98
|
+
"response": response.text,
|
|
99
|
+
"payload": payload
|
|
99
100
|
}
|
|
100
101
|
return response
|
|
101
102
|
else:
|
|
102
103
|
msg = {
|
|
103
104
|
"status_code": response.status_code,
|
|
104
105
|
"UnexpectedError": "There was an unexpected error using the API",
|
|
105
|
-
"error": response.text
|
|
106
|
+
"error": response.text,
|
|
107
|
+
"payload": payload
|
|
106
108
|
}
|
|
107
109
|
raise APIFailure(msg)
|
|
108
110
|
|
|
@@ -115,6 +115,20 @@ parser.add_argument(
|
|
|
115
115
|
default=False
|
|
116
116
|
)
|
|
117
117
|
|
|
118
|
+
parser.add_argument(
|
|
119
|
+
'--disable-overview',
|
|
120
|
+
help='Disables Dependency Overview comments',
|
|
121
|
+
action='store_true',
|
|
122
|
+
default=False
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
parser.add_argument(
|
|
126
|
+
'--disable-security-issue',
|
|
127
|
+
help='Disables Security Issues comment',
|
|
128
|
+
action='store_true',
|
|
129
|
+
default=False
|
|
130
|
+
)
|
|
131
|
+
|
|
118
132
|
parser.add_argument(
|
|
119
133
|
'--files',
|
|
120
134
|
help='Specify a list of files in the format of ["file1", "file2"]',
|
|
@@ -168,7 +182,10 @@ def main_code():
|
|
|
168
182
|
sbom_file = arguments.sbom_file
|
|
169
183
|
license_mode = arguments.generate_license
|
|
170
184
|
enable_json = arguments.enable_json
|
|
185
|
+
disable_overview = arguments.disable_overview
|
|
186
|
+
disable_security_issue = arguments.disable_security_issue
|
|
171
187
|
files = arguments.files
|
|
188
|
+
log.info(f"Starting Socket Security Scan version {__version__}")
|
|
172
189
|
api_token = os.getenv("SOCKET_SECURITY_API_KEY") or arguments.api_token
|
|
173
190
|
try:
|
|
174
191
|
files = json.loads(files)
|
|
@@ -203,7 +220,6 @@ def main_code():
|
|
|
203
220
|
if branch is not None:
|
|
204
221
|
license_file += f"_{branch}"
|
|
205
222
|
license_file += ".json"
|
|
206
|
-
log.info(f"Starting Socket Security Scan version {__version__}")
|
|
207
223
|
scm = None
|
|
208
224
|
if scm_type == "github":
|
|
209
225
|
from socketsecurity.core.github import Github
|
|
@@ -245,9 +261,9 @@ def main_code():
|
|
|
245
261
|
security_comment = Messages.security_comment_template(diff)
|
|
246
262
|
new_security_comment = True
|
|
247
263
|
new_overview_comment = True
|
|
248
|
-
if len(diff.new_alerts) == 0:
|
|
264
|
+
if len(diff.new_alerts) == 0 or disable_security_issue:
|
|
249
265
|
new_security_comment = False
|
|
250
|
-
if len(diff.new_packages) == 0 and diff.removed_packages == 0:
|
|
266
|
+
if (len(diff.new_packages) == 0 and diff.removed_packages == 0) or disable_overview:
|
|
251
267
|
new_overview_comment = False
|
|
252
268
|
scm.add_socket_comments(
|
|
253
269
|
security_comment,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-0.0.85 → socketsecurity-0.0.87}/socketsecurity.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|