[Bug]: Key Vault: enableRbacAuthorization is always reported as false (New-MonkeyVaultObject reads the property at the wrong level)
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 86/100
調査の方向性
core/api/azure/resourcemanagement/helpers/keyvault/New-MonkeyVaultObject.ps1 の60行目から始め、ARM応答の properties.enableRbacAuthorization がどのように読み取られるかを確認します。プロパティを true、false、未設定にして、該当する Key Vault ルールまたはテストを実行します。RBAC が有効な vault がルールに合格し、false または未設定の値では無効のままであれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- PowerShell
- スター
- 1.4k
- フォーク
- 144
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
silverhack/monkey365 のほかの issue
-
bug status/needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
silverhack/monkey365#199 ·
-
bug status/needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
silverhack/monkey365#198 ·
-
documentation enhancement help wanted impact-low priority-medium question
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
silverhack/monkey365#187 · コメント 1 件 ·
-
documentation enhancement epic priority-medium
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
silverhack/monkey365#184 ·
-
Expose domain-level context for SPF / DKIM / DMARC findings in Exchange Online再び着手できるかも @silverhack が 112 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
silverhack/monkey365#167 · コメント 3 件 · 担当者 1 名 ·
silverhack/monkey365 の issue をすべて見る
似ている issue
-
CRT transfer manager mutates the caller's ExtraArgs, so reusing the dict fails on the next uploadオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
boto/s3transfer#433 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
platform rust
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
laithalsaadoon/microvms-agentd#758 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
MicrosoftLearning/eShopOnWeb#466 ·
-
Updating an `OidcIssuer` without `thumbprints` fails with "You must provide at least one thumbprint"オープンBug kind/bug pulumi/pulumi-pulumiservice R1 S1
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
pulumi/pulumi-pulumiservice#1370 ·
メンテナーはふだん 1 日以内に返信