socketsecurity 0.0.39__tar.gz → 0.0.41__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 0.0.39
3
+ Version: 0.0.41
4
4
  Requires-Dist: click
5
5
  Requires-Dist: mdutils
6
6
  Requires-Dist: requests
@@ -1,7 +1,7 @@
1
1
  from setuptools import setup, find_packages
2
2
  setup(
3
3
  name='socketsecurity',
4
- version='0.0.39',
4
+ version='0.0.41',
5
5
  packages=find_packages(),
6
6
  install_requires=[
7
7
  'click',
@@ -13,4 +13,4 @@ setup(
13
13
  [console_scripts]
14
14
  socketcli=socketsecurity.socketcli:cli
15
15
  ''',
16
- )
16
+ )
File without changes
@@ -0,0 +1,50 @@
1
+ import click
2
+ from core import Core, version
3
+ from core.classes import FullScanParams, Diff, Issue
4
+ from core.messages import Messages
5
+ import os
6
+
7
+
8
+ @click.command()
9
+ @click.option('--api_token', default='', help='The Socket API token can be set via SOCKET_SECURITY_API_KEY')
10
+ @click.option('--repo', default='', help='The name of the repository', required=True)
11
+ @click.option('--branch', default='main', help='The name of the branch')
12
+ @click.option('--committer', default='', help='The name of the person or bot running this', required=True)
13
+ @click.option('--pr_number', default='0', help='The pr or build number')
14
+ @click.option('--commit_message', default='', help='Commit or build message for the run')
15
+ @click.option('--default_branch', default=True, help='Whether this is the default/head for run')
16
+ @click.option('--target_path', default='./', help='Path to look for manifest files')
17
+ def cli(api_token, repo, branch, committer, pr_number, commit_message, default_branch, target_path):
18
+ print(f"Starting Socket Security Scan version {version}")
19
+ token = os.getenv("SOCKET_SECURITY_API_KEY") or api_token
20
+ if token is None:
21
+ print("Unable to get Socket Security API Token")
22
+ exit(2)
23
+ base_api_url = os.getenv("BASE_API_URL") or None
24
+ core = Core(token=token, request_timeout=6000, base_api_url=base_api_url)
25
+ set_as_pending_head = False
26
+ if default_branch:
27
+ set_as_pending_head = True
28
+ params = FullScanParams(
29
+ repo=repo,
30
+ branch=branch,
31
+ commit_message=commit_message,
32
+ commit_hash="",
33
+ pull_request=pr_number,
34
+ committers=committer,
35
+ make_default_branch=default_branch,
36
+ set_as_pending_head=set_as_pending_head
37
+ )
38
+ diff: Diff
39
+ diff = core.create_new_diff(target_path, params, workspace=target_path)
40
+ security_comment = Messages.create_console_security_alert_table(diff)
41
+ if len(diff.new_alerts) > 0:
42
+ print("Security issues detected by Socket Security")
43
+ print(security_comment)
44
+ exit(1)
45
+ else:
46
+ print("No New wSecurity issues detected by Socket Security")
47
+
48
+
49
+ if __name__ == '__main__':
50
+ cli()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 0.0.39
3
+ Version: 0.0.41
4
4
  Requires-Dist: click
5
5
  Requires-Dist: mdutils
6
6
  Requires-Dist: requests
@@ -0,0 +1,13 @@
1
+ setup.py
2
+ socketsecurity/__init__.py
3
+ socketsecurity/socketcli.py
4
+ socketsecurity.egg-info/PKG-INFO
5
+ socketsecurity.egg-info/SOURCES.txt
6
+ socketsecurity.egg-info/dependency_links.txt
7
+ socketsecurity.egg-info/entry_points.txt
8
+ socketsecurity.egg-info/requires.txt
9
+ socketsecurity.egg-info/top_level.txt
10
+ socketsecurity/core/__init__.py
11
+ socketsecurity/core/classes.py
12
+ socketsecurity/core/exceptions.py
13
+ socketsecurity/core/messages.py
@@ -0,0 +1 @@
1
+ socketsecurity
@@ -1,11 +0,0 @@
1
- setup.py
2
- core/__init__.py
3
- core/classes.py
4
- core/exceptions.py
5
- core/messages.py
6
- socketsecurity.egg-info/PKG-INFO
7
- socketsecurity.egg-info/SOURCES.txt
8
- socketsecurity.egg-info/dependency_links.txt
9
- socketsecurity.egg-info/entry_points.txt
10
- socketsecurity.egg-info/requires.txt
11
- socketsecurity.egg-info/top_level.txt