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

Xdr isolation and un-isolation warning on disconnected endpoint #14751

Merged
merged 24 commits into from
Sep 30, 2021

Conversation

abaumgarten
Copy link
Contributor

@abaumgarten abaumgarten commented Sep 5, 2021

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

related: https://github.com/demisto/etc/issues/23083
related: #14505

Description

Added a new argument for both isolation and un-isolation actions in order to know if the user wants to get back an error if the endpoint is disconnected. The default is an error. Otherwise, a warning will be returned.

Screenshots

image
image
image

Does it break backward compatibility?

  • Yes
    • Further details:
  • No

Must have

  • Tests
  • Documentation

@abaumgarten abaumgarten self-assigned this Sep 5, 2021
@abaumgarten abaumgarten marked this pull request as ready for review September 5, 2021 10:30
Copy link
Member

@bakatzir bakatzir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please consider renaming the arg to the suggested. I did not review the code.

description: Whether return an error when trying to isolate a disconnected endpoint.
When sets to false, a warnning will be returned.
isArray: false
name: disconnected_endpoint_should_return_error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: disconnected_endpoint_should_return_error
name: suppress_disconnected_endpoint_error

- auto: PREDEFINED
default: false
defaultValue: 'True'
description: Whether return an error when trying to isolate a disconnected endpoint.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Whether return an error when trying to isolate a disconnected endpoint.
description: Whether to return an error when trying to isolate a disconnected endpoint.

description: Whether return an error when trying to unisolate a disconnected
endpoint. When sets to false, a warnning will be returned.
isArray: false
name: disconnected_endpoint_should_return_error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: disconnected_endpoint_should_return_error
name: suppress_disconnected_endpoint_error

- auto: PREDEFINED
default: false
defaultValue: 'True'
description: Whether return an error when trying to unisolate a disconnected
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Whether return an error when trying to unisolate a disconnected
description: Whether to return an error when trying to unisolate a disconnected


#### Integrations
##### Palo Alto Networks Cortex XDR - Investigation and Response
- Added an argument for the **xdr-isolate-endpoint** and **xdr-unisolate-endpoint** commands whether or not to return an error when the endpoint is disconnected.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Added an argument for the **xdr-isolate-endpoint** and **xdr-unisolate-endpoint** commands whether or not to return an error when the endpoint is disconnected.
- Added the *suppress_disconnected_endpoint_error* argument for the ***xdr-isolate-endpoint*** and the ***xdr-unisolate-endpoint*** commands which dictates whether to return an error when the endpoint is disconnected.

@abaumgarten
Copy link
Contributor Author

@yuvalbenshalom can you review this, please?

Copy link
Contributor

@yuvalbenshalom yuvalbenshalom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comments

@@ -789,6 +789,18 @@ script:
name: endpoint_id
required: true
secret: false
- auto: PREDEFINED
default: false
defaultValue: 'True'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defaultValue: 'True'
defaultValue: 'true'

@@ -805,6 +817,18 @@ script:
name: endpoint_id
required: true
secret: false
- auto: PREDEFINED
default: false
defaultValue: 'True'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defaultValue: 'True'
defaultValue: 'true'

@@ -1881,7 +1881,7 @@ def insert_cef_alerts_command(client, args):

def isolate_endpoint_command(client, args):
endpoint_id = args.get('endpoint_id')

disconnected_should_return_error = argToBoolean(args.get('suppress_disconnected_endpoint_error', True))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
disconnected_should_return_error = argToBoolean(args.get('suppress_disconnected_endpoint_error', True))
disconnected_should_return_error = not argToBoolean(args.get('suppress_disconnected_endpoint_error', False))

while it is correct that if suppress_disconnected_endpoint_error does not exist, then disconnected_should_return_error should be true,
if uppress_disconnected_endpoint_error exists, disconnected_should_return_error should get the opposite value of it.

@@ -1922,7 +1928,7 @@ def isolate_endpoint_command(client, args):

def unisolate_endpoint_command(client, args):
endpoint_id = args.get('endpoint_id')

disconnected_should_return_error = argToBoolean(args.get('suppress_disconnected_endpoint_error', True))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
disconnected_should_return_error = argToBoolean(args.get('suppress_disconnected_endpoint_error', True))
disconnected_should_return_error = not argToBoolean(args.get('suppress_disconnected_endpoint_error', False))

# Conflicts:
#	Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py
#	Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.yml
#	Packs/CortexXDR/Integrations/CortexXDRIR/README.md
@abaumgarten abaumgarten merged commit 7b45527 into master Sep 30, 2021
@abaumgarten abaumgarten deleted the xdr_isolavtion_warning branch September 30, 2021 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants