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

feat: set allowBlobPublicAccess as false by default #519

Merged
Merged
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
2 changes: 1 addition & 1 deletion docs/driver-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protocol | specify blobfuse mount or NFSv3 mount | `fuse`, `nfs` | No | `fuse`
containerName | specify the existing container name | existing container name | No | if empty, driver will create a new container name, starting with `pvc-fuse` for blobfuse or `pvc-nfs` for NFSv3
isHnsEnabled | enable `Hierarchical namespace` for Azure DataLake storage account(only for blobfuse) | `true`,`false` | No | `false`
server | specify Azure storage account server address | existing server address, e.g. `accountname.privatelink.blob.core.windows.net` | No | if empty, driver will use default `accountname.blob.core.windows.net` or other sovereign cloud account address
allowBlobPublicAccess | Allow or disallow public access to all blobs or containers for storage account created by driver | `true`,`false` | No | `true`
allowBlobPublicAccess | Allow or disallow public access to all blobs or containers for storage account created by driver | `true`,`false` | No | `false`
storageEndpointSuffix | specify Azure storage endpoint suffix | `core.windows.net` | No | if empty, driver will use default storage endpoint suffix according to cloud environment, e.g. `core.windows.net`
tags | [tags](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources) would be created in newly created storage account | tag format: 'foo=aaa,bar=bbb' | No | ""

Expand Down
8 changes: 5 additions & 3 deletions pkg/blob/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
parameters = make(map[string]string)
}
var storageAccountType, resourceGroup, location, account, containerName, protocol, customTags, secretNamespace string
var isHnsEnabled, allowBlobPublicAccess *bool
var isHnsEnabled *bool
// set allowBlobPublicAccess as false by default
allowBlobPublicAccess := to.BoolPtr(false)

// store account key to k8s secret by default
storeAccountKey := true
Expand Down Expand Up @@ -102,8 +104,8 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
storeAccountKey = false
}
case allowBlobPublicAccessField:
if strings.EqualFold(v, falseValue) {
allowBlobPublicAccess = to.BoolPtr(false)
if strings.EqualFold(v, trueValue) {
allowBlobPublicAccess = to.BoolPtr(true)
}
case pvcNamespaceKey:
if secretNamespace == "" {
Expand Down