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

EWS - Adding O365 Tenant Allow/Block List Management #19103

Conversation

mikejrizzo
Copy link
Contributor

Contributing to Cortex XSOAR Content

Make sure to register your contribution by filling the contribution registration form

The Pull Request will be reviewed only after the contribution registration form is filled.

Status

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

Related Issues

No related issues.

Description

This pull request adds additional commands to the "EWS Extension Online Powershell v2" to allow management of O365 Tenant Allow/Block Lists. This O365 feature allows for simple tenant-wide blocking or allowing of things such as email senders, file hashes, and URLs. This feature is managed using the same PowerShell module already incorporated into the integration.

Existing functionality of this integration is not changed. This contribution only adds new functionality.

Official documentation of this O365 feature can be found here: https://docs.microsoft.com/en-us/microsoft-365/security/office-365-security/tenant-allow-block-list?view=o365-worldwide

Screenshots

Paste here any images that will help the reviewer

Minimum version of Cortex XSOAR

  • 5.5 or later - same as the current published version of this integration.

Does it break backward compatibility?

  • Yes
    • Further details:
  • [ X ] No

Must have

  • Tests (Published integration contains no tests)
  • [ X ] Documentation

@content-bot content-bot added the Contribution Thank you! Contributions are always welcome! label May 18, 2022
@content-bot content-bot changed the base branch from master to contrib/mikejrizzo_contrib/mikerizzo_ews May 18, 2022 16:10
@content-bot
Copy link
Collaborator

Thank you for your contribution. Your generosity and caring are unrivaled! Make sure to register your contribution by filling the Contribution Registration form, so our content wizard @ShacharKidor will know he can start review the proposed changes.

@content-bot content-bot added Community Contribution Form Filled Whether contribution form filled or not. labels May 18, 2022
@content-bot
Copy link
Collaborator

The CircleCI check from your latest pushed commit was unsuccessful. @mikejrizzo take a look at the build by clicking this link.


Failed Build Steps

  • Validate Files and Yaml

Try and address the listed CircleCI build step failures at your earliest convenience. This will greatly expedite the process of getting your proposed changes merged into master. Happy coding and may the force be with you.

@content-bot
Copy link
Collaborator

The CircleCI build failed again. @mikejrizzo take a look at the build details here - and try and fix the issues so that we can merge your proposed changes as soon as possible.


Failed Build Steps

  • Validate Files and Yaml

@ShacharKidor ShacharKidor removed their request for review May 22, 2022 13:03
@ShacharKidor ShacharKidor removed their assignment May 22, 2022
@Noy-Maimon Noy-Maimon requested a review from yaakovi May 25, 2022 07:50
Comment on lines 9 to 12


---
[View Integration Documentation](https://xsoar.pan.dev/docs/reference/integrations/ews-extension-online-powershell-v2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove (This is added automatically when publishing to the marketplace)

Suggested change
---
[View Integration Documentation](https://xsoar.pan.dev/docs/reference/integrations/ews-extension-online-powershell-v2)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this was added by one of the demisto-sdk commands I ran to format and validate files, but I've manually removed it.

Done.

arguments:
- name: entries
required: true
description: Entries to add to the list. Separate multiple entries with a comma (e.g. "Item1,Item2").
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
description: Entries to add to the list. Separate multiple entries with a comma (e.g. "Item1,Item2").
description: A comma-separated list of entries to add to the list (e.g. "Item1,Item2").

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

predefined:
- Tenant
- AdvancedDelivery
description: 'List subtype to add items to. '
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
description: 'List subtype to add items to. '
description: List subtype to add items to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

- name: notes
description: Notes to include on new list entries
- name: expiration_date
description: Enter a specific date and time for the new entries to expire using format "YYYY-MM-DD HH:MM:SSz" for UTC time. Alternately, a PowerShell **GetDate** statement can be used.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the ISO format (YYYY-MM-DDTHH:MM:SSZ) instead? We are using it across the product.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The time format I used came from the Microsoft documentation for this Powershell cmdlet, however I tested the command with ISO formatting and that works as well. I'm updating the field description to specify to use ISO format.

Done.

- Allow
description: Action to filter entries by.
- name: expiration_date
description: Enter a specific date and time to filter entries by using format "YYYY-MM-DD HH:MM:SSz" for UTC time. Alternately, a PowerShell **GetDate** statement can be used.
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

$ids = $kwargs.ids
$list_type = $kwargs.list_type
$list_subtype = $kwargs.list_subtype
if ($entries -and $ids)
Copy link
Contributor

Choose a reason for hiding this comment

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

What if not are passed?

Comment on lines 686 to 690
if ($kwargs.set_context -eq "yes")
{
$entry_context = @{ "$script:INTEGRATION_ENTRY_CONTEXT.RemovedTenantBlocks" = $raw_response }
Write-Output $human_readable, $entry_context, $raw_response
}
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to write to context on "delete" commands

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is intended to allow storing a list of deleted items for later confirmation in playbooks/scripts that deletion was successful. I would suggest keeping this here unless it cannot be included.

$entries, $list_type, $list_subtype, $action, $notes, $no_expiration, $expiration_date
)
$human_readable = TableToMarkdown $raw_response "Results of $command"
if ($kwargs.set_context -eq "yes")
Copy link
Contributor

Choose a reason for hiding this comment

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

The command should always set the context.

$entry, $list_type, $list_subtype, $action, $no_expiration, $expiration_date
)
$human_readable = TableToMarkdown $raw_response "Results of $command"
if ($kwargs.set_context -eq "yes")
Copy link
Contributor

