Skip to content

kamal remove does not delete the accessory env files that contain secrets. #1469

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

Open
orehmane opened this issue Mar 25, 2025 · 2 comments
Open

Comments

@orehmane
Copy link

Apologies for creating 2 issues in quick succession, but I noticed them at pretty much the same time.

If you have secret env vars, they are deployed through an env file to the server. The issue is that kamal remove does not delete them, potentially leaving sensitive data on a server that is supposed to be "removed". I'm quite strapped for time, but would be happy to try to fix this myself if that would help.

Would that be desired behavior?

@djmb
Copy link
Collaborator

djmb commented Apr 21, 2025

Do you have more details?

The secrets for an app are stored in ~/.kamal/apps/<app-name>/env and the entire ~/.kamal/apps/<app-name> directory should be removed when calling kamal remove.

@orehmane
Copy link
Author

I just tested it again. I have 2 web nodes, 1 job node, and 1 accessory, the database.

I ran kamal remove and responded y when it asked if I was sure.

  • For the web and job nodes, the .kamal directory remains, though .kamal/apps is empty.
  • For the db accessory node, .kamal/apps/<app-name>/env/accessories/db.env remains, and still has all the secret values.

@djmb djmb changed the title kamal remove does not delete the env files that contain secrets. kamal remove does not delete the accessory env files that contain secrets. Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants