diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ca6ff5..cb71927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,58 +8,109 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +## [3.2.0] - 2026-09-10 + +Scanner accuracy release. TruffleHog secret verification and the Java SAST rule +set were both fixed, and both change which findings a scan produces — read the +upgrade notes before rolling this out to a pipeline that gates on findings. + +### Upgrade notes + +Nothing here requires a configuration change, but expect different results on +the first run after upgrading. + +- **TruffleHog secrets can now block a run.** With `trufflehog_show_unverified` + off (the default), the connector passed `--no-verification`, which disabled + verification outright instead of filtering to verified results. Severity is + derived from each finding's `Verified` flag, so every result came back + unverified, low severity and non-blocking: on the default path no secret + could ever block a run, the exact inverse of intent. Verification now always + runs and the setting only selects result types, so a real leaked credential + is reported as critical and blocking. (#110) +- **TruffleHog verification reaches third-party endpoints.** Verification is a + live check: candidate credentials are sent to the issuing provider's + validation endpoint on every scan. This is TruffleHog's own default behavior, + but it is new for runs with `trufflehog_show_unverified` off. Egress + restricted runners should account for it. (#110) +- **A TruffleHog scan that cannot run now fails the run.** A non-zero exit, a + missing binary or a source error was logged and converted into an empty clean + result, so a broken install or a malformed exclude pattern was + indistinguishable from a repository with no secrets. These now fail with + TruffleHog's exit code and stderr — the same fail-closed idiom as an + unresolvable `changed_files` scope in 3.1.0. (#110) +- **Java SAST findings shift substantially, in both directions.** Twelve rules + were rewritten (see Fixed). Existing Java baselines will lose most of their + current findings and gain new ones at call sites the old patterns could never + match, so re-baseline instead of diffing against a previous run. (#112) + ### Added -- `--version` CLI flag. -- `--socket-org` CLI flag, the command-line equivalent of the `socket_org` - action input and the `SOCKET_ORG` environment variable. The API key remains - environment-only. -- GitHub Action inputs `verbose`, `console_tabular_enabled` and - `console_json_enabled`, delivered as `INPUT_VERBOSE`, - `INPUT_CONSOLE_TABULAR_ENABLED` and `INPUT_CONSOLE_JSON_ENABLED` and honored - from the environment the same way as the matching CLI flags. -- GitHub Action inputs `jira_url` and `jira_project`, matching the names used in - the documentation; `server` and `project` remain as aliases. Also added - `ms_sentinel_shared_key` (alias of `ms_sentinel_key`), - `opengrep_notification_method` and `trufflehog_notification_method` - (`notification_method` remains as an alias). -- `docs/parameters.md` gains a **Name Mapping** section listing every setting as - CLI flag, GitHub Action input, environment variable and JSON key, generated - from `connectors.yaml`, `notifications.yaml` and `action.yml`. A new test - keeps `action.yml` and the parameter declarations in step. -- `scripts/check_release_docs.py` now also checks that action references use an - exact release tag and that the bundled scanner versions quoted in the guides - match the Dockerfile pins; `--write` updates both. +- `--version` and `--socket-org` CLI flags. `--socket-org` is the command-line + equivalent of the `socket_org` action input and the `SOCKET_ORG` environment + variable; the API key remains environment-only. (#111) +- Action inputs for settings that previously existed only as CLI flags or + environment variables: `verbose`, `console_tabular_enabled`, + `console_json_enabled`, `jira_url`, `jira_project`, `ms_sentinel_shared_key`, + `opengrep_notification_method` and `trufflehog_notification_method`. The + older `server`, `project`, `ms_sentinel_key` and `notification_method` names + remain as aliases. (#111) +- A **Name Mapping** section in `docs/parameters.md` listing every setting as + CLI flag, action input, environment variable and JSON key, generated from + `connectors.yaml`, `notifications.yaml` and `action.yml`, plus a test that + keeps `action.yml` and the parameter declarations in step. (#111) - Documentation for the `-heavy` image variant and for when the standard image - is the right choice. + is the right choice. (#111) - Java SAST: `java-xss` (CWE-79) and `java-xpath-injection` (CWE-643) taint rules; an OWASP Benchmark scorer (`scripts/score_owasp_benchmark.py`) with the method and results in `docs/java-sast-benchmark.md`; and annotated Java rule regression fixtures under `tests/fixtures/opengrep/java`, which CI now runs against the opengrep release pinned in the Dockerfile. (#112) +- `scripts/check_release_docs.py` also verifies that action references use an + exact release tag and that the bundled scanner versions quoted in the guides + match the Dockerfile pins; `--write` updates both. (#111) ### Changed +- TruffleHog reports verified and unknown results by default, and adds + unverified results only when `trufflehog_show_unverified` is on. Verified + findings are critical and blocking; unknown and unverified findings remain + low and non-blocking. Boolean strings are now coerced wherever the setting + comes from, so a Socket dashboard config supplying `"false"` is no longer + read as on. (#110) - Socket Python CLI 2.7.0 → 2.8.0 in the heavy and app-tests images. (#112) ### Removed - The `workspace` and `GITHUB_API_URL` GitHub Action inputs. Neither had an effect: the action always scans `GITHUB_WORKSPACE`, and `GITHUB_API_URL` is provided by the runner. Workflows that still set them receive an - "Unexpected input" warning and otherwise behave as before. + "Unexpected input" warning and otherwise behave as before. (#111) - `docs/alert-quality-improvement-plan.md`, a draft working document from a - hackathon branch. The plan itself is now tracked separately. + hackathon branch. The plan itself is now tracked separately. (#111) ### Fixed -- TruffleHog now always verifies candidates, reports verified and unknown - results by default, and adds unverified results only when requested. Verified - findings are critical/blocking; unknown and unverified findings remain - low/non-blocking. Boolean string configuration is handled correctly. (#110) -- Missing or unsuccessful TruffleHog scans now fail the run instead of returning - an empty clean result, including source errors surfaced by - `--fail-on-scan-errors`. (#110) +- **Java SAST precision and recall.** Twelve rules were rewritten after a + customer evaluation reported roughly 90% false positives. Two systematic + defects drove the recall gap: patterns written with simple type names never + matched fully qualified call sites, and crypto rules matched exact algorithm + literals instead of transformation strings. On OWASP Benchmark v1.2 recall + rises from 13.2% to 71.3% while precision improves from 64.5% to 76.7%; on + six mature open source projects (~17,400 files) findings drop by 92%, and the + four lint-style rules (`java-empty-catch-block`, `java-system-out-usage`, + `java-reflection-injection`, `java-hardcoded-credentials`) report nothing + there — the first three alone produced 74% of the original noise. About a + quarter of that volume drop comes from new test, benchmark and example path + exclusions rather than rule logic; `docs/java-sast-benchmark.md` records the + method, the per-category numbers and the caveats. (#112) +- Java SAST false positives removed along the way: `RSA/ECB/...` is no longer a + weak cipher; a hardened cookie no longer hides an unhardened neighbour; + parameterized `JdbcTemplate`/`PreparedStatement` calls, the four-argument + LDAP `search(base, filter, args, controls)` form, `MessageDigest.update()`, + and the `Path.startsWith`/canonical-path containment idioms are no longer + reported; SnakeYAML `SafeConstructor` loads are excluded (including the 2.0 + `LoaderOptions` form) while `loadAs`/`loadAll` are now sinks; `"10.0.0.1"` is + reported as a hardcoded IP and `"10.2.3"` is not. (#112) - The Sentinel and Sumo Logic notifiers now read `ms_sentinel_workspace_id`, `ms_sentinel_key` and `sumologic_endpoint` from CLI flags, action inputs and dashboard configuration, in addition to the `MS_SENTINEL_*` and - `SUMO_LOGIC_HTTP_SOURCE_URL` environment variables. + `SUMO_LOGIC_HTTP_SOURCE_URL` environment variables. (#111) - Documentation consistency pass across the GitHub Action, Docker and local installation guides. CLI examples use the flag names that `socket-basics --help` prints. Docker examples keep the facts file inside the @@ -71,25 +122,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). match the code, GitLab and Jenkins examples override the image entrypoint, pre-commit hook examples use the published image name, and the installation guide states the Python 3.10 requirement and the npm install path for the - Socket CLI. New guidance covers large repositories and facts-file size. -- **Java SAST precision and recall.** Twelve Java rules were rewritten after a - customer evaluation reported roughly 90% false positives. On six mature open - source projects (~17,400 files) the rule set now emits about 95% fewer - findings, and the lint-style rules (`java-empty-catch-block`, - `java-system-out-usage`, `java-reflection-injection`, - `java-hardcoded-credentials`) report nothing there. On OWASP Benchmark v1.2, - recall rises from 13% to 71% while precision improves from 64.5% to 76.7%. - Two systematic defects drove the recall gap: patterns written with simple - type names never matched fully qualified call sites, and crypto rules matched - exact algorithm literals instead of transformation strings. (#112) -- Java SAST false positives removed along the way: `RSA/ECB/...` is no longer a - weak cipher; a hardened cookie no longer hides an unhardened neighbour; - parameterized `JdbcTemplate`/`PreparedStatement` calls, the four-argument - LDAP `search(base, filter, args, controls)` form, `MessageDigest.update()`, - and the `Path.startsWith`/canonical-path containment idioms are no longer - reported; SnakeYAML `SafeConstructor` loads are excluded (including the 2.0 - `LoaderOptions` form) while `loadAs`/`loadAll` are now sinks; `"10.0.0.1"` is - reported as a hardcoded IP and `"10.2.3"` is not. (#112) + Socket CLI. New guidance covers large repositories and facts-file size. (#111) +- TruffleHog parameter documentation: exclude paths accept files and globs, not + only directories, and `trufflehog_show_unverified` widens result types rather + than toggling verification. A JSON configuration example named a nonexistent + `show_unverified` key. (#110) ## [3.1.0] - 2026-09-02 diff --git a/README.md b/README.md index 3d4131c..d3328ed 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ jobs: - name: Run Socket Basics # Pin to a commit SHA for supply-chain safety. # Dependabot will keep this up to date automatically — see docs/github-action.md. - uses: SocketDev/socket-basics@ # v3.1.0 + uses: SocketDev/socket-basics@ # v3.2.0 env: GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} with: @@ -179,10 +179,10 @@ For GitHub Actions, see the [Quick Start](#-quick-start---github-actions) above ```bash # Pull the pre-built image (recommended — no build step required) -docker pull ghcr.io/socketdev/socket-basics:3.1.0 +docker pull ghcr.io/socketdev/socket-basics:3.2.0 # Run scan -docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.1.0 \ +docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.2.0 \ --workspace /workspace \ --python \ --secrets \ diff --git a/action.yml b/action.yml index f9a15c8..21f3065 100644 --- a/action.yml +++ b/action.yml @@ -4,7 +4,7 @@ author: "Socket" runs: using: "docker" - image: "docker://ghcr.io/socketdev/socket-basics:3.1.0" + image: "docker://ghcr.io/socketdev/socket-basics:3.2.0" env: # Core GitHub variables (these are automatically available, but we explicitly pass GITHUB_TOKEN) GITHUB_TOKEN: ${{ inputs.github_token }} diff --git a/docs/github-action.md b/docs/github-action.md index c80f9fe..389a02d 100644 --- a/docs/github-action.md +++ b/docs/github-action.md @@ -43,7 +43,7 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run Socket Basics - uses: SocketDev/socket-basics@v3.1.0 + uses: SocketDev/socket-basics@v3.2.0 env: GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} with: @@ -57,7 +57,7 @@ With just your `SOCKET_SECURITY_API_KEY`, all scanning configurations are manage ### How the action is currently built -When you reference `uses: SocketDev/socket-basics@v3.1.0`, GitHub Actions pulls the +When you reference `uses: SocketDev/socket-basics@v3.2.0`, GitHub Actions pulls the pre-built image referenced by [`action.yml`](../action.yml). The historical multi-stage Docker build still matters for maintainers because it determines what lands in the published image: @@ -75,7 +75,7 @@ Socket Basics from source in every workflow run. ### Pre-built image Starting with v2, the action pulls a pre-built image from GHCR rather than -building from source on every run. Pinning to a specific version tag (e.g. `@v3.1.0`) +building from source on every run. Pinning to a specific version tag (e.g. `@v3.2.0`) means the action starts in seconds — the image is built, integration-tested, and published before the release tag is ever created. @@ -85,7 +85,7 @@ If you run socket-basics in other CI systems (Jenkins, GitLab, CircleCI, etc.) o as a standalone `docker run`, pull the pre-built image directly: ```bash -docker pull ghcr.io/socketdev/socket-basics:3.1.0 +docker pull ghcr.io/socketdev/socket-basics:3.2.0 ``` See [Local Docker Installation](local-install-docker.md) for usage examples. @@ -101,7 +101,7 @@ is immediately affected. We've seen this happen across the ecosystem: publish `:latest`/`:latest-heavy` Docker aliases as an onboarding convenience, but treat them as exactly that — production pipelines should pin an exact version or digest.) -- **Version tags** (`@v3.1.0`) are better, but tags are mutable by default. +- **Version tags** (`@v3.2.0`) are better, but tags are mutable by default. A tag can be deleted and recreated pointing at a different commit. There are documented cases of this happening — maliciously and accidentally. - **Commit SHAs** are the only truly immutable reference. A SHA cannot be @@ -126,14 +126,14 @@ The only truly immutable reference. Dependabot keeps it current automatically. ```yaml - name: Run Socket Basics # Dependabot keeps this SHA up to date — see .github/dependabot.yml setup below. - uses: SocketDev/socket-basics@ # v3.1.0 + uses: SocketDev/socket-basics@ # v3.2.0 with: socket_security_api_key: ${{ secrets.SOCKET_SECURITY_API_KEY }} ``` Get the SHA for any release: ```bash -git ls-remote https://github.com/SocketDev/socket-basics refs/tags/v3.1.0 +git ls-remote https://github.com/SocketDev/socket-basics refs/tags/v3.2.0 ``` --- @@ -145,7 +145,7 @@ enforces tag protection rules). SHA pinning is still preferable for defence in depth. ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: socket_security_api_key: ${{ secrets.SOCKET_SECURITY_API_KEY }} ``` @@ -166,7 +166,7 @@ updates: ``` Dependabot opens a PR for each new release, updating the SHA or version tag -and keeping the `# v3.1.0` comment in sync. You review, approve, and merge +and keeping the `# v3.2.0` comment in sync. You review, approve, and merge on your own schedule — automated upgrades with a human gate. --- @@ -176,7 +176,7 @@ on your own schedule — automated upgrades with a human gate. | Strategy | Immutable? | Auto-updates | Review gate | |---|---|---|---| | `@v2` floating tag | ❌ (not published) | — | — | -| `@v3.1.0` + Dependabot | ✅ (tag protection enforced) | Yes (weekly PR) | Yes | +| `@v3.2.0` + Dependabot | ✅ (tag protection enforced) | Yes (weekly PR) | Yes | | `@` + Dependabot | ✅ always | Yes (weekly PR) | Yes | ## Basic Configuration @@ -217,7 +217,7 @@ Include these in your workflow's `jobs..permissions` section. **SAST (Static Analysis):** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} # Enable SAST for specific languages @@ -231,7 +231,7 @@ Include these in your workflow's `jobs..permissions` section. **Secret Scanning:** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} secret_scanning_enabled: 'true' @@ -251,7 +251,7 @@ Include these in your workflow's `jobs..permissions` section. **Container Scanning:** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} # Listing images or Dockerfiles auto-enables the matching Trivy scan. @@ -271,7 +271,7 @@ Include these in your workflow's `jobs..permissions` section. **Socket Tier 1 Reachability:** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} socket_tier_1_enabled: 'true' @@ -280,7 +280,7 @@ Include these in your workflow's `jobs..permissions` section. ### Output Configuration ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} python_sast_enabled: 'true' @@ -318,7 +318,7 @@ jobs: fetch-depth: 0 - name: Run Socket Basics (changed files only) - uses: SocketDev/socket-basics@v3.1.0 + uses: SocketDev/socket-basics@v3.2.0 env: GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }} with: @@ -444,7 +444,7 @@ Configure Socket Basics centrally from the [Socket Dashboard](https://socket.dev **Enable in workflow:** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 env: GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} with: @@ -457,7 +457,7 @@ Configure Socket Basics centrally from the [Socket Dashboard](https://socket.dev > [!NOTE] > You can also pass credentials using environment variables instead of the `with:` section: > ```yaml -> - uses: SocketDev/socket-basics@v3.1.0 +> - uses: SocketDev/socket-basics@v3.2.0 > env: > SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_SECURITY_API_KEY }} > with: @@ -475,7 +475,7 @@ All notification integrations require Socket Enterprise. **Slack Notifications:** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} socket_org: ${{ secrets.SOCKET_ORG }} @@ -487,7 +487,7 @@ All notification integrations require Socket Enterprise. **Jira Issue Creation:** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} socket_org: ${{ secrets.SOCKET_ORG }} @@ -502,7 +502,7 @@ All notification integrations require Socket Enterprise. **Microsoft Teams:** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} socket_org: ${{ secrets.SOCKET_ORG }} @@ -514,7 +514,7 @@ All notification integrations require Socket Enterprise. **Generic Webhook:** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} socket_org: ${{ secrets.SOCKET_ORG }} @@ -526,7 +526,7 @@ All notification integrations require Socket Enterprise. **SIEM Integration:** ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} socket_org: ${{ secrets.SOCKET_ORG }} @@ -562,7 +562,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run Socket Basics - uses: SocketDev/socket-basics@v3.1.0 + uses: SocketDev/socket-basics@v3.2.0 env: GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} with: @@ -604,7 +604,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run Full Security Scan - uses: SocketDev/socket-basics@v3.1.0 + uses: SocketDev/socket-basics@v3.2.0 env: GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} with: @@ -663,7 +663,7 @@ jobs: run: docker build -t myapp:${{ github.sha }} . - name: Run Socket Basics (image + Dockerfile scan) - uses: SocketDev/socket-basics@v3.1.0 + uses: SocketDev/socket-basics@v3.2.0 env: GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }} with: @@ -724,7 +724,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run Socket Basics - uses: SocketDev/socket-basics@v3.1.0 + uses: SocketDev/socket-basics@v3.2.0 env: GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} with: @@ -782,7 +782,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run Socket Basics - uses: SocketDev/socket-basics@v3.1.0 + uses: SocketDev/socket-basics@v3.2.0 env: GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} with: @@ -943,7 +943,7 @@ in the [name mapping](parameters.md#name-mapping). ```yaml steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - Must be first - - uses: SocketDev/socket-basics@v3.1.0 + - uses: SocketDev/socket-basics@v3.2.0 ``` ### PR Comments Not Appearing diff --git a/docs/github-pr-comment-guide.md b/docs/github-pr-comment-guide.md index ed55d67..03c2ec8 100644 --- a/docs/github-pr-comment-guide.md +++ b/docs/github-pr-comment-guide.md @@ -315,7 +315,7 @@ PR. This is for teams who want to review finding quality in the Socket dashboard first, without every PR growing a comment that developers have to scroll past. ```yaml -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 with: socket_security_api_key: ${{ secrets.SOCKET_SECURITY_API_KEY }} github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/local-install-docker.md b/docs/local-install-docker.md index 3e52258..ff2e490 100644 --- a/docs/local-install-docker.md +++ b/docs/local-install-docker.md @@ -16,7 +16,7 @@ Run Socket Basics locally using Docker without installing security tools on your ```bash # 1. Pull a pinned release from GHCR (no build step required) -docker pull ghcr.io/socketdev/socket-basics:3.1.0 +docker pull ghcr.io/socketdev/socket-basics:3.2.0 # 2. Create .env file with your credentials (the API key is environment-only; # the organization can also be passed per run with --socket-org) @@ -29,14 +29,14 @@ EOF docker run --rm \ -v "$PWD:/workspace" \ --env-file .env \ - ghcr.io/socketdev/socket-basics:3.1.0 \ + ghcr.io/socketdev/socket-basics:3.2.0 \ --workspace /workspace \ --python \ --secrets \ --console-tabular-enabled ``` -The Docker image should always be pinned to an exact version such as `3.1.0`. Avoid +The Docker image should always be pinned to an exact version such as `3.2.0`. Avoid floating tags like `:latest` in CI/CD. ## Using Pre-built Images @@ -46,13 +46,13 @@ The baked-in security tool versions are recorded in the image labels so you can inspect exactly what's inside: ```bash -docker inspect ghcr.io/socketdev/socket-basics:3.1.0 \ +docker inspect ghcr.io/socketdev/socket-basics:3.2.0 \ | jq '.[0].Config.Labels' # { # "com.socket.trivy-version": "0.73.0", # "com.socket.trufflehog-version": "3.96.0", # "com.socket.opengrep-version": "v1.26.0", -# "org.opencontainers.image.version": "3.1.0", +# "org.opencontainers.image.version": "3.2.0", # ... # } ``` @@ -90,8 +90,8 @@ tool: `socketcli` runs the Python CLI; `socket-basics`, or any other argument, runs Socket Basics: ```bash -docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.1.0-heavy socketcli --help -docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.1.0-heavy --workspace /workspace --python +docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.2.0-heavy socketcli --help +docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.2.0-heavy --workspace /workspace --python ``` `latest` and `latest-heavy` are floating aliases published for onboarding @@ -109,7 +109,7 @@ comments and labels. If you must run the image directly, pin the exact version: -v "$GITHUB_WORKSPACE:/workspace" \ -e SOCKET_SECURITY_API_KEY=${{ secrets.SOCKET_SECURITY_API_KEY }} \ -e SOCKET_ORG=${{ secrets.SOCKET_ORG }} \ - ghcr.io/socketdev/socket-basics:3.1.0 \ + ghcr.io/socketdev/socket-basics:3.2.0 \ --workspace /workspace \ --python \ --javascript \ @@ -122,7 +122,7 @@ comments and labels. If you must run the image directly, pin the exact version: ```yaml security-scan: image: - name: ghcr.io/socketdev/socket-basics:3.1.0 + name: ghcr.io/socketdev/socket-basics:3.2.0 entrypoint: [""] # GitLab needs a shell; the image's entrypoint is socket-basics stage: test script: @@ -141,7 +141,7 @@ security-scan: ```dockerfile # Pin socket-basics and let Dependabot send upgrade PRs automatically -FROM ghcr.io/socketdev/socket-basics:3.1.0 +FROM ghcr.io/socketdev/socket-basics:3.2.0 ``` ### Staying Up to Date with Dependabot @@ -159,7 +159,7 @@ updates: interval: "weekly" ``` -Dependabot will detect the `FROM ghcr.io/socketdev/socket-basics:3.1.0` reference +Dependabot will detect the `FROM ghcr.io/socketdev/socket-basics:3.2.0` reference and open a PR with the version bump when a new release is available. ## Building the Docker Image @@ -170,10 +170,10 @@ Pull a specific release without building locally: ```bash # GHCR (preferred) -docker pull ghcr.io/socketdev/socket-basics:3.1.0 +docker pull ghcr.io/socketdev/socket-basics:3.2.0 # Docker Hub -docker pull socketdev/socket-basics:3.1.0 +docker pull socketdev/socket-basics:3.2.0 ``` ### Build from Source @@ -186,7 +186,7 @@ git clone https://github.com/SocketDev/socket-basics.git cd socket-basics # Build with version tag (multi-stage; first build is slower, subsequent ones are fast) -docker build -t socket-basics:3.1.0 . +docker build -t socket-basics:3.2.0 . # Verify the build docker images | grep socket-basics @@ -195,7 +195,7 @@ docker images | grep socket-basics ### Build for a Specific Platform (M1/M2 Macs) ```bash -docker build --platform linux/amd64 -t socket-basics:3.1.0 . +docker build --platform linux/amd64 -t socket-basics:3.2.0 . ``` ### Build with Custom Tool Versions @@ -206,7 +206,7 @@ The image pins the bundled tools to specific versions. You can override them at docker build \ --build-arg TRUFFLEHOG_VERSION=3.96.0 \ --build-arg OPENGREP_VERSION=v1.26.0 \ - -t socket-basics:3.1.0 . + -t socket-basics:3.2.0 . ``` Trivy comes from a Socket-built image pinned by digest via the `TRIVY_IMAGE` @@ -219,13 +219,13 @@ tests image, build from the `app_tests` directory and use the same build args. ```bash # The image's entrypoint is `socket-basics`, so its own flags need no prefix -docker run --rm socket-basics:3.1.0 --version +docker run --rm socket-basics:3.2.0 --version # Other bundled tools need --entrypoint -docker run --rm --entrypoint socket socket-basics:3.1.0 --version -docker run --rm --entrypoint opengrep socket-basics:3.1.0 --version -docker run --rm --entrypoint trufflehog socket-basics:3.1.0 --version -docker run --rm --entrypoint trivy socket-basics:3.1.0 --version +docker run --rm --entrypoint socket socket-basics:3.2.0 --version +docker run --rm --entrypoint opengrep socket-basics:3.2.0 --version +docker run --rm --entrypoint trufflehog socket-basics:3.2.0 --version +docker run --rm --entrypoint trivy socket-basics:3.2.0 --version ``` ### Smoke Test @@ -260,7 +260,7 @@ Mount your project directory into the container: # Scan current directory docker run --rm \ -v "$PWD:/workspace" \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --python \ --secrets \ @@ -277,7 +277,7 @@ docker run --rm \ # Scan a specific project directory docker run --rm \ -v "/path/to/your/project:/workspace" \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --javascript \ --secrets @@ -288,7 +288,7 @@ docker run --rm \ ```bash docker run --rm \ -v "$PWD:/workspace" \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --all-languages \ --secrets \ @@ -341,7 +341,7 @@ INPUT_VERBOSE=false docker run --rm \ -v "$PWD:/workspace" \ --env-file .env \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --python \ --secrets @@ -356,7 +356,7 @@ docker run --rm \ -v "$PWD:/workspace" \ -e "SOCKET_SECURITY_API_KEY=scrt_your_api_key" \ -e "SOCKET_ORG=your-org-slug" \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --python \ --secrets \ @@ -378,7 +378,7 @@ docker run --rm \ --env-file .env.socket \ --env-file .env.notifiers \ --env-file .env.scanning \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --all-languages ``` @@ -397,7 +397,7 @@ docker run --rm \ -v "$PWD:/workspace" \ -e "SOCKET_SECURITY_API_KEY=$SOCKET_SECURITY_API_KEY" \ -e "SOCKET_ORG=$SOCKET_ORG" \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --python ``` @@ -424,7 +424,7 @@ docker run --rm \ -e GITHUB_TOKEN \ -e GITHUB_REPOSITORY=owner/repo \ -e GITHUB_PR_NUMBER=123 \ - ghcr.io/socketdev/socket-basics:3.1.0 \ + ghcr.io/socketdev/socket-basics:3.2.0 \ --workspace /workspace \ --python --javascript --secrets ``` @@ -463,7 +463,7 @@ mkdir -p ./scan-results docker run --rm \ -v "$PWD:/workspace" \ --env-file .env \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --python \ --secrets \ @@ -488,7 +488,7 @@ docker run --rm -it \ -v "$PWD:/workspace" \ --env-file .env \ --entrypoint /bin/bash \ - socket-basics:3.1.0 + socket-basics:3.2.0 # Inside container, run commands manually: # cd /workspace @@ -517,7 +517,7 @@ docker run --rm \ -v "$PWD:/workspace" \ -v "$PWD/socket-config.json:/config.json" \ --env-file .env \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --config /config.json ``` @@ -541,7 +541,7 @@ for PROJECT in "${PROJECTS[@]}"; do docker run --rm \ -v "$PROJECT:/workspace" \ --env-file .env \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --all-languages \ --secrets \ @@ -584,7 +584,7 @@ pipeline { script { // --entrypoint='' is required: Jenkins runs `cat` to keep the // container alive, and the image's entrypoint is socket-basics. - docker.image('ghcr.io/socketdev/socket-basics:3.1.0').inside( + docker.image('ghcr.io/socketdev/socket-basics:3.2.0').inside( "--entrypoint='' -v ${WORKSPACE}:/workspace --env-file .env" ) { sh ''' @@ -607,7 +607,7 @@ pipeline { ```yaml security-scan: image: - name: ghcr.io/socketdev/socket-basics:3.1.0 + name: ghcr.io/socketdev/socket-basics:3.2.0 entrypoint: [""] # GitLab needs a shell; the image's entrypoint is socket-basics stage: test script: @@ -650,7 +650,7 @@ security-scan: ```bash docker run --rm \ -v "$(pwd):/workspace" \ # Use $(pwd) instead of $PWD - socket-basics:3.1.0 + socket-basics:3.2.0 ``` 2. Verify mount (the entrypoint is `socket-basics`, so override it to run `ls`): @@ -658,7 +658,7 @@ security-scan: docker run --rm \ -v "$PWD:/workspace" \ --entrypoint ls \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ -la /workspace ``` @@ -688,7 +688,7 @@ security-scan: docker run --rm \ -v "$PWD:/workspace" \ --env-file "$(pwd)/.env" \ - socket-basics:3.1.0 + socket-basics:3.2.0 ``` ### Container Image Too Large @@ -719,7 +719,7 @@ security-scan: ```bash docker run --rm \ -v "$PWD:/workspace" \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --python \ --secrets \ @@ -740,7 +740,7 @@ security-scan: ```bash docker run --rm \ -v "$PWD:/workspace" \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --output /workspace/results.json # Save to mounted directory ``` @@ -751,7 +751,7 @@ security-scan: mkdir -p ./scan-results docker run --rm \ -v "$PWD:/workspace" \ - socket-basics:3.1.0 \ + socket-basics:3.2.0 \ --workspace /workspace \ --output /workspace/scan-results/scan.json ``` @@ -784,7 +784,7 @@ Add these to your `~/.bashrc` or `~/.zshrc` for quick access: ```bash # Socket Basics Docker aliases -alias sb-docker='docker run --rm -v "$PWD:/workspace" --env-file .env ghcr.io/socketdev/socket-basics:3.1.0 --workspace /workspace' +alias sb-docker='docker run --rm -v "$PWD:/workspace" --env-file .env ghcr.io/socketdev/socket-basics:3.2.0 --workspace /workspace' alias sb-quick='sb-docker --secrets --console-tabular-enabled' alias sb-python='sb-docker --python --secrets --console-tabular-enabled' alias sb-js='sb-docker --javascript --secrets --console-tabular-enabled' @@ -810,7 +810,7 @@ sb-all 1. **Use pre-built images** — Pull `ghcr.io/socketdev/socket-basics:` instead of building locally 2. **Use the standard image** — `-heavy` exists for one deployment constraint (see [Image Variants](#image-variants)); it adds nothing to Socket Basics -3. **Pin to a specific version** — Avoid `:latest` in production CI; pin to `3.1.0` and upgrade deliberately +3. **Pin to a specific version** — Avoid `:latest` in production CI; pin to `3.2.0` and upgrade deliberately 4. **Use Dependabot** — Reference the image in your Dockerfile/Compose to get automatic upgrade PRs 5. **Inspect baked-in labels** — Run `docker inspect | jq '.[0].Config.Labels'` to verify tool versions 6. **Use .env files** — Keep credentials out of command history @@ -830,7 +830,7 @@ set -e # Configuration PROJECT_DIR="$(pwd)" RESULTS_DIR="scan-results" # relative to the project: it must stay inside the workspace -IMAGE_NAME="ghcr.io/socketdev/socket-basics:3.1.0" +IMAGE_NAME="ghcr.io/socketdev/socket-basics:3.2.0" ENV_FILE=".env" # Create results directory (add it to .gitignore) diff --git a/docs/parameters.md b/docs/parameters.md index 4f1e883..1f1bc24 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -308,7 +308,7 @@ workflow and pass it in yourself: run: echo "ref=$(gh pr view ${{ github.event.issue.number }} --json baseRefName -q .baseRefName)" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- uses: SocketDev/socket-basics@v3.1.0 +- uses: SocketDev/socket-basics@v3.2.0 env: GITHUB_BASE_REF: ${{ steps.prbase.outputs.ref }} with: diff --git a/docs/pre-commit-hook.md b/docs/pre-commit-hook.md index 1475013..3ee6788 100644 --- a/docs/pre-commit-hook.md +++ b/docs/pre-commit-hook.md @@ -41,7 +41,7 @@ Best for: Teams wanting consistent environments without installing security tool ```bash # Pull the pre-built image (no build step required) -docker pull ghcr.io/socketdev/socket-basics:3.1.0 +docker pull ghcr.io/socketdev/socket-basics:3.2.0 ``` **2. Create pre-commit hook:** @@ -64,7 +64,7 @@ fi # Run Socket Basics in Docker docker run --rm \ -v "$PWD:/workspace" \ - ghcr.io/socketdev/socket-basics:3.1.0 \ + ghcr.io/socketdev/socket-basics:3.2.0 \ --workspace /workspace \ --python \ --javascript \ @@ -118,7 +118,7 @@ fi # Scope the scan to the staged changes docker run --rm \ -v "$PWD:/workspace" \ - ghcr.io/socketdev/socket-basics:3.1.0 \ + ghcr.io/socketdev/socket-basics:3.2.0 \ --workspace /workspace \ --changed-files auto \ --python \ @@ -153,7 +153,7 @@ docker run --rm \ -e SOCKET_ORG="$SOCKET_ORG" \ -e SOCKET_SECURITY_API_KEY="$SOCKET_SECURITY_API_KEY" \ -e SLACK_WEBHOOK_URL="$SLACK_WEBHOOK_URL" \ - ghcr.io/socketdev/socket-basics:3.1.0 \ + ghcr.io/socketdev/socket-basics:3.2.0 \ --workspace /workspace \ --python \ --javascript \ @@ -504,7 +504,7 @@ repos: hooks: - id: socket-basics name: Socket Basics Security Scan - entry: docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.1.0 --workspace /workspace --changed-files auto --python --secrets + entry: docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.2.0 --workspace /workspace --changed-files auto --python --secrets language: system pass_filenames: false ``` diff --git a/pyproject.toml b/pyproject.toml index 2962d3f..a8ac37f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "socket_basics" -version = "3.1.0" +version = "3.2.0" description = "Socket Basics with integrated SAST, secret scanning, and container analysis" readme = "README.md" requires-python = ">=3.10" diff --git a/socket_basics/__init__.py b/socket_basics/__init__.py index 3cb2d14..c8fd1e6 100644 --- a/socket_basics/__init__.py +++ b/socket_basics/__init__.py @@ -12,7 +12,7 @@ from .socket_basics import SecurityScanner, main from .core.config import load_config_from_env, Config -__version__ = "3.1.0" +__version__ = "3.2.0" __author__ = "Socket.dev" __email__ = "support@socket.dev" diff --git a/socket_basics/version.py b/socket_basics/version.py index f5f41e5..1173108 100644 --- a/socket_basics/version.py +++ b/socket_basics/version.py @@ -1 +1 @@ -__version__ = "3.1.0" +__version__ = "3.2.0" diff --git a/uv.lock b/uv.lock index 3d5f814..a0fb1d2 100644 --- a/uv.lock +++ b/uv.lock @@ -692,7 +692,7 @@ wheels = [ [[package]] name = "socket-basics" -version = "3.1.0" +version = "3.2.0" source = { editable = "." } dependencies = [ { name = "jsonschema" },