mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-08-01 08:30:20 +00:00
Place useful parts of the surrounding repos into sica-fondt by layer, per the
body model (Ada = membrane; brain/endocrine/capabilities/knowledge non-Ada):
- brain/ LLM reasoning + providers (dapr, hermes, MoMoA)
- capabilities/ REPRAG sidecars: hermes tools/skills, dapr tools, parallel
dispatch, A51 channels, and the OSINT cluster
- knowledge/ LORAG corpus: 754 cyber-skills, agency personas, secure-coding,
MITRE ATT&CK data
- reference/ defensive threat-reference (C3, shhbruh doc) + AdaYaml parser
License handling: AGPL sources (worldosint, advanced_evolution, mercury,
Reticulum) and GPL DeTTECT are SPEC-only clean-room/port descriptions — no
copyleft code copied. MIT/Apache/data parts copied as working trees.
Safety: shhbruh escape/persistence material and C3 covert-C2 kept as reference
only, not wired into the running organism. See CONSOLIDATION.md.
https://claude.ai/code/session_01UehUqEXXJJCsHoA4voCU5c
94 lines
2.3 KiB
Markdown
94 lines
2.3 KiB
Markdown
# API Reference: Analyzing Threat Intelligence Feeds
|
|
|
|
## taxii2-client
|
|
|
|
### Server Discovery
|
|
|
|
```python
|
|
from taxii2client.v21 import Server
|
|
|
|
server = Server("https://cti.example.com/taxii2/", user="u", password="p")
|
|
for api_root in server.api_roots:
|
|
for col in api_root.collections:
|
|
print(col.id, col.title)
|
|
```
|
|
|
|
### Fetch Indicators from Collection
|
|
|
|
```python
|
|
from taxii2client.v21 import Collection, as_pages
|
|
|
|
collection = Collection(
|
|
"https://cti.example.com/taxii2/collections/abc123/",
|
|
user="u", password="p"
|
|
)
|
|
for bundle in as_pages(collection.get_objects, per_request=100):
|
|
for obj in bundle.get("objects", []):
|
|
if obj["type"] == "indicator":
|
|
print(obj["pattern"])
|
|
```
|
|
|
|
### Push Indicators
|
|
|
|
```python
|
|
collection.add_objects(stix_bundle_json)
|
|
```
|
|
|
|
## stix2 (Python Library)
|
|
|
|
### Create Indicator
|
|
|
|
```python
|
|
from stix2 import Indicator
|
|
|
|
indicator = Indicator(
|
|
name="Malicious IP",
|
|
pattern="[ipv4-addr:value = '1.2.3.4']",
|
|
pattern_type="stix",
|
|
valid_from="2025-01-01T00:00:00Z",
|
|
confidence=85,
|
|
)
|
|
```
|
|
|
|
### Create Bundle and Serialize
|
|
|
|
```python
|
|
from stix2 import Bundle
|
|
bundle = Bundle(objects=[indicator])
|
|
print(bundle.serialize(pretty=True))
|
|
```
|
|
|
|
### MemoryStore for Querying
|
|
|
|
```python
|
|
from stix2 import MemoryStore, Filter
|
|
store = MemoryStore(stix_data=bundle)
|
|
results = store.query([Filter("type", "=", "indicator")])
|
|
```
|
|
|
|
## STIX 2.1 Pattern Syntax
|
|
|
|
| IOC Type | Pattern |
|
|
|----------|---------|
|
|
| IPv4 | `[ipv4-addr:value = '1.2.3.4']` |
|
|
| Domain | `[domain-name:value = 'evil.com']` |
|
|
| SHA-256 | `[file:hashes.'SHA-256' = 'abc...']` |
|
|
| URL | `[url:value = 'http://evil.com/payload']` |
|
|
| Email | `[email-addr:value = 'phish@evil.com']` |
|
|
|
|
## TAXII 2.1 HTTP Endpoints
|
|
|
|
| Endpoint | Method | Description |
|
|
|----------|--------|-------------|
|
|
| `/taxii2/` | GET | Server discovery |
|
|
| `/{api-root}/collections/` | GET | List collections |
|
|
| `/{api-root}/collections/{id}/objects/` | GET | Get STIX objects |
|
|
| `/{api-root}/collections/{id}/objects/` | POST | Add STIX objects |
|
|
|
|
### References
|
|
|
|
- taxii2-client: https://pypi.org/project/taxii2-client/
|
|
- stix2 library: https://pypi.org/project/stix2/
|
|
- STIX 2.1 spec: https://docs.oasis-open.org/cti/stix/v2.1/stix-v2.1.html
|
|
- TAXII 2.1 spec: https://docs.oasis-open.org/cti/taxii/v2.1/taxii-v2.1.html
|