Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungFirst-touch attribution on a cookieless static Nuxt site(21.09.2026 um 02:51 Uhr)
Sichere ProgrammierungWho Is the Customer? It Might Not Be Who Uses the Product(21.09.2026 um 02:57 Uhr)
Sichere ProgrammierungOn My Japanese Team, We Greet Each Other by Saying "You Must Be Tired"(21.09.2026 um 03:06 Uhr)
Sichere ProgrammierungRedis vs Memcached: Complete Comparison(21.09.2026 um 03:16 Uhr)
Sichere ProgrammierungHow Databricks Serverless Compute Cost My Team $14k in One Weekend(21.09.2026 um 03:20 Uhr)
Sichere ProgrammierungStop trying to make Airflow work for Medallion pipelines(21.09.2026 um 03:21 Uhr)
Sichere ProgrammierungI built an app that turns workout videos into actual workouts(21.09.2026 um 03:39 Uhr)
Sichere ProgrammierungFirst-touch attribution on a cookieless static Nuxt site(21.09.2026 um 02:51 Uhr)
Sichere ProgrammierungWho Is the Customer? It Might Not Be Who Uses the Product(21.09.2026 um 02:57 Uhr)
Sichere ProgrammierungOn My Japanese Team, We Greet Each Other by Saying "You Must Be Tired"(21.09.2026 um 03:06 Uhr)
Sichere ProgrammierungRedis vs Memcached: Complete Comparison(21.09.2026 um 03:16 Uhr)
Sichere ProgrammierungHow Databricks Serverless Compute Cost My Team $14k in One Weekend(21.09.2026 um 03:20 Uhr)
Sichere ProgrammierungStop trying to make Airflow work for Medallion pipelines(21.09.2026 um 03:21 Uhr)
Sichere ProgrammierungI built an app that turns workout videos into actual workouts(21.09.2026 um 03:39 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Creating a Custom Role for Secure Bicep Deployments in Azure

Reagiere als Erste:r — dein Feedback zählt!

When deploying Azure resources with Bicep, you might have encountered the need for elevated permissions to create role assignments. By default, assigning roles during deployments requires high-level permissions like Owner at the subscription or resource group level. This setup can be concerning, as it grants more permissions than are necessary for the task.

To tackle this, I created a custom Azure role that has just the required permissions for creating role assignments. This ensures deployments remain secure and adhere to the principle of least privilege.

Why Use a Custom Role?

Instead of assigning broad roles like Owner or Contributor, a custom role enables you to:

  1. Limit permissions to only what’s necessary.
  2. Improve security by minimizing access rights.
  3. Maintain compliance with organizational governance policies.

Here’s how you can create a custom role that allows Bicep deployments to create role assignments without requiring Owner access.

Step-by-Step Guide to Creating the Custom Role

To create the custom role, you can use the Azure PowerShell module. Below is a script that defines and deploys the custom role.

# Define a new custom role with the required permissions
$role = Get-AzRoleDefinition Contributor
$role.Id = $null # Set ID to null to define a new role
$role.Name = "Role Assignment Creator"
$role.Description = "Can create role assignments during ARM/Bicep deployments"
$role.Actions.Clear() # Clear inherited permissions
$role.NotActions.Clear() # Clear inherited NotActions
$role.Actions.Add("Microsoft.Authorization/roleAssignments/write")
$role.Actions.Add("Microsoft.Resources/deployments/write")
$role.Actions.Add("Microsoft.Resources/deployments/read")
$role.Actions.Add("Microsoft.Resources/deployments/operationStatuses/read")
$role.AssignableScopes.Clear() # Clear existing scopes
$role.AssignableScopes.Add("/subscriptions/<subscriptionID>") # Replace <subscriptionID> with your subscription ID

# Create the custom role definition
New-AzRoleDefinition -Role $role

# Verify the new role definition
Get-AzRoleDefinition -Name "Role Assignment Creator"

Key Permissions Explained

Microsoft.Authorization/roleAssignments/write allows the creation of role assignments.
Microsoft.Resources/deployments/write grants permission to create deployments.
Microsoft.Resources/deployments/read enables read access to deployments.
Microsoft.Resources/deployments/operationStatuses/read allows reading deployment operation statuses.

These actions cover the necessary permissions for Bicep deployments involving role assignments, without granting broader access like Owner.

Assigning the Custom Role

After creating the role, you can assign it to a specific user, group, or service principal using the Azure portal, CLI, or PowerShell.

New-AzRoleAssignment -ObjectId <principalId> -RoleDefinitionName "Role Assignment Creator" -Scope "/subscriptions/<subscriptionID>"

Replace <principalId> with the object ID of the user or service principal you want to assign the role to.

Creating a custom role like this provides a more secure and fine-grained approach to handling deployments in Azure. By defining the exact permissions needed, you can minimize security risks and ensure compliance with best practices.

If you have similar requirements or insights into role definitions, feel free to share in the comments!

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Creating a Custom Role for Secure Bicep Deployments in Azure

Thematisch verwandte Begriffe: Creating, Custom, Role, Secure · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93968 | A vulnerability was determined in aiyiyi121 SxDevOps 1.0/1.1. This affec…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick