Giter Club home page Giter Club logo

Comments (5)

ChrisMeenan avatar ChrisMeenan commented on September 16, 2024

Hi,

checkout this script here

https://github.com/ibm-security-intelligence/data-import/blob/master/assets/update_assets.py

It updates assets from a .csv file using the same rest end point

essentially you can update any asset field returned by the "asset_model/properties endpoint". That includes all the 'out of the box' asset fields, as well as any custom ones you add.

The key thing to note is that you need to use the id of the property in the update, not the name.

e.g. this body updates the business owner of an asset

{
"properties": [
{
"type_id": 1006,
"value": "Chris Meenan"
}
]
}

Chris

from api-samples.

makefu avatar makefu commented on September 16, 2024

thanks, what the API expects as input structure was what i was looking for.
I looked at the data importer and imho building json with string concatination is a very bad habit.
it would be much cleaner to understand and use
json.dumps({'properties':[ {'type_id': 1006, 'value': 'Chris Meenan' }]})

Is it possible to update other fields which are not properties, like interfaces or the mac address?
Too bad the REST API is not very verbose when it comes to invalid input ... :)

from api-samples.

ChrisMeenan avatar ChrisMeenan commented on September 16, 2024

thanks,

the structure of the input is also outlined in the online API documentation available at https:///restapi/doc. If you open the end point and click on the 'View' link you will see a sample for each parameter. I just copied and pasted that and inserted a couple of examples as above.
screenhunter_461 oct 22 09 50

I think they could be more verbose, but thankfully the data structures are pretty straightforward.

Currently the asset API only accepts properties returned by the properties end point, but we do want to expand it to include MACs, interfaces and IPs. Those can be feed in via identity events into QRAdar, but I do admit via the API would be much better (in this instance!).

from api-samples.

makefu avatar makefu commented on September 16, 2024

In the previous version of Qradar the sample was not very helpful and stated for the sample something like this: {'key1' :'value1'} which was not really helpful. I am glad this changed :D

For me (QRadar v7.2.3 Build 918945) the api for /asset_model//properties returns nothing, but of course i can just fill an asset with all the data available and check out what /asset_model/assets returns.

Thanks for the support, it still would be great if this repository has an example for updating an asset :) or at least a link to the repository you mentioned before.

from api-samples.

makefu avatar makefu commented on September 16, 2024

i hope that qradar will have an 'asset insert' soon :)

from api-samples.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.