socketsecurity 1.0.29__tar.gz → 1.0.31__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.
Files changed (23) hide show
  1. {socketsecurity-1.0.29/socketsecurity.egg-info → socketsecurity-1.0.31}/PKG-INFO +1 -1
  2. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/__init__.py +1 -1
  3. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/__init__.py +5 -4
  4. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/classes.py +7 -2
  5. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/socketcli.py +12 -3
  6. {socketsecurity-1.0.29 → socketsecurity-1.0.31/socketsecurity.egg-info}/PKG-INFO +1 -1
  7. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/LICENSE +0 -0
  8. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/README.md +0 -0
  9. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/pyproject.toml +0 -0
  10. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/setup.cfg +0 -0
  11. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/exceptions.py +0 -0
  12. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/git_interface.py +0 -0
  13. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/github.py +0 -0
  14. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/gitlab.py +0 -0
  15. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/issues.py +0 -0
  16. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/licenses.py +0 -0
  17. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/messages.py +0 -0
  18. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity/core/scm_comments.py +0 -0
  19. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity.egg-info/SOURCES.txt +0 -0
  20. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity.egg-info/dependency_links.txt +0 -0
  21. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity.egg-info/entry_points.txt +0 -0
  22. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity.egg-info/requires.txt +0 -0
  23. {socketsecurity-1.0.29 → socketsecurity-1.0.31}/socketsecurity.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 1.0.29
3
+ Version: 1.0.31
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Author-email: Douglas Coburn <douglas@socket.dev>
6
6
  Maintainer-email: Douglas Coburn <douglas@socket.dev>
@@ -1,2 +1,2 @@
1
1
  __author__ = 'socket.dev'
2
- __version__ = '1.0.29'
2
+ __version__ = '1.0.31'
@@ -749,10 +749,11 @@ class Core:
749
749
  if alert.type in security_policy:
750
750
  action = security_policy[alert.type]['action']
751
751
  setattr(issue_alert, action, True)
752
- if issue_alert.key not in alerts:
753
- alerts[issue_alert.key] = [issue_alert]
754
- else:
755
- alerts[issue_alert.key].append(issue_alert)
752
+ if issue_alert.type != 'licenseSpdxDisj':
753
+ if issue_alert.key not in alerts:
754
+ alerts[issue_alert.key] = [issue_alert]
755
+ else:
756
+ alerts[issue_alert.key].append(issue_alert)
756
757
  return alerts
757
758
 
758
759
  @staticmethod
@@ -161,10 +161,15 @@ class Issue:
161
161
 
162
162
  if hasattr(self, "created_at"):
163
163
  self.created_at = self.created_at.strip(" (Coordinated Universal Time)")
164
- if not hasattr(self, "introduced_by"):
165
- self.introduced_by = []
166
164
  if not hasattr(self, "manifests"):
167
165
  self.manifests = ""
166
+ if not hasattr(self, "introduced_by"):
167
+ self.introduced_by = []
168
+ else:
169
+ for item in self.introduced_by:
170
+ pkg, manifest = item
171
+ self.manifests += f"{manifest};"
172
+ self.manifests = self.manifests.rstrip(";")
168
173
  if not hasattr(self, "error"):
169
174
  self.error = False
170
175
  if not hasattr(self, "warn"):
@@ -167,12 +167,16 @@ def output_console_comments(diff_report: Diff, sbom_file_name: str = None) -> No
167
167
  console_security_comment = Messages.create_console_security_alert_table(diff_report)
168
168
  save_sbom_file(diff_report, sbom_file_name)
169
169
  log.info(f"Socket Full Scan ID: {diff_report.id}")
170
- if not report_pass(diff_report):
170
+ if len(diff_report.new_alerts) > 0:
171
171
  log.info("Security issues detected by Socket Security")
172
172
  msg = f"\n{console_security_comment}"
173
173
  log.info(msg)
174
- if not blocking_disabled:
174
+ if not report_pass(diff_report) and not blocking_disabled:
175
175
  sys.exit(1)
176
+ else:
177
+ # Means only warning alerts with no blocked
178
+ if not blocking_disabled:
179
+ sys.exit(5)
176
180
  else:
177
181
  log.info("No New Security issues detected by Socket Security")
178
182
 
@@ -184,6 +188,9 @@ def output_console_json(diff_report: Diff, sbom_file_name: str = None) -> None:
184
188
  print(json.dumps(console_security_comment))
185
189
  if not report_pass(diff_report) and not blocking_disabled:
186
190
  sys.exit(1)
191
+ elif len(diff_report.new_alerts) > 0 and not blocking_disabled:
192
+ # Means only warning alerts with no blocked
193
+ sys.exit(5)
187
194
 
188
195
 
189
196
  def report_pass(diff_report: Diff) -> bool:
@@ -306,6 +313,7 @@ def main_code():
306
313
  if ignore_commit_files:
307
314
  no_change = False
308
315
  elif is_repo and files is not None and len(files) > 0:
316
+ log.info(files)
309
317
  no_change = core.match_supported_files(files)
310
318
 
311
319
  set_as_pending_head = False
@@ -379,7 +387,8 @@ def main_code():
379
387
  new_overview_comment
380
388
  )
381
389
  else:
382
- log.info("Not a PR/MR event no comment needed")
390
+ log.info("Starting non-PR/MR flow")
391
+ diff = core.create_new_diff(target_path, params, workspace=target_path, no_change=no_change)
383
392
  if enable_json:
384
393
  log.debug("Outputting JSON Results")
385
394
  output_console_json(diff, sbom_file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 1.0.29
3
+ Version: 1.0.31
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Author-email: Douglas Coburn <douglas@socket.dev>
6
6
  Maintainer-email: Douglas Coburn <douglas@socket.dev>
File without changes