Metadata-Version: 2.1
Name: RegScale-CLI
Version: 5.2.0
Summary: Command Line Interface (CLI) for bulk processing/loading data into RegScale
Home-page: https://github.com/RegScale/regscale-cli
Author: Travis Howerton
Author-email: thowerton@regscale.com
License: MIT
Platform: UNKNOWN
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyMuPDF (==1.21.0)
Requires-Dist: boto3 (==1.26.119)
Requires-Dist: bs4
Requires-Dist: click (==8.1.3)
Requires-Dist: colorama (==0.4.5)
Requires-Dist: cryptography (==38.0.4)
Requires-Dist: docx (==0.2.4)
Requires-Dist: fitz (==0.0.1.dev2)
Requires-Dist: flask
Requires-Dist: frontend
Requires-Dist: jira (==3.5.0)
Requires-Dist: jwcrypto (==1.4.2)
Requires-Dist: matplotlib
Requires-Dist: msal (==1.18.0)
Requires-Dist: numpy (==1.23.3)
Requires-Dist: openpyxl
Requires-Dist: pandas
Requires-Dist: pdfplumber (==0.7.6)
Requires-Dist: pre-commit
Requires-Dist: pyTenable
Requires-Dist: pyaml (==21.10.1)
Requires-Dist: pytest
Requires-Dist: python-docx
Requires-Dist: python-jwt (==4.0.0)
Requires-Dist: regscale-python-ssp
Requires-Dist: requests (==2.28.2)
Requires-Dist: rich (==13.3.4)
Requires-Dist: setuptools
Requires-Dist: static
Requires-Dist: tools
Requires-Dist: wheel
Requires-Dist: xmltodict
Provides-Extra: dev
Requires-Dist: black ; extra == 'dev'
Requires-Dist: coveralls ; extra == 'dev'
Requires-Dist: flake8 ; extra == 'dev'
Requires-Dist: isort ; extra == 'dev'
Requires-Dist: moto ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Requires-Dist: pytest-cov ; extra == 'dev'
Requires-Dist: pytest-mock ; extra == 'dev'
Requires-Dist: pytest (>=5) ; extra == 'dev'

# RegScale Command Line Interface (CLI)

This CLI application is for supporting advanced automation and bulk data processing related to the [RegScale Compliance Automation Platform](https://www.regscale.com).  This application is intended to run as a "side car" that be scheduled via CRON job or serverless function to perform sophisticated data processing.  The CLI includes multiple libraries for processing data, connecting to RegScale Application Programming Interfaces (APIs), and commercial integrations.  This software may be packaged and included in other commercial software to lower the level of effort associated with building RegScale integrations to other commercial tools.

See [full documentation on regscale.readme.io](https://regscale.readme.io/docs/overview).

See [RegScale CLI Standards](https://regscale.atlassian.net/l/cp/AVWc8dK8) for developer standards.

See [RegScale GraphQL](https://regscale.atlassian.net/l/cp/h8M3YzbS) for documenation on working with RegScale GraphQL API and [GraphQL CLI](https://regscale.atlassian.net/wiki/spaces/RW/pages/52428951/RegScale+CLI+Standards#GraphQL-Queries) on incorporating it into the CLI.

[![Code Check](https://github.com/RegScale/regscale-cli/actions/workflows/code_check.yml/badge.svg)](https://github.com/RegScale/regscale-cli/actions/workflows/code_check.yml)
[![Run Tests](https://github.com/RegScale/regscale-cli/actions/workflows/test.yaml/badge.svg)](https://github.com/RegScale/regscale-cli/actions/workflows/test.yaml)

## Installation

Create a virtual environment and install required Python libraries.

```shell
# create and activate python virtual environment
python -m venv venv
source venv/bin/activate

# upgrade pip
pip install --upgrade pip

# install application
pip install .

# optional: install application with "dev" packages
pip install ".[dev]"

# initialize environment

```

## Initialization

Initialize your CLI environment with the `init` command:

```shell
# initialize environment
regscale init
```

The CLI will generate a default init.yaml file and prompt you for RegScale domain and to log in:

```shell
Initializing your RegScale CLI environment...
Would you like to change your RegScale domain from https://regscale.yourcompany.com/? (Y/n): y

Please enter your RegScale domain.
Example: https://mydomain.regscale.com/
Domain: https://regscale.mycomapny.com
[2023/01/20 04:32;41] INFO     [2023/01/20 04:32;41] [INFO ]  Valid URL provided, regscale.py:349
                               init.yaml has been updated.                                       
Would you like to log in to your RegScale instance? (Y/n): y
Please enter your username: rross
Please enter your password:
```

## Use Cases

- Sidecar for bulk processing compliance data such as vulnerability scans or continuous monitoring logs
- Processing and ingest of data such as National Institute of Standards and Technology (NIST) Open Security Control Assessment Language (OSCAL)
- Running CRON jobs to bulk-process data
- Managing users and identities from external sources
- Threat intelligence feeds

## Specific Integrations

- See the [RegScale Documentation](https://regscale.readme.io/docs/overview) for details.

## Running Locally

- Example for running locally on Windows

`py regscale.py about`

## Testing

Run `pytest -v ./tests/{test_filename}.py` and replace `{test_filename}` with name of test file.

## Release Process

### Preparation
1. Merge all desired branches into main.
2. Synchronize `app._version.__version__` with RegScale application version.
3. Test all Python packages have been added to `requirements.txt` and `setup.py`.
4. Update `CHANGELOG.md`

### Build Python Package
1. Run `release.sh` to create
2. Test built package from [https://test.pypi.org/project/RegScale-CLI/](https://test.pypi.org/project/RegScale-CLI/)

```shell
mkdir rsc
cd rsc
python3 -m venv venv
source venv/bin/activate
pip install --extra-index-url https://test.pypi.org/simple/ RegScale-CLI

# alternative install
pip install -i https://test.pypi.org/simple/RegScale-CLI

```

The `release.sh` script calls `build.sh` and `build_wheel.sh`. The built wheel file for the package is available in the created `dist` directory.

### Build Docker Container
1. Run the `docker_run.sh` script.

### Release
1. Prepare release on GitHub. The Release will upload the Python packge to pypi.org.

### Update Documentation
1. Update documentation on [CLI documentation on regscale.readme.io](https://regscale.readme.io/docs/overview).


