socketsecurity 2.0.8__tar.gz → 2.0.9__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-2.0.8/socketsecurity.egg-info → socketsecurity-2.0.9}/PKG-INFO +27 -11
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/README.md +26 -10
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/__init__.py +3 -1
- {socketsecurity-2.0.8 → socketsecurity-2.0.9/socketsecurity.egg-info}/PKG-INFO +27 -11
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/LICENSE +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/pyproject.toml +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/setup.cfg +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/config.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/issues.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/licenses.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/socket_config.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/output.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity/socketcli.py +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity.egg-info/SOURCES.txt +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity.egg-info/dependency_links.txt +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity.egg-info/entry_points.txt +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity.egg-info/requires.txt +0 -0
- {socketsecurity-2.0.8 → socketsecurity-2.0.9}/socketsecurity.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: socketsecurity
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.9
|
|
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>
|
|
@@ -38,10 +38,10 @@ The Socket Security CLI was created to enable integrations with other tools like
|
|
|
38
38
|
## Usage
|
|
39
39
|
|
|
40
40
|
```` shell
|
|
41
|
-
socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--integration {api,github,gitlab}] [--owner OWNER] [--branch BRANCH]
|
|
42
|
-
[--committers [COMMITTERS ...]] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA]
|
|
43
|
-
[--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--files FILES] [--default-branch] [--pending-head]
|
|
44
|
-
[--generate-license] [--enable-debug] [--enable-json] [--enable-sarif] [--disable-overview] [--disable-security-issue]
|
|
41
|
+
socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--integration {api,github,gitlab}] [--owner OWNER] [--branch BRANCH]
|
|
42
|
+
[--committers [COMMITTERS ...]] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA]
|
|
43
|
+
[--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--files FILES] [--default-branch] [--pending-head]
|
|
44
|
+
[--generate-license] [--enable-debug] [--enable-json] [--enable-sarif] [--disable-overview] [--disable-security-issue]
|
|
45
45
|
[--allow-unverified] [--ignore-commit-files] [--disable-blocking] [--scm SCM] [--timeout TIMEOUT]
|
|
46
46
|
[--exclude-license-details]
|
|
47
47
|
````
|
|
@@ -108,9 +108,30 @@ If you don't want to provide the Socket API Token every time then you can use th
|
|
|
108
108
|
| --scm | False | api | Source control management type |
|
|
109
109
|
| --timeout | False | | Timeout in seconds for API requests |
|
|
110
110
|
|
|
111
|
+
## File Selection Behavior
|
|
112
|
+
|
|
113
|
+
The CLI determines which files to scan based on the following logic:
|
|
114
|
+
|
|
115
|
+
1. **Git Commit Files**: By default, the CLI checks files changed in the current git commit first. If any of these files match supported manifest patterns (like package.json, requirements.txt, etc.), a scan is triggered.
|
|
116
|
+
|
|
117
|
+
2. **`--files` Parameter**: If no git commit exists, or no manifest files are found in the commit changes, the CLI checks files specified via the `--files` parameter. This parameter accepts a JSON array of file paths.
|
|
118
|
+
|
|
119
|
+
3. **`--ignore-commit-files`**: When this flag is set, git commit files are ignored completely, and only files specified in `--files` are considered. This also forces a scan regardless of whether manifest files are present.
|
|
120
|
+
|
|
121
|
+
4. **No Manifest Files**: If no manifest files are found in either git commit changes or `--files` (and `--ignore-commit-files` is not set), the scan is skipped.
|
|
122
|
+
|
|
123
|
+
> **Note**: The CLI does not scan only the specified files - it uses them to determine whether a scan should be performed. When a scan is triggered, it searches the entire `--target-path` for all supported manifest files.
|
|
124
|
+
|
|
125
|
+
### Examples
|
|
126
|
+
|
|
127
|
+
- **Commit with manifest file**: If your commit includes changes to `package.json`, a scan will be triggered automatically.
|
|
128
|
+
- **Commit without manifest files**: If your commit only changes non-manifest files (like `.github/workflows/socket.yaml`), no scan will be performed unless you use `--files` or `--ignore-commit-files`.
|
|
129
|
+
- **Using `--files`**: If you specify `--files '["package.json"]'`, the CLI will check if this file exists and is a manifest file before triggering a scan.
|
|
130
|
+
- **Using `--ignore-commit-files`**: This forces a scan of all manifest files in the target path, regardless of what's in your commit.
|
|
131
|
+
|
|
111
132
|
## Development
|
|
112
133
|
|
|
113
|
-
This project uses `pyproject.toml` as the primary dependency specification.
|
|
134
|
+
This project uses `pyproject.toml` as the primary dependency specification.
|
|
114
135
|
|
|
115
136
|
### Development Workflows
|
|
116
137
|
|
|
@@ -165,8 +186,3 @@ Implementation targets:
|
|
|
165
186
|
### Environment Variables
|
|
166
187
|
|
|
167
188
|
- `SOCKET_SDK_PATH`: Path to local socket-sdk-python repository (default: ../socket-sdk-python)
|
|
168
|
-
|
|
169
|
-
### Running tests:
|
|
170
|
-
|
|
171
|
-
#### Run all tests:
|
|
172
|
-
```
|
|
@@ -5,10 +5,10 @@ The Socket Security CLI was created to enable integrations with other tools like
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```` shell
|
|
8
|
-
socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--integration {api,github,gitlab}] [--owner OWNER] [--branch BRANCH]
|
|
9
|
-
[--committers [COMMITTERS ...]] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA]
|
|
10
|
-
[--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--files FILES] [--default-branch] [--pending-head]
|
|
11
|
-
[--generate-license] [--enable-debug] [--enable-json] [--enable-sarif] [--disable-overview] [--disable-security-issue]
|
|
8
|
+
socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--integration {api,github,gitlab}] [--owner OWNER] [--branch BRANCH]
|
|
9
|
+
[--committers [COMMITTERS ...]] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA]
|
|
10
|
+
[--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--files FILES] [--default-branch] [--pending-head]
|
|
11
|
+
[--generate-license] [--enable-debug] [--enable-json] [--enable-sarif] [--disable-overview] [--disable-security-issue]
|
|
12
12
|
[--allow-unverified] [--ignore-commit-files] [--disable-blocking] [--scm SCM] [--timeout TIMEOUT]
|
|
13
13
|
[--exclude-license-details]
|
|
14
14
|
````
|
|
@@ -75,9 +75,30 @@ If you don't want to provide the Socket API Token every time then you can use th
|
|
|
75
75
|
| --scm | False | api | Source control management type |
|
|
76
76
|
| --timeout | False | | Timeout in seconds for API requests |
|
|
77
77
|
|
|
78
|
+
## File Selection Behavior
|
|
79
|
+
|
|
80
|
+
The CLI determines which files to scan based on the following logic:
|
|
81
|
+
|
|
82
|
+
1. **Git Commit Files**: By default, the CLI checks files changed in the current git commit first. If any of these files match supported manifest patterns (like package.json, requirements.txt, etc.), a scan is triggered.
|
|
83
|
+
|
|
84
|
+
2. **`--files` Parameter**: If no git commit exists, or no manifest files are found in the commit changes, the CLI checks files specified via the `--files` parameter. This parameter accepts a JSON array of file paths.
|
|
85
|
+
|
|
86
|
+
3. **`--ignore-commit-files`**: When this flag is set, git commit files are ignored completely, and only files specified in `--files` are considered. This also forces a scan regardless of whether manifest files are present.
|
|
87
|
+
|
|
88
|
+
4. **No Manifest Files**: If no manifest files are found in either git commit changes or `--files` (and `--ignore-commit-files` is not set), the scan is skipped.
|
|
89
|
+
|
|
90
|
+
> **Note**: The CLI does not scan only the specified files - it uses them to determine whether a scan should be performed. When a scan is triggered, it searches the entire `--target-path` for all supported manifest files.
|
|
91
|
+
|
|
92
|
+
### Examples
|
|
93
|
+
|
|
94
|
+
- **Commit with manifest file**: If your commit includes changes to `package.json`, a scan will be triggered automatically.
|
|
95
|
+
- **Commit without manifest files**: If your commit only changes non-manifest files (like `.github/workflows/socket.yaml`), no scan will be performed unless you use `--files` or `--ignore-commit-files`.
|
|
96
|
+
- **Using `--files`**: If you specify `--files '["package.json"]'`, the CLI will check if this file exists and is a manifest file before triggering a scan.
|
|
97
|
+
- **Using `--ignore-commit-files`**: This forces a scan of all manifest files in the target path, regardless of what's in your commit.
|
|
98
|
+
|
|
78
99
|
## Development
|
|
79
100
|
|
|
80
|
-
This project uses `pyproject.toml` as the primary dependency specification.
|
|
101
|
+
This project uses `pyproject.toml` as the primary dependency specification.
|
|
81
102
|
|
|
82
103
|
### Development Workflows
|
|
83
104
|
|
|
@@ -132,8 +153,3 @@ Implementation targets:
|
|
|
132
153
|
### Environment Variables
|
|
133
154
|
|
|
134
155
|
- `SOCKET_SDK_PATH`: Path to local socket-sdk-python repository (default: ../socket-sdk-python)
|
|
135
|
-
|
|
136
|
-
### Running tests:
|
|
137
|
-
|
|
138
|
-
#### Run all tests:
|
|
139
|
-
```
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__author__ = 'socket.dev'
|
|
2
|
-
__version__ = '2.0.
|
|
2
|
+
__version__ = '2.0.9'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import os
|
|
2
3
|
import sys
|
|
3
4
|
import time
|
|
4
5
|
from dataclasses import asdict
|
|
@@ -146,7 +147,8 @@ class Core:
|
|
|
146
147
|
glob_start = time.time()
|
|
147
148
|
glob_files = glob(file_path, recursive=True)
|
|
148
149
|
for glob_file in glob_files:
|
|
149
|
-
if
|
|
150
|
+
# Only add if it's a file, not a directory
|
|
151
|
+
if glob_file not in files and os.path.isfile(glob_file):
|
|
150
152
|
files.add(glob_file)
|
|
151
153
|
glob_end = time.time()
|
|
152
154
|
glob_total_time = glob_end - glob_start
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: socketsecurity
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.9
|
|
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>
|
|
@@ -38,10 +38,10 @@ The Socket Security CLI was created to enable integrations with other tools like
|
|
|
38
38
|
## Usage
|
|
39
39
|
|
|
40
40
|
```` shell
|
|
41
|
-
socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--integration {api,github,gitlab}] [--owner OWNER] [--branch BRANCH]
|
|
42
|
-
[--committers [COMMITTERS ...]] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA]
|
|
43
|
-
[--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--files FILES] [--default-branch] [--pending-head]
|
|
44
|
-
[--generate-license] [--enable-debug] [--enable-json] [--enable-sarif] [--disable-overview] [--disable-security-issue]
|
|
41
|
+
socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--integration {api,github,gitlab}] [--owner OWNER] [--branch BRANCH]
|
|
42
|
+
[--committers [COMMITTERS ...]] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA]
|
|
43
|
+
[--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--files FILES] [--default-branch] [--pending-head]
|
|
44
|
+
[--generate-license] [--enable-debug] [--enable-json] [--enable-sarif] [--disable-overview] [--disable-security-issue]
|
|
45
45
|
[--allow-unverified] [--ignore-commit-files] [--disable-blocking] [--scm SCM] [--timeout TIMEOUT]
|
|
46
46
|
[--exclude-license-details]
|
|
47
47
|
````
|
|
@@ -108,9 +108,30 @@ If you don't want to provide the Socket API Token every time then you can use th
|
|
|
108
108
|
| --scm | False | api | Source control management type |
|
|
109
109
|
| --timeout | False | | Timeout in seconds for API requests |
|
|
110
110
|
|
|
111
|
+
## File Selection Behavior
|
|
112
|
+
|
|
113
|
+
The CLI determines which files to scan based on the following logic:
|
|
114
|
+
|
|
115
|
+
1. **Git Commit Files**: By default, the CLI checks files changed in the current git commit first. If any of these files match supported manifest patterns (like package.json, requirements.txt, etc.), a scan is triggered.
|
|
116
|
+
|
|
117
|
+
2. **`--files` Parameter**: If no git commit exists, or no manifest files are found in the commit changes, the CLI checks files specified via the `--files` parameter. This parameter accepts a JSON array of file paths.
|
|
118
|
+
|
|
119
|
+
3. **`--ignore-commit-files`**: When this flag is set, git commit files are ignored completely, and only files specified in `--files` are considered. This also forces a scan regardless of whether manifest files are present.
|
|
120
|
+
|
|
121
|
+
4. **No Manifest Files**: If no manifest files are found in either git commit changes or `--files` (and `--ignore-commit-files` is not set), the scan is skipped.
|
|
122
|
+
|
|
123
|
+
> **Note**: The CLI does not scan only the specified files - it uses them to determine whether a scan should be performed. When a scan is triggered, it searches the entire `--target-path` for all supported manifest files.
|
|
124
|
+
|
|
125
|
+
### Examples
|
|
126
|
+
|
|
127
|
+
- **Commit with manifest file**: If your commit includes changes to `package.json`, a scan will be triggered automatically.
|
|
128
|
+
- **Commit without manifest files**: If your commit only changes non-manifest files (like `.github/workflows/socket.yaml`), no scan will be performed unless you use `--files` or `--ignore-commit-files`.
|
|
129
|
+
- **Using `--files`**: If you specify `--files '["package.json"]'`, the CLI will check if this file exists and is a manifest file before triggering a scan.
|
|
130
|
+
- **Using `--ignore-commit-files`**: This forces a scan of all manifest files in the target path, regardless of what's in your commit.
|
|
131
|
+
|
|
111
132
|
## Development
|
|
112
133
|
|
|
113
|
-
This project uses `pyproject.toml` as the primary dependency specification.
|
|
134
|
+
This project uses `pyproject.toml` as the primary dependency specification.
|
|
114
135
|
|
|
115
136
|
### Development Workflows
|
|
116
137
|
|
|
@@ -165,8 +186,3 @@ Implementation targets:
|
|
|
165
186
|
### Environment Variables
|
|
166
187
|
|
|
167
188
|
- `SOCKET_SDK_PATH`: Path to local socket-sdk-python repository (default: ../socket-sdk-python)
|
|
168
|
-
|
|
169
|
-
### Running tests:
|
|
170
|
-
|
|
171
|
-
#### Run all tests:
|
|
172
|
-
```
|
|
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
|
|
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
|
|
File without changes
|