Skip to content

Commit 7271046

Browse files
committed
docs: cleanup versioning guidance, pinning examples, container scanning status
Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent 5aa26ce commit 7271046

9 files changed

Lines changed: 231 additions & 163 deletions

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ jobs:
4343
socket_security_api_key: ${{ secrets.SOCKET_SECURITY_API_KEY }}
4444
```
4545
46-
> **Why pin to a SHA?** Socket Basics is a security tool — its own supply-chain
46+
> [!NOTE]
47+
> Why pin to a SHA? Socket Basics is a security tool, so its own supply-chain
4748
> integrity matters. Version tags can be force-pushed or deleted; a commit SHA is
4849
> immutable. Dependabot manages the upgrade automatically so you still get updates
4950
> with a review gate. See [docs/github-action.md](docs/github-action.md#pinning-strategies)
@@ -54,7 +55,7 @@ jobs:
5455
### What You Get
5556

5657
- ✅ **Zero Configuration Required** — Configure scanning policies in the Socket Dashboard
57-
- ✅ **All Scanners Included** — SAST, secrets, containers, and dependency analysis
58+
- ✅ **Unified Scanning** — SAST, secrets, dependency analysis, and native container scanning support
5859
- ✅ **PR Comments** — Automated security findings on pull requests
5960
- ✅ **Centralized Management** — Update policies across all repos from one place
6061

@@ -64,6 +65,16 @@ jobs:
6465

6566
Socket Basics can also run locally or in other CI/CD environments:
6667

68+
> [!NOTE]
69+
> Container and Dockerfile scanning remain part of Socket Basics, but the current
70+
> GitHub Action and pre-built image paths have Trivy-backed support temporarily
71+
> disabled while we complete additional security review of the underlying scanner
72+
> dependency path. If container or Dockerfile scanning is a near-term
73+
> requirement, the [native installation path](docs/local-installation.md) remains
74+
> available as a temporary workaround while the pre-built path is under
75+
> additional review. Review the upstream install path and artifacts carefully
76+
> before adopting it in production CI.
77+
6778
- **[Pre-Commit Hook](docs/pre-commit-hook.md)** — Catch issues before they're committed
6879
- **[Local Docker Installation](docs/local-install-docker.md)** — Run in Docker with no tool installation required
6980
- **[Local Installation](docs/local-installation.md)** — Install security tools natively on your machine
@@ -73,7 +84,7 @@ Socket Basics can also run locally or in other CI/CD environments:
7384
**Built-in Security Scanners:**
7485
- 🔍 **SAST** — Static analysis for 15+ languages (Python, JavaScript, Go, Java, Ruby, C#, and more)
7586
- 🔐 **Secret Scanning** — Detect leaked credentials and API keys with TruffleHog
76-
- 🐳 **Container Scanning** — Vulnerability scanning for Docker images and Dockerfiles with Trivy
87+
- 🐳 **Container Scanning** — Trivy-backed image and Dockerfile scanning for native installs
7788
- 📦 **Dependency Analysis** — Socket Tier 1 reachability analysis for supply chain security
7889

7990
**Enterprise Features** (requires [Socket Enterprise](https://socket.dev/enterprise)):
@@ -108,8 +119,7 @@ Every feature is customizable via GitHub Actions inputs, CLI flags, or environme
108119
- [PR Comment Guide](docs/github-pr-comment-guide.md) — Detailed guide to PR comment customization
109120
- [Pre-Commit Hook Setup](docs/pre-commit-hook.md) — Two installation methods (Docker vs native)
110121
- [Local Docker Installation](docs/local-install-docker.md) — Run with Docker, no tools to install
111-
- [Local Installation](docs/local-installation.md) — Install Socket CLI, Trivy, and other tools natively
112-
- [Releasing](docs/releasing.md) — Maintainer guide: How to cut a release for Socket Basics
122+
- [Local Installation](docs/local-installation.md) — Install Socket CLI and other tools natively with version pinning guidance
113123

114124
### Configuration
115125
All configuration can be managed through:
@@ -153,16 +163,18 @@ For GitHub Actions, see the [Quick Start](#-quick-start---github-actions) above
153163

154164
```bash
155165
# Pull the pre-built image (recommended — no build step required)
156-
docker pull socketdev/socket-basics:1.1.3
166+
docker pull ghcr.io/socketdev/socket-basics:2.0.2
157167
158168
# Run scan
159-
docker run --rm -v "$PWD:/workspace" socketdev/socket-basics:1.1.3 \
169+
docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:2.0.2 \
160170
--workspace /workspace \
161171
--python-sast-enabled \
162172
--secret-scanning-enabled \
163173
--console-tabular-enabled
164174
```
165175

176+
The pre-built image is versioned and intended to be pinned exactly. Avoid floating tags like `:latest` in CI.
177+
166178
📖 **[View Docker Installation Guide](docs/local-install-docker.md)**
167179

168180
### CLI
@@ -175,12 +187,12 @@ socket-basics --python --secrets --containers --verbose
175187

176188
## 🔧 Requirements
177189

178-
**For GitHub Actions & Docker:** No installation needed — all tools are bundled in the container.
190+
**For GitHub Actions & Docker:** No local installation needed for the supported bundled scanners.
179191

180192
**For Local Installation:**
181193
- Python 3.10+
182194
- [Socket CLI](https://docs.socket.dev/docs/cli) (for dependency analysis)
183-
- [Trivy](https://github.com/aquasecurity/trivy) (for container scanning)
195+
- [Trivy](https://github.com/aquasecurity/trivy) (for native container scanning)
184196
- [OpenGrep/Semgrep](https://semgrep.dev/) (for SAST)
185197
- [TruffleHog](https://github.com/trufflesecurity/trufflehog) (for secret scanning)
186198

@@ -258,7 +270,6 @@ We welcome contributions! To add new features:
258270
2. **New Notifiers:** Implement under `socket_basics/core/notification/`
259271
3. **Configuration:** Add entries to `socket_basics/connectors.yaml` or `socket_basics/notifications.yaml`
260272
4. **Testing:** See [Testing](#-testing) section below
261-
5. **Releasing:** See [docs/releasing.md](docs/releasing.md) for the maintainer release process
262273

263274
## 🧪 Testing
264275

action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,19 +383,19 @@ inputs:
383383
required: false
384384
default: "false"
385385
trivy_disabled_rules:
386-
description: "Comma-separated list of Trivy rules to disable"
386+
description: "Comma-separated list of Trivy rules to disable. Trivy-backed scanning is temporarily unavailable in the pre-built GitHub Action image."
387387
required: false
388388
default: ""
389389
trivy_image_scanning_disabled:
390-
description: "Disable Trivy image scanning"
390+
description: "Disable Trivy image scanning. Trivy-backed scanning is temporarily unavailable in the pre-built GitHub Action image."
391391
required: false
392392
default: "false"
393393
trivy_notification_method:
394-
description: "Notification method for Trivy (e.g., console, slack)"
394+
description: "Notification method for Trivy (e.g., console, slack). Trivy-backed scanning is temporarily unavailable in the pre-built GitHub Action image."
395395
required: false
396396
default: ""
397397
trivy_vuln_enabled:
398-
description: "Enable Trivy vulnerability scanning for all supported language ecosystems"
398+
description: "Enable Trivy vulnerability scanning for all supported language ecosystems. Trivy-backed scanning is temporarily unavailable in the pre-built GitHub Action image."
399399
required: false
400400
default: "false"
401401
trufflehog_exclude_dir:

docs/github-action.md

Lines changed: 73 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Complete guide to integrating Socket Basics into your GitHub Actions workflows f
55
## Table of Contents
66

77
- [Quick Start](#quick-start)
8-
- [Performance and Caching](#performance-and-caching) *(maintainers: see [releasing.md](releasing.md))*
8+
- [Performance and Caching](#performance-and-caching)
99
- [Basic Configuration](#basic-configuration)
1010
- [Enterprise Features](#enterprise-features)
1111
- [Advanced Workflows](#advanced-workflows)
@@ -57,10 +57,10 @@ With just your `SOCKET_SECURITY_API_KEY`, all scanning configurations are manage
5757

5858
### How the action is currently built
5959

60-
When you reference `uses: SocketDev/socket-basics@v2.0.2`, GitHub Actions builds the
61-
`Dockerfile` from source at the start of every workflow run. As of `1.1.3` the
62-
Dockerfile uses a **multi-stage build** with BuildKit cache mounts, which provides
63-
two categories of improvement:
60+
When you reference `uses: SocketDev/socket-basics@v2.0.2`, GitHub Actions pulls the
61+
pre-built image referenced by [`action.yml`](../action.yml). The historical multi-stage
62+
Docker build still matters for maintainers because it determines what lands in the
63+
published image:
6464

6565
| Improvement | Benefit |
6666
|-------------|---------|
@@ -69,27 +69,23 @@ two categories of improvement:
6969
| `--mount=type=cache` for apt / uv / npm | Faster repeated builds locally and on self-hosted runners with a persistent cache |
7070

7171
**On standard GitHub-hosted runners** (ephemeral, no persistent Docker cache between
72-
jobs), the multi-stage improvement is most visible when the same runner picks up a
73-
cached layer — typically within a workflow run or when GitHub's runner image itself
74-
includes the base layers. Cold runs still download and run all tool-install steps.
72+
jobs), users mainly benefit from pulling a ready-made image instead of rebuilding
73+
Socket Basics from source in every workflow run.
7574

7675
### Pre-built image
7776

7877
Starting with v2, the action pulls a pre-built image from GHCR rather than
79-
building from source on every run. Pinning to a specific version tag (e.g. `@v2.0.0`)
78+
building from source on every run. Pinning to a specific version tag (e.g. `@v2.0.2`)
8079
means the action starts in seconds — the image is built, integration-tested, and
8180
published before the release tag is ever created.
8281

83-
> **Maintainers:** see [releasing.md](releasing.md) for the publish-before-tag
84-
> release process and the PR checklist.
85-
8682
### If you're running socket-basics outside of the GitHub Action
8783

8884
If you run socket-basics in other CI systems (Jenkins, GitLab, CircleCI, etc.) or
8985
as a standalone `docker run`, pull the pre-built image directly:
9086

9187
```bash
92-
docker pull ghcr.io/socketdev/socket-basics:1.1.3
88+
docker pull ghcr.io/socketdev/socket-basics:2.0.2
9389
```
9490

9591
See [Local Docker Installation](local-install-docker.md) for usage examples.
@@ -104,15 +100,15 @@ is immediately affected. We've seen this happen across the ecosystem:
104100
A single bad push silently reaches all users with no review gate. This is
105101
structurally identical to `docker pull :latest` — the anti-pattern we
106102
explicitly warn against in our Docker docs.
107-
- **Version tags** (`@v2.0.0`) are better, but tags are mutable by default.
103+
- **Version tags** (`@v2.0.2`) are better, but tags are mutable by default.
108104
A tag can be deleted and recreated pointing at a different commit. There are
109105
documented cases of this happening — maliciously and accidentally.
110106
- **Commit SHAs** are the only truly immutable reference. A SHA cannot be
111107
reassigned. Combined with Dependabot, you get automated upgrades with a
112108
human review gate at zero ongoing maintenance cost.
113109

114110
We don't publish a floating major tag (`v2`). We do publish immutable version
115-
tags (`v2.0.0`) protected by tag protection rules in GitHub — but SHA pinning
111+
tags (`v2.0.2`) protected by tag protection rules in GitHub — but SHA pinning
116112
is still the recommendation for defence in depth.
117113

118114
### Pinning strategies
@@ -128,14 +124,14 @@ The only truly immutable reference. Dependabot keeps it current automatically.
128124
```yaml
129125
- name: Run Socket Basics
130126
# Dependabot keeps this SHA up to date — see .github/dependabot.yml setup below.
131-
uses: SocketDev/socket-basics@<sha> # v2.0.0
127+
uses: SocketDev/socket-basics@<sha> # v2.0.2
132128
with:
133129
socket_security_api_key: ${{ secrets.SOCKET_SECURITY_API_KEY }}
134130
```
135131

136132
Get the SHA for any release:
137133
```bash
138-
git ls-remote https://github.com/SocketDev/socket-basics refs/tags/v2.0.0
134+
git ls-remote https://github.com/SocketDev/socket-basics refs/tags/v2.0.2
139135
```
140136

141137
---
@@ -168,7 +164,7 @@ updates:
168164
```
169165

