Socket Security CLI

raw JSON →
2.2.86 verified Mon Apr 27 auth: no python

Socket Security CLI for CI/CD, detecting supply chain threats in Python dependencies. Current version is 2.2.86, with frequent releases.

pip install socketsecurity
error socketsecurity.exceptions.AuthenticationError: API key not provided
cause The API key is missing or not set in environment.
fix
Set the SOCKET_SECURITY_API_KEY environment variable or pass api_key to SocketSecurity().
error ModuleNotFoundError: No module named 'socketsecurity'
cause The package is not installed.
fix
Run 'pip install socketsecurity' to install the package.
deprecated Python 3.10 and below are not supported; requires Python >= 3.11.
fix Upgrade to Python 3.11 or later.
gotcha The API key must be set via environment variable SOCKET_SECURITY_API_KEY or passed directly; forgetting it causes authentication failures.
fix Set SOCKET_SECURITY_API_KEY in your environment or pass api_key parameter.

Initialize and run a dependency check using the API key from environment variable.

from socketsecurity import SocketSecurity
import os

client = SocketSecurity(api_key=os.environ.get('SOCKET_SECURITY_API_KEY', ''))
client.check_dependencies()