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

Different FERNET_KEY across docker containers #39

Closed
stlong0521 opened this issue Sep 26, 2016 · 5 comments
Closed

Different FERNET_KEY across docker containers #39

stlong0521 opened this issue Sep 26, 2016 · 5 comments

Comments

@stlong0521
Copy link

Hi @puckel ,

I just noticed that the fernet keys are different across containers, which makes the encryption not reversible. This is probably because each container will generate a new key when launching the image and running entrypoint.sh.

I was thinking a solution to move the key generation to Dockerfile from entrypoint.sh, but this could leave security flaws as the key will possibly be built into the image and pushed remote afterwards.

Please let me know what you have in mind about this issue, or correct me if I misunderstood anything.

Thanks,
Tianlong

@puckel
Copy link
Owner

puckel commented Sep 27, 2016

Hi,

It's an issue indeed, maybe we can set it by an environment variable by default and generate one if nothing is given.

@stlong0521
Copy link
Author

Yeah, my current workaround is to set it as an environment variable to those containers, and read it from an .env file, which is local and will not be git included.

puckel added a commit that referenced this issue Oct 17, 2016
puckel added a commit that referenced this issue Oct 17, 2016
@puckel
Copy link
Owner

puckel commented Oct 17, 2016

Hi. I've pushed the fix.

@puckel puckel closed this as completed Oct 17, 2016
@stlong0521
Copy link
Author

That is awesome! To keep it complete, would you like to do the celery mode as well? BTW, setting FERNET_KEY to a newly generated key if it is not set seems redundant, because it will mostly likely still face the "different key" issue.

@puckel
Copy link
Owner

puckel commented Oct 17, 2016

It's the entrypoint.sh which deals with fernet_key, just add the environment variable to docker-compose file

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