MaltegoTech / maltego-trx

Maltego Transform library for Python
MIT License
218 stars 45 forks source link

How to set properties on created entities? #47

Closed TheEnjinia closed 10 months ago

TheEnjinia commented 1 year ago

Maybe this is obvious, but I am not seeing a way in the documentation and in the examples to set the properties of an entity. For example setting the value for the Person entity, the "Value" property can be manipulated, which is apparently the "Full Name" property, but to me there is no apparent way to manipulate "Surname" and "First Names"

How can this be achieved?

tendai-zw commented 1 year ago

You can do it as follows:

    person_entity = MaltegoEntity(type="maltego.Person", value="John Doe")`
    person_entity.addProperty(fieldName="other_name", displayName="Other Name", matchingRule="loose", value="XYZ Name")
     person_entity.addProperty(fieldName="first_names", displayName="First Names", matchingRule="loose", value="John GI")
     person_entity.addProperty(fieldName="surname", displayName="Surname", matchingRule="loose", value="Joe")

the code reference is here - https://github.com/MaltegoTech/maltego-trx/blob/b0c3eae5f304a1c16a68aa1d3406981ac373420d/maltego_trx/maltego.py#L88

You can refer to example Transforms here:

crest42 commented 10 months ago

Hey @TheEnjinia. Does this work for you? Closing the Issue for now but happy to reopen if things are still unclear.