Metadata-Version: 2.4
Name: clue-api
Version: 1.0.0.dev45
Summary: Clue distributed enrichment service
License: MIT
License-File: LICENSE
Keywords: clue,distributed,enrichment,gc,canada,cse-cst,cse,cst,cyber,cccs
Author: Canadian Centre for Cyber Security
Author-email: contact@cyber.gc.ca
Requires-Python: >=3.12,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Provides-Extra: server
Requires-Dist: PyYAML (>=6.0.1,<7.0.0) ; extra == "server"
Requires-Dist: Werkzeug (>=3.0.2,<4.0.0) ; extra == "server"
Requires-Dist: apscheduler (>=3.10.4,<4.0.0) ; extra == "server"
Requires-Dist: authlib (<1.0.0) ; extra == "server"
Requires-Dist: bcrypt (>=4.1.2,<5.0.0) ; extra == "server"
Requires-Dist: beautifulsoup4 (>=4.13.3,<5.0.0)
Requires-Dist: cart (>=1.2.3,<2.0.0)
Requires-Dist: elastic-apm (>=6.22.0,<7.0.0)
Requires-Dist: flasgger (>=0.9.7.1,<0.10.0.0) ; extra == "server"
Requires-Dist: flask (<3.0.0)
Requires-Dist: flask-caching (>=2.1.0,<3.0.0)
Requires-Dist: flask-cors (>=4.0.1,<5.0.0) ; extra == "server"
Requires-Dist: gevent (>=24.2.1,<25.0.0)
Requires-Dist: geventhttpclient (>=2.3.1,<3.0.0)
Requires-Dist: gunicorn (>=22,<24)
Requires-Dist: imgkit (>=1.2.3,<2.0.0)
Requires-Dist: passlib (>=1.7.4,<2.0.0) ; extra == "server"
Requires-Dist: pillow (>=11.1.0,<12.0.0)
Requires-Dist: prometheus-client (>=0.20.0,<0.21.0) ; extra == "server"
Requires-Dist: pydantic (>=2.7.1,<3.0.0)
Requires-Dist: pydantic-settings[yaml] (>=2.3.4,<3.0.0)
Requires-Dist: pyjwt (>=2.8.0,<3.0.0) ; extra == "server"
Requires-Dist: pyroute2 (>=0.7.12,<0.8.0) ; extra == "server"
Requires-Dist: python-baseconv (>=1.2.2,<2.0.0) ; extra == "server"
Requires-Dist: pytz (>=2024.1,<2025.0) ; extra == "server"
Requires-Dist: redis (>=5.0.3,<6.0.0)
Requires-Dist: requests (>=2.32.5,<3.0.0)
Requires-Dist: setuptools (<79.0.0)
Requires-Dist: trino (>=0.336.0,<0.337.0)
Project-URL: Documentation, https://github.com/CybercentreCanada/clue
Project-URL: Homepage, https://github.com/CybercentreCanada/clue
Project-URL: Repository, https://github.com/CybercentreCanada/clue
Description-Content-Type: text/markdown

# Clue

To start the API for clue, check to ensure that:

1. Docker is composed up through `dev/docker-compose.yml`
    1. Note that you may need to set up uchimera container connections if you have not tyet done so:
    2. `az login && az acr login -n uchimera`
    3. If you do not have permission, reach out to APA2B.
2. `cd clue/api`
3. Run `poetry install` within the clue/api folder to install all dependencies
4. You may need to run `poetry install --with test,dev,types,plugins --all-extras`
5. Run `sudo mkdir -p /var/log/clue/`
6. Run `sudo mkdir -p /etc/clue/conf/`
7. Run `sudo chmod a+rw /var/log/clue/`
8. Run `sudo chmod a+rw /etc/clue/conf/`
9. Run `cp build_scripts/classification.yml /etc/clue/conf/classification.yml`
10. Run `cp test/unit/config.yml /etc/clue/conf/config.yml`
11. To start server: `poetry run server`

To start Enrichment Testing:

* In order to have the local server connect to the UI the servers need to be ran manually
* Please ensure that ```pwd``` is clue/api
* May need to add ```poetry run``` before each command

1. ```flask --app test.utils.test_server run --no-reload --port 5008```
2. ```flask --app test.utils.bad_server run --no-reload --port 5009```
3. ```flask --app test.utils.slow_server run --no-reload --port 5010```
4. ```flask --app test.utils.telemetry_server run --no-reload --port 5011```

Troubleshooting:

1. If there are issues with these steps please check the build system for poetry installation steps
2. The scripts will show all necessary directories that need to be made in order for classfication to work

## Contributing

See [CONTRIBUTING.md](documentation/CONTRIBUTING.md) for more information

## FAQ

### I'm getting permissions issues on `/var/log/clue` or `/etc/clue/conf`?

Run `sudo chmod a+rw /var/log/clue/` and `sudo chmod a+rw /etc/clue/conf/`.

### How can I add dependencies for my plugin?

See [this section](documentation/CONTRIBUTING.md#external-dependencies) of CONTRIBUTING.md.

### Email rendering does not seem to be working?

You must install `wkhtmltopdf`, both locally for development and in your Dockerfile:

```bash
sudo apt install wkhtmltopdf
```

