Skip to content
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

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

helene-nguyen
Copy link
Member

@helene-nguyen helene-nguyen commented Jan 21, 2025

Proposed changes

  • Add playbook compatibility and handle bundle when STIX objects is not in scope defined
  • URL analysis submission support
  • Remove confidence_level inf configuration files as it is not used anymore since OpenCTI version >= 6.0.0

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

@helene-nguyen helene-nguyen added the filigran team use to identify PR from the Filigran team label Jan 21, 2025
@helene-nguyen helene-nguyen self-assigned this Jan 21, 2025
@helene-nguyen helene-nguyen linked an issue Jan 30, 2025 that may be closed by this pull request
Copy link
Member

@Megafredo Megafredo left a 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."                         <<<<<<<<<<

@helene-nguyen helene-nguyen force-pushed the feat/2931-hatching-triage branch from 2892eb0 to 8d83bf5 Compare February 3, 2025 15:09
@helene-nguyen
Copy link
Member Author

@Megafredo Thanks a lot for your feedback ✨

For point 1, it will be added in the documentation, other points is corrected :)

Copy link
Member

@Megafredo Megafredo left a 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 !

@helene-nguyen helene-nguyen merged commit d66b0f5 into master Feb 3, 2025
4 checks passed
@helene-nguyen helene-nguyen deleted the feat/2931-hatching-triage branch February 3, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Hatching Triage] URL analysis support + Playbook compatibility
2 participants