Using Blobfuse2 to mount Azure Blob Storage using managed identity from Azure Container Instance privileged containers
- You can mount Azure Blob Storage as a filesystem on Linux using Blobfuse2. This includes support for both blob containers and data lake hierarchical namespaces.
- You can also perform this mount on Linux containers as long as the container has mount privilege provided by the CAP_SYS_ADMIN capability.
- You can run containers with privileged capabilities on Azure PaaS using Azure Container Instance confidential containers.
- You can authenticate Blobfuse2 against Azure Storage using an Entra workload identity, including Azure Container Instance managed identity.
The Bicep template azure-privileged-containers.bicep
provides an example of how to:
- Mount an Azure Storage data lake container using Blobfuse2
- Within a privileged Azure Container Instance confidential tier instance
- Running an Azure Linux based container
- Authenticated against Azure Storage using the Azure Container Instance system assigned managed identity
- Exposing the mounted filesystem using the Filebrowser web-based file manager
- Serving the Filebrowser UI using a Caddy reverse proxy which provides automatic HTTPS with a public CA issued TLS certificate for the Azure Container Instance default domain name (
<name>.<location>.azurecontainer.io
)
Note
It might take a few minutes for Azure role assignments to propagate and/or the TLS certificate to be issued.
Azure hosted containers often run in multi-tenant or multi-application environments and as such have restricted capabilities in order to maintain container isolation. One exception is Azure Container Instance confidential containers which allow running containers in privileged mode. This is possible because confidential containers run within a hardware based Hyper-V isolated trusted execution environment.
Azure Container Instance confidential containers are configured with privileged capabilities by setting the privileged
flag on the securityContext configuration:
resource containerGroup 'Microsoft.ContainerInstance/containerGroups@2024-10-01-preview' = {
properties: {
// securityContext privileged only available with confidential linux containers
sku: 'Confidential'
osType: 'Linux'
containers: [
{
properties: {
securityContext: {
privileged: true
}
}
}
]
}
}
Azure Kubernetes Service also provides options to configure containers with privileged capabilities. This is a high risk configuration flagged by Azure Policy since such privilege might allow a malicious actor or a compromised application to break out of the container boundary.
Below is an overview of the capabilities provided by different Azure PaaS container hosting options (checked using capsh):
Capability | Container App | App Service | Container Instances Standard | Container Instances Confidential | Container Instances Confidential Privileged |
---|---|---|---|---|---|
cap_audit_control |
x | ||||
cap_audit_read |
x | x | x | x | x |
cap_audit_write |
x | ||||
cap_block_suspend |
x | ||||
cap_bpf |
x | ||||
cap_checkpoint_restore |
x | ||||
cap_chown |
x | x | x | x | x |
cap_dac_override |
x | x | x | x | x |
cap_dac_read_search |
x | ||||
cap_fowner |
x | x | x | x | x |
cap_fsetid |
x | x | x | x | x |
cap_ipc_lock |
x | ||||
cap_ipc_owner |
x | ||||
cap_kill |
x | x | x | x | x |
cap_lease |
x | ||||
cap_linux_immutable |
x | ||||
cap_mac_admin |
x | ||||
cap_mac_override |
x | ||||
cap_mknod |
x | x | x | x | x |
cap_net_admin |
x | ||||
cap_net_bind_service |
x | x | x | x | x |
cap_net_broadcast |
x | ||||
cap_net_raw |
x | x | x | x | x |
cap_perfmon |
x | ||||
cap_setfcap |
x | x | x | x | x |
cap_setgid |
x | x | x | x | x |
cap_setpcap |
x | x | x | x | x |
cap_setuid |
x | x | x | x | x |
cap_sys_admin |
x | ||||
cap_sys_boot |
x | ||||
cap_sys_chroot |
x | x | x | x | x |
cap_sys_module |
x | ||||
cap_sys_nice |
x | ||||
cap_sys_pacct |
x | ||||
cap_sys_ptrace |
x | ||||
cap_sys_rawio |
x | ||||
cap_sys_resource |
x | ||||
cap_sys_time |
x | ||||
cap_sys_tty_config |
x | ||||
cap_syslog |
x | ||||
cap_wake_alarm |
x |