CheckmarxPythonSDK


NameCheckmarxPythonSDK JSON
Version 1.1.5 PyPI version JSON
download
home_pagehttps://github.com/checkmarx-ts/checkmarx-python-sdk
SummaryCheckmarx Python SDK
upload_time2025-01-24 06:36:17
maintainerNone
docs_urlNone
authorHappy Yang
requires_python!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7
licenseNone
keywords
VCS
bugtrack_url
requirements urllib3 requests requests-toolbelt zeep python-dateutil keyring Deprecated gql
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Checkmarx Python SDK

This is wrapper using Python for CxSAST and CxOSA REST API, Portal SOAP API, CxSAST ODATA API, CxSCA REST API. 

By using this SDK, Checkmarx users will be able to do automatic scanning with CxSAST, CxOSA, and CxSCA.

[![Downloads](https://static.pepy.tech/badge/CheckmarxPythonSDK/month)](https://static.pepy.tech/badge/CheckmarxPythonSDK/month)
[![Supported Versions](https://img.shields.io/pypi/pyversions/CheckmarxPythonSDK.svg)](https://pypi.org/project/CheckmarxPythonSDK)
[![Contributors](https://img.shields.io/github/contributors/checkmarx-ts/checkmarx-python-sdk.svg)](https://github.com/checkmarx-ts/checkmarx-python-sdk/graphs/contributors)

# Checkmarx API Official Documents

For more information about Checkmarx API, please refer to Checkmarx knowledge Center:

- [CxSAST API Document](https://checkmarx.com/resource/documents/en/34965-46552-sast-api-guide.html)  
- [CxOSA API Document](https://checkmarx.com/resource/documents/en/34965-46909-cxosa-api-guide.html)
- [Access Control API Document](https://checkmarx.com/resource/documents/en/34965-46622-access-control--rest--api--v1-5-and-up-.html)
- [CxSCA API Document](https://checkmarx.com/resource/documents/en/34965-19221-checkmarx-sca--rest--api-documentation.html)
- [CxOne API Document](https://checkmarx.com/resource/documents/en/34965-68772-checkmarx-one-api-documentation.html)
- [CxReporting API Document](https://checkmarx.com/resource/documents/en/34965-93162-apis.html)

# Notice

Please use Python3

# Quick Start

## Install the library

The easiest way to begin using the SDK is to install it using the **pip** command.

```
$ pip install CheckmarxPythonSDK
```

Alternatively, either download and unzip this repository, or clone it to your local drive, and install using the `setup.py` script.

```
$ git clone https://github.com/checkmarx-ts/checkmarx-python-sdk.git
$ python setup.py install
```

Even if you install the SDK using **pip**, you might still want to download or clone this repository for the sample scripts.

## Set up configuration

### Option 1, using config.ini file: 
```buildoutcfg
[checkmarx]
base_url = http://localhost:80
username = ******
password = ******
grant_type = password
scope = sast_rest_api
client_id = resource_owner_client
client_secret = 014DF517-39D1-4453-B7B3-9930C563627C
url =  %(base_url)s/cxrestapi
scan_preset = Checkmarx Default
configuration = Default Configuration
team_full_name = /CxServer
max_try = 3

[CxSCA]
access_control_url = https://platform.checkmarx.net
server = https://api-sca.checkmarx.net
account = ***
username = ***
password = ***

[CxOne]
access_control_url = https://iam.checkmarx.net
server = https://ast.checkmarx.net
tenant_name  = ***
grant_type = refresh_token
client_id = ast-app
client_secret = ***
username = ***
password = ***
refresh_token = ***

[CxReporting]
base_url = http://localhost
reporting_client_url = http://localhost:5001
username = ***
password = ***
grant_type = password
scope = reporting_api
client_id = reporting_service_api
client_secret = 014DF517-39D1-4453-B7B3-9930C563627C
```

configuration file path:

By default, Checkmarx Python SDK looks for `config.ini` or `config.json` file in a `.Checkmarx` folder in your home directory. 
- For windows, it should be like `C:\\Users\\<UserName>\\.Checkmarx\\config.ini`
- For linux and MacOS, it should be like `/home/<UserName>/.Checkmarx/config.ini` 

You can also use `checkmarx_config_path` as environment variable  or command line argument to set up configuration file path.

For CxOne configuration, if you are going to use refresh_token grant type, you must use client id "ast-app", 
refresh_token, ignore client_secret, username, password. If you are going to use client_credentials grant type, 
you must create a client with roles such as ast-scanner, manage-webhook, queries-editor, ast-viewer, manage-application,
manage-project, then fill in your own client_id, client secret, username, password, ignore the refresh_token.

### Option 2, using environment variables (Upper Case or Lower Case) or command line arguments

For CxSAST:

    - cxsast_base_url
    - cxsast_username
    - cxsast_password
    - cxsast_grant_type
    - cxsast_scope
    - cxsast_client_id
    - cxsast_client_secret

For CxSCA:

    - cxsca_access_control_url
    - cxsca_server
    - cxsca_account
    - cxsca_username
    - cxsca_password

For CxOne:
    
    - cxone_access_control_url
    - cxone_server
    - cxone_tenant_name
    - cxone_grant_type
    - cxone_client_id
    - cxone_client_secret
    - cxone_username
    - cxone_password
    - cxone_refresh_token
 
 For CxReporting
 
    - cxreporting_base_url
    - cxreporting_reporting_client_url
    - cxreporting_username
    - cxreporting_password
    - cxreporting_grant_type
    - cxreporting_scope
    - cxreporting_client_id
    - cxreporting_client_secret

# Debug Mode
You can use command line option `--cx_debug true` to enable debug mode. In debug mode, it will print out how to load the
configuration file and print every http request send out.

# Examples
 Please find example scripts from [examples folder](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/examples).


# API List

- [CxOne_REST_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxOne_REST_API_List.md)
- [CxSAST_and_CxOSA_REST_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxSAST_and_CxOSA_REST_API_List.md)
- [CxSAST_ODATA_API](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxSAST_ODATA_API.md)
- [CxSAST_Portal_SOAP_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxSAST_Portal_SOAP_API_List.md)
- [CxSCA_REST_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxSCA_REST_API_List.md)
- [CxReporting_REST_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/blob/master/docs/CxReporting_REST_API_List.md)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/checkmarx-ts/checkmarx-python-sdk",
    "name": "CheckmarxPythonSDK",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Happy Yang",
    "author_email": "happy.yang@checkmarx.com",
    "download_url": "https://files.pythonhosted.org/packages/ca/21/b358d9fe5f768de5e93b31fca7236b37a734881f2e2ec8b849074e7ee015/checkmarxpythonsdk-1.1.5.tar.gz",
    "platform": null,
    "description": "# Checkmarx Python SDK\n\nThis is wrapper using Python for CxSAST and CxOSA REST API, Portal SOAP API, CxSAST ODATA API, CxSCA REST API. \n\nBy using this SDK, Checkmarx users will be able to do automatic scanning with CxSAST, CxOSA, and CxSCA.\n\n[![Downloads](https://static.pepy.tech/badge/CheckmarxPythonSDK/month)](https://static.pepy.tech/badge/CheckmarxPythonSDK/month)\n[![Supported Versions](https://img.shields.io/pypi/pyversions/CheckmarxPythonSDK.svg)](https://pypi.org/project/CheckmarxPythonSDK)\n[![Contributors](https://img.shields.io/github/contributors/checkmarx-ts/checkmarx-python-sdk.svg)](https://github.com/checkmarx-ts/checkmarx-python-sdk/graphs/contributors)\n\n# Checkmarx API Official Documents\n\nFor more information about Checkmarx API, please refer to Checkmarx knowledge Center\uff1a\n\n- [CxSAST API Document](https://checkmarx.com/resource/documents/en/34965-46552-sast-api-guide.html)  \n- [CxOSA API Document](https://checkmarx.com/resource/documents/en/34965-46909-cxosa-api-guide.html)\n- [Access Control API Document](https://checkmarx.com/resource/documents/en/34965-46622-access-control--rest--api--v1-5-and-up-.html)\n- [CxSCA API Document](https://checkmarx.com/resource/documents/en/34965-19221-checkmarx-sca--rest--api-documentation.html)\n- [CxOne API Document](https://checkmarx.com/resource/documents/en/34965-68772-checkmarx-one-api-documentation.html)\n- [CxReporting API Document](https://checkmarx.com/resource/documents/en/34965-93162-apis.html)\n\n# Notice\n\nPlease use Python3\n\n# Quick Start\n\n## Install the library\n\nThe easiest way to begin using the SDK is to install it using the **pip** command.\n\n```\n$ pip install CheckmarxPythonSDK\n```\n\nAlternatively, either download and unzip this repository, or clone it to your local drive, and install using the `setup.py` script.\n\n```\n$ git clone https://github.com/checkmarx-ts/checkmarx-python-sdk.git\n$ python setup.py install\n```\n\nEven if you install the SDK using **pip**, you might still want to download or clone this repository for the sample scripts.\n\n## Set up configuration\n\n### Option 1, using config.ini file: \n```buildoutcfg\n[checkmarx]\nbase_url = http://localhost:80\nusername = ******\npassword = ******\ngrant_type = password\nscope = sast_rest_api\nclient_id = resource_owner_client\nclient_secret = 014DF517-39D1-4453-B7B3-9930C563627C\nurl =  %(base_url)s/cxrestapi\nscan_preset = Checkmarx Default\nconfiguration = Default Configuration\nteam_full_name = /CxServer\nmax_try = 3\n\n[CxSCA]\naccess_control_url = https://platform.checkmarx.net\nserver = https://api-sca.checkmarx.net\naccount = ***\nusername = ***\npassword = ***\n\n[CxOne]\naccess_control_url = https://iam.checkmarx.net\nserver = https://ast.checkmarx.net\ntenant_name  = ***\ngrant_type = refresh_token\nclient_id = ast-app\nclient_secret = ***\nusername = ***\npassword = ***\nrefresh_token = ***\n\n[CxReporting]\nbase_url = http://localhost\nreporting_client_url = http://localhost:5001\nusername = ***\npassword = ***\ngrant_type = password\nscope = reporting_api\nclient_id = reporting_service_api\nclient_secret = 014DF517-39D1-4453-B7B3-9930C563627C\n```\n\nconfiguration file path:\n\nBy default, Checkmarx Python SDK looks for `config.ini` or `config.json` file in a `.Checkmarx` folder in your home directory. \n- For windows, it should be like `C:\\\\Users\\\\<UserName>\\\\.Checkmarx\\\\config.ini`\n- For linux and MacOS, it should be like `/home/<UserName>/.Checkmarx/config.ini` \n\nYou can also use `checkmarx_config_path` as environment variable  or command line argument to set up configuration file path.\n\nFor CxOne configuration, if you are going to use refresh_token grant type, you must use client id \"ast-app\", \nrefresh_token, ignore client_secret, username, password. If you are going to use client_credentials grant type, \nyou must create a client with roles such as ast-scanner, manage-webhook, queries-editor, ast-viewer, manage-application,\nmanage-project, then fill in your own client_id, client secret, username, password, ignore the refresh_token.\n\n### Option 2, using environment variables (Upper Case or Lower Case) or command line arguments\n\nFor CxSAST:\n\n    - cxsast_base_url\n    - cxsast_username\n    - cxsast_password\n    - cxsast_grant_type\n    - cxsast_scope\n    - cxsast_client_id\n    - cxsast_client_secret\n\nFor CxSCA:\n\n    - cxsca_access_control_url\n    - cxsca_server\n    - cxsca_account\n    - cxsca_username\n    - cxsca_password\n\nFor CxOne:\n    \n    - cxone_access_control_url\n    - cxone_server\n    - cxone_tenant_name\n    - cxone_grant_type\n    - cxone_client_id\n    - cxone_client_secret\n    - cxone_username\n    - cxone_password\n    - cxone_refresh_token\n \n For CxReporting\n \n    - cxreporting_base_url\n    - cxreporting_reporting_client_url\n    - cxreporting_username\n    - cxreporting_password\n    - cxreporting_grant_type\n    - cxreporting_scope\n    - cxreporting_client_id\n    - cxreporting_client_secret\n\n# Debug Mode\nYou can use command line option `--cx_debug true` to enable debug mode. In debug mode, it will print out how to load the\nconfiguration file and print every http request send out.\n\n# Examples\n Please find example scripts from [examples folder](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/examples).\n\n\n# API List\n\n- [CxOne_REST_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxOne_REST_API_List.md)\n- [CxSAST_and_CxOSA_REST_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxSAST_and_CxOSA_REST_API_List.md)\n- [CxSAST_ODATA_API](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxSAST_ODATA_API.md)\n- [CxSAST_Portal_SOAP_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxSAST_Portal_SOAP_API_List.md)\n- [CxSCA_REST_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/tree/master/docs/CxSCA_REST_API_List.md)\n- [CxReporting_REST_API_List](https://github.com/checkmarx-ts/checkmarx-python-sdk/blob/master/docs/CxReporting_REST_API_List.md)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Checkmarx Python SDK",
    "version": "1.1.5",
    "project_urls": {
        "Homepage": "https://github.com/checkmarx-ts/checkmarx-python-sdk"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "29e3ec0fe902e521d86e860e364ac3689ab24c9e6b3a78d943273eeb0fea73d3",
                "md5": "1dcd3c2f100ad1591318051e717bef91",
                "sha256": "bd0fb284fad28bc3e82f6cbde82396961a52ca20a0fffef09ff0eb7de43ba06d"
            },
            "downloads": -1,
            "filename": "CheckmarxPythonSDK-1.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1dcd3c2f100ad1591318051e717bef91",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
            "size": 388472,
            "upload_time": "2025-01-24T06:36:15",
            "upload_time_iso_8601": "2025-01-24T06:36:15.980209Z",
            "url": "https://files.pythonhosted.org/packages/29/e3/ec0fe902e521d86e860e364ac3689ab24c9e6b3a78d943273eeb0fea73d3/CheckmarxPythonSDK-1.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ca21b358d9fe5f768de5e93b31fca7236b37a734881f2e2ec8b849074e7ee015",
                "md5": "6ef93b449f1afc2eb7e2f5f65f692341",
                "sha256": "2599978a4235bfb4e6cc89727f6781d7c1756f233e54c13d2373fe00657efdeb"
            },
            "downloads": -1,
            "filename": "checkmarxpythonsdk-1.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "6ef93b449f1afc2eb7e2f5f65f692341",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
            "size": 237583,
            "upload_time": "2025-01-24T06:36:17",
            "upload_time_iso_8601": "2025-01-24T06:36:17.552379Z",
            "url": "https://files.pythonhosted.org/packages/ca/21/b358d9fe5f768de5e93b31fca7236b37a734881f2e2ec8b849074e7ee015/checkmarxpythonsdk-1.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-24 06:36:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "checkmarx-ts",
    "github_project": "checkmarx-python-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.3.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.3"
                ]
            ]
        },
        {
            "name": "requests-toolbelt",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "zeep",
            "specs": [
                [
                    "==",
                    "4.3.1"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "keyring",
            "specs": [
                [
                    "==",
                    "25.6.0"
                ]
            ]
        },
        {
            "name": "Deprecated",
            "specs": [
                [
                    "==",
                    "1.2.15"
                ]
            ]
        },
        {
            "name": "gql",
            "specs": [
                [
                    "==",
                    "3.5.0"
                ]
            ]
        }
    ],
    "lcname": "checkmarxpythonsdk"
}
        
Elapsed time: 1.29051s