Skip to content

Commit 77906f0

Browse files
chkp-natanelmchkp-noamcohchkp-eddiekchkp-romankachkp-avivm
authored
adding validation for cleaning azure resources option (#504)
Co-authored-by: noamcoh <noamcoh@checkpoint.com> Co-authored-by: eddiek <eddiek@checkpoint.com> Co-authored-by: romanka <romanka@checkpoint.com> Co-authored-by: Aviv Meydan <avivm@checkpoint.com>
1 parent 1c37c1c commit 77906f0

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

cloudguard-network-application/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ For customer-managed (single-tenant) onboarding, the script performs the followi
2020
- **Service Principal Creation:** Registers a service principal for the newly created application, enabling programmatic access to Azure resources.
2121
- **Role Assignment:** Assigns the necessary Azure roles (such as `Reader` or `Contributor`) to the service principal at the subscription or management group level to ensure CGNS can operate as required.
2222
- **Resource Cleanup (optional, using `--clean` flag):** Removes the application, service principal, and associated role assignments to fully clean up the integration if requested.
23+
> **Note:** When using the `--clean` option, you must also provide the `--app_name`, `--scope`, and the relevant `--subscription_id` or `--management_group_id` to ensure proper identification and removal of resources.
2324
2425
For CloudGuard-managed (multi-tenant) onboarding, the script performs the following steps:
2526
- **Service Principal Assignment:** Assigns a service principal for the pre-existing CloudGuard-managed Azure application to the customer’s subscription or management group.

cloudguard-network-application/cgns_onboarding_azure.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,12 @@ validate_inputs() {
204204
if [ "$scope" = "$MANAGEMENT_GROUPS_SCOPE" ] && [ -z "$management_group_id" ]; then
205205
exit_with_error "Missing required argument: --management_group_id"
206206
fi
207-
207+
if [ "$clean" = "true" ]; then
208+
if [ -z "$app_name" ]; then
209+
exit_with_error "When --clean is specified, --app_name must also be provided."
210+
fi
211+
return 0
212+
fi
208213
if [ -z "$onboarding_mode" ]; then
209214
exit_with_error "Missing required argument: --onboarding_mode"
210215
fi

0 commit comments

Comments
 (0)