Skip to content

Commit 82847c5

Browse files
authored
Azure | Templates | Created unique name to reader_role_assignment (#507)
1 parent dd320c7 commit 82847c5

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

azure/templates/vwan-managed-app/mainTemplate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
"dependsOn": [
233233
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('managed_identity_name'))]"
234234
],
235-
"name": "reader_role_assignment",
235+
"name": "[concat('reader_role_assignment_', uniqueString(parameters('deploymentTime'), resourceGroup().name))]",
236236
"apiVersion": "2021-04-01",
237237
"resourceGroup": "[split(parameters('hubId'), '/')[4]]",
238238
"subscriptionId": "[subscription().subscriptionId]",

cloudguard-network-application/cgns_onboarding_azure.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ usage() {
3333
echo " --help Show this help message and exit"
3434
}
3535

36+
3637
# -----------------------------------------------------------------------------
3738
# Color Output Functions
3839
#
@@ -59,7 +60,6 @@ usage() {
5960
# Call the desired function with the text to print in color, e.g.:
6061
# red "This is an error message"
6162
# -----------------------------------------------------------------------------
62-
6363
end="\033[0m"
6464
red="\033[0;31m"
6565
function red {
@@ -203,7 +203,6 @@ parse_input() {
203203
# The command's output is stored in the variable 'AzOutput', and the exit code in 'AzRetVal'.
204204
# Errors from the az command do not cause the script to exit; they are handled by the caller.
205205
# ---------------------------------------------------------------------------
206-
207206
az_wrapper() {
208207
if [ "$dry_run" = "true" ]; then
209208
echo "az $*"
@@ -293,6 +292,7 @@ rollback() {
293292
}
294293

295294

295+
296296
# rollback_delete_customer_app
297297
# ----------------------------
298298
# Deletes an Azure AD application with the specified name, including its role assignments.
@@ -316,8 +316,6 @@ rollback() {
316316
# 0 if the application is not found or deleted successfully.
317317
# Exits with error if multiple applications are found or if any operation fails.
318318
# -------------------------------------------------------------------------------
319-
320-
321319
rollback_delete_customer_app() {
322320
az_wrapper ad app list --filter "displayName eq '$app_name'" --query "[].appId" -o tsv
323321

@@ -351,6 +349,7 @@ rollback_delete_customer_app() {
351349
}
352350

353351

352+
354353
# Function to prompt user for confirmation
355354
check_if_user_would_like_to_proceed() {
356355
local message="$1"
@@ -380,6 +379,7 @@ check_if_user_would_like_to_proceed() {
380379
}
381380

382381

382+
383383
# Function to delete multi-tenant service principal role assignments
384384
rollback_delete_multi_tenant_sp_role_assignments(){
385385
if service_principal_doesnt_exists "$multi_tenant_app_id"; then
@@ -403,7 +403,6 @@ rollback_delete_multi_tenant_sp_role_assignments(){
403403
# - Deletes all role assignments by their IDs.
404404
# - If deletion fails, prints a warning message with the error details.
405405
# --------------------------------------------------------------------------
406-
407406
rollback_delete_role_assignments(){
408407
local app_to_delete=$1
409408
local role_assignments
@@ -486,7 +485,6 @@ set_scope() {
486485
# Returns:
487486
# 0 if the user has sufficient permissions, otherwise exits with an error.
488487
#------------------------------------------------------------------------------
489-
490488
validate_user_permissions() {
491489
local scope_type="$1"
492490

@@ -748,7 +746,6 @@ service_principal_doesnt_exists() {
748746
# - Creates role assignments in Azure for the specified application and scope.
749747
# - May create multiple role assignments depending on the onboarding mode.
750748
# ------------------------------------------------------------------------------------
751-
752749
create_role_assignments_for_cloudguard_app() {
753750
local app_id=$1
754751
if [ -z "$sp_id" ]; then
@@ -785,7 +782,6 @@ create_role_assignments_for_cloudguard_app() {
785782
# - If the assignment does not exist, attempts to create it.
786783
# - Exits with an error message if listing or creating the role assignment fails.
787784
# ------------------------------------------------------------------------------------
788-
789785
app_add_role_assignment_if_needed() {
790786
local app_id=$1
791787
local scope=$2

terraform/aws/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# ⚠️ Directory Deprecated
22
This directory is now officially deprecated. All future development and maintenance will take place in a new [repository](https://registry.terraform.io/modules/CheckPointSW/cloudguard-network-security/aws/latest)
3-
43
.
54

65
### 📌 New Repository and Modules

0 commit comments

Comments
 (0)