socketsecurity 2.2.27__tar.gz → 2.2.32__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.2.32/Dockerfile +102 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/PKG-INFO +4 -2
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/README.md +2 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/pyproject.toml +2 -2
- socketsecurity-2.2.32/scripts/build_container_flexible.sh +161 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/config.py +30 -9
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/tools/reachability.py +19 -1
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/socketcli.py +12 -2
- socketsecurity-2.2.27/Dockerfile +0 -41
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/CODEOWNERS +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/workflows/docker-stable.yml +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/workflows/pr-preview.yml +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/workflows/release.yml +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/workflows/version-check.yml +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.gitignore +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.hooks/sync_version.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.pre-commit-config.yaml +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/.python-version +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/LICENSE +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/Makefile +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/docs/README.md +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/pytest.ini +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/scripts/build_container.sh +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/scripts/deploy-test-docker.sh +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/scripts/deploy-test-pypi.sh +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/scripts/run.sh +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/__init__.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/helper/__init__.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/lazy_file_loader.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/resource_utils.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/socket_config.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/output.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/plugins/__init__.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/plugins/base.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/plugins/jira.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/plugins/manager.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/plugins/slack.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/plugins/teams.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/socketsecurity/plugins/webhook.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/__init__.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/core/conftest.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/core/create_diff_input.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/core/test_diff_generation.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/core/test_package_and_alerts.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/core/test_sdk_methods.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/core/test_supporting_methods.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/create_response.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/diff/stream_diff.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/head_scan/metadata.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/new_scan/metadata.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/repos/repo_info_error.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/repos/repo_info_no_head.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/repos/repo_info_success.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/settings/security-policy.json +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/unit/__init__.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/unit/test_cli_config.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/unit/test_client.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/unit/test_config.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/unit/test_gitlab_auth.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/unit/test_gitlab_auth_fallback.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/unit/test_output.py +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/uv.lock +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/workflows/bitbucket-pipelines.yml +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/workflows/github-actions.yml +0 -0
- {socketsecurity-2.2.27 → socketsecurity-2.2.32}/workflows/gitlab-ci.yml +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
FROM python:3-alpine
|
|
2
|
+
LABEL org.opencontainers.image.authors="socket.dev"
|
|
3
|
+
|
|
4
|
+
# Language version arguments with defaults
|
|
5
|
+
ARG GO_VERSION=system
|
|
6
|
+
ARG JAVA_VERSION=17
|
|
7
|
+
ARG DOTNET_VERSION=8
|
|
8
|
+
|
|
9
|
+
# CLI and SDK arguments
|
|
10
|
+
ARG CLI_VERSION
|
|
11
|
+
ARG SDK_VERSION
|
|
12
|
+
ARG PIP_INDEX_URL=https://pypi.org/simple
|
|
13
|
+
ARG PIP_EXTRA_INDEX_URL=https://pypi.org/simple
|
|
14
|
+
ARG USE_LOCAL_INSTALL=false
|
|
15
|
+
|
|
16
|
+
# Install base packages first
|
|
17
|
+
RUN apk update && apk add --no-cache \
|
|
18
|
+
git nodejs npm yarn curl wget \
|
|
19
|
+
ruby ruby-dev build-base
|
|
20
|
+
|
|
21
|
+
# Install Go with version control
|
|
22
|
+
RUN if [ "$GO_VERSION" = "system" ]; then \
|
|
23
|
+
apk add --no-cache go; \
|
|
24
|
+
else \
|
|
25
|
+
cd /tmp && \
|
|
26
|
+
ARCH=$(uname -m) && \
|
|
27
|
+
case $ARCH in \
|
|
28
|
+
x86_64) GOARCH=amd64 ;; \
|
|
29
|
+
aarch64) GOARCH=arm64 ;; \
|
|
30
|
+
*) echo "Unsupported architecture: $ARCH" && exit 1 ;; \
|
|
31
|
+
esac && \
|
|
32
|
+
wget https://golang.org/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz && \
|
|
33
|
+
tar -C /usr/local -xzf go${GO_VERSION}.linux-${GOARCH}.tar.gz && \
|
|
34
|
+
rm go${GO_VERSION}.linux-${GOARCH}.tar.gz; \
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Install Java with version control
|
|
38
|
+
RUN if [ "$JAVA_VERSION" = "8" ]; then \
|
|
39
|
+
apk add --no-cache openjdk8-jdk; \
|
|
40
|
+
elif [ "$JAVA_VERSION" = "11" ]; then \
|
|
41
|
+
apk add --no-cache openjdk11-jdk; \
|
|
42
|
+
elif [ "$JAVA_VERSION" = "17" ]; then \
|
|
43
|
+
apk add --no-cache openjdk17-jdk; \
|
|
44
|
+
elif [ "$JAVA_VERSION" = "21" ]; then \
|
|
45
|
+
apk add --no-cache openjdk21-jdk; \
|
|
46
|
+
else \
|
|
47
|
+
echo "Unsupported Java version: $JAVA_VERSION. Supported: 8, 11, 17, 21" && exit 1; \
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# Install .NET with version control
|
|
51
|
+
RUN if [ "$DOTNET_VERSION" = "6" ]; then \
|
|
52
|
+
apk add --no-cache dotnet6-sdk; \
|
|
53
|
+
elif [ "$DOTNET_VERSION" = "8" ]; then \
|
|
54
|
+
apk add --no-cache dotnet8-sdk; \
|
|
55
|
+
else \
|
|
56
|
+
echo "Unsupported .NET version: $DOTNET_VERSION. Supported: 6, 8" && exit 1; \
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
# Install additional tools
|
|
60
|
+
RUN npm install @coana-tech/cli -g && \
|
|
61
|
+
gem install bundler && \
|
|
62
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
|
|
63
|
+
. ~/.cargo/env && \
|
|
64
|
+
rustup component add rustfmt clippy
|
|
65
|
+
|
|
66
|
+
# Set environment paths
|
|
67
|
+
ENV PATH="/usr/local/go/bin:/root/.cargo/bin:${PATH}"
|
|
68
|
+
ENV GOROOT="/usr/local/go"
|
|
69
|
+
ENV GOPATH="/go"
|
|
70
|
+
|
|
71
|
+
# Install uv
|
|
72
|
+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
|
73
|
+
|
|
74
|
+
# Install CLI based on build mode
|
|
75
|
+
RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
|
|
76
|
+
echo "Using local development install"; \
|
|
77
|
+
else \
|
|
78
|
+
for i in $(seq 1 10); do \
|
|
79
|
+
echo "Attempt $i/10: Installing socketsecurity==$CLI_VERSION"; \
|
|
80
|
+
if pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketsecurity==$CLI_VERSION; then \
|
|
81
|
+
break; \
|
|
82
|
+
fi; \
|
|
83
|
+
echo "Install failed, waiting 30s before retry..."; \
|
|
84
|
+
sleep 30; \
|
|
85
|
+
done && \
|
|
86
|
+
if [ ! -z "$SDK_VERSION" ]; then \
|
|
87
|
+
pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketdev==${SDK_VERSION}; \
|
|
88
|
+
fi; \
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
# Copy local source and install in editable mode if USE_LOCAL_INSTALL is true
|
|
92
|
+
COPY . /app
|
|
93
|
+
WORKDIR /app
|
|
94
|
+
RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
|
|
95
|
+
pip install --upgrade -e .; \
|
|
96
|
+
pip install --upgrade socketdev; \
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
# Create workspace directory with proper permissions
|
|
100
|
+
RUN mkdir -p /go/src && chmod -R 777 /go
|
|
101
|
+
|
|
102
|
+
ENTRYPOINT ["socketcli"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: socketsecurity
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.32
|
|
4
4
|
Summary: Socket Security CLI for CI/CD
|
|
5
5
|
Project-URL: Homepage, https://socket.dev
|
|
6
6
|
Author-email: Douglas Coburn <douglas@socket.dev>
|
|
@@ -40,7 +40,7 @@ Requires-Dist: packaging
|
|
|
40
40
|
Requires-Dist: prettytable
|
|
41
41
|
Requires-Dist: python-dotenv
|
|
42
42
|
Requires-Dist: requests
|
|
43
|
-
Requires-Dist: socketdev<4.0.0,>=3.0.
|
|
43
|
+
Requires-Dist: socketdev<4.0.0,>=3.0.19
|
|
44
44
|
Provides-Extra: dev
|
|
45
45
|
Requires-Dist: hatch; extra == 'dev'
|
|
46
46
|
Requires-Dist: pre-commit; extra == 'dev'
|
|
@@ -228,6 +228,8 @@ If you don't want to provide the Socket API Token every time then you can use th
|
|
|
228
228
|
| --reach-version | False | latest | Version of @coana-tech/cli to use for analysis |
|
|
229
229
|
| --reach-analysis-timeout | False | 1200 | Timeout in seconds for the reachability analysis (default: 1200 seconds / 20 minutes) |
|
|
230
230
|
| --reach-analysis-memory-limit | False | 4096 | Memory limit in MB for the reachability analysis (default: 4096 MB / 4 GB) |
|
|
231
|
+
| --reach-concurrency | False | | Control parallel analysis execution (must be >= 1) |
|
|
232
|
+
| --reach-additional-params | False | | Pass custom parameters to the coana CLI tool |
|
|
231
233
|
| --reach-ecosystems | False | | Comma-separated list of ecosystems to analyze (e.g., "npm,pypi"). If not specified, all supported ecosystems are analyzed |
|
|
232
234
|
| --reach-exclude-paths | False | | Comma-separated list of file paths or patterns to exclude from reachability analysis |
|
|
233
235
|
| --reach-min-severity | False | | Minimum severity level for reporting reachability results (low, medium, high, critical) |
|
|
@@ -171,6 +171,8 @@ If you don't want to provide the Socket API Token every time then you can use th
|
|
|
171
171
|
| --reach-version | False | latest | Version of @coana-tech/cli to use for analysis |
|
|
172
172
|
| --reach-analysis-timeout | False | 1200 | Timeout in seconds for the reachability analysis (default: 1200 seconds / 20 minutes) |
|
|
173
173
|
| --reach-analysis-memory-limit | False | 4096 | Memory limit in MB for the reachability analysis (default: 4096 MB / 4 GB) |
|
|
174
|
+
| --reach-concurrency | False | | Control parallel analysis execution (must be >= 1) |
|
|
175
|
+
| --reach-additional-params | False | | Pass custom parameters to the coana CLI tool |
|
|
174
176
|
| --reach-ecosystems | False | | Comma-separated list of ecosystems to analyze (e.g., "npm,pypi"). If not specified, all supported ecosystems are analyzed |
|
|
175
177
|
| --reach-exclude-paths | False | | Comma-separated list of file paths or patterns to exclude from reachability analysis |
|
|
176
178
|
| --reach-min-severity | False | | Minimum severity level for reporting reachability results (low, medium, high, critical) |
|
|
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "socketsecurity"
|
|
9
|
-
version = "2.2.
|
|
9
|
+
version = "2.2.32"
|
|
10
10
|
requires-python = ">= 3.10"
|
|
11
11
|
license = {"file" = "LICENSE"}
|
|
12
12
|
dependencies = [
|
|
@@ -16,7 +16,7 @@ dependencies = [
|
|
|
16
16
|
'GitPython',
|
|
17
17
|
'packaging',
|
|
18
18
|
'python-dotenv',
|
|
19
|
-
'socketdev>=3.0.
|
|
19
|
+
'socketdev>=3.0.19,<4.0.0',
|
|
20
20
|
"bs4>=0.0.2",
|
|
21
21
|
]
|
|
22
22
|
readme = "README.md"
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'")
|
|
3
|
+
ENABLE_PYPI_BUILD=$1
|
|
4
|
+
STABLE_VERSION=$2
|
|
5
|
+
GO_VERSION=${GO_VERSION:-"1.21"}
|
|
6
|
+
JAVA_VERSION=${JAVA_VERSION:-"17"}
|
|
7
|
+
DOTNET_VERSION=${DOTNET_VERSION:-"8"}
|
|
8
|
+
|
|
9
|
+
verify_package() {
|
|
10
|
+
local version=$1
|
|
11
|
+
local pip_index=$2
|
|
12
|
+
echo "Verifying package availability..."
|
|
13
|
+
|
|
14
|
+
for i in $(seq 1 30); do
|
|
15
|
+
if pip install --index-url $pip_index socketsecurity==$version; then
|
|
16
|
+
echo "Package $version is now available and installable"
|
|
17
|
+
pip uninstall -y socketsecurity
|
|
18
|
+
return 0
|
|
19
|
+
fi
|
|
20
|
+
echo "Attempt $i: Package not yet installable, waiting 20s... ($i/30)"
|
|
21
|
+
sleep 20
|
|
22
|
+
done
|
|
23
|
+
|
|
24
|
+
echo "Package verification failed after 30 attempts"
|
|
25
|
+
return 1
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
# Function to build Docker image with language versions
|
|
29
|
+
build_docker_image() {
|
|
30
|
+
local cli_version=$1
|
|
31
|
+
local tag=$2
|
|
32
|
+
local pip_index=${3:-"https://pypi.org/simple"}
|
|
33
|
+
local pip_extra_index=${4:-"https://pypi.org/simple"}
|
|
34
|
+
local use_local=${5:-"false"}
|
|
35
|
+
local dockerfile=${6:-"Dockerfile"}
|
|
36
|
+
|
|
37
|
+
echo "Building with Go $GO_VERSION, Java $JAVA_VERSION, .NET $DOTNET_VERSION"
|
|
38
|
+
|
|
39
|
+
local build_args="--build-arg CLI_VERSION=$cli_version"
|
|
40
|
+
build_args="$build_args --build-arg GO_VERSION=$GO_VERSION"
|
|
41
|
+
build_args="$build_args --build-arg JAVA_VERSION=$JAVA_VERSION"
|
|
42
|
+
build_args="$build_args --build-arg DOTNET_VERSION=$DOTNET_VERSION"
|
|
43
|
+
build_args="$build_args --build-arg PIP_INDEX_URL=$pip_index"
|
|
44
|
+
build_args="$build_args --build-arg PIP_EXTRA_INDEX_URL=$pip_extra_index"
|
|
45
|
+
build_args="$build_args --build-arg USE_LOCAL_INSTALL=$use_local"
|
|
46
|
+
|
|
47
|
+
docker build --no-cache $build_args --platform linux/amd64,linux/arm64 -t $tag -f $dockerfile .
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
echo "Socket CLI version: $VERSION"
|
|
51
|
+
echo "Language versions: Go $GO_VERSION, Java $JAVA_VERSION, .NET $DOTNET_VERSION"
|
|
52
|
+
|
|
53
|
+
if [ -z $ENABLE_PYPI_BUILD ] || [ -z $STABLE_VERSION ]; then
|
|
54
|
+
echo "$0 pypi-build=<option> stable=<true|false|prod|test>"
|
|
55
|
+
echo "\tpypi-build: Options are prod, test, or local"
|
|
56
|
+
echo "\t - prod: Build and publish to production PyPI, then build Docker images"
|
|
57
|
+
echo "\t - test: Build and publish to test PyPI, then build Docker images"
|
|
58
|
+
echo "\t - local: Build Docker images only using existing PyPI package (specify prod or test via stable parameter)"
|
|
59
|
+
echo "\tstable: true/false/prod/test - Also tag as stable; for local builds:"
|
|
60
|
+
echo "\t - stable=prod: Use production PyPI package"
|
|
61
|
+
echo "\t - stable=test: Use test PyPI package"
|
|
62
|
+
echo "\t - stable=false: Use local development install (pip install -e .)"
|
|
63
|
+
echo ""
|
|
64
|
+
echo "Environment variables for language versions:"
|
|
65
|
+
echo "\tGO_VERSION: Go version to install (default: 1.21, or 'system' for Alpine package)"
|
|
66
|
+
echo "\tJAVA_VERSION: Java version to install (default: 17, options: 8, 11, 17, 21)"
|
|
67
|
+
echo "\tDOTNET_VERSION: .NET version to install (default: 8, options: 6, 8)"
|
|
68
|
+
echo ""
|
|
69
|
+
echo "Examples:"
|
|
70
|
+
echo "\tGO_VERSION=1.19 JAVA_VERSION=11 $0 pypi-build=local stable=prod"
|
|
71
|
+
echo "\tGO_VERSION=system JAVA_VERSION=8 $0 pypi-build=local stable=false"
|
|
72
|
+
exit
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
if [ $ENABLE_PYPI_BUILD = "pypi-build=prod" ]; then
|
|
76
|
+
echo "Doing production build"
|
|
77
|
+
|
|
78
|
+
build_docker_image $VERSION "socketdev/cli:$VERSION"
|
|
79
|
+
docker push socketdev/cli:$VERSION
|
|
80
|
+
|
|
81
|
+
build_docker_image $VERSION "socketdev/cli:latest"
|
|
82
|
+
docker push socketdev/cli:latest
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
if [ $ENABLE_PYPI_BUILD = "pypi-build=test" ]; then
|
|
86
|
+
echo "Doing test build"
|
|
87
|
+
if ! python -m build --wheel --sdist; then
|
|
88
|
+
echo "Build failed"
|
|
89
|
+
exit 1
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
if ! twine upload --repository testpypi dist/*$VERSION*; then
|
|
93
|
+
echo "Upload to TestPyPI failed"
|
|
94
|
+
exit 1
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
if ! verify_package $VERSION "https://test.pypi.org/simple"; then
|
|
98
|
+
echo "Failed to verify package on TestPyPI"
|
|
99
|
+
exit 1
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
build_docker_image $VERSION "socketdev/cli:$VERSION-test" "https://test.pypi.org/simple" "https://pypi.org/simple"
|
|
103
|
+
docker push socketdev/cli:$VERSION-test
|
|
104
|
+
|
|
105
|
+
build_docker_image $VERSION "socketdev/cli:test" "https://test.pypi.org/simple" "https://pypi.org/simple"
|
|
106
|
+
docker push socketdev/cli:test
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
if [ $STABLE_VERSION = "stable=true" ]; then
|
|
110
|
+
if [ $ENABLE_PYPI_BUILD = "pypi-build=enable" ]; then
|
|
111
|
+
if ! verify_package $VERSION "https://pypi.org/simple"; then
|
|
112
|
+
echo "Failed to verify package on PyPI"
|
|
113
|
+
exit 1
|
|
114
|
+
fi
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
build_docker_image $VERSION "socketdev/cli:stable"
|
|
118
|
+
docker push socketdev/cli:stable
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
if [ $ENABLE_PYPI_BUILD = "pypi-build=local" ]; then
|
|
122
|
+
echo "Building local version without publishing to PyPI"
|
|
123
|
+
|
|
124
|
+
# Determine PyPI source and build parameters
|
|
125
|
+
if [ $STABLE_VERSION = "stable=prod" ]; then
|
|
126
|
+
echo "Using production PyPI"
|
|
127
|
+
PIP_INDEX_URL="https://pypi.org/simple"
|
|
128
|
+
PIP_EXTRA_INDEX_URL="https://pypi.org/simple"
|
|
129
|
+
TAG_SUFFIX="local"
|
|
130
|
+
USE_LOCAL_INSTALL="false"
|
|
131
|
+
elif [ $STABLE_VERSION = "stable=test" ]; then
|
|
132
|
+
echo "Using test PyPI"
|
|
133
|
+
PIP_INDEX_URL="https://test.pypi.org/simple"
|
|
134
|
+
PIP_EXTRA_INDEX_URL="https://pypi.org/simple"
|
|
135
|
+
TAG_SUFFIX="local-test"
|
|
136
|
+
USE_LOCAL_INSTALL="false"
|
|
137
|
+
elif [ $STABLE_VERSION = "stable=false" ]; then
|
|
138
|
+
echo "Using local development install (pip install -e .)"
|
|
139
|
+
TAG_SUFFIX="local-dev"
|
|
140
|
+
USE_LOCAL_INSTALL="true"
|
|
141
|
+
PIP_INDEX_URL="https://pypi.org/simple"
|
|
142
|
+
PIP_EXTRA_INDEX_URL="https://pypi.org/simple"
|
|
143
|
+
else
|
|
144
|
+
echo "For local builds, use stable=prod, stable=test, or stable=false"
|
|
145
|
+
exit 1
|
|
146
|
+
fi
|
|
147
|
+
|
|
148
|
+
# Create language-specific tag if non-default versions are used
|
|
149
|
+
LANG_TAG=""
|
|
150
|
+
if [ "$GO_VERSION" != "1.21" ] || [ "$JAVA_VERSION" != "17" ] || [ "$DOTNET_VERSION" != "8" ]; then
|
|
151
|
+
LANG_TAG="-go${GO_VERSION}-java${JAVA_VERSION}-dotnet${DOTNET_VERSION}"
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
build_docker_image $VERSION "socketdev/cli:$VERSION-$TAG_SUFFIX$LANG_TAG" $PIP_INDEX_URL $PIP_EXTRA_INDEX_URL $USE_LOCAL_INSTALL "Dockerfile.flexible"
|
|
155
|
+
|
|
156
|
+
build_docker_image $VERSION "socketdev/cli:$TAG_SUFFIX$LANG_TAG" $PIP_INDEX_URL $PIP_EXTRA_INDEX_URL $USE_LOCAL_INSTALL "Dockerfile.flexible"
|
|
157
|
+
|
|
158
|
+
echo "Local build complete. Tagged as:"
|
|
159
|
+
echo " - socketdev/cli:$VERSION-$TAG_SUFFIX$LANG_TAG"
|
|
160
|
+
echo " - socketdev/cli:$TAG_SUFFIX$LANG_TAG"
|
|
161
|
+
fi
|
|
@@ -73,6 +73,8 @@ class CliConfig:
|
|
|
73
73
|
reach_skip_cache: bool = False
|
|
74
74
|
reach_min_severity: Optional[str] = None
|
|
75
75
|
reach_output_file: Optional[str] = None
|
|
76
|
+
reach_concurrency: Optional[int] = None
|
|
77
|
+
reach_additional_params: Optional[List[str]] = None
|
|
76
78
|
only_facts_file: bool = False
|
|
77
79
|
|
|
78
80
|
@classmethod
|
|
@@ -132,6 +134,8 @@ class CliConfig:
|
|
|
132
134
|
'reach_skip_cache': args.reach_skip_cache,
|
|
133
135
|
'reach_min_severity': args.reach_min_severity,
|
|
134
136
|
'reach_output_file': args.reach_output_file,
|
|
137
|
+
'reach_concurrency': args.reach_concurrency,
|
|
138
|
+
'reach_additional_params': args.reach_additional_params,
|
|
135
139
|
'only_facts_file': args.only_facts_file,
|
|
136
140
|
'version': __version__
|
|
137
141
|
}
|
|
@@ -169,6 +173,11 @@ class CliConfig:
|
|
|
169
173
|
logging.error("--only-facts-file requires --reach to be specified")
|
|
170
174
|
exit(1)
|
|
171
175
|
|
|
176
|
+
# Validate reach_concurrency is >= 1 if provided
|
|
177
|
+
if args.reach_concurrency is not None and args.reach_concurrency < 1:
|
|
178
|
+
logging.error("--reach-concurrency must be >= 1")
|
|
179
|
+
exit(1)
|
|
180
|
+
|
|
172
181
|
return cls(**config_args)
|
|
173
182
|
|
|
174
183
|
def to_dict(self) -> dict:
|
|
@@ -429,20 +438,13 @@ def create_argument_parser() -> argparse.ArgumentParser:
|
|
|
429
438
|
help="Exclude license details from the diff report (boosts performance for large repos)"
|
|
430
439
|
)
|
|
431
440
|
|
|
432
|
-
|
|
433
|
-
security_group = parser.add_argument_group('Security Configuration')
|
|
434
|
-
security_group.add_argument(
|
|
435
|
-
"--allow-unverified",
|
|
436
|
-
action="store_true",
|
|
437
|
-
help="Allow unverified packages"
|
|
438
|
-
)
|
|
439
|
-
security_group.add_argument(
|
|
441
|
+
output_group.add_argument(
|
|
440
442
|
"--disable-security-issue",
|
|
441
443
|
dest="disable_security_issue",
|
|
442
444
|
action="store_true",
|
|
443
445
|
help="Disable security issue checks"
|
|
444
446
|
)
|
|
445
|
-
|
|
447
|
+
output_group.add_argument(
|
|
446
448
|
"--disable_security_issue",
|
|
447
449
|
dest="disable_security_issue",
|
|
448
450
|
action="store_true",
|
|
@@ -494,6 +496,11 @@ def create_argument_parser() -> argparse.ArgumentParser:
|
|
|
494
496
|
help="Timeout in seconds for API requests",
|
|
495
497
|
required=False
|
|
496
498
|
)
|
|
499
|
+
advanced_group.add_argument(
|
|
500
|
+
"--allow-unverified",
|
|
501
|
+
action="store_true",
|
|
502
|
+
help="Disable SSL certificate verification for API requests"
|
|
503
|
+
)
|
|
497
504
|
config_group.add_argument(
|
|
498
505
|
"--include-module-folders",
|
|
499
506
|
dest="include_module_folders",
|
|
@@ -567,6 +574,20 @@ def create_argument_parser() -> argparse.ArgumentParser:
|
|
|
567
574
|
default=".socket.facts.json",
|
|
568
575
|
help="Output file path for reachability analysis results (default: .socket.facts.json)"
|
|
569
576
|
)
|
|
577
|
+
reachability_group.add_argument(
|
|
578
|
+
"--reach-concurrency",
|
|
579
|
+
dest="reach_concurrency",
|
|
580
|
+
type=int,
|
|
581
|
+
metavar="<number>",
|
|
582
|
+
help="Concurrency level for reachability analysis (must be >= 1)"
|
|
583
|
+
)
|
|
584
|
+
reachability_group.add_argument(
|
|
585
|
+
"--reach-additional-params",
|
|
586
|
+
dest="reach_additional_params",
|
|
587
|
+
nargs='+',
|
|
588
|
+
metavar="<param>",
|
|
589
|
+
help="Additional parameters to pass to the coana CLI (e.g., --reach-additional-params --other-param value --another-param value2)"
|
|
590
|
+
)
|
|
570
591
|
reachability_group.add_argument(
|
|
571
592
|
"--only-facts-file",
|
|
572
593
|
dest="only_facts_file",
|
|
@@ -20,7 +20,7 @@ class ReachabilityAnalyzer:
|
|
|
20
20
|
Check if @coana-tech/cli is installed, and install/update it if needed.
|
|
21
21
|
|
|
22
22
|
Args:
|
|
23
|
-
version: Specific version to install (e.g., '1.2.3'). If None, updates to latest.
|
|
23
|
+
version: Specific version to install (e.g., '1.2.3'). If None, always updates to latest.
|
|
24
24
|
|
|
25
25
|
Returns:
|
|
26
26
|
str: The package specifier to use with npx
|
|
@@ -48,6 +48,7 @@ class ReachabilityAnalyzer:
|
|
|
48
48
|
log.debug(f"Could not check for existing @coana-tech/cli installation: {e}")
|
|
49
49
|
|
|
50
50
|
# Install or update the package
|
|
51
|
+
# When no version is specified, always try to update to latest
|
|
51
52
|
if version:
|
|
52
53
|
log.info(f"Installing reachability analysis plugin (@coana-tech/cli@{version})...")
|
|
53
54
|
else:
|
|
@@ -95,6 +96,9 @@ class ReachabilityAnalyzer:
|
|
|
95
96
|
repo_name: Optional[str] = None,
|
|
96
97
|
branch_name: Optional[str] = None,
|
|
97
98
|
version: Optional[str] = None,
|
|
99
|
+
concurrency: Optional[int] = None,
|
|
100
|
+
additional_params: Optional[List[str]] = None,
|
|
101
|
+
allow_unverified: bool = False,
|
|
98
102
|
) -> Dict[str, Any]:
|
|
99
103
|
"""
|
|
100
104
|
Run reachability analysis.
|
|
@@ -114,6 +118,9 @@ class ReachabilityAnalyzer:
|
|
|
114
118
|
repo_name: Repository name
|
|
115
119
|
branch_name: Branch name
|
|
116
120
|
version: Specific version of @coana-tech/cli to use
|
|
121
|
+
concurrency: Concurrency level for analysis (must be >= 1)
|
|
122
|
+
additional_params: Additional parameters to pass to coana CLI
|
|
123
|
+
allow_unverified: Disable SSL certificate verification (sets NODE_TLS_REJECT_UNAUTHORIZED=0)
|
|
117
124
|
|
|
118
125
|
Returns:
|
|
119
126
|
Dict containing scan_id and report_path
|
|
@@ -158,6 +165,13 @@ class ReachabilityAnalyzer:
|
|
|
158
165
|
if skip_cache:
|
|
159
166
|
cmd.append("--skip-cache-usage")
|
|
160
167
|
|
|
168
|
+
if concurrency:
|
|
169
|
+
cmd.extend(["--concurrency", str(concurrency)])
|
|
170
|
+
|
|
171
|
+
# Add any additional parameters provided by the user
|
|
172
|
+
if additional_params:
|
|
173
|
+
cmd.extend(additional_params)
|
|
174
|
+
|
|
161
175
|
# Set up environment variables
|
|
162
176
|
env = os.environ.copy()
|
|
163
177
|
|
|
@@ -172,6 +186,10 @@ class ReachabilityAnalyzer:
|
|
|
172
186
|
if branch_name:
|
|
173
187
|
env["SOCKET_BRANCH_NAME"] = branch_name
|
|
174
188
|
|
|
189
|
+
# Set NODE_TLS_REJECT_UNAUTHORIZED=0 if allow_unverified is True
|
|
190
|
+
if allow_unverified:
|
|
191
|
+
env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0"
|
|
192
|
+
|
|
175
193
|
# Execute CLI
|
|
176
194
|
log.info("Running reachability analysis...")
|
|
177
195
|
log.debug(f"Reachability command: {' '.join(cmd)}")
|
|
@@ -2,6 +2,7 @@ import json
|
|
|
2
2
|
import sys
|
|
3
3
|
import traceback
|
|
4
4
|
import shutil
|
|
5
|
+
import warnings
|
|
5
6
|
|
|
6
7
|
from dotenv import load_dotenv
|
|
7
8
|
from git import InvalidGitRepositoryError, NoSuchPathError
|
|
@@ -55,7 +56,13 @@ def main_code():
|
|
|
55
56
|
"2. Environment variable: SOCKET_SECURITY_API_KEY")
|
|
56
57
|
sys.exit(3)
|
|
57
58
|
|
|
58
|
-
sdk = socketdev(token=config.api_token)
|
|
59
|
+
sdk = socketdev(token=config.api_token, allow_unverified=config.allow_unverified)
|
|
60
|
+
|
|
61
|
+
# Suppress urllib3 InsecureRequestWarning when using --allow-unverified
|
|
62
|
+
if config.allow_unverified:
|
|
63
|
+
import urllib3
|
|
64
|
+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
65
|
+
|
|
59
66
|
output_handler = OutputHandler(config, sdk)
|
|
60
67
|
log.debug("sdk loaded")
|
|
61
68
|
|
|
@@ -277,7 +284,10 @@ def main_code():
|
|
|
277
284
|
disable_analytics=config.reach_disable_analytics or False,
|
|
278
285
|
repo_name=config.repo,
|
|
279
286
|
branch_name=config.branch,
|
|
280
|
-
version=config.reach_version
|
|
287
|
+
version=config.reach_version,
|
|
288
|
+
concurrency=config.reach_concurrency,
|
|
289
|
+
additional_params=config.reach_additional_params,
|
|
290
|
+
allow_unverified=config.allow_unverified
|
|
281
291
|
)
|
|
282
292
|
|
|
283
293
|
log.info(f"Reachability analysis completed successfully")
|
socketsecurity-2.2.27/Dockerfile
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
FROM python:3-alpine
|
|
2
|
-
LABEL org.opencontainers.image.authors="socket.dev"
|
|
3
|
-
ARG CLI_VERSION
|
|
4
|
-
ARG SDK_VERSION
|
|
5
|
-
ARG PIP_INDEX_URL=https://pypi.org/simple
|
|
6
|
-
ARG PIP_EXTRA_INDEX_URL=https://pypi.org/simple
|
|
7
|
-
ARG USE_LOCAL_INSTALL=false
|
|
8
|
-
|
|
9
|
-
RUN apk update \
|
|
10
|
-
&& apk add --no-cache git nodejs npm yarn curl \
|
|
11
|
-
&& npm install @coana-tech/cli -g
|
|
12
|
-
|
|
13
|
-
# Install uv
|
|
14
|
-
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
|
15
|
-
|
|
16
|
-
# Install CLI based on build mode
|
|
17
|
-
RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
|
|
18
|
-
echo "Using local development install"; \
|
|
19
|
-
else \
|
|
20
|
-
for i in $(seq 1 10); do \
|
|
21
|
-
echo "Attempt $i/10: Installing socketsecurity==$CLI_VERSION"; \
|
|
22
|
-
if pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketsecurity==$CLI_VERSION; then \
|
|
23
|
-
break; \
|
|
24
|
-
fi; \
|
|
25
|
-
echo "Install failed, waiting 30s before retry..."; \
|
|
26
|
-
sleep 30; \
|
|
27
|
-
done && \
|
|
28
|
-
if [ ! -z "$SDK_VERSION" ]; then \
|
|
29
|
-
pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketdev==${SDK_VERSION}; \
|
|
30
|
-
fi; \
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
# Copy local source and install in editable mode if USE_LOCAL_INSTALL is true
|
|
34
|
-
COPY . /app
|
|
35
|
-
WORKDIR /app
|
|
36
|
-
RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
|
|
37
|
-
pip install --upgrade -e .; \
|
|
38
|
-
pip install --upgrade socketdev; \
|
|
39
|
-
fi
|
|
40
|
-
|
|
41
|
-
# ENTRYPOINT ["socketcli"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.27 → socketsecurity-2.2.32}/.github/PULL_REQUEST_TEMPLATE/improvement.md
RENAMED
|
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
|
|
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
|
{socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/diff/stream_diff_full.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/head_scan/metadata.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/head_scan/stream_scan.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/head_scan/stream_scan_full.json
RENAMED
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.27 → socketsecurity-2.2.32}/tests/data/fullscans/new_scan/stream_scan.json
RENAMED
|
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
|