stidantic 0.1.0__py3-none-any.whl

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.

Potentially problematic release.


This version of stidantic might be problematic. Click here for more details.

stidantic/vocab.py ADDED
@@ -0,0 +1,512 @@
1
+ from enum import Enum
2
+
3
+
4
+ class AccountType(Enum):
5
+ facebook = "facebook"
6
+ ldap = "ldap"
7
+ nis = "nis"
8
+ openid = "openid"
9
+ radius = "radius"
10
+ skype = "skype"
11
+ tacacs = "tacacs"
12
+ twitter = "twitter"
13
+ unix = "unix"
14
+ windows_local = "windows-local"
15
+ windows_domain = "windows-domain"
16
+
17
+
18
+ class AttackMotivation(Enum):
19
+ accidental = "accidental"
20
+ coercion = "coercion"
21
+ dominance = "dominance"
22
+ ideology = "ideology"
23
+ notoriety = "notoriety"
24
+ organizational_gain = "organizational-gain"
25
+ personal_gain = "personal-gain"
26
+ personal_satisfaction = "personal-satisfaction"
27
+ revenge = "revenge"
28
+ unpredictable = "unpredictable"
29
+
30
+
31
+ class AttackResourceLevel(Enum):
32
+ individual = "individual"
33
+ club = "club"
34
+ contest = "contest"
35
+ team = "team"
36
+ organization = "organization"
37
+ government = "government"
38
+
39
+
40
+ class EncryptionAlgorithm(Enum):
41
+ aes_256_gcm = "AES-256-GCM"
42
+ chacha20_poly1305 = "ChaCha20-Poly1305"
43
+ mime_type_indicated = "mime-type-indicated"
44
+
45
+
46
+ class ExtensionType(Enum):
47
+ new_sdo = "new-sdo"
48
+ new_sco = "new-sco"
49
+ new_sro = "new-sro"
50
+ property_extension = "property-extension"
51
+ toplevel_property_extension = "toplevel-property-extension"
52
+
53
+
54
+ class GroupingContext(Enum):
55
+ suspicious_activity = "suspicious-activity"
56
+ malware_analysis = "malware-analysis"
57
+ unspecified = "unspecified"
58
+
59
+
60
+ class HashingAlgorithm(Enum):
61
+ md5 = "MD5"
62
+ sha1 = "SHA-1"
63
+ sha_256 = "SHA-256"
64
+ sha_512 = "SHA-512"
65
+ sha3_256 = "SHA3-256"
66
+ sha3_512 = "SHA3-512"
67
+ ssdeep = "SSDEEP"
68
+ tlsh = "TLSH"
69
+
70
+
71
+ class IdentityClass(Enum):
72
+ individual = "individual"
73
+ group = "group"
74
+ system = "system"
75
+ organization = "organization"
76
+ class_ = "class"
77
+ unknown = "unknown"
78
+
79
+
80
+ class ImplementationLanguage(Enum):
81
+ applescript = "applescript"
82
+ bash = "bash"
83
+ c = "c"
84
+ cpp = "c++"
85
+ csharp = "c#"
86
+ go = "go"
87
+ java = "java"
88
+ javascript = "javascript"
89
+ lua = "lua"
90
+ objective_c = "objective-c"
91
+ perl = "perl"
92
+ php = "php"
93
+ powershell = "powershell"
94
+ python = "python"
95
+ ruby = "ruby"
96
+ scala = "scala"
97
+ swift = "swift"
98
+ typescript = "typescript"
99
+ visual_basic = "visual-basic"
100
+ x86_32 = "x86-32"
101
+ x86_64 = "x86-64"
102
+
103
+
104
+ class IndicatorType(Enum):
105
+ anomalous_activity = "anomalous-activity"
106
+ anonymization = "anonymization"
107
+ benign = "benign"
108
+ compromised = "compromised"
109
+ malicious_activity = "malicious-activity"
110
+ attribution = "attribution"
111
+ unknown = "unknown"
112
+
113
+
114
+ class IndustrySector(Enum):
115
+ agriculture = "agriculture"
116
+ aerospace = "aerospace"
117
+ automotive = "automotive"
118
+ chemical = "chemical"
119
+ commercial = "commercial"
120
+ communications = "communications"
121
+ construction = "construction"
122
+ defense = "defense"
123
+ education = "education"
124
+ energy = "energy"
125
+ entertainment = "entertainment"
126
+ financial_services = "financial-services"
127
+ government = "government "
128
+ emergency_services = "emergency-services"
129
+ government_local = "government-local"
130
+ government_national = "government-national"
131
+ government_public_services = "government-public-services"
132
+ government_regional = "government-regional"
133
+ healthcare = "healthcare"
134
+ hospitality_leisure = "hospitality-leisure"
135
+ infrastructure = "infrastructure"
136
+ dams = "dams"
137
+ nuclear = "nuclear"
138
+ water = "water"
139
+ insurance = "insurance"
140
+ manufacturing = "manufacturing"
141
+ mining = "mining"
142
+ non_profit = "non-profit"
143
+ pharmaceuticals = "pharmaceuticals"
144
+ retail = "retail"
145
+ technology = "technology"
146
+ telecommunications = "telecommunications"
147
+ transportation = "transportation"
148
+ utilities = "utilities"
149
+
150
+
151
+ class InfrastructureType(Enum):
152
+ amplification = "amplification"
153
+ anonymization = "anonymization"
154
+ botnet = "botnet"
155
+ command_and_control = "command-and-control"
156
+ exfiltration = "exfiltration"
157
+ hosting_malware = "hosting-malware"
158
+ hosting_target_lists = "hosting-target-lists"
159
+ phishing = "phishing"
160
+ reconnaissance = "reconnaissance"
161
+ staging = "staging"
162
+ unknown = "unknown"
163
+
164
+
165
+ class MalwareResult(Enum):
166
+ malicious = "malicious"
167
+ suspicious = "suspicious"
168
+ benign = "benign"
169
+ unknown = "unknown"
170
+
171
+
172
+ class MalwareCapabilities(Enum):
173
+ accesses_remote_machines = "accesses-remote-machines"
174
+ anti_debugging = "anti-debugging"
175
+ anti_disassembly = "anti-disassembly"
176
+ anti_emulation = "anti-emulation"
177
+ anti_memory_forensics = "anti-memory-forensics"
178
+ anti_sandbox = "anti-sandbox"
179
+ anti_vm = "anti-vm"
180
+ captures_input_peripherals = "captures-input-peripherals"
181
+ captures_output_peripherals = "captures-output-peripherals"
182
+ captures_system_state_data = "captures-system-state-data"
183
+ cleans_traces_of_infection = "cleans-traces-of-infection"
184
+ commits_fraud = "commits-fraud"
185
+ communicates_with_c2 = "communicates-with-c2"
186
+ compromises_data_availability = "compromises-data-availability"
187
+ compromises_data_integrity = "compromises-data-integrity"
188
+ compromises_system_availability = "compromises-system-availability"
189
+ controls_local_machine = "controls-local-machine"
190
+ degrades_security_software = "degrades-security-software"
191
+ degrades_system_updates = "degrades-system-updates"
192
+ determines_c2_server = "determines-c2-server"
193
+ emails_spam = "emails-spam"
194
+ escalates_privileges = "escalates-privileges"
195
+ evades_av = "evades-av"
196
+ exfiltrates_data = "exfiltrates-data"
197
+ fingerprints_host = "fingerprints-host"
198
+ hides_artifacts = "hides-artifacts"
199
+ hides_executing_code = "hides-executing-code"
200
+ infects_files = "infects-files"
201
+ infects_remote_machines = "infects-remote-machines"
202
+ installs_other_components = "installs-other-components"
203
+ persists_after_system_reboot = "persists-after-system-reboot"
204
+ prevents_artifact_access = "prevents-artifact-access"
205
+ prevents_artifact_deletion = "prevents-artifact-deletion"
206
+ probes_network_environment = "probes-network-environment"
207
+ self_modifies = "self-modifies"
208
+ steals_authentication_credentials = "steals-authentication-credentials"
209
+ violates_system_operational_integrity = "violates-system-operational-integrity"
210
+
211
+
212
+ class MalwareType(Enum):
213
+ adware = "adware"
214
+ backdoor = "backdoor"
215
+ bot = "bot"
216
+ bootkit = "bootkit"
217
+ ddos = "ddos"
218
+ downloader = "downloader"
219
+ dropper = "dropper"
220
+ exploit_kit = "exploit-kit"
221
+ keylogger = "keylogger"
222
+ ransomware = "ransomware"
223
+ remote_access_trojan = "remote-access-trojan"
224
+ resource_exploitation = "resource-exploitation"
225
+ rogue_security_software = "rogue-security-software"
226
+ rootkit = "rootkit"
227
+ screen_capture = "screen-capture"
228
+ spyware = "spyware"
229
+ trojan = "trojan"
230
+ unknown = "unknown"
231
+ virus = "virus"
232
+ webshell = "webshell"
233
+ wiper = "wiper"
234
+ worm = "worm"
235
+
236
+
237
+ class NetworkSocketAddressFamily(Enum):
238
+ UNSPEC = "AF_UNSPEC"
239
+ INET = "AF_INET"
240
+ IPX = "AF_IPX"
241
+ APPLETALK = "AF_APPLETALK"
242
+ NETBIOS = "AF_NETBIOS"
243
+ INET6 = "AF_INET6"
244
+ IRDA = "AF_IRDA"
245
+ BTH = "AF_BTH"
246
+
247
+
248
+ class NetworkSocketType(Enum):
249
+ SOCK_STREAM = "SOCK_STREAM"
250
+ AF_ISOCK_DGRAMNET = "AF_ISOCK_DGRAMNET"
251
+ SOCK_RAW = "SOCK_RAW"
252
+ SOCK_RDM = "SOCK_RDM"
253
+ SOCK_SEQPACKET = "SOCK_SEQPACKET"
254
+
255
+
256
+ class OpinionEnum(Enum):
257
+ strongly_disagree = "strongly-disagree"
258
+ disagree = "disagree"
259
+ neutral = "neutral"
260
+ agree = "agree"
261
+ strongly_agree = "strongly-agree"
262
+
263
+
264
+ class PatternType(Enum):
265
+ stix = "stix"
266
+ pcre = "pcre"
267
+ sigma = "sigma"
268
+ snort = "snort"
269
+ suricata = "suricata"
270
+ yara = "yara"
271
+
272
+
273
+ class ProcessorArchitecture(Enum):
274
+ alpha = "alpha"
275
+ arm = "arm"
276
+ ia_64 = "ia-64"
277
+ mips = "mips"
278
+ powerpc = "powerpc"
279
+ sparc = "sparc"
280
+ x86 = "x86"
281
+ x86_64 = "x86-64"
282
+
283
+
284
+ class Region(Enum):
285
+ africa = "africa"
286
+ eastern_africa = "eastern-africa"
287
+ middle_africa = "middle-africa"
288
+ northern_africa = "northern-africa"
289
+ southern_africa = "southern-africa"
290
+ western_africa = "western-africa"
291
+ americas = "americas"
292
+ caribbean = "caribbean"
293
+ central_america = "central-america"
294
+ latin_america_caribbean = "latin-america-caribbean"
295
+ northern_america = "northern-america"
296
+ south_america = "south-america"
297
+ asia = "asia"
298
+ central_asia = "central-asia"
299
+ eastern_asia = "eastern-asia"
300
+ southern_asia = "southern-asia"
301
+ south_eastern_asia = "south-eastern-asia"
302
+ western_asia = "western-asia"
303
+ europe = "europe"
304
+ eastern_europe = "eastern-europe"
305
+ northern_europe = "northern-europe"
306
+ southern_europe = "southern-europe"
307
+ western_europe = "western-europe"
308
+ oceania = "oceania"
309
+ antarctica = "antarctica"
310
+ australia_new_zealand = "australia-new-zealand"
311
+ melanesia = "melanesia"
312
+ micronesia = "micronesia"
313
+ polynesia = "polynesia"
314
+
315
+
316
+ class ReportType(Enum):
317
+ attack_pattern = "attack-pattern"
318
+ campaign = "campaign"
319
+ identity = "identity"
320
+ indicator = "indicator"
321
+ intrusion_set = "intrusion-set"
322
+ malware = "malware"
323
+ observed_data = "observed-data"
324
+ threat_actor = "threat-actor"
325
+ threat_report = "threat-report"
326
+ tool = "tool"
327
+ vulnerability = "vulnerability"
328
+
329
+
330
+ class ThreatActorType(Enum):
331
+ activist = "activist"
332
+ competitor = "competitor"
333
+ crime_syndicate = "crime-syndicate"
334
+ criminal = "criminal"
335
+ hacker = "hacker"
336
+ insider_accidental = "insider-accidental"
337
+ insider_disgruntled = "insider-disgruntled"
338
+ nation_state = "nation-state"
339
+ sensationalist = "sensationalist"
340
+ spy = "spy"
341
+ terrorist = "terrorist"
342
+ unknown = "unknown"
343
+
344
+
345
+ class ThreatActorRole(Enum):
346
+ agent = "agent"
347
+ director = "director"
348
+ independent = "independent"
349
+ infrastructure_architect = "infrastructure-architect"
350
+ infrastructure_operator = "infrastructure-operator"
351
+ malware_author = "malware-author"
352
+ sponsor = "sponsor"
353
+
354
+
355
+ class ThreatActorSophistication(Enum):
356
+ none = "none"
357
+ minimal = "minimal"
358
+ intermediate = "intermediate"
359
+ advanced = "advanced"
360
+ expert = "expert"
361
+ innovator = "innovator"
362
+ strategic = "strategic"
363
+
364
+
365
+ class ToolType(Enum):
366
+ denial_of_service = "denial-of-service"
367
+ exploitation = "exploitation"
368
+ information_gathering = "information-gathering"
369
+ network_capture = "network-capture"
370
+ credential_exploitation = "credential-exploitation"
371
+ remote_access = "remote-access"
372
+ vulnerability_scanning = "vulnerability-scanning"
373
+ unknown = "unknown"
374
+
375
+
376
+ class WindowsIntegrityLevel(Enum):
377
+ low = "low"
378
+ medium = "medium"
379
+ high = "high"
380
+ system = "system"
381
+
382
+
383
+ class WindowsPEBinary(Enum):
384
+ dll = "dll"
385
+ exe = "exe"
386
+ sys = "sys"
387
+
388
+
389
+ class WindowsRegistryDatatype(Enum):
390
+ NONE = "REG_NONE"
391
+ SZ = "REG_SZ"
392
+ EXPAND_SZ = "REG_EXPAND_SZ"
393
+ BINARY = "REG_BINARY"
394
+ DWORD = "REG_DWORD"
395
+ DWORD_BIG_ENDIAN = "REG_DWORD_BIG_ENDIAN"
396
+ DWORD_LITTLE_ENDIAN = "REG_DWORD_LITTLE_ENDIAN"
397
+ LINK = "REG_LINK"
398
+ MULTI_SZ = "REG_MULTI_SZ"
399
+ RESOURCE_LIST = "REG_RESOURCE_LIST"
400
+ FULL_RESOURCE_DESCRIPTION = "REG_FULL_RESOURCE_DESCRIPTION"
401
+ RESOURCE_REQUIREMENTS_LIST = "REG_RESOURCE_REQUIREMENTS_LIST"
402
+ QWORD = "REG_QWORD"
403
+ INVALID_TYPE = "REG_INVALID_TYPE"
404
+
405
+
406
+ class WindowsServiceStartType(Enum):
407
+ AUTO_START = "SERVICE_AUTO_START"
408
+ BOOT_START = "SERVICE_BOOT_START"
409
+ DEMAND_START = "SERVICE_DEMAND_START"
410
+ DISABLED = "SERVICE_DISABLED"
411
+ SYSTEM_ALERT = "SERVICE_SYSTEM_ALERT"
412
+
413
+
414
+ class WindowsServiceType(Enum):
415
+ KERNEL_DRIVER = "SERVICE_KERNEL_DRIVER"
416
+ FILE_SYSTEM_DRIVER = "SERVICE_FILE_SYSTEM_DRIVER"
417
+ WIN32_OWN_PROCESS = "SERVICE_WIN32_OWN_PROCESS"
418
+ WIN32_SHARE_PROCESS = "SERVICE_WIN32_SHARE_PROCESS"
419
+
420
+
421
+ class WindowsServiceStatus(Enum):
422
+ CONTINUE_PENDING = "SERVICE_CONTINUE_PENDING"
423
+ PAUSE_PENDING = "SERVICE_PAUSE_PENDING"
424
+ PAUSED = "SERVICE_PAUSED"
425
+ RUNNING = "SERVICE_RUNNING"
426
+ START_PENDING = "SERVICE_START_PENDING"
427
+ STOP_PENDING = "SERVICE_STOP_PENDING"
428
+ STOPPED = "SERVICE_STOPPED"
429
+
430
+
431
+ class DNSRecord(Enum):
432
+ A = "A" # Address record : Returns a 32-bit IPv4 address, most commonly used to map hostnames to an IP address
433
+ # of the host, but it is also used for DNSBLs, storing subnet masks in RFC 1101, etc.
434
+ AAAA = "AAAA" # IPv6 address record : Returns a 128-bit IPv6 address, most commonly used to map hostnames
435
+ # to an IP address of the host.
436
+ AFSDB = "AFSDB" # AFS database record : Location of database servers of an AFS cell. This record is commonly
437
+ # used by AFS clients to contact AFS cells outside their local domain.
438
+ APL = "APL" # Address Prefix List : Specify lists of address ranges, e.g. in CIDR format,
439
+ # for various address families. Experimental.
440
+ CAA = "CAA" # Certification Authority Authorization : DNS Certification Authority Authorization,
441
+ # constraining acceptable CAs for a host/domain
442
+ CDNSKEY = "CDNSKEY" # Child copy of DNSKEY record, for transfer to parent
443
+ CDS = "CDS" # Child DS : Child copy of DS record, for transfer to parent
444
+ CERT = "CERT" # Certificate record : Stores PKIX, SPKI, PGP, etc.
445
+ CNAME = "CNAME" # Canonical name record : Alias of one name to another: the DNS lookup will continue
446
+ # by retrying the lookup with the new name.
447
+ CSYNC = "CSYNC" # Child-to-Parent Synchronization : Specify a synchronization mechanism between a child
448
+ # and a parent DNS zone. Typical example is declaring the same NS records in the parent and the child zone
449
+ DHCID = (
450
+ "DHCID" # DHCP identifier : Used in conjunction with the FQDN option to DHCP
451
+ )
452
+ DLV = "DLV" # DNSSEC Lookaside Validation record : For publishing DNSSEC trust anchors outside of the
453
+ # DNS delegation chain. Uses the same format as the DS record. RFC 5074 describes a way of using these records.
454
+ DNAME = "DNAME" # Delegation name record : Alias for a name and all its subnames, unlike CNAME, which is an alias
455
+ # for only the exact name. Like a CNAME, the DNS lookup will continue by retrying the lookup with the new name.
456
+ DNSKEY = "DNSKEY" # DNS Key record : The key record used in DNSSEC. Uses the same format as the KEY record.
457
+ DS = "DS" # Delegation signer : The record used to identify the DNSSEC signing key of a delegated zone
458
+ EUI48 = "EUI48" # MAC address (EUI-48) : A 48-bit IEEE Extended Unique Identifier.
459
+ EUI64 = "EUI64" # MAC address (EUI-64) : A 64-bit IEEE Extended Unique Identifier.
460
+ HINFO = "HINFO" # Host Information : Providing Minimal-Sized Responses to DNS Queries That Have QTYPE=ANY
461
+ HIP = "HIP" # Host Identity Protocol : Method of separating the end-point identifier and locator roles of IPs.
462
+ HTTPS = "HTTPS" # HTTPS Binding : RR that improves performance for clients that need to resolve many resources
463
+ # to access a domain. More info in this IETF Draft by DNSOP Working group and Akamai technologies.
464
+ IPSECKEY = "IPSECKEY" # IPsec Key : Key record that can be used with IPsec
465
+ KEY = "KEY" # Key record
466
+ KX = "KX" # Key Exchanger record : Used with some cryptographic systems (not including DNSSEC) to identify
467
+ # a key management agent for the associated domain-name. Note that this has nothing to do with DNS Security.
468
+ LOC = "LOC" # Location record : Specifies a geographical location associated with a domain name
469
+ MX = "MX" # Mail exchange record : List of mail exchange servers that accept email for a domain
470
+ NAPTR = "NAPTR" # Naming Authority Pointer : Allows regular-expression-based rewriting of domain names
471
+ # which can then be used as URIs, further domain names to lookups, etc.
472
+ NS = "NS" # Name server record : Delegates a DNS zone to use the given authoritative name servers
473
+ NSEC = "NSEC" # Next Secure record : Part of DNSSEC—used to prove a name does not exist.
474
+ NSEC3 = "NSEC3" # Next Secure record version 3 : An extension to DNSSEC that allows proof of nonexistence
475
+ # for a name without permitting zonewalking
476
+ NSEC3PARAM = "NSEC3PARAM" # NSEC3 parameters : Parameter record for use with NSEC3
477
+ OPENPGPKEY = "OPENPGPKEY" # OpenPGP public key record : A DNS-based Authentication of Named Entities (DANE) method
478
+ # for publishing and locating OpenPGP public keys in DNS for a specific email address.
479
+ PTR = "PTR" # PTR Resource Record [de] : Pointer to a canonical name. Unlike a CNAME, DNS processing stops and
480
+ # just the name is returned. The most common use is for implementing reverse DNS lookups.
481
+ RRSIG = "RRSIG" # DNSSEC signature : Signature for a DNSSEC-secured record set. Same format as the SIG record.
482
+ RP = "RP" # Responsible Person : Information about the responsible person(s) for the domain.
483
+ # Usually an email address with the @ replaced by a .
484
+ SIG = "SIG" # Signature
485
+ SMIMEA = "SMIMEA" # S/MIME cert association : Associates an S/MIME certificate with a domain name
486
+ # for sender authentication.
487
+ SOA = "SOA" # Start of [a zone of] authority record : Specifies authoritative information about a DNS zone,
488
+ # including the primary name server, the email of the domain administrator, the domain serial number,
489
+ # and several timers relating to refreshing the zone.
490
+ SRV = "SRV" # Service locator : Generalized service location record, used for newer protocols instead of
491
+ # creating protocol-specific records such as MX.
492
+ SSHFP = "SSHFP" # SSH Public Key Fingerprint : Resource record for publishing SSH public host key fingerprints
493
+ # in the DNS, in order to aid in verifying the authenticity of the host.
494
+ SVCB = "SVCB" # Service Binding : RR that improves performance for clients that need to resolve many
495
+ # resources to access a domain.
496
+ TA = "TA" # Trust Authorities : Part of a deployment proposal for DNSSEC without a signed DNS root.
497
+ TKEY = "TKEY" # Transaction Key record : A method of providing keying material to be used with TSIG
498
+ # that is encrypted under the public key in an accompanying KEY RR.
499
+ TLSA = "TLSA" # TLSA certificate association : A record for DANE. The TLSA DNS resource record is used to
500
+ # associate a TLS server certificate or public key with the domain name where the record is found.
501
+ TSIG = "TSIG" # Transaction Signature : Can be used to authenticate dynamic updates as coming from an approved
502
+ # client, or to authenticate responses as coming from an approved recursive name server similar to DNSSEC.
503
+ TXT = "TXT" # Text record : Originally for arbitrary human-readable text in a DNS record. Often carries
504
+ # machine-readable data, such as opportunistic encryption, Sender Policy Framework, DKIM, DMARC, DNS-SD, etc.
505
+ URI = "URI" # Uniform Resource Identifier : Can be used for publishing mappings from hostnames to URIs.
506
+ ZONEMD = "ZONEMD" # Message Digests for DNS Zones : Provides a cryptographic message digest over DNS zone data.
507
+
508
+
509
+ class IPUsage(Enum):
510
+ parking = "parking"
511
+ vpn = "vpn"
512
+ tor = "tor"
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.4
2
+ Name: stidantic
3
+ Version: 0.1.0
4
+ Summary: A Pydantic-based Python library for parsing, validating, and creating STIX 2.1 cyber threat intelligence data
5
+ Project-URL: Homepage, https://github.com/nicocti/stidantic
6
+ Project-URL: Repository, https://github.com/nicocti/stidantic
7
+ Project-URL: Issues, https://github.com/nicocti/stidantic/issues
8
+ Project-URL: Documentation, https://github.com/nicocti/stidantic#readme
9
+ Author-email: nicocti <your.email@example.com>
10
+ Maintainer-email: nicocti <your.email@example.com>
11
+ License: MIT
12
+ License-File: LICENSE
13
+ Keywords: cti,pydantic,stix,stix2,stix2.1
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Security
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.12
26
+ Requires-Dist: pydantic>=2.12
27
+ Description-Content-Type: text/markdown
28
+
29
+ # stidantic [WIP]
30
+
31
+ **This is work in progress, not compliant yet.**
32
+
33
+ A Pydantic-based Python library for parsing, validating, and creating STIX 2.1 cyber threat intelligence data.
34
+
35
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
36
+ [![Pydantic v2](https://img.shields.io/badge/pydantic-v2.12+-green.svg)](https://docs.pydantic.dev/)
37
+
38
+ ## Overview
39
+
40
+ **stidantic** provides a type-safe, Pythonic way to work with [STIX 2.1](https://oasis-open.github.io/cti-documentation/stix/intro) (Structured Threat Information Expression) objects.
41
+
42
+ This library leverages [Pydantic](https://docs.pydantic.dev/) to provide:
43
+
44
+ - 🔒 **Strong type validation** for all STIX objects
45
+ - 📝 **IDE auto-completion** and type hints
46
+ - ✅ **Automatic validation** of STIX specification constraints
47
+ - 🔄 **Easy JSON serialization/deserialization**
48
+ - ❄️ **Immutable models** with frozen Pydantic configurations
49
+ - 🎯 **Discriminated unions** for polymorphic STIX object handling
50
+
51
+ ## Installation
52
+
53
+ ### Requirements
54
+
55
+ - Python 3.12 or later (uses PEP 695 type statements)
56
+ - Pydantic > 2.10
57
+
58
+ ## Quick Start
59
+
60
+ ### Parsing a STIX Bundle
61
+
62
+ ```python
63
+ from stidantic.bundle import StixBundle
64
+
65
+ # Load from JSON file
66
+ with open("threat_data.json", "r") as f:
67
+ bundle = StixBundle.model_validate_json(f.read())
68
+
69
+ # Access objects
70
+ print(f"Bundle contains {len(bundle.objects)} objects")
71
+ for obj in bundle.objects:
72
+ print(f"- {obj.type}: {obj.id}")
73
+ ```
74
+
75
+ ### Creating STIX Objects
76
+
77
+ ```python
78
+ from datetime import datetime
79
+ from stidantic.sdo import Campaign
80
+ from stidantic.types import Identifier
81
+
82
+ campaign = Campaign(
83
+ id=Identifier("campaign--8e2e2d2b-17d4-4cbf-938f-98ee46b3cd3f"),
84
+ created=datetime.now(),
85
+ modified=datetime.now(),
86
+ name="Operation Stealth",
87
+ description="A sophisticated campaign targeting financial institutions",
88
+ objective="Financial gain through wire fraud"
89
+ )
90
+
91
+ # Export to JSON
92
+ json_output = campaign.model_dump_json(indent=2, exclude_none=True, by_alias=True)
93
+ print(json_output)
94
+ ```
95
+
96
+ ## Implemented STIX Objects
97
+
98
+ ### STIX Domain Objects (SDOs)
99
+ - ✅ `AttackPattern` - Ways adversaries attempt to compromise targets
100
+ - ✅ `Campaign` - Grouping of adversarial behaviors over time
101
+ - 🚧 `Course of Action` - Action taken to prevent or respond to an attack
102
+ - 🚧 `Grouping` - Explicitly asserts that STIX Objects have a shared context
103
+ - 🚧 `Identity` - Actual individuals, organizations, or groups
104
+ - 🚧 `Incident` - A stub object representing a security incident
105
+ - 🚧 `Indicator` - Pattern that can be used to detect suspicious or malicious activity
106
+ - 🚧 `Infrastructure` - Systems, software services, and associated resources
107
+ - 🚧 `Intrusion Set` - A grouped set of adversarial behaviors and resources
108
+ - 🚧 `Location` - A geographic location
109
+ - 🚧 `Malware` - A type of TTP that represents malicious code
110
+ - 🚧 `Malware Analysis` - The results of a malware analysis
111
+ - 🚧 `Note` - Analyst-created content and context
112
+ - 🚧 `Observed Data` - Information about cyber security related entities
113
+ - 🚧 `Opinion` - An assessment of the correctness of a STIX Object
114
+ - 🚧 `Report` - Collections of threat intelligence
115
+ - 🚧 `Threat Actor` - Actual individuals, groups, or organizations
116
+ - 🚧 `Tool` - Legitimate software that can be used by threat actors
117
+ - 🚧 `Vulnerability` - A mistake in software that can be used to compromise a system
118
+
119
+ ### STIX Cyber-observable Objects (SCOs)
120
+ - ✅ `Artifact` - Binary or file-like objects
121
+ - ✅ `AutonomousSystem` - Autonomous System (AS) information
122
+ - 🚧 `Directory` - A directory on a file system
123
+ - 🚧 `Domain Name` - A network domain name
124
+ - 🚧 `Email Address` - An email address
125
+ - 🚧 `Email Message` - An email message
126
+ - 🚧 `File` - A computer file
127
+ - 🚧 `IPv4 Address` - An IPv4 address
128
+ - 🚧 `IPv6 Address` - An IPv6 address
129
+ - 🚧 `MAC Address` - A Media Access Control (MAC) address
130
+ - 🚧 `Mutex` - A mutual exclusion object
131
+ - 🚧 `Network Traffic` - A network traffic flow
132
+ - 🚧 `Process` - A running process
133
+ - 🚧 `Software` - A software product
134
+ - 🚧 `URL` - A Uniform Resource Locator (URL)
135
+ - 🚧 `User Account` - A user account on a system
136
+ - 🚧 `Windows Registry Key` - A key in the Windows registry
137
+ - 🚧 `X.509 Certificate` - An X.509 certificate
138
+
139
+ ### STIX Relationship Objects (SROs)
140
+ - ✅ `Relationship` - Connections between STIX objects
141
+ - ✅ `Sighting` - Observations of threat intelligence in the wild
142
+
143
+ ### Meta Objects
144
+ - ✅ `MarkingDefinition` - Data markings (includes TLP)
145
+ - ✅ `LanguageContent` - Translations and internationalization
146
+ - ✅ `ExtensionDefinition` - Custom STIX extensions
147
+
148
+ ### Bundle
149
+ - ✅ `StixBundle` - Container for STIX objects
150
+
151
+ ## Roadmap
152
+
153
+ - **Full STIX 2.1 Compliance**
154
+ - **Python packaging**
155
+ - **Extensive Testing**
156
+ - Better STIX Extension Support: Develop a robust and user-friendly mechanism for defining, parsing, and validating custom STIX extensions.
157
+ - TAXII 2.1 Server: Build a TAXII 2.1 compliant server using FastAPI.
158
+ - OCA Standard Extensions: Implement STIX extensions from the [Open Cybersecurity Alliance (OCA)](https://github.com/opencybersecurityalliance/stix-extensions) repository.
159
+ - Performance Tuning: Profile and optimize parsing and serialization.
160
+
161
+ ## Resources
162
+
163
+ - [STIX 2.1 Specification](https://docs.oasis-open.org/cti/stix/v2.1/stix-v2.1.html)
164
+ - [STIX 2.1 Introduction](https://oasis-open.github.io/cti-documentation/stix/intro)
165
+ - [Pydantic Documentation](https://docs.pydantic.dev/)
166
+
167
+ ## License
168
+
169
+ stidantic is released under the [MIT License](https://opensource.org/licenses/MIT).
170
+
171
+ ## Acknowledgments
172
+
173
+ This project implements the STIX 2.1 specification published by the OASIS Cyber Threat Intelligence (CTI) Technical Committee.