Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update alert using 'fields' is not working #130

Closed
mgabriel-silva opened this issue Aug 26, 2019 · 0 comments
Closed

Update alert using 'fields' is not working #130

mgabriel-silva opened this issue Aug 26, 2019 · 0 comments
Assignees
Milestone

Comments

@mgabriel-silva
Copy link

Request Type

Bug

Work Environment

Question Answer
TheHive4py version / git hash 1.5.1

Problem Description

When using 'fields' to update only 'customFields', it's updating other fields as well.

Steps to Reproduce

  1. Create an Alert with no artifacts based on an existing alert (I'm using object from thehivehooks)
alert = Alert(
        title = event['object'].get('title', ''),
        type = event['object'].get('type', ''),
        source = event['object'].get('source', ''),
        sourceRef = event['object'].get('sourceRef', ''),
        description = event['object'].get('description', ''),
        customFields = event['object'].get('customFields', {}))
  1. Add customFields to the alert
    alert.customFields['test'] = {"string": 'Test'}

  2. Update the alert. (Only the customFields)
    the_hive_api.update_alert(event['object']['id'], alert, fields=['customFields'])

  3. The artifacts from the alert were deleted.

Complementary information

I have to create the alert without using 'json=', because it has file observables.
Thehive4py does not support file artifacts yet in 'json='. Even so, downloading and resending files is not efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants