Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions doc/plugin_server_bundlepublisher_azure_blob.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Server plugin: BundlePublisher "azure_blob"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This new plugin needs an entry in the BundlePublisher table in doc/spire_server.mdto to keep the built-in plugin index updated.


The `azure_blob` plugin puts the current trust bundle of the server in a designated
Azure Blob Storage container, keeping it updated.

The plugin accepts the following configuration options:

| Configuration | Description | Required | Default |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|-----------------------|
| storage_account_name | The name of the Azure Storage account. | Yes. | |
| storage_account_key | The base64-encoded access key for the Azure Storage account. Used for shared key authentication (found in the Azure Portal, **Access keys**). | Required only when using shared key authentication. | |
| container_name | The name of the blob container to which the trust bundle is uploaded. | Yes. | |
| blob_name | The blob name inside the container. | Yes. | |
| format | Format in which the trust bundle is stored, <spiffe | jwks | pem>. See [Supported bundle formats](#supported-bundle-formats) for more details. | Yes. | |
| service_endpoint | The Azure Blob Storage service endpoint. | No. | blob.core.windows.net |
| tenant_id | The Azure tenant ID for client secret credential authentication. | Required only when using client secret credentials. | |
| app_id | The Azure application (client) ID for client secret credential authentication. | Required only when using client secret credentials. | |
| app_secret | The Azure application client secret for client secret credential authentication. | Required only when using client secret credentials. | |
| refresh_hint | Sets the refresh hint for the bundle when using the spiffe format. Specified as string e.g. '10m', '1h'. See [time.ParseDuration](https://pkg.go.dev/time#ParseDuration) for details | No. | |

## Supported bundle formats

The following bundle formats are supported:

### SPIFFE format

The trust bundle is represented as an RFC 7517 compliant JWK Set, with the specific parameters defined in the [SPIFFE Trust Domain and Bundle specification](https://github.com/spiffe/spiffe/blob/main/standards/SPIFFE_Trust_Domain_and_Bundle.md#4-spiffe-bundle-format). Both the JWT authorities and the X.509 authorities are included.

### JWKS format

The trust bundle is encoded as an RFC 7517 compliant JWK Set, omitting SPIFFE-specific parameters. Both the JWT authorities and the X.509 authorities are included.

### PEM format

The trust bundle is formatted using PEM encoding. Only the X.509 authorities are included.

## Authentication

The plugin supports three authentication methods. Only one method may be used at a time; shared key authentication and client secret credentials are mutually exclusive.

### Shared key authentication

When `storage_account_key` is provided, the plugin authenticates using the storage account's access key. This method does not require Azure AD and is useful in environments where Azure AD is not available.

### Client secret credentials

When `tenant_id`, `app_id`, and `app_secret` are all provided, the plugin authenticates using Azure client secret credentials. All three fields must be specified together.

### Default Azure credentials

When neither shared key nor client secret credentials are configured, the plugin uses the [Azure Default Credential](https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication) chain. This supports Managed Identity, environment variables, Azure CLI credentials, and other methods provided by the Azure SDK.

## Required permissions

The authenticated identity must have the `Storage Blob Data Contributor` role (or equivalent permissions to write blobs) on the configured storage account or container.

## Sample configuration using Default Azure Credentials

The following configuration uploads the local trust bundle contents to the `example.org` blob in the `spire-bundle` container within the `mystorageaccount` storage account. Since client secret credentials are not configured, [Default Azure Credentials](https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication) are used.

```hcl
BundlePublisher "azure_blob" {
plugin_data {
storage_account_name = "mystorageaccount"
container_name = "spire-bundle"
blob_name = "example.org"
format = "spiffe"
}
}
```

## Sample configuration using shared key authentication

The following configuration uploads the local trust bundle contents to the `example.org` blob in the `spire-bundle` container, authenticating with a storage account access key.

```hcl
BundlePublisher "azure_blob" {
plugin_data {
storage_account_name = "mystorageaccount"
storage_account_key = "my-storage-account-key"
container_name = "spire-bundle"
blob_name = "example.org"
format = "spiffe"
}
}
```

## Sample configuration using client secret credentials

The following configuration uploads the local trust bundle contents to the `example.org` blob in the `spire-bundle` container, authenticating with client secret credentials.

```hcl
BundlePublisher "azure_blob" {
plugin_data {
storage_account_name = "mystorageaccount"
container_name = "spire-bundle"
blob_name = "example.org"
format = "spiffe"
tenant_id = "my-tenant-id"
app_id = "my-app-id"
app_secret = "my-app-secret"
}
}
```
1 change: 1 addition & 0 deletions doc/spire_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ This document is a configuration reference for SPIRE Server. It includes informa
| BundlePublisher | [aws_s3](/doc/plugin_server_bundlepublisher_aws_s3.md) | Publishes the trust bundle to an Amazon S3 bucket. |
| BundlePublisher | [gcp_cloudstorage](/doc/plugin_server_bundlepublisher_gcp_cloudstorage.md) | Publishes the trust bundle to a Google Cloud Storage bucket. |
| BundlePublisher | [aws_rolesanywhere_trustanchor](/doc/plugin_server_bundlepublisher_aws_rolesanywhere_trustanchor.md) | Publishes the trust bundle to an AWS IAM Roles Anywhere trust anchor. |
| BundlePublisher | [azure_blob](/doc/plugin_server_bundlepublisher_azure_blob.md) | Publishes the trust bundle to an Azure Blob Storage account. |
| BundlePublisher | [k8s_configmap](/doc/plugin_server_bundlepublisher_k8s_configmap.md) | Publishes the trust bundle to a Kubernetes ConfigMap. |

## Server configuration file
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.10.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v3 v3.0.1
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.5.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.7.0
github.com/GoogleCloudPlatform/cloudsql-proxy v1.38.1
github.com/Keyfactor/ejbca-go-client-sdk v1.1.0
github.com/Masterminds/sprig/v3 v3.3.0
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v3 v3.0.1 h1:guyQA4b8XB2sbJZXzUnOF9mn0WDBv/ZT7me9wTipKtE=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v3 v3.0.1/go.mod h1:8h8yhzh9o+0HeSIhUxYny+rEQajScrfIpNktvgYG3Q8=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1 h1:/Zt+cDPnpC3OVDm/JKLOs7M2DKmLRIIp3XIx9pHHiig=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1/go.mod h1:Ng3urmn6dYe8gnbCMoHHVl5APYz2txho3koEkV2o2HA=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.5.0 h1:MaKvxE6D0KkjOg6Wd9M00iqP5PR0kUxCfiezes4JweM=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.5.0/go.mod h1:i2h9fsTFKZorh8RdV2IcSUf/Qj98GlTkrTvUbX/s8as=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 h1:nCYfgcSyHZXJI8J0IWE5MsCGlb2xp9fJiXyxWgmOFg4=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0/go.mod h1:ucUjca2JtSZboY8IoUqyQyuuXvwbMBVwFOm0vdQPNhA=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.7.0 h1:BM85pSYlVYQHdq00nxyPoOkyLF5NArJG3bOsrmbwr4k=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.7.0/go.mod h1:QYjP2cB7ZYtS/8jAbE0VSBZde/tjExqGjp+8JY6/+ts=
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=
Expand Down
2 changes: 2 additions & 0 deletions pkg/server/catalog/bundlepublisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/spiffe/spire/pkg/server/plugin/bundlepublisher"
"github.com/spiffe/spire/pkg/server/plugin/bundlepublisher/awsrolesanywhere"
"github.com/spiffe/spire/pkg/server/plugin/bundlepublisher/awss3"
"github.com/spiffe/spire/pkg/server/plugin/bundlepublisher/azureblob"
"github.com/spiffe/spire/pkg/server/plugin/bundlepublisher/gcpcloudstorage"
"github.com/spiffe/spire/pkg/server/plugin/bundlepublisher/k8sconfigmap"
)
Expand All @@ -28,6 +29,7 @@ func (repo *bundlePublisherRepository) Versions() []catalog.Version {
func (repo *bundlePublisherRepository) BuiltIns() []catalog.BuiltIn {
return []catalog.BuiltIn{
awss3.BuiltIn(),
azureblob.BuiltIn(),
gcpcloudstorage.BuiltIn(),
awsrolesanywhere.BuiltIn(),
k8sconfigmap.BuiltIn(),
Expand Down
Loading
Loading