Choose a reason for hiding this comment

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

The command should always set the context.

@mikejrizzo mikejrizzo requested review from a team and michalgold as code owners June 6, 2022 23:40
@CLAassistant
Copy link

CLAassistant commented Jun 6, 2022

CLA assistant check
All committers have signed the CLA.

@mikejrizzo
Copy link
Contributor Author

@yaakovi I've pushed the various changes we discussed in our meeting on Tuesday. Please let me know if you have any further questions or items I need to look at.

Thanks!

@ShahafBenYakir ShahafBenYakir removed the request for review from a team June 8, 2022 22:22
@yaakovi yaakovi self-requested a review June 14, 2022 05:31
@yaakovi yaakovi merged commit 9114c6c into demisto:contrib/mikejrizzo_contrib/mikerizzo_ews Jun 14, 2022
yaakovi added a commit that referenced this pull request Jun 14, 2022
* Added new commands to retrieve/modify Tenant Allow/Block Lists.  Initial working version.

* Restoring Readme content deleted accidentally

* Tweaked description on command ews-get-tenant-allow-block-list-items

* Updated pack documentation with new release notes and readme content for new commands.

* Added command output definitions for added commands and incremented integration version number.

* Added contributors.md file to pack.

* Fixed issues found by YAML validation.

* Fixed validation issue in release notes md file.

* Added mention of Tenant Allow/Block List management features.

* Removing set-context arguments and related code

* Removed references to set_context argument.

* Removed duplicated contributor section.

* Removed duplicated contributor section.

Co-authored-by: Mike Rizzo <mjrizzo@gmail.com>
Co-authored-by: yaakovi <syaakovi@paloaltonetworks.com>
PierrickV pushed a commit to SEKOIA-IO/Cortex-XSOAR-integration that referenced this pull request Jul 11, 2022
…emisto#19554)

* Added new commands to retrieve/modify Tenant Allow/Block Lists.  Initial working version.

* Restoring Readme content deleted accidentally

* Tweaked description on command ews-get-tenant-allow-block-list-items

* Updated pack documentation with new release notes and readme content for new commands.

* Added command output definitions for added commands and incremented integration version number.

* Added contributors.md file to pack.

* Fixed issues found by YAML validation.

* Fixed validation issue in release notes md file.

* Added mention of Tenant Allow/Block List management features.

* Removing set-context arguments and related code

* Removed references to set_context argument.

* Removed duplicated contributor section.

* Removed duplicated contributor section.

Co-authored-by: Mike Rizzo <mjrizzo@gmail.com>
Co-authored-by: yaakovi <syaakovi@paloaltonetworks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution Form Filled Whether contribution form filled or not. Contribution Thank you! Contributions are always welcome! docs-approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants