For security purposes, Aviatrix recommends you use a custom role rather than
the default role Aviatrix created. When you use a custom role name it is
important to make sure the AssumeRole policy and Trust policy are correct. The
AssumeRole policy is attached to the Azure Virtual Machine role and the Trust
policy is accessed on the APP role Trust Relationship tab.
Step 1. Add a Custom Role through Powershell
The custom role must have permission that meets the requirement for Aviatrix Controller to function. The permission is represented by the json file below. Remember to replace the subscription “11111111-1111-1111-1111-111111111111” with your own valid subscription ID.- Edit avx_rbac_role.json, copy and paste above Aviatrix RBAC role. Save the file.
- New-AzRoleDefinition -InputFile avx_rbac_role.json
The Microsoft.ContainerService lines in the above json file example allow the
Aviatrix Controller to connect to your Kubernetes clusters.
Step 2. Add a Role Assignment in the Azure Portal
In Azure portal > Subscriptions > Access Control (IAM) > Add > Add role assignment. At Role assignment, fill the fields as shown below.
Once the above step is complete, you have assigned the My-new-controller (as a
service principal) the custom role called “Aviatrix Controller Custom Role.”
For more information on how to PowerShell to create custom role on Azure, refer
to
this link.