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

If a key is undecryptable, rename it, log it, regnerate it #2072

Closed
ahmelsayed opened this issue Oct 26, 2017 · 5 comments
Closed

If a key is undecryptable, rename it, log it, regnerate it #2072

ahmelsayed opened this issue Oct 26, 2017 · 5 comments
Assignees
Milestone

Comments

@ahmelsayed
Copy link
Contributor

The runtime today fails with 500 when keys are not decryptable and the user needs to manually go and clean them up.

It'll be much better if for example

  1. rename <name>.json to <name>.json.undecryptable
  2. log message saying that happened.
  3. create a new key
@paulbatum
Copy link
Member

Chat with @fabiocav to get more specifics on how this should work.

@paulbatum paulbatum modified the milestones: Triaged, Sprint 11 Nov 17, 2017
@ahmelsayed
Copy link
Contributor Author

and btw, this is just my proposal for how things could be. There are other options that I remember @fabiocav suggesting as well; for example write more metadata into the secrets that would tell you what happened.

Regardless, the only way to get out of this situation currently is manual (delete all secrets in your storage account or in your file system depending on what an app setting says), and there should be a better way.

@ericleigh007
Copy link

Can you explain exactly the workaround you mentioned above? I'm in this situation and don't really want to recreate the function app.
"Regardless, the only way to get out of this situation currently is manual (delete all secrets in your storage account or in your file system depending on what an app setting says)"

-thanks
-e

@paulbatum
Copy link
Member

@ericleigh007 Try this:

  1. Go to https://.scm.azurewebsites.net/DebugConsole
  2. Go into data -> functions
  3. Delete the secrets folder

If that doesn't work:

  1. browse to the storage account for your function app into the azure portal,
  2. go into containers -> azure-webjobs-secrets
  3. delete the container with your function app name e.g. the circled entry in this screenshot:
    image

@fabiocav
Copy link
Member

Had a quick chat with @alrod and we'll start this simple by following an approach similar to what @ahmelsayed suggested:

If we are unable to decrypt the payload:

  1. Rename the file to <name>-<timestamp>.undecryptable.json (name would be the same as the original file, as this could happen to the host or function secrets
  2. Log a message with the details
  3. Create the new key

NOTE: We may need to specially consider scenarios where multiple sites are mistakenly setup with the same share, as this may lead to a situation where the sites keep correcting each other's secrets, initiating a loop. So we may need to limit the number of times we take this action.

alrod added a commit to alrod/azure-webjobs-sdk-script that referenced this issue Jan 3, 2018
@alrod alrod closed this as completed Jan 3, 2018
alrod added a commit to alrod/azure-webjobs-sdk-script that referenced this issue Jan 3, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants