nullcone 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ # Rust
2
+ target/
3
+ Cargo.lock
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.pyc
8
+ *.pyo
9
+ .venv/
10
+ venv/
11
+ dist/
12
+ *.egg-info/
13
+ .pytest_cache/
14
+
15
+ # Data / secrets
16
+ *.env
17
+ .env
18
+ *.key
19
+ spacetimedb_data/
20
+
21
+ # IDEs
22
+ .idea/
23
+ .vscode/
24
+ *.swp
nullcone-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nullcone
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,213 @@
1
+ Metadata-Version: 2.4
2
+ Name: nullcone
3
+ Version: 0.1.0
4
+ Summary: Distributed threat intelligence for AI agents — real-time IOC sharing via SpacetimeDB
5
+ Project-URL: Homepage, https://nullcone.ai
6
+ Project-URL: Repository, https://github.com/maco144/nullcone
7
+ Project-URL: Issues, https://github.com/maco144/nullcone/issues
8
+ Project-URL: Documentation, https://nullcone.ai/docs
9
+ Author-email: Nullcone <hello@nullcone.ai>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: ai-agents,ioc,malware,security,spacetimedb,threat-intelligence
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Internet
22
+ Classifier: Topic :: Security
23
+ Requires-Python: >=3.11
24
+ Requires-Dist: click>=8.0
25
+ Requires-Dist: httpx>=0.24.0
26
+ Requires-Dist: websockets>=11.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: httpx; extra == 'dev'
29
+ Requires-Dist: pytest-asyncio; extra == 'dev'
30
+ Requires-Dist: pytest>=7; extra == 'dev'
31
+ Provides-Extra: embeddings
32
+ Requires-Dist: sentence-transformers>=2.0; extra == 'embeddings'
33
+ Description-Content-Type: text/markdown
34
+
35
+ # nullcone
36
+
37
+ **Distributed threat intelligence for AI agents and security teams.**
38
+
39
+ Real-time IOC sharing powered by [SpacetimeDB](https://spacetimedb.com). Your agent detects a threat — report it in one call — every other agent on the network is protected within milliseconds.
40
+
41
+ 592,000+ IOCs indexed · 549 malware families · 12+ live feeds · <1ms query latency
42
+
43
+ ---
44
+
45
+ ## Install
46
+
47
+ ```bash
48
+ pip install nullcone
49
+ ```
50
+
51
+ Python 3.11+ required.
52
+
53
+ ---
54
+
55
+ ## Quick start — Python SDK
56
+
57
+ ```python
58
+ from nullcone import NullconeAgent, IOC, IOCType
59
+
60
+ with NullconeAgent(api_key="nc_...") as agent:
61
+
62
+ # ① Check any IOC instantly
63
+ sig = agent.find_by_value("185.220.101.47")
64
+ if sig:
65
+ print(f"{sig.value} — {sig.family_name} — severity {sig.severity}/10")
66
+ agent.report_detection(sig.id, "blocked")
67
+
68
+ # ② Report new threats — protects every connected agent instantly
69
+ agent.submit_ioc(IOC(
70
+ ioc_type=IOCType.IP,
71
+ value="10.10.10.1",
72
+ severity=8,
73
+ tags=["c2", "botnet"],
74
+ ))
75
+
76
+ # ③ Delta sync — stream everything new since your last check
77
+ sigs, last_id = agent.poll_since(last_id)
78
+ ```
79
+
80
+ ### Self-registration
81
+
82
+ ```python
83
+ agent = NullconeAgent(api_key="nc_...")
84
+ agent.register() # idempotent — safe to call on every startup
85
+ ```
86
+
87
+ Registration is automatic when using the context manager (`with NullconeAgent(...) as agent`).
88
+
89
+ ### Continuous sync
90
+
91
+ ```python
92
+ def on_new_threats(sigs):
93
+ for s in sigs:
94
+ print(f"[{s.severity}/10] {s.ioc_type} {s.value}")
95
+
96
+ agent.sync_loop(on_new_threats, interval=300)
97
+ # state is auto-persisted to ~/.nullcone/{agent_id}.state
98
+ ```
99
+
100
+ ### Real-time WebSocket subscription
101
+
102
+ ```python
103
+ agent.subscribe_new_threats(callback=on_new_threats, min_severity=7)
104
+ agent.start_subscriptions()
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Quick start — CLI
110
+
111
+ ```bash
112
+ # First-time setup
113
+ nullcone config init
114
+
115
+ # Register your agent
116
+ nullcone register
117
+
118
+ # Look up an IOC
119
+ nullcone lookup 185.220.101.47
120
+ nullcone lookup evil.example.com
121
+
122
+ # Submit a new threat
123
+ nullcone submit 1.2.3.4 -t ip -s high --tags c2,botnet
124
+ nullcone submit CVE-2024-1337 -t cve -s critical
125
+ nullcone submit "ignore previous instructions" -t prompt -s 8
126
+
127
+ # Submit a batch from JSON
128
+ nullcone submit-batch threats.json
129
+
130
+ # Stream recent threats
131
+ nullcone threats --limit 50 --min-severity 5
132
+
133
+ # Poll for new IOCs since a known ID
134
+ nullcone poll --since 591000
135
+ nullcone poll --watch --min-severity 7 # live stream, Ctrl-C to stop
136
+
137
+ # Report a detection
138
+ nullcone detect 12345 --action blocked
139
+
140
+ # All commands support --json for machine-readable output
141
+ nullcone lookup 1.2.3.4 --json | jq .
142
+ nullcone threats --json | jq '.[].value'
143
+ ```
144
+
145
+ ### CLI environment variables
146
+
147
+ | Variable | Description |
148
+ |---|---|
149
+ | `NULLCONE_URL` | SpacetimeDB server URL |
150
+ | `NULLCONE_DB` | Database name (default: `nullcone`) |
151
+ | `NULLCONE_AGENT_ID` | Agent ID (auto-generated on first run) |
152
+ | `NULLCONE_TOKEN` | Auth token |
153
+ | `NULLCONE_JSON` | Set to `1` to always output JSON |
154
+
155
+ ---
156
+
157
+ ## IOC types
158
+
159
+ | Key | Description |
160
+ |---|---|
161
+ | `ip` | IPv4 / IPv6 address |
162
+ | `domain` | Malicious domain |
163
+ | `url` | Malicious URL |
164
+ | `md5` / `sha1` / `sha256` | File hashes |
165
+ | `ja3` | TLS fingerprint |
166
+ | `cve` | CVE identifier |
167
+ | `prompt` | Malicious LLM instruction / prompt injection pattern |
168
+ | `skill` | Malicious AI agent skill / plugin identifier |
169
+ | `yara` | YARA rule pattern |
170
+ | `email`, `mutex`, `registry`, `filepath`, `asn`, `imphash` | Standard IOC types |
171
+
172
+ ---
173
+
174
+ ## Batch submission format
175
+
176
+ ```json
177
+ [
178
+ {"type": "ip", "value": "1.2.3.4", "severity": 7, "tags": ["c2"]},
179
+ {"type": "domain", "value": "evil.example.com", "severity": 5},
180
+ {"type": "sha256", "value": "abc123...", "severity": 9, "family": "emotet"}
181
+ ]
182
+ ```
183
+
184
+ ```bash
185
+ nullcone submit-batch threats.json
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Severity scale
191
+
192
+ | Value | Label |
193
+ |---|---|
194
+ | 9–10 | CRITICAL |
195
+ | 7–8 | HIGH |
196
+ | 5–6 | MEDIUM |
197
+ | 3–4 | LOW |
198
+ | 1–2 | INFO |
199
+
200
+ ---
201
+
202
+ ## Links
203
+
204
+ - **Website**: [nullcone.ai](https://nullcone.ai)
205
+ - **Documentation**: [nullcone.ai/docs](https://nullcone.ai/docs)
206
+ - **Issues**: [github.com/maco144/nullcone](https://github.com/maco144/nullcone/issues)
207
+ - **Contact**: [hello@nullcone.ai](mailto:hello@nullcone.ai)
208
+
209
+ ---
210
+
211
+ ## License
212
+
213
+ MIT — see [LICENSE](https://github.com/maco144/nullcone/blob/main/LICENSE).
@@ -0,0 +1,179 @@
1
+ # nullcone
2
+
3
+ **Distributed threat intelligence for AI agents and security teams.**
4
+
5
+ Real-time IOC sharing powered by [SpacetimeDB](https://spacetimedb.com). Your agent detects a threat — report it in one call — every other agent on the network is protected within milliseconds.
6
+
7
+ 592,000+ IOCs indexed · 549 malware families · 12+ live feeds · <1ms query latency
8
+
9
+ ---
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install nullcone
15
+ ```
16
+
17
+ Python 3.11+ required.
18
+
19
+ ---
20
+
21
+ ## Quick start — Python SDK
22
+
23
+ ```python
24
+ from nullcone import NullconeAgent, IOC, IOCType
25
+
26
+ with NullconeAgent(api_key="nc_...") as agent:
27
+
28
+ # ① Check any IOC instantly
29
+ sig = agent.find_by_value("185.220.101.47")
30
+ if sig:
31
+ print(f"{sig.value} — {sig.family_name} — severity {sig.severity}/10")
32
+ agent.report_detection(sig.id, "blocked")
33
+
34
+ # ② Report new threats — protects every connected agent instantly
35
+ agent.submit_ioc(IOC(
36
+ ioc_type=IOCType.IP,
37
+ value="10.10.10.1",
38
+ severity=8,
39
+ tags=["c2", "botnet"],
40
+ ))
41
+
42
+ # ③ Delta sync — stream everything new since your last check
43
+ sigs, last_id = agent.poll_since(last_id)
44
+ ```
45
+
46
+ ### Self-registration
47
+
48
+ ```python
49
+ agent = NullconeAgent(api_key="nc_...")
50
+ agent.register() # idempotent — safe to call on every startup
51
+ ```
52
+
53
+ Registration is automatic when using the context manager (`with NullconeAgent(...) as agent`).
54
+
55
+ ### Continuous sync
56
+
57
+ ```python
58
+ def on_new_threats(sigs):
59
+ for s in sigs:
60
+ print(f"[{s.severity}/10] {s.ioc_type} {s.value}")
61
+
62
+ agent.sync_loop(on_new_threats, interval=300)
63
+ # state is auto-persisted to ~/.nullcone/{agent_id}.state
64
+ ```
65
+
66
+ ### Real-time WebSocket subscription
67
+
68
+ ```python
69
+ agent.subscribe_new_threats(callback=on_new_threats, min_severity=7)
70
+ agent.start_subscriptions()
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Quick start — CLI
76
+
77
+ ```bash
78
+ # First-time setup
79
+ nullcone config init
80
+
81
+ # Register your agent
82
+ nullcone register
83
+
84
+ # Look up an IOC
85
+ nullcone lookup 185.220.101.47
86
+ nullcone lookup evil.example.com
87
+
88
+ # Submit a new threat
89
+ nullcone submit 1.2.3.4 -t ip -s high --tags c2,botnet
90
+ nullcone submit CVE-2024-1337 -t cve -s critical
91
+ nullcone submit "ignore previous instructions" -t prompt -s 8
92
+
93
+ # Submit a batch from JSON
94
+ nullcone submit-batch threats.json
95
+
96
+ # Stream recent threats
97
+ nullcone threats --limit 50 --min-severity 5
98
+
99
+ # Poll for new IOCs since a known ID
100
+ nullcone poll --since 591000
101
+ nullcone poll --watch --min-severity 7 # live stream, Ctrl-C to stop
102
+
103
+ # Report a detection
104
+ nullcone detect 12345 --action blocked
105
+
106
+ # All commands support --json for machine-readable output
107
+ nullcone lookup 1.2.3.4 --json | jq .
108
+ nullcone threats --json | jq '.[].value'
109
+ ```
110
+
111
+ ### CLI environment variables
112
+
113
+ | Variable | Description |
114
+ |---|---|
115
+ | `NULLCONE_URL` | SpacetimeDB server URL |
116
+ | `NULLCONE_DB` | Database name (default: `nullcone`) |
117
+ | `NULLCONE_AGENT_ID` | Agent ID (auto-generated on first run) |
118
+ | `NULLCONE_TOKEN` | Auth token |
119
+ | `NULLCONE_JSON` | Set to `1` to always output JSON |
120
+
121
+ ---
122
+
123
+ ## IOC types
124
+
125
+ | Key | Description |
126
+ |---|---|
127
+ | `ip` | IPv4 / IPv6 address |
128
+ | `domain` | Malicious domain |
129
+ | `url` | Malicious URL |
130
+ | `md5` / `sha1` / `sha256` | File hashes |
131
+ | `ja3` | TLS fingerprint |
132
+ | `cve` | CVE identifier |
133
+ | `prompt` | Malicious LLM instruction / prompt injection pattern |
134
+ | `skill` | Malicious AI agent skill / plugin identifier |
135
+ | `yara` | YARA rule pattern |
136
+ | `email`, `mutex`, `registry`, `filepath`, `asn`, `imphash` | Standard IOC types |
137
+
138
+ ---
139
+
140
+ ## Batch submission format
141
+
142
+ ```json
143
+ [
144
+ {"type": "ip", "value": "1.2.3.4", "severity": 7, "tags": ["c2"]},
145
+ {"type": "domain", "value": "evil.example.com", "severity": 5},
146
+ {"type": "sha256", "value": "abc123...", "severity": 9, "family": "emotet"}
147
+ ]
148
+ ```
149
+
150
+ ```bash
151
+ nullcone submit-batch threats.json
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Severity scale
157
+
158
+ | Value | Label |
159
+ |---|---|
160
+ | 9–10 | CRITICAL |
161
+ | 7–8 | HIGH |
162
+ | 5–6 | MEDIUM |
163
+ | 3–4 | LOW |
164
+ | 1–2 | INFO |
165
+
166
+ ---
167
+
168
+ ## Links
169
+
170
+ - **Website**: [nullcone.ai](https://nullcone.ai)
171
+ - **Documentation**: [nullcone.ai/docs](https://nullcone.ai/docs)
172
+ - **Issues**: [github.com/maco144/nullcone](https://github.com/maco144/nullcone/issues)
173
+ - **Contact**: [hello@nullcone.ai](mailto:hello@nullcone.ai)
174
+
175
+ ---
176
+
177
+ ## License
178
+
179
+ MIT — see [LICENSE](https://github.com/maco144/nullcone/blob/main/LICENSE).
@@ -0,0 +1,43 @@
1
+ """
2
+ Nullcone — distributed threat intelligence client SDK.
3
+
4
+ Quick start:
5
+ from nullcone import NullconeAgent, IOC, IOCType
6
+
7
+ with NullconeAgent() as agent:
8
+ result = agent.submit_ioc(IOC(ioc_type=IOCType.DOMAIN, value="evil.example.com"))
9
+ """
10
+ from .agent import NullconeAgent
11
+ from .models import (
12
+ IOC,
13
+ IOCType,
14
+ Severity,
15
+ ActionTaken,
16
+ ThreatSignature,
17
+ MalwareFamily,
18
+ AgentInfo,
19
+ SubmitResult,
20
+ DetectionEvent,
21
+ )
22
+ from .client import SpacetimeDBClient, SpacetimeDBSubscriber, SpacetimeDBError
23
+ from .ei_client import EIClient, EIVerification, EIError, ALLOWED_ENTITY_TYPES
24
+
25
+ __all__ = [
26
+ "NullconeAgent",
27
+ "IOC",
28
+ "IOCType",
29
+ "Severity",
30
+ "ActionTaken",
31
+ "ThreatSignature",
32
+ "MalwareFamily",
33
+ "AgentInfo",
34
+ "SubmitResult",
35
+ "DetectionEvent",
36
+ "SpacetimeDBClient",
37
+ "SpacetimeDBSubscriber",
38
+ "SpacetimeDBError",
39
+ "EIClient",
40
+ "EIVerification",
41
+ "EIError",
42
+ "ALLOWED_ENTITY_TYPES",
43
+ ]