Skip to content

SocketDev/socket-basics

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Socket Basics

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.

Socket Basics Example Results

πŸš€ Quick Start - GitHub Actions

The easiest way to use Socket Basics is through GitHub Actions. Add it to your workflow in minutes:

name: Security Scan
on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  security-scan:
    permissions:
      issues: write
      contents: read
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      
      - name: Run Socket Basics
        uses: SocketDev/[email protected]
        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 }}

That's it! With just your SOCKET_SECURITY_API_KEY, all scanning configurations are managed through the Socket Dashboard β€” no workflow changes needed.

What You Get

  • βœ… Zero Configuration Required β€” Configure scanning policies in the Socket Dashboard
  • βœ… All Scanners Included β€” SAST, secrets, containers, and dependency analysis
  • βœ… PR Comments β€” Automated security findings on pull requests
  • βœ… Centralized Management β€” Update policies across all repos from one place

πŸ“– Complete GitHub Actions Guide β†’

Other Installation Methods

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

✨ Features

Built-in Security Scanners:

  • πŸ” SAST β€” Static analysis for 15+ languages (Python, JavaScript, Go, Java, Ruby, C#, and more)
  • πŸ” Secret Scanning β€” Detect leaked credentials and API keys with TruffleHog
  • 🐳 Container Scanning β€” Vulnerability scanning for Docker images and Dockerfiles with Trivy
  • πŸ“¦ Dependency Analysis β€” Socket Tier 1 reachability analysis for supply chain security

Enterprise Features (requires Socket Enterprise):

  • πŸŽ›οΈ Dashboard Configuration β€” Centrally manage scanning policies across your organization
  • πŸ“’ Notification Integrations β€” Send results to Slack, Jira, MS Teams, MS Sentinel, Sumo Logic, and webhooks
  • πŸ”„ Unified Reporting β€” Consolidated security view across all your projects

Flexible Configuration:

  • Configure via CLI flags, environment variables, JSON files, or the Socket Dashboard
  • Auto-enablement for container scanning when images or Dockerfiles are specified
  • Support for both standard and GitHub Actions INPUT_* environment variables

πŸ“– Documentation

Getting Started

Configuration

All configuration can be managed through:

  1. Socket Dashboard (Enterprise) β€” Centralized policy management
  2. CLI Arguments β€” Direct command-line flags
  3. Environment Variables β€” Standard or INPUT_* prefixed for GitHub Actions
  4. JSON Configuration File β€” Structured configuration (see socket_config_example.json)

See Configuration Documentation for details on all available options.

🎯 What Socket Basics Does

  1. Scans your codebase using multiple security tools in parallel
  2. Normalizes all findings into a unified Socket facts JSON format
  3. Filters results based on severity thresholds and configured rules
  4. Reports consolidated findings through console, files, or notification channels

🏒 Enterprise Dashboard Configuration

Socket Enterprise customers can configure Socket Basics directly from the Socket Dashboard:

Socket Basics Settings

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.

Socket Basics Section Config

πŸ’» Usage Examples

GitHub Actions (Recommended)

Dashboard-Configured (Enterprise):

- uses: SocketDev/[email protected]
  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 }}
    # All configuration managed in Socket Dashboard

CLI-Configured:

- uses: SocketDev/[email protected]
  env:
    GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    python_sast_enabled: 'true'
    secret_scanning_enabled: 'true'
    container_images: 'myapp:latest'

πŸ“– View Complete GitHub Actions Documentation

Docker

# Build with version tag
docker build -t socketdev/socket-basics:1.0.10 .

# Run scan
docker run --rm -v "$PWD:/workspace" socketdev/socket-basics:1.0.10 \
  --workspace /workspace \
  --python-sast-enabled \
  --secret-scanning-enabled \
  --console-tabular-enabled

πŸ“– View Docker Installation Guide

CLI

socket-basics --python --secrets --containers --verbose

πŸ“– View Local Installation Guide

πŸ”§ Requirements

For GitHub Actions & Docker: No installation needed β€” all tools are bundled in the container.

For Local Installation:

See Local Installation Guide for detailed setup instructions.

πŸ“Š Output Format

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:

  • Printed to console in tabular or JSON format
  • Written to file (.socket.facts.json)
  • Sent to notification channels (Slack, Jira, webhooks, etc.)

πŸ”Œ Connector Architecture

Socket Basics uses a plugin-style connector system. Each connector:

  • Lives under socket_basics/core/connector/
  • Implements scan() to execute the underlying tool
  • Implements _process_results() to normalize output

Add new connectors by:

  1. Creating a directory under socket_basics/core/connector/<tool>/
  2. Implementing the connector class
  3. Adding configuration to socket_basics/connectors.yaml

See the Developer Guide for details.

πŸ§ͺ Testing

Integration tests for connectors live in app_tests/. This is the authoritative location for connector-level testing with sample repositories.

# Run tests
python -m pytest app_tests/ -v

# Run specific connector tests
python -m pytest app_tests/test_trivy.py -v

πŸ› Troubleshooting

Connector fails to load:

  • Verify module_path and class in socket_basics/connectors.yaml

Socket API errors:

  • Ensure SOCKET_SECURITY_API_KEY and SOCKET_ORG are set correctly
  • Verify your Socket Enterprise subscription is active

Notifier errors:

  • Check that notification credentials (Slack webhook, Jira token, etc.) are properly configured
  • Remember: Notifiers require Socket Enterprise

Image scanning failures:

  • Confirm Docker access in your runtime environment
  • For GitHub Actions, ensure images are publicly accessible or credentials are provided

Enable verbose logging:

socket-basics --verbose ...
# or
INPUT_VERBOSE=true socket-basics ...

🀝 Contributing

We welcome contributions! To add new features:

  1. New Connectors: Implement under socket_basics/core/connector/
  2. New Notifiers: Implement under socket_basics/core/notification/
  3. Configuration: Add entries to socket_basics/connectors.yaml or socket_basics/notifications.yaml
  4. Tests: Add test cases to app_tests/

πŸ”— Resources


Need help? Visit our documentation or contact Socket Support.

About

Socket's tool for running SAST, Secrets, and Container Scaning

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •