pulumi-azure-native icon indicating copy to clipboard operation
pulumi-azure-native copied to clipboard

listStaticSiteSecrets results are not marked as secrets

Open TechWatching opened this issue 2 years ago • 8 comments

What happened?

The azure-native.web.listStaticSiteSecrets methods return a result that is not maked as a secret so it appear in plain text when outputing it.

Expected Behavior

The listStaticSiteSecrets result should be marked as a secret.

Steps to reproduce

const staticWebApp = new web.StaticSite("stapp-vue2048-preprod", {
    resourceGroupName: resourceGroup.name,
    sku: {
        name: "Free",
        tier: "Free"
    },
    repositoryUrl: "",
});

export const staticWebAppDeployToken = pulumi.secret(web.listStaticSiteSecretsOutput({name: staticWebApp.name, resourceGroupName: resourceGroup.name}).properties["apiKey"]);

If we remove the pulumi.secret the output is not a secret

Output of pulumi about

CLI Version 3.64.0 Go Version go1.20.3 Go Compiler gc

Plugins NAME VERSION azure-native 1.100.1 nodejs unknown

Host OS Microsoft Windows 11 Enterprise Version 10.0.22000 Build 22000 Arch x86_64

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

TechWatching avatar Apr 26 '23 20:04 TechWatching

@TechWatching Thanks for reporting this issue. Yes, these responses should be marked as a secret within our provider so they can be generated as a secret field! Adding this to our backlog now!

rquitales avatar Apr 28 '23 09:04 rquitales

@mnlumi @rquitales Is it something coming soon? Currently anyone that does use the azure-typescript template (or similar template creating a storage account and listing its keys) will output in clear text the secret. If someone tries to run this template in a GitHub Actions workflow, the secret will be available in the logs.

By the way, the listStaticSiteSecretsfunction is not the only one with this issue.

TechWatching avatar Jul 20 '23 09:07 TechWatching

hey @TechWatching. I will work with the team to prioritize this work and update you as soon I have news. Thanks for checking in!

mnlumi avatar Jul 21 '23 14:07 mnlumi

Related https://github.com/pulumi/pulumi/issues/12710

t0yv0 avatar Aug 08 '23 01:08 t0yv0