feat(scanner): add enterprise data protection and database rules - #278
feat(scanner): add enterprise data protection and database rules#278TFT444 wants to merge 5 commits into
Conversation
Signed-off-by: Tanvir Farhad <tamimtarafder12@gmail.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
Signed-off-by: Tanvir Farhad <tamimtarafder12@gmail.com>
Signed-off-by: Tanvir Farhad <tamimtarafder12@gmail.com>
Signed-off-by: Tanvir Farhad <tamimtarafder12@gmail.com>
|
@ritiksah141 @parthrohit22 - an initial review would be appreciated. |
There was a problem hiding this comment.
Thanks for putting this rule pack together. I went through the implementation and tests carefully. The direction is useful, but I found three things we need to fix before merging:
-
AZ-STOR-009 cannot currently be enabled for a real blob container. The shared policy helper reads
resource.tags, while Azure BlobContainer objects expose metadata rather than ARM tags. That means the documentedoshield:immutability-requiredmarker will never be seen and the rule will silently skip every real container. Please use a supported source of applicability, such as container metadata or an account-level policy, and add a regression test with an SDK-shaped BlobContainer object. -
The NIST mapping for AZ-DB-007 is incorrect.
A.12.4.1is an ISO 27001 control, not a NIST CSF identifier. Please correct it consistently in the rule,nist_csf.json, and the rules reference. If there is no verified direct mapping, use an explicit N/A value. -
Several files presented as remediation playbooks only print guidance. This affects the cache, Cosmos, and SQL rules in this PR. Since the API exposes these files as CLI remediation, either implement safe, validated commands with proper argument handling or classify them clearly as manual guidance instead of executable remediation.
I ran the focused rule tests locally and all 24 passed. The Azure client test module could not collect because this checkout is missing azure.mgmt.authorization, so I did not treat that environment issue as a PR failure. The points above are production contract gaps that the current mocked tests do not cover.
Once these are addressed, I will be happy to take another look.
…ules - Move AZ-STOR-009 opt-in check from BlobContainer (no ARM tags) to the parent storage account, which exposes tags via the SDK; all containers under a tagged account are now evaluated for immutability. - Replace incorrect NIST mapping A.12.4.1 (ISO 27001) on AZ-DB-007 with PR.PT-1 across az_db_007.py, nist_csf.json, and rules-reference. - Add executable az CLI commands to fix_az_cache_001, fix_az_cosmos_001, fix_az_cosmos_002, fix_az_db_005, fix_az_db_006, and fix_az_db_007 playbooks; each validates the target and requires APPLY confirmation before modifying any Azure resource. - Update storage-protection-controls.md to document the account-level tagging scope for AZ-STOR-009. Signed-off-by: Tanvir Farhad <tamimtarafder12@gmail.com>
TFT444
left a comment
There was a problem hiding this comment.
All three blockers addressed in the latest commit:
- AZ-STOR-009 opt-in check moved from the BlobContainer to the parent storage account, which exposes ARM tags via the SDK. All containers under a tagged account are now evaluated.
- AZ-DB-007 NIST mapping corrected from A.12.4.1 (ISO 27001) to PR.PT-1 across the rule, nist_csf.json, and rules-reference.
- All six echo-only playbooks now contain validated az CLI commands behind an APPLY confirmation gate.
Ready for re-review.
Summary
Implements issue #261 as a policy-driven Azure data-protection and database-security rule pack.
Added controls
Implementation
Validation
The playbooks are review-safe guidance commands; they do not apply irreversible Azure changes automatically.
Closes #261