socketsecurity 1.0.25__tar.gz → 1.0.29__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.25/socketsecurity.egg-info → socketsecurity-1.0.29}/PKG-INFO +1 -1
  2. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/__init__.py +1 -1
  3. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/__init__.py +0 -1
  4. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/github.py +2 -1
  5. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/socketcli.py +24 -20
  6. {socketsecurity-1.0.25 → socketsecurity-1.0.29/socketsecurity.egg-info}/PKG-INFO +1 -1
  7. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/LICENSE +0 -0
  8. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/README.md +0 -0
  9. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/pyproject.toml +0 -0
  10. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/setup.cfg +0 -0
  11. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/classes.py +0 -0
  12. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/exceptions.py +0 -0
  13. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/git_interface.py +0 -0
  14. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/gitlab.py +0 -0
  15. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/issues.py +0 -0
  16. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/licenses.py +0 -0
  17. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/messages.py +0 -0
  18. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity/core/scm_comments.py +0 -0
  19. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity.egg-info/SOURCES.txt +0 -0
  20. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity.egg-info/dependency_links.txt +0 -0
  21. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity.egg-info/entry_points.txt +0 -0
  22. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/socketsecurity.egg-info/requires.txt +0 -0
  23. {socketsecurity-1.0.25 → socketsecurity-1.0.29}/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.25
3
+ Version: 1.0.29
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.25'
2
+ __version__ = '1.0.29'
@@ -410,7 +410,6 @@ class Core:
410
410
  Globs the path for supported manifest files.
411
411
  Note: Might move the source to a JSON file
412
412
  :param path: Str - path to where the manifest files are located
413
- :param files: override finding the manifest files using the glob matcher
414
413
  :return:
415
414
  """
416
415
  log.debug("Starting Find Files")
@@ -116,7 +116,8 @@ class Github:
116
116
  else:
117
117
  event_type = "diff"
118
118
  elif github_event_name.lower() == "pull_request":
119
- if event_action is not None and event_action != "" and event_action.lower() == "opened":
119
+ if event_action is not None and event_action != "" and (
120
+ event_action.lower() == "opened" or event_action.lower() == 'synchronize'):
120
121
  event_type = "diff"
121
122
  else:
122
123
  log.info(f"Pull Request Action {event_action} is not a supported type")
@@ -163,25 +163,27 @@ parser.add_argument(
163
163
 
164
164
 
165
165
  def output_console_comments(diff_report: Diff, sbom_file_name: str = None) -> None:
166
- console_security_comment = Messages.create_console_security_alert_table(diff_report)
167
- save_sbom_file(diff_report, sbom_file_name)
168
- log.info(f"Socket Full Scan ID: {diff_report.id}")
169
- if not report_pass(diff_report):
170
- log.info("Security issues detected by Socket Security")
171
- msg = f"\n{console_security_comment}"
172
- log.info(msg)
173
- if not blocking_disabled:
174
- sys.exit(1)
175
- else:
176
- log.info("No New Security issues detected by Socket Security")
166
+ if diff_report.id != "NO_DIFF_RAN":
167
+ console_security_comment = Messages.create_console_security_alert_table(diff_report)
168
+ save_sbom_file(diff_report, sbom_file_name)
169
+ log.info(f"Socket Full Scan ID: {diff_report.id}")
170
+ if not report_pass(diff_report):
171
+ log.info("Security issues detected by Socket Security")
172
+ msg = f"\n{console_security_comment}"
173
+ log.info(msg)
174
+ if not blocking_disabled:
175
+ sys.exit(1)
176
+ else:
177
+ log.info("No New Security issues detected by Socket Security")
177
178
 
178
179
 
179
180
  def output_console_json(diff_report: Diff, sbom_file_name: str = None) -> None:
180
- console_security_comment = Messages.create_security_comment_json(diff_report)
181
- save_sbom_file(diff_report, sbom_file_name)
182
- print(json.dumps(console_security_comment))
183
- if not report_pass(diff_report) and not blocking_disabled:
184
- sys.exit(1)
181
+ if diff_report.id != "NO_DIFF_RAN":
182
+ console_security_comment = Messages.create_security_comment_json(diff_report)
183
+ save_sbom_file(diff_report, sbom_file_name)
184
+ print(json.dumps(console_security_comment))
185
+ if not report_pass(diff_report) and not blocking_disabled:
186
+ sys.exit(1)
185
187
 
186
188
 
187
189
  def report_pass(diff_report: Diff) -> bool:
@@ -299,7 +301,7 @@ def main_code():
299
301
  default_branch = scm.is_default_branch
300
302
 
301
303
  base_api_url = os.getenv("BASE_API_URL") or None
302
- core = Core(token=api_token, request_timeout=1200, base_api_url=base_api_url)
304
+ core = Core(token=api_token, request_timeout=1200, base_api_url=base_api_url, allow_unverified=allow_unverified)
303
305
  no_change = True
304
306
  if ignore_commit_files:
305
307
  no_change = False
@@ -319,7 +321,8 @@ def main_code():
319
321
  make_default_branch=default_branch,
320
322
  set_as_pending_head=set_as_pending_head
321
323
  )
322
- diff = None
324
+ diff = Diff()
325
+ diff.id = "NO_DIFF_RAN"
323
326
  if scm is not None and scm.check_event_type() == "comment":
324
327
  log.info("Comment initiated flow")
325
328
  log.debug(f"Getting comments for Repo {scm.repository} for PR {scm.pr_number}")
@@ -329,10 +332,11 @@ def main_code():
329
332
  elif scm is not None and scm.check_event_type() != "comment":
330
333
  log.info("Push initiated flow")
331
334
  diff: Diff
332
- diff = core.create_new_diff(target_path, params, workspace=target_path, no_change=no_change)
333
335
  if no_change:
334
- log.info("No dependency changes")
336
+ log.info("No manifest files changes, skipping scan")
337
+ # log.info("No dependency changes")
335
338
  elif scm.check_event_type() == "diff":
339
+ diff = core.create_new_diff(target_path, params, workspace=target_path, no_change=no_change)
336
340
  log.info("Starting comment logic for PR/MR event")
337
341
  log.debug(f"Getting comments for Repo {scm.repository} for PR {scm.pr_number}")
338
342
  comments = scm.get_comments_for_pr(repo, str(pr_number))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 1.0.25
3
+ Version: 1.0.29
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