170166
Dependabot opens a PR for each new release, updating the SHA or version tag
171-
and keeping the `# v2.0.0` comment in sync. You review, approve, and merge
167+
and keeping the `# v2.0.2` comment in sync. You review, approve, and merge
172168
on your own schedule — automated upgrades with a human gate.
173169

174170
---
@@ -178,7 +174,7 @@ on your own schedule — automated upgrades with a human gate.
178174
| Strategy | Immutable? | Auto-updates | Review gate |
179175
|---|---|---|---|
180176
| `@v2` floating tag | ❌ (not published) | — | — |
181-
| `@v2.0.0` + Dependabot | ✅ (tag protection enforced) | Yes (weekly PR) | Yes |
177+
| `@v2.0.2` + Dependabot | ✅ (tag protection enforced) | Yes (weekly PR) | Yes |
182178
| `@<sha>` + Dependabot | ✅ always | Yes (weekly PR) | Yes |
183179

184180
## Basic Configuration
@@ -235,12 +231,21 @@ Include these in your workflow's `jobs.<job_id>.permissions` section.
235231
- uses: SocketDev/socket-basics@v2.0.2
236232
with:
237233
github_token: ${{ secrets.GITHUB_TOKEN }}
238-
# Scan Docker images (auto-enables container scanning)
239-
container_images: 'myorg/myapp:latest,redis:7'
240-
# Scan Dockerfiles (auto-enables Dockerfile scanning)
241-
dockerfiles: 'Dockerfile,docker/Dockerfile.prod'
234+
# Trivy-backed container scanning is temporarily not available in the
235+
# pre-built GitHub Action image. Use a native install if you need it today.
236+
# See docs/local-installation.md.
242237
```
243238

239+
> [!NOTE]
240+
> Container and Dockerfile scanning remain part of Socket Basics, but the current
241+
> GitHub Action and pre-built image paths have Trivy-backed support temporarily
242+
> disabled while we complete additional security review of the underlying scanner
243+
> dependency path. If container or Dockerfile scanning is a near-term
244+
> requirement, the [native installation path](local-installation.md) remains
245+
> available as a temporary workaround while the pre-built path is under
246+
> additional review. Review the upstream install path and artifacts carefully
247+
> before adopting it in production CI.
248+
244249
**Socket Tier 1 Reachability:**
245250
```yaml
246251
- uses: SocketDev/socket-basics@v2.0.2
@@ -298,7 +303,8 @@ Configure Socket Basics centrally from the [Socket Dashboard](https://socket.dev
298303
socket_security_api_key: ${{ secrets.SOCKET_SECURITY_API_KEY }}
299304
```
300305

301-
> **Note:** You can also pass credentials using environment variables instead of the `with:` section:
306+
> [!NOTE]
307+
> You can also pass credentials using environment variables instead of the `with:` section:
302308
> ```yaml
303309
> - uses: SocketDev/socket-basics@v2.0.2
304310
> env:
@@ -423,9 +429,6 @@ jobs:
423429
secret_scanning_enabled: 'true'
424430
socket_tier_1_enabled: 'true'
425431
426-
# Container scanning
427-
dockerfiles: 'Dockerfile'
428-
429432
# Notifications (Enterprise)
430433
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
431434
```
@@ -480,6 +483,21 @@ jobs:
480483

481484
### Container Security Pipeline
482485

486+
> [!NOTE]
487+
> Container and Dockerfile scanning remain part of Socket Basics, but the current
488+
> pre-built GitHub Action path has Trivy-backed support temporarily disabled while
489+
> we complete additional security review of the underlying scanner dependency path.
490+
> If container or Dockerfile scanning is a near-term requirement, the
491+
> [native installation path](local-installation.md) remains available as a
492+
> temporary workaround while the pre-built path is under additional review.
493+
> Review the upstream install path and artifacts carefully before adopting it in
494+
> production CI.
495+
496+
> [!WARNING]
497+
> This fallback path relies on upstream Trivy installation material outside the
498+
> pinned pre-built distribution model. Review the upstream install path and
499+
> artifacts carefully before using it in production CI.
500+
483501
```yaml
484502
name: Container Security
485503
on:
@@ -504,19 +522,16 @@ jobs:
504522
- name: Build Docker Image
505523
run: docker build -t myapp:${{ github.sha }} .
506524
525+
- name: Install pinned Trivy
526+
run: |
527+
TRIVY_VERSION=0.69.3
528+
curl -fsSL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh \
529+
| sh -s -- -b /usr/local/bin "v${TRIVY_VERSION}"
530+
507531
- name: Scan Container
508-
uses: SocketDev/socket-basics@v2.0.2
509-
env:
510-
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
511-
with:
512-
github_token: ${{ secrets.GITHUB_TOKEN }}
513-
514-
# Scan built image and Dockerfile
515-
container_images: 'myapp:${{ github.sha }}'
516-
dockerfiles: 'Dockerfile'
517-
518-
# Additional Trivy options
519-
trivy_vuln_enabled: 'true'
532+
run: |
533+
trivy image --exit-code 1 --severity HIGH,CRITICAL "myapp:${{ github.sha }}"
534+
trivy config --exit-code 1 --severity HIGH,CRITICAL Dockerfile
520535
```
521536

522537
### Dockerfile Auto-Discovery
@@ -573,8 +588,10 @@ jobs:
573588
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
574589
with:
575590
github_token: ${{ secrets.GITHUB_TOKEN }}
576-
dockerfiles: ${{ needs.discover-dockerfiles.outputs.dockerfiles }}
577-
trivy_vuln_enabled: 'true'
591+
# Dockerfile discovery remains useful context for future container
592+
# scanning support, but the current pre-built action image does not
593+
# execute Trivy-backed scans.
594+
verbose: 'true'
578595
```
579596

580597
**How it works:**
@@ -674,12 +691,19 @@ See [`action.yml`](../action.yml) for the complete list of inputs.
674691
- `trufflehog_show_unverified` — Show unverified secrets
675692
- `socket_tier_1_enabled` — Socket Tier 1 reachability
676693

677-
**Container Scanning:**
694+
**Container Scanning (configuration surface):**
678695
- `container_images` — Comma-separated images to scan
679696
- `dockerfiles` — Comma-separated Dockerfiles to scan
680697
- `trivy_disabled_rules` — Trivy rules to disable
681698
- `trivy_vuln_enabled` — Enable vulnerability scanning
682699

700+
> [!NOTE]
701+
> These inputs remain part of the action interface, but the current pre-built
702+
> GitHub Action path has Trivy-backed support temporarily disabled while we
703+
> complete additional security review of the underlying scanner dependency path.
704+
> Use the [native installation path](local-installation.md) if container scanning
705+
> is a near-term requirement.
706+
683707
**Notifications (Enterprise Required):**
684708
- `slack_webhook_url` — Slack webhook
685709
- `jira_url`, `jira_email`, `jira_api_token`, `jira_project` — Jira config
@@ -734,8 +758,13 @@ permissions:
734758
**Problem:** Container image scanning fails.
735759

736760
**Solutions:**
737-
1. Ensure Docker is available in runner
738-
2. For private images, add authentication:
761+
> [!NOTE]
762+
> The current pre-built GitHub Action path has Trivy-backed support temporarily
763+
> disabled while the underlying scanner dependency path remains under additional
764+
> security review. If container scanning is a near-term requirement, switch to a
765+
> native Trivy install in the workflow.
766+
767+
1. For private images, add authentication:
739768
```yaml
740769
- name: Login to Registry
741770
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

0 commit comments

Comments
 (0)