-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Hatching Triage Sandbox] URL analysis support + Playbook compatibility #3324
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed 3 small points, they are side effects but no problems with your code, great job !
01 - The first point is that the urls are accepted and sometimes we find some with ‘?’, which results in a 400 INVALID QUERY error from the sorting client.
02 - We need to update the relationship_type a little if the entity_type is a url.
for ttp in ttps:
attack_pattern = stix2.AttackPattern(
id=AttackPattern.generate_id(name, ttp),
created_by_ref=self.identity,
name=name,
custom_properties={
"x_mitre_id": ttp,
},
object_marking_refs=[stix2.TLP_WHITE],
allow_custom=True,
)
<<<<<<<<<<<<<<<<<<<<<<<<
relationship_type = (
"uses" if entity_type == "artifact" else "related-to"
)
<<<<<<<<<<<<<<<<<<<<<<<<
relationship = stix2.Relationship(
id=StixCoreRelationship.generate_id(
relationship_type, observable["standard_id"], attack_pattern.id <<<<<<<<<<
),
relationship_type=relationship_type,
created_by_ref=self.identity,
source_ref=observable["standard_id"],
target_ref=attack_pattern.id,
object_marking_refs=[stix2.TLP_WHITE],
allow_custom=True,
)
03 - Add a little end message for the front end when it's a success ! xD
# Serialize and send all bundles
if bundle_objects:
self._send_bundle(bundle_objects)
return "Enrichment has been achieved." <<<<<<<<<<
2892eb0
to
8d83bf5
Compare
@Megafredo Thanks a lot for your feedback ✨ For point 1, it will be added in the documentation, other points is corrected :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok for me ;), good job !
Proposed changes
Related issues
Checklist
Further comments