Azure Integrator requires "Owner" service principal

Bug #1928906 reported by Peter Jose De Sousa
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Azure Integrator Charm
Fix Released
High
Cory Johns

Bug Description

Hi,

When deploying Charmed Kubernetes the azure integrator assigns roles to VMs to be able to create LoadBalancers and PVCs, as well as other cloud actions. When using Service Principals with juju this presents a problem as a service principal that can assign roles to VMs (Managed Identities[1]) can also assign roles to any entity within in the azure subscription.

E.g.

Service Principal A "Owner"

A Assigns "Subscription Owner to B"

B or A are leaked/stolen/compromised.

Malicious user uses A or B to delete subscription (The Virtual Datacentre).

It is not possible in azure to assign "lesser" permissions to a Service Principal to grant role permissions without granting "Owner". Although, it is possible to configure the k8s-azure cloud provider to use the service principal directly.

The Azure cloud provider for k8s has two modes of authentication, Managed Identity (VM Identities) or using the service principal directly. [2]

The fix for this bug is to pass the azure credentials over the relations to the k8s masters so that they can render the azure configuration with useManagedIdentites: false. e.g.

/var/snap/kube-controller-manager/common/cloud-conf.conf
{

    "useManagedIdentityExtension": false,
    "aadClient": "MY-CLIENT-GUID",
    "aadClientSecret": "MY-SUPER-SECURE-CLIENT-SECRET",
    .... other configuration....
}

[1] https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
[2] https://github.com/kubernetes/kubernetes/blob/80093635c618a62d3ffaa0aabb7b2e2f75393274/staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go#L58

Peter

Revision history for this message
Peter Jose De Sousa (pjds) wrote :
description: updated
description: updated
George Kraft (cynerva)
Changed in charm-azure-integrator:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Cory Johns (johnsca) wrote :
Changed in charm-azure-integrator:
status: Triaged → Fix Committed
milestone: none → 1.22
milestone: 1.22 → 1.21+ck3
milestone: 1.21+ck3 → none
Revision history for this message
Cory Johns (johnsca) wrote :

I'm not sure which milestone this should be targeted to (and hence whether these PRs need to be backported).

George Kraft (cynerva)
Changed in charm-azure-integrator:
milestone: none → 1.22
Changed in charm-azure-integrator:
status: Fix Committed → Fix Released
Changed in charm-azure-integrator:
assignee: nobody → Cory Johns (johnsca)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.