| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Comprehensive security scanning with SAST, secrets detection, container scanning, and more — all in one unified tool.
Socket Basics orchestrates multiple security scanners, normalizes their outputs into Socket's standardized format, and delivers consolidated results through your preferred notification channels.
The easiest way to use Socket Basics is through GitHub Actions:
# .github/workflows/socket.yml
name: ⚡️ Security Scan
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
jobs:
security-scan:
permissions:
issues: write
contents: read
pull-requests: write
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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@<sha> # v3.0.0
env:
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
socket_security_api_key: ${{ secrets.SOCKET_SECURITY_API_KEY }}Note
Why pin to a SHA? Socket Basics is a security tool, so its own supply-chain integrity matters. Version tags can be force-pushed or deleted; a commit SHA is immutable. Dependabot manages the upgrade automatically so you still get updates with a review gate. See docs/github-action.md for the full explanation and Dependabot setup.
That's it! With a properly scoped SOCKET_SECURITY_API_KEY, all scanning configurations are managed through the Socket Dashboard — no workflow changes needed. See Required API Token Scopes for details.
📖 Complete GitHub Actions Guide →
Socket Basics can also run locally or in other CI/CD environments:
Note
Trivy-backed scanning is bundled in the pre-built GitHub Action and Docker images again. Socket Basics ships a Socket-built distribution of Trivy — rebuilt from unmodified upstream source by Socket's own release pipeline and pinned by digest in the Dockerfile — rather than pulling upstream-published binaries or images. If you install Trivy natively instead, never use versions 0.69.4, 0.69.5, or 0.69.6 (Aqua's incident summary), and audit any cached Docker Hub images for those tags. See Local Installation for installation options.
Built-in Security Scanners:
Enterprise Features (requires Socket Enterprise):
Flexible Configuration:
Socket Basics delivers beautifully formatted, actionable PR comments with smart defaults — all enabled by default, zero configuration needed.
Every feature is customizable via GitHub Actions inputs, CLI flags, or environment variables.
📖 PR Comment Guide → — Full customization options, examples, and configuration reference
All configuration can be managed through:
See Parameters Reference for the full list of CLI options and environment variables.
Socket Basics supports special environment variables for integration with other tools:
SKIP_SOCKET_REACH=1 — Skip Socket Tier 1 reachability analysis. This allows external tools (like the Node.js Socket CLI) to skip redundant reachability scans when the analysis will be performed separately or is not needed for a particular workflow.
SKIP_SOCKET_SUBMISSION=1 — Skip submission to Socket API while still generating .socket.facts.json. This allows external tools (like the Node.js Socket CLI) to collect the facts file and submit it along with other data in a unified API call. When this is set, Socket Basics will complete all scanning and generate the facts file, but will not make the API submission call.
Socket Enterprise customers can configure Socket Basics directly from the Socket Dashboard:
Configure scanning policies, notification channels, and rule sets for your entire organization in one place. Your settings are automatically synchronized when you provide SOCKET_SECURITY_API_KEY and SOCKET_ORG.
Create your SOCKET_SECURITY_API_KEY in the Socket Dashboard under Settings → API Tokens. Dashboard routes can depend on your organization and login session, so start from the dashboard or see the Socket API Tokens docs for token-management details. Socket Basics needs the following scopes:
| Scope | Required for |
|---|---|
| full-scans | Submitting scan results to your organization |
| socket-basics | Loading scanner configuration from the Socket Dashboard |
If Socket Basics is configured from the Socket Dashboard, the socket-basics scope is required. If it is missing, you will see Insufficient permissions when Socket Basics loads dashboard configuration.
If Socket Basics is configured with CLI arguments, environment variables, or a JSON config file, only full-scans permissions are required for result submission. Set SOCKET_ORG explicitly in your workflow when using this mode.
For GitHub Actions, see the Quick Start above or the Complete GitHub Actions Guide for advanced workflows.
# Pull the pre-built image (recommended — no build step required)
docker pull ghcr.io/socketdev/socket-basics:3.0.0
# Run scan
docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.0.0 \
--workspace /workspace \
--python-sast-enabled \
--secret-scanning-enabled \
--console-tabular-enabledThe pre-built image is versioned and intended to be pinned exactly. Avoid floating tags like :latest in CI.
📖 View Docker Installation Guide
socket-basics --python --secrets --containers --verbose📖 View Local Installation Guide
For GitHub Actions & Docker: No local installation needed for the supported bundled scanners.
For Local Installation:
See Local Installation Guide for detailed setup instructions.
Socket Basics normalizes all scanner findings into a standardized Socket facts JSON structure:
{
"components": [
{
"type": "file",
"name": "path/to/file",
"alerts": [
{
"type": "sast|secret|container",
"severity": "low|medium|high|critical",
"message": "description",
"location": {"path": "file/path", "line": 42}
}
]
}
]
}Results can be:
Socket Basics uses a plugin-style connector system. Each connector:
Add new connectors by:
Connector fails to load:
Socket API errors:
Notifier errors:
Image scanning failures:
Enable verbose logging:
socket-basics --verbose ...
# or
INPUT_VERBOSE=true socket-basics ...We welcome contributions! To add new features:
Socket Basics uses a two-tier testing strategy to ensure code quality and scanner accuracy.
socket-basics/
├── tests/ # Unit & integration tests (pytest)
│ └── test_*.py # Fast, isolated tests of functions/modules
└── app_tests/ # End-to-end test fixtures
├── juice-shop/ # Node.js vulnerable app
├── pygoat/ # Python vulnerable app
├── NodeGoat/ # Node.js vulnerable app
├── DVWA/ # PHP vulnerable app
└── ... # Other deliberately vulnerable apps
Quick test run:
# Setup (first time only)
python3 -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
# Run all unit tests
pytest
# Run specific test file
pytest tests/test_github_helpers.py
# Run with verbose output
pytest -v
# Run with coverage report
pytest --cov=socket_basics tests/Characteristics:
The app_tests/ directory contains deliberately vulnerable applications (git submodules) for validating scanner accuracy.
Purpose:
Run E2E tests:
# Scan a vulnerable Node.js app
socket-basics --workspace app_tests/juice-shop \
--javascript-sast-enabled \
--secret-scanning-enabled
# Scan a vulnerable Python app
socket-basics --workspace app_tests/pygoat \
--python-sast-enabled \
--secret-scanning-enabled
# Compare results against known vulnerabilities
# (Manual verification of findings)Characteristics:
Adding Unit Tests:
# tests/test_new_feature.py
import pytest
from socket_basics.module import new_function
def test_new_feature():
result = new_function(input_data)
assert result == expected_outputAdding E2E Test Fixtures:
# Add a new vulnerable app as a git submodule
cd app_tests/
git submodule add https://github.com/org/vulnerable-app
git submodule update --initFor contributors:
For security researchers:
# Example GitHub Actions workflow
- name: Run Unit Tests
run: |
pip install -e ".[dev]"
pytest tests/ --cov=socket_basics
- name: Run E2E Tests (Selected)
run: |
# Run against specific vulnerable apps
socket-basics --workspace app_tests/pygoat --pythonNeed help? Visit our documentation or contact Socket Support.
| Back | FazBrowse Home | New Git URL |