|
| 1 | +# PRODAFT CATALYST API Client |
| 2 | + |
| 3 | +[](https://badge.fury.io/py/python-catalyst) |
| 4 | +[](https://pypi.org/project/python-catalyst/) |
| 5 | +[](https://opensource.org/licenses/MIT) |
| 6 | +[](https://github.com/prodaft/python-catalyst/actions/workflows/python-test.yml) |
| 7 | + |
| 8 | +A Python client for the PRODAFT CATALYST API, enabling seamless integration with OpenCTI by converting threat intelligence data into STIX 2.1 format. |
| 9 | + |
| 10 | +## Overview |
| 11 | + |
| 12 | +This library provides a simple interface to retrieve threat intelligence from the PRODAFT CATALYST platform and convert it into STIX 2.1 format for ingestion into OpenCTI or other threat intelligence platforms. |
| 13 | + |
| 14 | +## Key Features |
| 15 | + |
| 16 | +- Retrieve threat intelligence from CATALYST API |
| 17 | +- Extract entities (malware, threat actors, tools, etc.) |
| 18 | +- Convert to STIX 2.1 format for OpenCTI integration |
| 19 | +- Support for all CATALYST observable types |
| 20 | +- TLP classification support (CLEAR, GREEN, AMBER, AMBER+STRICT, RED) |
| 21 | +- Automatic pagination for large result sets |
| 22 | +- Proxy and custom logging support |
| 23 | + |
| 24 | +## Installation |
| 25 | + |
| 26 | +```bash |
| 27 | +pip install python-catalyst |
| 28 | +``` |
| 29 | + |
| 30 | +## Requirements |
| 31 | + |
| 32 | +- Python 3.8+ |
| 33 | +- requests |
| 34 | +- stix2 |
| 35 | +- python-dateutil |
| 36 | +- pycti |
| 37 | + |
| 38 | +## Basic Usage |
| 39 | + |
| 40 | +```python |
| 41 | +from python_catalyst import CatalystClient, PostCategory, TLPLevel |
| 42 | +from datetime import datetime |
| 43 | + |
| 44 | +# Initialize client |
| 45 | +client = CatalystClient(api_key="your_api_key") |
| 46 | + |
| 47 | +# Get threat intelligence data |
| 48 | +content = client.get_member_content("content_id") |
| 49 | + |
| 50 | +# Extract entities |
| 51 | +entities = client.extract_entities_from_member_content("content_id") |
| 52 | + |
| 53 | +# Convert to STIX format for OpenCTI |
| 54 | +report, stix_objects = client.create_report_from_member_content(content) |
| 55 | +``` |
| 56 | + |
| 57 | +## Documentation |
| 58 | + |
| 59 | +### Authentication |
| 60 | + |
| 61 | +```python |
| 62 | +client = CatalystClient( |
| 63 | + api_key="your_api_key", |
| 64 | + base_url="https://prod.blindspot.prodaft.com/api" |
| 65 | +) |
| 66 | +``` |
| 67 | + |
| 68 | +### Content Retrieval |
| 69 | + |
| 70 | +The client supports various methods to retrieve threat intelligence: |
| 71 | + |
| 72 | +- `get_member_content(content_id)`: Get a specific content by ID |
| 73 | +- `get_member_contents(category, tlp, page, page_size)`: Get paginated content |
| 74 | +- `get_all_member_contents(category, published_on_after, search)`: Get all content with automatic pagination |
| 75 | +- `get_updated_member_contents(since, max_results)`: Get content updated since a specific date |
| 76 | + |
| 77 | +### Entity Extraction |
| 78 | + |
| 79 | +```python |
| 80 | +entities = client.extract_entities_from_member_content("content_id") |
| 81 | +``` |
| 82 | + |
| 83 | +### STIX Conversion |
| 84 | + |
| 85 | +Convert CATALYST content to STIX 2.1 objects for OpenCTI integration: |
| 86 | + |
| 87 | +```python |
| 88 | +# Convert to STIX format |
| 89 | +report, stix_objects = client.create_report_from_member_content(content) |
| 90 | +``` |
| 91 | + |
| 92 | +## Development |
| 93 | + |
| 94 | +### Setting up the development environment |
| 95 | + |
| 96 | +```bash |
| 97 | +# Clone the repository |
| 98 | +git clone https://github.com/prodaft/python-catalyst.git |
| 99 | +cd python-catalyst |
| 100 | + |
| 101 | +# Install development dependencies |
| 102 | +pip install -r requirements-dev.txt |
| 103 | +``` |
| 104 | + |
| 105 | +### Running tests |
| 106 | + |
| 107 | +```bash |
| 108 | +# Run unit tests |
| 109 | +pytest -xvs tests/ -k "not test_integration" |
| 110 | + |
| 111 | +# Run integration tests (requires API key) |
| 112 | +export CATALYST_API_KEY=your_api_key |
| 113 | +pytest -xvs tests/ --run-integration |
| 114 | + |
| 115 | +``` |
| 116 | + |
| 117 | +## Contributing |
| 118 | + |
| 119 | +Contributions are welcome! Please feel free to submit a Pull Request. |
| 120 | + |
| 121 | +1. Fork the repository |
| 122 | +2. Create your feature branch (`git checkout -b feature/amazing-feature`) |
| 123 | +3. Commit your changes (`git commit -m 'Add some amazing feature'`) |
| 124 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 125 | +5. Open a Pull Request |
| 126 | + |
| 127 | +## Support |
| 128 | + |
| 129 | +For support or feature requests, please create an issue on the GitHub repository or contact PRODAFT. |
| 130 | + |
| 131 | +## License |
| 132 | + |
| 133 | +Distributed under the MIT License. See `LICENSE` for more information. |
0 commit comments