socketsecurity 0.0.59__tar.gz → 0.0.60__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.59 → socketsecurity-0.0.60}/PKG-INFO +1 -1
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/pyproject.toml +1 -1
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/core/__init__.py +1 -1
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/socketcli.py +21 -9
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity.egg-info/PKG-INFO +1 -1
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/README.md +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/setup.cfg +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/__init__.py +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/core/github.py +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/core/glitlab.py +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/core/issues.py +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/core/licenses.py +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity.egg-info/SOURCES.txt +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity.egg-info/dependency_links.txt +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity.egg-info/entry_points.txt +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity.egg-info/requires.txt +0 -0
- {socketsecurity-0.0.59 → socketsecurity-0.0.60}/socketsecurity.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,10 @@ from socketsecurity.core.classes import FullScanParams, Diff, Package
|
|
|
5
5
|
from socketsecurity.core.messages import Messages
|
|
6
6
|
import os
|
|
7
7
|
import sys
|
|
8
|
+
import logging
|
|
8
9
|
|
|
10
|
+
logging.basicConfig(level=logging.INFO)
|
|
11
|
+
log = logging.getLogger("socketcli")
|
|
9
12
|
|
|
10
13
|
parser = argparse.ArgumentParser(
|
|
11
14
|
prog="socketcli",
|
|
@@ -80,19 +83,28 @@ parser.add_argument(
|
|
|
80
83
|
help='Display the version',
|
|
81
84
|
)
|
|
82
85
|
|
|
86
|
+
parser.add_argument(
|
|
87
|
+
'--enable-debug',
|
|
88
|
+
help='Enable debug mode',
|
|
89
|
+
action='store_true',
|
|
90
|
+
default=False
|
|
91
|
+
)
|
|
83
92
|
|
|
84
93
|
def output_console_comments(diff_report) -> None:
|
|
85
94
|
console_security_comment = Messages.create_console_security_alert_table(diff_report)
|
|
86
95
|
if len(diff_report.new_alerts) > 0:
|
|
87
|
-
|
|
88
|
-
|
|
96
|
+
log.info("Security issues detected by Socket Security")
|
|
97
|
+
log.info(console_security_comment)
|
|
89
98
|
sys.exit(1)
|
|
90
99
|
else:
|
|
91
|
-
|
|
100
|
+
log.info("No New Security issues detected by Socket Security")
|
|
92
101
|
|
|
93
102
|
|
|
94
103
|
def cli():
|
|
95
104
|
arguments = parser.parse_args()
|
|
105
|
+
debug = arguments.enable_debug
|
|
106
|
+
if debug:
|
|
107
|
+
logging.basicConfig(level=logging.DEBUG)
|
|
96
108
|
repo = arguments.repo
|
|
97
109
|
branch = arguments.branch
|
|
98
110
|
commit_message = arguments.commit_message
|
|
@@ -111,12 +123,12 @@ def cli():
|
|
|
111
123
|
license_file += ".json"
|
|
112
124
|
api_token = os.getenv("SOCKET_SECURITY_API_KEY") or arguments.api_token
|
|
113
125
|
if api_token is None:
|
|
114
|
-
|
|
126
|
+
log.info("Unable to find Socket API Token")
|
|
115
127
|
sys.exit(3)
|
|
116
128
|
if repo is None:
|
|
117
|
-
|
|
129
|
+
log.info("Repo name needs to be set")
|
|
118
130
|
sys.exit(2)
|
|
119
|
-
|
|
131
|
+
log.info(f"Starting Socket Security Scan version {__version__}")
|
|
120
132
|
scm = None
|
|
121
133
|
if scm_type == "github":
|
|
122
134
|
from socketsecurity.core.github import Github
|
|
@@ -143,11 +155,11 @@ def cli():
|
|
|
143
155
|
)
|
|
144
156
|
diff = None
|
|
145
157
|
if scm is not None and scm.check_event_type() == "comment":
|
|
146
|
-
|
|
158
|
+
log.info("Comment initiated flow")
|
|
147
159
|
comments = scm.get_comments_for_pr(scm.repository, str(scm.pr_number))
|
|
148
160
|
scm.remove_comment_alerts(comments)
|
|
149
161
|
elif scm is not None and scm.check_event_type() != "comment":
|
|
150
|
-
|
|
162
|
+
log.info("Push initiated flow")
|
|
151
163
|
diff: Diff
|
|
152
164
|
diff = core.create_new_diff(target_path, params, workspace=target_path)
|
|
153
165
|
if scm.check_event_type() == "diff":
|
|
@@ -158,7 +170,7 @@ def cli():
|
|
|
158
170
|
scm.add_socket_comments(security_comment, overview_comment, comments)
|
|
159
171
|
output_console_comments(diff)
|
|
160
172
|
else:
|
|
161
|
-
|
|
173
|
+
log.info("API Mode")
|
|
162
174
|
diff: Diff
|
|
163
175
|
diff = core.create_new_diff(target_path, params, workspace=target_path)
|
|
164
176
|
output_console_comments(diff)
|
|
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.59 → socketsecurity-0.0.60}/socketsecurity.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|