|
2 | 2 |
|
3 | 3 | The Socket Security CLI was created to enable integrations with other tools like Github Actions, Gitlab, BitBucket, local use cases and more. The tool will get the head scan for the provided repo from Socket, create a new one, and then report any new alerts detected. If there are new alerts against the Socket security policy it'll exit with a non-Zero exit code.
|
4 | 4 |
|
5 |
| - |
6 |
| - |
7 | 5 | ## Usage
|
8 | 6 |
|
9 | 7 | ```` shell
|
10 |
| -socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--branch BRANCH] [--committer COMMITTER] [--pr-number PR_NUMBER] |
11 |
| - [--commit-message COMMIT_MESSAGE] [--default-branch] [--target-path TARGET_PATH] [--scm {api,github,gitlab}] [--sbom-file SBOM_FILE] |
12 |
| - [--commit-sha COMMIT_SHA] [--generate-license GENERATE_LICENSE] [-v] [--enable-debug] [--enable-json] [--enable-sarif] [--disable-overview] |
13 |
| - [--disable-security-issue] [--files FILES] [--ignore-commit-files] [--timeout] |
| 8 | +socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--integration {api,github,gitlab}] [--owner OWNER] [--branch BRANCH] |
| 9 | + [--committers [COMMITTERS ...]] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA] |
| 10 | + [--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--files FILES] [--default-branch] [--pending-head] |
| 11 | + [--generate-license] [--enable-debug] [--enable-json] [--enable-sarif] [--disable-overview] [--disable-security-issue] |
| 12 | + [--allow-unverified] [--ignore-commit-files] [--disable-blocking] [--scm SCM] [--timeout TIMEOUT] |
14 | 13 | ````
|
15 | 14 |
|
16 | 15 | If you don't want to provide the Socket API Token every time then you can use the environment variable `SOCKET_SECURITY_API_KEY`
|
17 | 16 |
|
18 |
| - |
19 |
| -| Parameter | Alternate Name | Required | Default | Description | |
20 |
| -|:-------------------------|:---------------|:---------|:--------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
21 |
| -| -h | --help | False | | Show the CLI help message | |
22 |
| -| --api-token | | False | | Provides the Socket API Token | |
23 |
| -| --repo | | True | | The string name in a git approved name for repositories. | |
24 |
| -| --branch | | False | | The string name in a git approved name for branches. | |
25 |
| -| --committer | | False | | The string name of the person doing the commit or running the CLI. Can be specified multiple times to have more than one committer | |
26 |
| -| --pr-number | | False | 0 | The integer for the PR or MR number | |
27 |
| -| --commit-message | | False | | The string for a commit message if there is one | |
28 |
| -| --default-branch | | False | False | If the flag is specified this will signal that this is the default branch. This needs to be enabled for a report to update Org Alerts and Org Dependencies | |
29 |
| -| --target-path | | False | ./ | This is the path to where the manifest files are location. The tool will recursively search for all supported manifest files | |
30 |
| -| --scm | | False | api | This is the mode that the tool is to run in. For local runs `api` would be the mode. Other options are `gitlab` and `github` | |
31 |
| -| --generate-license | | False | False | If this flag is specified it will generate a json file with the license per package and license text in the current working directory | |
32 |
| -| --version | -v | False | | Prints the version and exits | |
33 |
| -| --enable-debug | | False | False | Enables debug messaging for the CLI | |
34 |
| -| --sbom-file | | False | False | Creates a JSON file with all dependencies and alerts | |
35 |
| -| --commit-sha | | False | | The commit hash for the commit | |
36 |
| -| --generate-license | | False | False | If enabled with `--sbom-file` will include license details | |
37 |
| -| --enable-json | | False | False | If enabled will change the console output format to JSON | |
38 |
| -| --enable-sarif | | False | False | If enabled will change the console output format to SARIF | |
39 |
| -| --disable-overview | | False | False | If enabled will disable Dependency Overview comments | |
40 |
| -| --disable-security-issue | | False | False | If enabled will disable Security Issue Comments | |
41 |
| -| --files | | False | | If provided in the format of `["file1", "file2"]` will be used to determine if there have been supported file changes. This is used if it isn't a git repo and you would like to only run if it supported files have changed. | |
42 |
| -| --ignore-commit-files | | False | False | If enabled then the CLI will ignore what files are changed in the commit and look for all manifest files | |
43 |
| -| --disable-blocking | | False | False | Disables failing checks and will only exit with an exit code of 0 | |
| 17 | +### Parameters |
| 18 | +
|
| 19 | +#### Authentication |
| 20 | +| Parameter | Required | Default | Description | |
| 21 | +|:-------------|:---------|:--------|:--------------------------------------------------------------------------------------| |
| 22 | +| --api-token | False | | Socket Security API token (can also be set via SOCKET_SECURITY_API_KEY env var) | |
| 23 | +
|
| 24 | +#### Repository |
| 25 | +| Parameter | Required | Default | Description | |
| 26 | +|:-------------|:---------|:--------|:-------------------------------------------------------------------------| |
| 27 | +| --repo | False | | Repository name in owner/repo format | |
| 28 | +| --integration| False | api | Integration type (api, github, gitlab) | |
| 29 | +| --owner | False | | Name of the integration owner, defaults to the socket organization slug | |
| 30 | +| --branch | False | "" | Branch name | |
| 31 | +| --committers | False | | Committer(s) to filter by | |
| 32 | +
|
| 33 | +#### Pull Request and Commit |
| 34 | +| Parameter | Required | Default | Description | |
| 35 | +|:----------------|:---------|:--------|:-------------------| |
| 36 | +| --pr-number | False | "0" | Pull request number| |
| 37 | +| --commit-message| False | | Commit message | |
| 38 | +| --commit-sha | False | "" | Commit SHA | |
| 39 | +
|
| 40 | +#### Path and File |
| 41 | +| Parameter | Required | Default | Description | |
| 42 | +|:-------------|:---------|:--------|:-------------------------------------------| |
| 43 | +| --target-path| False | ./ | Target path for analysis | |
| 44 | +| --sbom-file | False | | SBOM file path | |
| 45 | +| --files | False | [] | Files to analyze (JSON array string) | |
| 46 | +
|
| 47 | +#### Branch and Scan Configuration |
| 48 | +| Parameter | Required | Default | Description | |
| 49 | +|:---------------|:---------|:--------|:----------------------------------------------------------| |
| 50 | +| --default-branch| False | False | Make this branch the default branch | |
| 51 | +| --pending-head | False | False | If true, the new scan will be set as the branch's head scan| |
| 52 | + |
| 53 | +#### Output Configuration |
| 54 | +| Parameter | Required | Default | Description | |
| 55 | +|:----------------------|:---------|:--------|:---------------------------------------------------------------| |
| 56 | +| --generate-license | False | False | Generate license information | |
| 57 | +| --enable-debug | False | False | Enable debug logging | |
| 58 | +| --enable-json | False | False | Output in JSON format | |
| 59 | +| --enable-sarif | False | False | Enable SARIF output of results instead of table or JSON format| |
| 60 | +| --disable-overview | False | False | Disable overview output | |
| 61 | + |
| 62 | +#### Security Configuration |
| 63 | +| Parameter | Required | Default | Description | |
| 64 | +|:-----------------------|:---------|:--------|:-------------------------------| |
| 65 | +| --allow-unverified | False | False | Allow unverified packages | |
| 66 | +| --disable-security-issue| False | False | Disable security issue checks | |
| 67 | + |
| 68 | +#### Advanced Configuration |
| 69 | +| Parameter | Required | Default | Description | |
| 70 | +|:-------------------|:---------|:--------|:-----------------------------------------------| |
| 71 | +| --ignore-commit-files| False | False | Ignore commit files | |
| 72 | +| --disable-blocking | False | False | Disable blocking mode | |
| 73 | +| --scm | False | api | Source control management type | |
| 74 | +| --timeout | False | | Timeout in seconds for API requests | |
44 | 75 |
|
45 | 76 | ## Development
|
46 | 77 |
|
|
0 commit comments