-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
Security Issue: AWS secrets keys revealed in migration files #1393
Comments
Where are you running this code? If you run in EC2, the credentials will be periodically obtained from instance metadata and are available to boto3, you don't need to provide them. If you run in Lambda, likewise they will be in the environment. There is an issue with the latest version where the session token is not fetched and things will break but #1399 fixes it and the previous version was fine as well. |
If you intend to use the standard variable names of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, the s3 storage backend will automatically look up and resolve these variables (https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html). So, you can remove those at least from the configuration and still get a working result, and this will ensure they are not kept in the migration file. |
@laurentdufloux and @maxmorlocke thanks for the workaround. Thanks Again !!! |
In general you should have separate configurations for your dev vs prod systems. Unfortunately this is how Django works with the migration system. Others have offered alternatives. |
settings.py :
Models.py
Migration file:
Is this the correct way of passing the storage to FileField ?
The text was updated successfully, but these errors were encountered: