graphsense / graphsense-python

A Python client for the GraphSense REST interface.
MIT License
19 stars 3 forks source link

Discrepancies in the logic for querying on Attribution Tags and possible bug in "list_tags_by_address" #21

Closed VinceICPO closed 1 year ago

VinceICPO commented 2 years ago

The AddressesApi still mentions the option to return tags in the query result.
It says "Get an address, optionally with tags # noqa: E501"
However, the 'include_tags = True' Keyword Argument has disappeared.

Instead, it seems we are meant to use the "list_tags_by_address" but for me this throws an exception (See 3 below)

However,

  1. this option to return tags is still included in the API 'list_address_neighbours' via the Keyword Argument 'include_labels = True'. I have not yet tested if this returns a "best_address_tag" or an exhaustive list of tags??
  2. the API 'get_address_entity' returns one (and only one) tag (this isn't optional, it always does). The result is in "best_address_tag". Which raises another question: from a judicial investigation perspective, we would be better off with a list of tags and tags_sources so we may conduct our own confirmations and cross-checks on the different sources.
  3. for me the API 'list_tags_by_address' unfortunately isn't functional and throws an exception due to a missing positional argument 'active' in "model_utils.py", line 1753, in get_allof_instances. Error: Invalid inputs given to generate an instance of 'Tag'. The input data was invalid for the allOf schema 'Tag' in the composed schema 'AddressTag'. Error=init() missing 1 required positional argument: 'active' Traceback (most recent call last): File "/Users/xxxx/GraphSense/graphsense/model_utils.py", line 1750, in get_allof_instances allof_instance = allof_class(model_args, constant_args)
myrho commented 2 years ago

Hi! Thank you for reporting back issues! Please excuse my late reply.

myrho commented 2 years ago

Hi again, regarding (3): Probably it's not a bug but your client being outdated. Please make sure you are using the recent version of graphsense-python (1.0.1):

$ pip show graphsense-python
Name: graphsense-python
Version: 1.0.1
Summary: GraphSense API
...
VinceICPO commented 1 year ago

Hi Matthias,

Finally found time to look into this. It isn't a bug indeed. Running graphsense-python(1.0.1) works.

Fixing the searches for attribution tags required a lot of work but both list_tags_by_address and list_address_tags_by_entity are now implemented in our Maltego transforms for Graphsense.