Create Socket API Key for CI/CD
Create your Socket API Key
You can either create your API key yourself if you have permissions in your socket.dev account or you can have your Admin create it for you with the scopes listed below. (See Notes section below for the environment variable usages)
-
Log into the socket.dev dashboard
-
Go to Settings
-
Go to the API Tokens tab
-
Select Create API Token
-
Give the token a name like CI/CD API Key
-
Select the following scopes
-
repo
- repo:list
- repo:create
- repo:update
-
security-policy
- security-policy:read
-
Triage
-
triage:alerts-list
-
triage:alerts-update
-
-
full-scans
- full-scans:list
- full-scans:create
-
packages
- packages:list
-
-
Click Confirm
-
Click on Show key
-
Click on the API Key Token to copy
Notes:
- The Socket CLI reads your API token from either
SOCKET_SECURITY_API_KEYorSOCKET_SECURITY_API_TOKEN(it also acceptsSOCKET_API_KEY/SOCKET_API_TOKEN, or the--api-tokenflag). These work the same whether you run the CLI locally or in a CI/CD integration (GitHub Actions, GitLab, Bitbucket, Jenkins, Azure DevOps). - If more than one is set,
SOCKET_SECURITY_API_KEYtakes precedence. The CI/CD examples in these docs useSOCKET_SECURITY_API_KEY.
