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

Use Blob SAS instead of Account SAS for better security #378

Closed
wants to merge 3 commits into from
Closed
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ CHANGELOG

## HEAD (Unreleased)
* Upgrade to v1.35.0 of the Azurerm Terraform Provider
* Use Blob Container SAS instead of Account SAS for zip packages for Function App deployments
[#378](https://github.com/pulumi/pulumi-azure/pull/378)

---

Expand Down
1 change: 0 additions & 1 deletion sdk/nodejs/appservice/zMixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ function createFunctionAppParts(name: string,
}, opts);

const zipBlob = new storageMod.ZipBlob(name, {
resourceGroupName,
storageAccountName: account.name,
storageContainerName: container.name,
type: "block",
Expand Down
19 changes: 2 additions & 17 deletions sdk/nodejs/storage/zMixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@
// limitations under the License.

import * as pulumi from "@pulumi/pulumi";
import * as eventgrid from "azure-eventgrid/lib/models";

import { Account } from "./account";
import { Blob } from "./blob";
import { Container } from "./container";
import { getAccountSAS } from "./getAccountSAS";
import { Queue } from "./queue";
import { Table } from "./table";
import { ZipBlob } from "./zipBlob";

import * as appservice from "../appservice";
import * as core from "../core";
import * as eventhub from "../eventhub";
import * as storage from "../storage";

/**
Expand All @@ -43,30 +40,18 @@ export function signedBlobReadUrl(blob: Blob | ZipBlob, account: Account): pulum

return pulumi.all([account.name, account.primaryConnectionString, blob.storageContainerName, blob.name]).apply(
async ([accountName, connectionString, containerName, blobName]) => {
const sas = await getAccountSAS({
const sas = await storage.getAccountBlobContainerSAS({
connectionString,
containerName,
start: "2019-01-01",
expiry: signatureExpiration,
services: {
blob: true,
queue: false,
table: false,
file: false,
},
resourceTypes: {
service: false,
container: false,
object: true,
},
permissions: {
read: true,
write: false,
delete: false,
list: false,
add: false,
create: false,
update: false,
process: false,
},
});

Expand Down