cvahid / tcex-utility

Utility functions using the TcEx package (https://github.com/ThreatConnect-Inc/tcex).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TCEX Utility

Utility for TCEX.

Usage

Coming soon...

Examples

Creating Content from Symbolic Structure

This example will create the following objects 10 times:

A signature, document, incident, and file. The signature will be associated with the document and the incident. The document will be associated with the incident and the file. The incident will be associated with the file.

from tcex_elements import Elements
u = Elements('testing-lab')
u.create_from_symbolic_pattern('sig=doc=inc-file', 10)
u.process()

Get Indicators by Type

from tcex_elements import Elements
u = Elements('testing-lab')
a = u.get_indicators('Address')
print(len(a))

Get Items with a Given Attribute

from tcex_molecules import Molecules
u = Molecules('testing-lab')
a = u.get_items_by_attribute({"type": "Description", "value": "this is just a test"}, 'Address')

Add Attribute to Items with a Given Attribute

from tcex_molecules import Molecules
u = Molecules('testing-lab')
a = u.add_attributes_to_items_by_attribute([{"type": "Description", "value": "New attribute"}], 'Address', {"type": "Description", "value": "this is just a test"})

Add Attributes to Items with a Given Tag

from tcex_molecules import Molecules
u = Molecules('testing-lab')
a = u.add_attributes_to_items_by_tag([{"type": "Description", "value": "this is just a test"}], 'Address', 'Test Tag')

Credits

This package was created with Cookiecutter and fhightower's Python project template.

About

Utility functions using the TcEx package (https://github.com/ThreatConnect-Inc/tcex).

License:MIT License


Languages

Language:Python 92.0%Language:Makefile 8.0%