[Bug]: Key Vault: enableRbacAuthorization is always reported as false (New-MonkeyVaultObject reads the property at the wrong level)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 86/100
Rechercherichtung
Beginne mit core/api/azure/resourcemanagement/helpers/keyvault/New-MonkeyVaultObject.ps1, Zeile 60, und prüfe, wie properties.enableRbacAuthorization aus der ARM-Antwort gelesen wird. Führe die relevante Key Vault-Regel oder die Tests mit der Eigenschaft auf true, false und nicht gesetzt aus; fertig ist die Aufgabe, wenn Tresore mit aktiviertem RBAC die Regel bestehen und Werte, die false oder nicht gesetzt sind, deaktiviert bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
What happened?
For every Key Vault, Monkey365 reports "RBAC Enabled: false", including vaults that use the Azure RBAC permission model. The rule "Ensure that RBAC is enabled for Azure Key Vault" (azure_key_vault_rbac_disabled) therefore fails for all vaults.
Cause: core/api/azure/resourcemanagement/helpers/keyvault/New-MonkeyVaultObject.ps1, line 60:
enableRbacAuthorization = if($null -ne $InputObject.Psobject.Properties.Item('enableRbacAuthorization')){$InputObject.properties.enableRbacAuthorization}else{$false};
The check looks for enableRbacAuthorization on the top level of the ARM object, but ARM returns it under properties. The condition is never true, so the value is always $false.
How to reproduce it
- Create a Key Vault with the RBAC permission model (
properties.enableRbacAuthorization = true, checked with an ARM GET). - Run
Invoke-Monkey365 -Instance Azurewith the default ruleset. - The vault is reported with RBAC disabled.
Expected behavior
Vaults with properties.enableRbacAuthorization = true pass the rule.
Suggested fix
enableRbacAuthorization = if($null -ne $InputObject.properties -and $null -ne $InputObject.properties.PsObject.Properties.Item('enableRbacAuthorization')){$InputObject.properties.enableRbacAuthorization}else{$false};
We apply this change locally and tested it against 1.0.5 with true, false and a missing property.
From where are you running Monkey365?
- Resource: Docker container
- OS: Linux (Ubuntu 24.04)
- PowerShell Version: 7.6.9
- Monkey365 Version: 1.0.5 (also seen in 1.0.0, PowerShell Gallery)
- Others: app-only authentication with access tokens
Additional context
The purge protection rule has a similar path problem; reported separately.
- Vorherrschende Sprache
- PowerShell
- Sterne
- 1.4k
- Forks
- 144
- Ø Merge
- 1 T. 21 Std.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus silverhack/monkey365
-
bug status/needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
silverhack/monkey365#199 ·
-
bug status/needs-triage
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 56/100
silverhack/monkey365#198 ·
-
documentation enhancement help wanted impact-low priority-medium question
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
silverhack/monkey365#187 · 1 Kommentar ·
-
documentation enhancement epic priority-medium
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
silverhack/monkey365#184 ·
-
Expose domain-level context for SPF / DKIM / DMARC findings in Exchange OnlineEvtl. wieder frei @silverhack hat das vor 112 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement
silverhack/monkey365#167 · 3 Kommentare · 1 zugewiesene Person ·
Alle Issues in silverhack/monkey365
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
[BUG] OpenSearch domain endpoint includes a URI scheme and breaks standard Terraform consumersOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
floci-io/floci#7707 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
CRT transfer manager mutates the caller's ExtraArgs, so reusing the dict fails on the next uploadOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
boto/s3transfer#433 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
S3 input fails in Docker image: DuckDB can't find home directoryEvtl. vergeben @jnioche hat das heute übernommen. Offenbug docker reporting
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
DigitalPebble/spruce#315 ·
Maintainer antworten meist innerhalb von 1 Tag