Skip to content

fix(scanner): improve AZ-NET-008 with SOC2 mapping and azure_client abstraction#108

Open
aav-wh wants to merge 1 commit into
openshield-org:devfrom
aav-wh:feat/az-net-016
Open

fix(scanner): improve AZ-NET-008 with SOC2 mapping and azure_client abstraction#108
aav-wh wants to merge 1 commit into
openshield-org:devfrom
aav-wh:feat/az-net-016

Conversation

@aav-wh

@aav-wh aav-wh commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?
Improves the existing AZ-NET-008 rule rather than adding a duplicate AZ-NET-016 rule, as identified in review.
Changes

Adds missing SOC2: CC8.1 to the FRAMEWORKS dict in az_net_008.py (the entry already existed in soc2.json but was absent from the Python rule)
Refactors the scan function to use azure_client.get_load_balancers() for consistency with the project's abstraction pattern
Adds resource_group to the metadata output
Removes the duplicate az_net_016.py rule and its playbook

Type of change

Bug fix / improvement to existing rule

Testing

Returns correct JSON output
All seven CI checks pass
No hardcoded credentials or secrets

@m-khan-97 m-khan-97 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I am requesting changes because this appears to duplicate the existing AZ-NET-008 rule, which already covers load balancers without backend pools.

Please do not merge this as a separate AZ-NET-016 rule in its current form. A better direction would be one of these:

  • improve the existing AZ-NET-008 implementation if it has gaps
  • add regression tests for the existing load-balancer backend-pool detection
  • improve the existing remediation playbook
  • refocus this PR on a clearly distinct lifecycle/resource-hygiene case that AZ-NET-008 does not already cover

This branch is also currently conflicting with dev, so it would need to be rebased before any revised version can be reviewed.

@aav-wh

aav-wh commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review @m-khan-97. Confirmed — AZ-NET-008 already covers this check. Rather than closing, I'll refocus this branch to improve the existing rule:

Add the missing SOC2: CC8.1 mapping to the FRAMEWORKS dict (it's already in soc2.json but missing from the Python file)
Refactor the scan function to use azure_client.get_load_balancers() for consistency with the project's abstraction pattern
Add resource_group to the metadata output

Will also rebase against dev to clear the conflicts and update the PR title/description.

@aav-wh aav-wh changed the title feat(scanner): add AZ-NET-016 load balancer no backend pool rule fix(scanner): improve AZ-NET-008 with SOC2 mapping and azure_client abstraction Jun 11, 2026
@aav-wh

aav-wh commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

@m-khan-97 Changes addressed — duplicate az_net_016.py and its playbook removed, az_net_008.py improved with SOC2 mapping, azure_client.get_load_balancers() abstraction, and resource_group added to metadata. JSON files restored to dev state. CI is passing and conflicts are resolved. Ready for re-review.

@Vishnu2707

Copy link
Copy Markdown
Member

@m-khan-97 @parthrohit22 , can you please revisit this PR.

@m-khan-97 m-khan-97 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for refocusing this away from a separate AZ-NET-016. The final tree no longer adds scanner/rules/az_net_016.py, and the AZ-NET-008 improvement direction is right.

I am keeping this in changes requested for now because the PR is still not merge-ready against current dev:

  1. GitHub marks the branch as conflicting (mergeStateStatus: DIRTY). Please rebase or merge current dev and resolve the conflicts.
  2. The current PR diff still includes out-of-scope framework JSON changes for AZ-IDN-005 through AZ-IDN-009 and AZ-PQC-001 through AZ-PQC-003, plus a deletion of frontend/.gitkeep. Those are unrelated to improving AZ-NET-008 and should be restored to the current dev state.
  3. Please keep the final diff scoped to the AZ-NET-008 improvement: scanner/rules/az_net_008.py, scanner/azure_client.py, and only the SOC2 mapping alignment if it is still missing after rebasing.

Once the branch is conflict-free and the diff is scoped, this can go to the Network review pair (@emon22-ts + @safidnadaf) for final review.

@Vishnu2707

Copy link
Copy Markdown
Member

@aav-wh , can u please revisit the PR

@aav-wh aav-wh force-pushed the feat/az-net-016 branch from 9b921a7 to 58c04c6 Compare June 28, 2026 16:41
@aav-wh

aav-wh commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @m-khan-97, all three points addressed:

  1. Rebased onto current dev — branch is now conflict-free, one clean commit on top of the latest upstream/dev.
  2. Diff scoped correctly — only two files changed:

scanner/rules/az_net_008.py — SOC2 mapping added, migrated to azure_client.get_load_balancers() abstraction, resource_group added to metadata
scanner/azure_client.py — get_load_balancers() method added

No JSON framework files, no frontend/.gitkeep deletion — those have all been cleaned out.
3. SOC2 alignment — already included in the single commit above.
CI should pass on this push. Happy to make any further changes. 🙏

@m-khan-97 m-khan-97 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed commit 58c04c6. The previous blockers are resolved: the branch is rebased onto current dev, the duplicate AZ-NET-016 work is gone, and the diff is now limited to scanner/azure_client.py and scanner/rules/az_net_008.py. CI is green, tests/test_rules_network.py passes, and a focused behavior check confirmed the AZ-NET-008 finding, resource_group metadata, and SOC2 CC8.1 mapping.

Approved from my side. Per our review-pair policy, final merge should still wait for the Network reviewers @emon22-ts and @safidnadaf. Non-blocking follow-up: add explicit AZ-NET-008 regression coverage, since the current network test module only exercises AZ-NET-001 and AZ-NET-002.

@m-khan-97 m-khan-97 requested review from ritiksah141 and safidnadaf and removed request for safidnadaf June 28, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants