
    <i2M                        S r SSKJr  SSKrSSKJr  SSKJr  SSKJ	r	  SSK
JrJrJrJrJrJrJrJrJrJrJr  SS	KJr  S
SKJr  S
SKJrJrJr  S
SKJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)   " S S\5      r* " S S\5      r+ " S S\5      r, " S S\5      r- " S S\5      r. " S S\5      r/ " S S\5      r0 " S S\5      r1 " S S\5      r2 " S  S!\5      r3 " S" S#\5      r4 " S$ S%\5      r5S'S& jr6g)(zSTIX 2.0 Domain Objects.    )OrderedDictN)run_validator   )_custom_object_builder)InvalidValueError)BooleanProperty
IDPropertyIntegerPropertyListPropertyObservablePropertyOpenVocabPropertyPatternPropertyReferencePropertyStringPropertyTimestampPropertyTypePropertyNOW   )_DomainObject)ExternalReferenceGranularMarkingKillChainPhase)ATTACK_MOTIVATIONATTACK_RESOURCE_LEVELIDENTITY_CLASSINDICATOR_LABELINDUSTRY_SECTORMALWARE_LABELREPORT_LABELTHREAT_ACTOR_LABELTHREAT_ACTOR_ROLETHREAT_ACTOR_SOPHISTICATION
TOOL_LABELc                      \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\" \5      4S\" S S94S\" \5      4S\" \5      4S\" \	" SSS
95      4S\" \5      4/5      rSrg) AttackPattern   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714302>`__.
zattack-patterntype2.0spec_versionidcreated_by_refidentityvalid_typesr+   createdc                      [         $ Nr        G/home/james-whalen/.local/lib/python3.13/site-packages/stix2/v20/sdo.py<lambda>AttackPattern.<lambda>#       cr5   milliseconddefault	precisionmodifiedc                      [         $ r3   r   r4   r5   r6   r7   r8   $       sr5   nameTrequireddescriptionkill_chain_phasesrevokedc                      gNFr4   r4   r5   r6   r7   r8   (       Er5   r<   labelsexternal_referencesobject_marking_refsmarking-definitiongranular_markingsr4   N)__name__
__module____qualname____firstlineno____doc___typer   r   r	   r   r   r   r   r   r   r   r   _properties__static_attributes__r4   r5   r6   r&   r&      s     E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	l>:;	OM:;	</0	-> ?@	->K_ns-t uv	l?;< Kr5   r&   c                   B   \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\" \5      4S\
" 5       4S\
" 5       4S\" 5       4S\" S S94S\" \5      4S\" \5      4S\" \	" SSS
95      4S \" \5      4/5      rS!rg")#Campaign0   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714305>`__.
campaignr(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   Campaign.<lambda>:   r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r]   ;   r@   r5   rA   TrB   rD   aliases
first_seen	last_seen	objectiverF   c                      grH   r4   r4   r5   r6   r7   r]   B   rI   r5   rJ   rK   rL   rM   rN   rO   r4   N)rP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r   r   r   r   r   rV   rW   r4   r5   r6   rY   rY   0   s     E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	L01	(*+	')*	n&'	OM:;	</0	-> ?@	->K_ns-t uv	l?;<! Kr5   rY   c                       \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\" S S94S\" \5      4S\" \5      4S\" \	" SSS
95      4S\" \5      4/5      rSrg)CourseOfActionJ   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714308>`__.
zcourse-of-actionr(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   CourseOfAction.<lambda>T   r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   rh   U   r@   r5   rA   TrB   rD   rF   c                      grH   r4   r4   r5   r6   r7   rh   X   rI   r5   rJ   rK   rL   rM   rN   rO   r4   NrP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r   r   r   r   r   rV   rW   r4   r5   r6   re   re   J   s     E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	OM:;	</0	-> ?@	->K_ns-t uv	l?;< Kr5   re   c                   >   \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" SSS	94S
\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\" \SS94S\" \" \5      5      4S\" 5       4S\" S S94S\" \5      4S\" \5      4S\" \	" SSS	95      4S\" \5      4/5      rSrg )!Identity`   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714311>`__.
r.   r(   r)   r*   r,   r-   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   Identity.<lambda>j   r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   rp   k   r@   r5   rA   TrB   rD   identity_classsectorscontact_informationrF   c                      grH   r4   r4   r5   r6   r7   rp   q   rI   r5   rJ   rK   rL   rM   rN   rO   r4   N)rP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r   r   r   r   r   r   r   r   rV   rW   r4   r5   r6   rm   rm   `   s     E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	,^dKL	L!2?!CDE	 01	OM:;	</0	-> ?@	->K_ns-t uv	l?;< Kr5   rm   c                   R   \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" 5       4S\" 5       4S\" SS94S\
" S S94S\
" 5       4S\" \5      4S\" S S94S\" \" \5      SS94S\" \5      4S\" \	" S SS
95      4S!\" \5      4/5      rS" rS#rg$)%	Indicatory   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714314>`__.
	indicatorr(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   Indicator.<lambda>   r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r{      r@   r5   rA   rD   patternTrB   
valid_fromc                      [         $ r3   r   r4   r5   r6   r7   r{      s    r5   rJ   valid_untilrE   rF   c                      grH   r4   r4   r5   r6   r7   r{      rI   r5   rK   rL   rM   rN   rO   c                     [        U R                  S5      S5      nU(       a#  [        U R                  S[	        US   5      5      eg )Nr}   r)   r   )r   getr   	__class__str)selferrorss     r6   _check_object_constraints#Indicator._check_object_constraints   s:    txx	2E:#DNNIs6!9~NN r5   r4   N)rP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r   r   r   r   r   r   r   r   r   rV   r   rW   r4   r5   r6   rw   rw   y   s    E	e%89	z%e45	,RWXY	%k]ST	&{mTU	!"	()	OT23	(=>	)+,	l>:;	OM:;	< 1/ BTRS	-> ?@	->K_ns-t uv	l?;<! K&Or5   rw   c                      \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\" \5      4S\
" 5       4S\
" 5       4S\" \5      4S\" 5       4S\" \5      4S\" \" \5      5      4S\" S S94S\" \5      4S \" \5      4S!\" \	" S"SS
95      4S#\" \5      4/5      rS$rg%)&IntrusionSet   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714317>`__.
zintrusion-setr(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   IntrusionSet.<lambda>   r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r      r@   r5   rA   TrB   rD   r_   r`   ra   goalsresource_levelprimary_motivationsecondary_motivationsrF   c                      grH   r4   r4   r5   r6   r7   r      rI   r5   rJ   rK   rL   rM   rN   rO   r4   N)rP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r   r   r   r   r   r   r   rV   rW   r4   r5   r6   r   r      s0    E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	L01	(*+	')*	,~./	>+,	01BCD	 ,/@AR/S"TU	OM:;	</0	-> ?@	->K_ns-t uv	l?;<' Kr5   r   c                      \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\" \5      4S\" S S94S\" \" \5      SS94S\" \5      4S\" \	" SSS
95      4S\" \5      4/5      rSrg) Malware   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714320>`__.
malwarer(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   Malware.<lambda>   r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r      r@   r5   rA   TrB   rD   rE   rF   c                      grH   r4   r4   r5   r6   r7   r      rI   r5   rJ   rK   rL   rM   rN   rO   r4   N)rP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r   r   r   r   r   r   r   r   rV   rW   r4   r5   r6   r   r      s     E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	l>:;	OM:;	< 1- @4PQ	-> ?@	->K_ns-t uv	l?;< Kr5   r   c                       \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\
" SS94S\
" SS94S\" SSSS94S\" SSS94S\" S S94S\" \5      4S\" \5      4S \" \	" S!SS
95      4S"\" \5      4/5      rS#rg$)%ObservedData   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714323>`__.
zobserved-datar(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   ObservedData.<lambda>   r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r      r@   r5   first_observedTrB   last_observednumber_observedr   iɚ;)minmaxrC   objects)r+   rC   rF   c                      grH   r4   r4   r5   r6   r7   r      rI   r5   rJ   rK   rL   rM   rN   rO   r4   N)rP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r
   r   r   r   r   r   r   rV   rW   r4   r5   r6   r   r      s     E	e%89	z%e45	,RWXY	%k]ST	&{mTU	,d;<	+T:;	Oy4PQ	&EDIJ	OM:;	</0	-> ?@	->K_ns-t uv	l?;< Kr5   r   c                   6   \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\
" SS94S\" \	" / SQSS
9SS94S\" S S94S\" \" \5      SS94S\" \5      4S\" \	" SSS
95      4S\" \5      4/5      rS rg!)"Report   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714326>`__.
reportr(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   Report.<lambda>   r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r      r@   r5   rA   TrB   rD   	publishedobject_refs)SCOSDOSROrF   c                      grH   r4   r4   r5   r6   r7   r      rI   r5   rJ   rK   rL   rM   rN   rO   r4   N)rP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r   r   r   r   r    r   r   rV   rW   r4   r5   r6   r   r      s     E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	'67	%6CXgl%mx|}~	OM:;	< 1, ?$OP	-> ?@	->K_ns-t uv	l?;< Kr5   r   c                      \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\" \5      4S\" \" \5      5      4S\" \5      4S\" \5      4S\" \5      4S\" \5      4S\" \" \5      5      4S\" \" \5      5      4S\" S S94S \" \" \5      SS94S!\" \5      4S"\" \	" S#SS
95      4S$\" \5      4/5      rS%rg&)'ThreatActor   zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714329>`__.
zthreat-actorr(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   ThreatActor.<lambda>  r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r     r@   r5   rA   TrB   rD   r_   rolesr   sophisticationr   r   r   personal_motivationsrF   c                      grH   r4   r4   r5   r6   r7   r     rI   r5   rJ   rK   rL   rM   rN   rO   r4   N)rP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r   r   r   r"   r#   r   r   r   r!   r   r   rV   rW   r4   r5   r6   r   r      s]    E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	L01	,01BCDE	,~./	,-HIJ	,-BCD	01BCD	 ,/@AR/S"TU	.?@Q.R!ST	OM:;	< 12D EPTUV	-> ?@	->K_ns-t uv	l?;<) Kr5   r   c                   ,   \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\" \5      4S\" 5       4S\" S S94S\" \" \5      SS94S\" \5      4S\" \	" SSS
95      4S\" \5      4/5      rSrg )!Tooli  zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714332>`__.
toolr(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   Tool.<lambda>$  r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r   %  r@   r5   rA   TrB   rD   rE   tool_versionrF   c                      grH   r4   r4   r5   r6   r7   r   *  rI   r5   rJ   rK   rL   rM   rN   rO   r4   N)rP   rQ   rR   rS   rT   rU   r   r   r	   r   r   r   r   r   r   r   r$   r   r   rV   rW   r4   r5   r6   r   r     s     E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	l>:;	)*	OM:;	< 1* =MN	-> ?@	->K_ns-t uv	l?;< Kr5   r   c                       \ rS rSrSrSr\" S\" \SS94S\" \SS94S\	" S	SS
94S\
" S SS94S\
" S SS94S\" SS94S\" 5       4S\" S S94S\" \5      4S\" \5      4S\" \	" SSS
95      4S\" \5      4/5      rSrg)Vulnerabilityi2  zFor more detailed information on this object's properties, see
`the STIX 2.0 specification <http://docs.oasis-open.org/cti/stix/v2.0/cs01/part2-stix-objects/stix-v2.0-cs01-part2-stix-objects.html#_Toc496714335>`__.
vulnerabilityr(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   Vulnerability.<lambda><  r9   r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r   =  r@   r5   rA   TrB   rD   rF   c                      grH   r4   r4   r5   r6   r7   r   @  rI   r5   rJ   rK   rL   rM   rN   rO   r4   Nrk   r4   r5   r6   r   r   2  s     E	e%89	z%e45	,RWXY	%k]ST	&{mTU	./	()	OM:;	</0	-> ?@	->K_ns-t uv	l?;< Kr5   r   c                    ^ ^ UU 4S jnU$ )a  Custom STIX Object type decorator.

Example:
    >>> from stix2.v20 import CustomObject
    >>> from stix2.properties import IntegerProperty, StringProperty
    >>> @CustomObject('x-type-name', [
    ...     ('property1', StringProperty(required=True)),
    ...     ('property2', IntegerProperty()),
    ... ])
    ... class MyNewObjectType():
    ...     pass

Supply an ``__init__()`` function to add any special validations to the custom
type. Don't call ``super().__init__()`` though - doing so will cause an error.

Example:
    >>> from stix2.v20 import CustomObject
    >>> from stix2.properties import IntegerProperty, StringProperty
    >>> @CustomObject('x-type-name', [
    ...     ('property1', StringProperty(required=True)),
    ...     ('property2', IntegerProperty()),
    ... ])
    ... class MyNewObjectType():
    ...     def __init__(self, property2=None, **kwargs):
    ...         if property2 and property2 < 10:
    ...             raise ValueError("'property2' is too small.")

c                 d  > [        [        R                  R                  S[	        TSS94S[        TSS94S[        SSS94S[        S	 S
S94S[        S S
S94/T Vs/ s H  oS   R                  S5      (       a  M  UPM!     snS[        S S94S[        [        5      4S[        [        5      4S[        [        SSS95      4S[        [        5      4/[        T Vs/ s H  oS   R                  S5      (       d  M  UPM!     snS S9/5      5      n[        U TUS[         5      $ s  snf s  snf )Nr(   r)   r*   r,   r-   r.   r/   r1   c                      [         $ r3   r   r4   r5   r6   r7   /CustomObject.<locals>.wrapper.<locals>.<lambda>l  s    #r5   r:   r;   r>   c                      [         $ r3   r   r4   r5   r6   r7   r   m  s    3r5   r   x_rF   c                      grH   r4   r4   r5   r6   r7   r   q  s    r5   rJ   rK   rL   rM   rN   rO   c                     U S   $ )Nr   r4   )xs    r6   r7   r   w  s    WXYZW[r5   )key)list	itertoolschainfrom_iterabler   r	   r   r   
startswithr   r   r   r   r   sortedr   r   )clsr   rV   
propertiesr(   s      r6   wrapperCustomObject.<locals>.wrappere  s>   OO))\$UCD:d?@%'8Z^c'de 1+Q^ _`!2;R_!`a 'DJqdood.CJD FG|N;<*L9J,KL*L9JWkz  :A  -B  C(,*GH :G:a11F:G^\!+ 
( &c4e]SS E Hs   D(>D(D-?D-r4   )r(   r   r   s   `` r6   CustomObjectr   H  s    :T, Nr5   )zx-custom-typeN)7rT   collectionsr   r   stix2patterns.validatorr   customr   
exceptionsr   r   r   r	   r
   r   r   r   r   r   r   r   r   utilsr   baser   commonr   r   r   vocabr   r   r   r   r   r   r    r!   r"   r#   r$   r&   rY   re   rm   rw   r   r   r   r   r   r   r   r   r4   r5   r6   <module>r      s     #  1 + *   
   F F   M .} 4] ,} 2O O>= :m .= 0] 0- <= 0M ,3r5   