Skip to main content

NetskopeMergePrivateAppFields

This Script is part of the Netskope - Direct to Zero Trust Pack.#

Supported versions

Available on Cortex XSOAR (versions 6.10.0 and later) and Cortex XSIAM.

Fetches a private app's current host, protocols, and tags, then applies the requested additions or removals without discarding the other values. This supports the Manage Private App Segment modify flow because netskopev2-update-private-app (PATCH) replaces host, protocols, and tags wholesale rather than merging them.

Script Data#


NameDescription
Script Typepython
TagsNetskope

Dependencies#


This script uses the following commands and scripts.

  • netskopev2-list-private-apps

Inputs#


Argument NameDescription
app_idThe ID of the private app to read current host/protocols/tags from. Required only if hosts_to_add, ports_to_add, hosts_to_remove, ports_to_remove, tags_to_add, or tags_to_remove is provided.
hostThe direct-replace host value (from the Host input) - passed through unchanged unless hosts_to_add or hosts_to_remove is also provided, in which case those win and this is ignored.
protocols_jsonThe direct-replace protocols JSON (from Netskope.BuiltProtocols.ProtocolsJson) - passed through unchanged unless ports_to_add or ports_to_remove is also provided, in which case those win and this is ignored.
tagsThe direct-replace comma-separated tags value (from the Tags input) - passed through unchanged unless tags_to_add or tags_to_remove is also provided, in which case those win and this is ignored.
hosts_to_addThe comma-separated hosts to add to the app's existing host list (e.g. "10.0.0.5") - fetches the app's current host first and merges, deduplicating case-insensitively.
ports_to_addThe comma-separated ports to add to the app's existing protocols (e.g. "8080") - fetches the app's current protocols first and merges, skipping ports already present.
hosts_to_removeThe comma-separated hosts to remove from the app's existing host list (e.g. "10.0.0.5") - fetches the app's current host first and removes just these entries.
ports_to_removeThe comma-separated ports to remove from the app's existing protocols (e.g. "8080") - fetches the app's current protocols first and removes just the matching port entries.
tags_to_addThe comma-separated tags to add to the app's existing tags (e.g. "test") - fetches the app's current tags first and merges, deduplicating case-insensitively.
tags_to_removeThe comma-separated tags to remove from the app's existing tags (e.g. "test") - fetches the app's current tags first and removes just these entries.
protocol_typeThe transport protocol used for any newly added ports in ports_to_add. Default is "tcp".

Outputs#


PathDescriptionType
Netskope.MergedPrivateAppFields.HostThe final host value to send - merged with hosts_to_add/hosts_to_remove if provided, otherwise the direct-replace value passed through unchanged.String
Netskope.MergedPrivateAppFields.ProtocolsJsonThe final protocols JSON to send - merged with ports_to_add/ports_to_remove if provided, otherwise the direct-replace value passed through unchanged.String
Netskope.MergedPrivateAppFields.TagsThe final comma-separated tags value to send - with tags_to_add/tags_to_remove applied if provided, otherwise the direct-replace value passed through unchanged.String