# Socket Security CLI
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.
## Usage
```` shell
socketcli [-h] [--api_token API_TOKEN] [--repo REPO] [--branch BRANCH] [--committer COMMITTER] [--pr_number PR_NUMBER]
[--commit_message COMMIT_MESSAGE] [--default_branch] [--target_path TARGET_PATH] [--scm {api,github,gitlab}] [--sbom-file SBOM_FILE]
[--commit-sha COMMIT_SHA] [--generate-license GENERATE_LICENSE] [-v] [--enable-debug] [--enable-json] [--disable-overview]
[--disable-security-issue] [--files FILES] [--ignore-commit-files]
````
If you don't want to provide the Socket API Token every time then you can use the environment variable `SOCKET_SECURITY_API_KEY`
| Parameter | Alternate Name | Required | Default | Description |
|:-------------------------|:---------------|:---------|:--------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -h | --help | False | | Show the CLI help message |
| --api_token | | False | | Provides the Socket API Token |
| --repo | | True | | The string name in a git approved name for repositories. |
| --branch | | False | | The string name in a git approved name for branches. |
| --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 |
| --pr_number | | False | 0 | The integer for the PR or MR number |
| --commit_message | | False | | The string for a commit message if there is one |
| --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 |
| --target_path | | False | ./ | This is the path to where the manifest files are location. The tool will recursively search for all supported manifest files |
| --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` |
| --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 |
| --version | -v | False | | Prints the version and exits |
| --enable-debug | | False | False | Enables debug messaging for the CLI |
| --sbom-file | | False | False | Creates a JSON file with all dependencies and alerts |
| --commit-sha | | False | | The commit hash for the commit |
| --generate-license | | False | False | If enabled with `--sbom-file` will include license details |
| --enable-json | | False | False | If enabled will change the console output format to JSON |
| --disable-overview | | False | False | If enabled will disable Dependency Overview comments |
| --disable-security-issue | | False | False | If enabled will disable Security Issue Comments |
| --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. |
| --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 |
| --disable-blocking | | False | False | Disables failing checks and will only exit with an exit code of 0 |
Raw data
{
"_id": null,
"home_page": null,
"name": "socketsecurity",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Douglas Coburn <douglas@socket.dev>",
"keywords": "socketsecurity, socket.dev, sca, oss, security",
"author": null,
"author_email": "Douglas Coburn <douglas@socket.dev>",
"download_url": "https://files.pythonhosted.org/packages/27/c4/2d2907dc948be0ecf8b7e92c597ad272871cdf07973fbba2023e1cf72f6f/socketsecurity-1.0.35.tar.gz",
"platform": null,
"description": "# Socket Security CLI\n\nThe 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.\n\n## Usage\n\n```` shell\nsocketcli [-h] [--api_token API_TOKEN] [--repo REPO] [--branch BRANCH] [--committer COMMITTER] [--pr_number PR_NUMBER]\n [--commit_message COMMIT_MESSAGE] [--default_branch] [--target_path TARGET_PATH] [--scm {api,github,gitlab}] [--sbom-file SBOM_FILE]\n [--commit-sha COMMIT_SHA] [--generate-license GENERATE_LICENSE] [-v] [--enable-debug] [--enable-json] [--disable-overview]\n [--disable-security-issue] [--files FILES] [--ignore-commit-files]\n````\n\nIf you don't want to provide the Socket API Token every time then you can use the environment variable `SOCKET_SECURITY_API_KEY`\n\n\n| Parameter | Alternate Name | Required | Default | Description |\n|:-------------------------|:---------------|:---------|:--------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| -h | --help | False | | Show the CLI help message |\n| --api_token | | False | | Provides the Socket API Token |\n| --repo | | True | | The string name in a git approved name for repositories. |\n| --branch | | False | | The string name in a git approved name for branches. |\n| --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 |\n| --pr_number | | False | 0 | The integer for the PR or MR number |\n| --commit_message | | False | | The string for a commit message if there is one |\n| --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 |\n| --target_path | | False | ./ | This is the path to where the manifest files are location. The tool will recursively search for all supported manifest files |\n| --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` |\n| --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 |\n| --version | -v | False | | Prints the version and exits |\n| --enable-debug | | False | False | Enables debug messaging for the CLI |\n| --sbom-file | | False | False | Creates a JSON file with all dependencies and alerts |\n| --commit-sha | | False | | The commit hash for the commit |\n| --generate-license | | False | False | If enabled with `--sbom-file` will include license details |\n| --enable-json | | False | False | If enabled will change the console output format to JSON |\n| --disable-overview | | False | False | If enabled will disable Dependency Overview comments |\n| --disable-security-issue | | False | False | If enabled will disable Security Issue Comments |\n| --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. |\n| --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 |\n| --disable-blocking | | False | False | Disables failing checks and will only exit with an exit code of 0 |\n",
"bugtrack_url": null,
"license": null,
"summary": "Socket Security CLI for CI/CD",
"version": "1.0.35",
"project_urls": {
"Homepage": "https://socket.dev"
},
"split_keywords": [
"socketsecurity",
" socket.dev",
" sca",
" oss",
" security"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "29640c5b233dbf45a217b9b26ed573486083150606f8a41d7cd965eb7fd32f53",
"md5": "83345b46efa793615e0fea4314be5b42",
"sha256": "ecef51e3b6f0519bdd68cb1de512e6d31077a3f838cb7aae0da959b4754c7edc"
},
"downloads": -1,
"filename": "socketsecurity-1.0.35-py3-none-any.whl",
"has_sig": false,
"md5_digest": "83345b46efa793615e0fea4314be5b42",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 2710774,
"upload_time": "2024-11-06T18:56:45",
"upload_time_iso_8601": "2024-11-06T18:56:45.890743Z",
"url": "https://files.pythonhosted.org/packages/29/64/0c5b233dbf45a217b9b26ed573486083150606f8a41d7cd965eb7fd32f53/socketsecurity-1.0.35-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "27c42d2907dc948be0ecf8b7e92c597ad272871cdf07973fbba2023e1cf72f6f",
"md5": "baba6ad6e6d4eeb3804ac5bafcb22f85",
"sha256": "14d691f56586c5b936fd439222a56b22d253cd33e4dff6e2c6c5b85e41a044ca"
},
"downloads": -1,
"filename": "socketsecurity-1.0.35.tar.gz",
"has_sig": false,
"md5_digest": "baba6ad6e6d4eeb3804ac5bafcb22f85",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 2691142,
"upload_time": "2024-11-06T18:56:48",
"upload_time_iso_8601": "2024-11-06T18:56:48.049066Z",
"url": "https://files.pythonhosted.org/packages/27/c4/2d2907dc948be0ecf8b7e92c597ad272871cdf07973fbba2023e1cf72f6f/socketsecurity-1.0.35.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-06 18:56:48",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "socketsecurity"
}