Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch policy library for Azure China #253

Merged
merged 69 commits into from
Jun 30, 2022

Conversation

faister
Copy link
Contributor

@faister faister commented Jun 1, 2022

Overview/Summary

This PR ensures policy definitions/policy set definitions along with policy assignments all work in Azure China. Internal SE backlog item here. This is because there are some policy definition differences in China especially wrt to the MS Defender for Cloud policies, hence there was a separate policy assignment definition in the upstream enterprise-scale repo.

Just to be sure, re-tested the entire deployment flow as per https://github.com/Azure/ALZ-Bicep/wiki/DeploymentFlow and made some fixes.

This PR fixes/adds/changes/removes

  1. Tested default policy assignments by introducing a new infra-as-code\bicep\modules\policy\assignments\alzDefaults\mc-alzDefaultPolicyAssignments.bicep file.
  2. Added separate lib/china folder under infra-as-code\bicep\modules\policy\assignments\lib\china\policy_assignments. Also added default policy assignments which would work in Azure China.
  3. Updated and tested Mooncake workflow file, and script to create separate lib/china folder under policy/assignments.
  4. Added customer usage attribution module in customRoleDefinitions module.
  5. Also fixes the deployment errors during MC testing found by @jfaurskov in Module Bicep template and parameter file hygiene #227

Breaking Changes

  1. None

Testing Evidence

image

Tested workflow manual run successfully in my forked repo
image

As part of this Pull Request I have

  • Read the Contribution Guide and ensured this PR is compliant with the guide
  • Checked for duplicate Pull Requests
  • Associated it with relevant GitHub Issues
  • (ALZ Bicep Core Team Only) Associated it with relevant ADO Items
  • Ensured my code/branch is up-to-date with the latest changes in the main branch
  • Performed testing and provided evidence.
  • Updated tests (if required) Unit - Linting - E2E (End-To-End)
  • Updated relevant and associated documentation (e.g. Contribution Guide, Module READMEs, Wiki Docs etc.)
  • If relevant, created or updated Code Tours here

actions-user and others added 30 commits January 11, 2022 05:32
Copy link
Contributor

@jfaurskov jfaurskov left a comment

Choose a reason for hiding this comment

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

Nice work @faister :-) Added a couple of suggestions. Also If you could merge with main and put the validation of the mc-alzdefaultpolicyassignments into the /tests/pipelines/mc-base-unit-validate.yml pipeline in place of the current alzdefaultpolicyassignments (line 81 - 87) that would be ace!

@ghost ghost removed the Needs: Author Feedback label Jun 28, 2022
@faister
Copy link
Contributor Author

faister commented Jun 29, 2022

Nice work @faister :-) Added a couple of suggestions. Also If you could merge with main and put the validation of the mc-alzdefaultpolicyassignments into the /tests/pipelines/mc-base-unit-validate.yml pipeline in place of the current alzdefaultpolicyassignments (line 81 - 87) that would be ace!

Thanks @jfaurskov, done updated tests/pipelines/mc-base-unit-validate.yml and tested it in az cli successfully. see attached output.
Az CLI Validate Alz Default policy assignments-succeeded.txt

@faister faister closed this Jun 29, 2022
@faister faister reopened this Jun 29, 2022
@faister faister requested a review from jfaurskov June 29, 2022 05:27
@jfaurskov
Copy link
Contributor

/azp run ValidateAzCloud

@jfaurskov
Copy link
Contributor

/azp run ValidateMcCloud

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jfaurskov
Copy link
Contributor

/azp run ValidateAzCloud

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jfaurskov
Copy link
Contributor

/azp run ValidateAzCloud

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@faister faister merged commit aebf60d into Azure:main Jun 30, 2022
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