google / timesketch

Collaborative forensic timeline analysis
Apache License 2.0
2.58k stars 589 forks source link

correct paramters in cli attributes method #2863

Closed jaegeral closed 1 year ago

jaegeral commented 1 year ago

The current way of cli is causing a wrong attribute to be added:

./timesketch.par --sketch 123 --output-format text sketch attributes add --name foo --ontology intelligence --value bar
Attribute added:
Name: foo
Ontology: intelligence
Value: bar
❯ ./timesketch.par --sketch 123 --output-format json sketch attributes list
{
    "foo": {
        "ontology": "bar",
        "value": "intelligence"
    },
    "intelligence": {
        "ontology": "intelligence",
        "value": {
            "data": [
                {
                    "externalURI": "aaaa",
                    "ioc": "foo",
                    "tags": [],
                    "type": "other"
                }
            ]
        }
    }
}

This is the header of the function that is called: def add_attribute(self, name, value, ontology="text"):

This PR fixes that and writes the correct values.

Closing issues closes #2862