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

Whitelist of production database(s) #70

Closed
f3l1x opened this issue Jun 19, 2017 · 9 comments
Closed

Whitelist of production database(s) #70

f3l1x opened this issue Jun 19, 2017 · 9 comments

Comments

@f3l1x
Copy link

f3l1x commented Jun 19, 2017

I have an idea about whitelisted database which will prevent of calling migration:reset command. Just for security reasons. What do you think?

@JanTvrdik
Copy link
Member

Whitelist of production database

I assume you mean whitelist of dev databases, otherwise it would useless.


The problem is that local database often has the same name as production database. Maybe would could create e.g. table migrations_dev on localhost and allow resetting database only when the table exists?

@f3l1x
Copy link
Author

f3l1x commented Jun 20, 2017

Something like that, I have not figured this out, just posting an idea. :-)

@Mikulas
Copy link
Contributor

Mikulas commented Jun 20, 2017

Yep, this is needed. This could probably best be implemented as a check against an environment variable. It probably should be an opt-in featured. The env name could be defined in the configuration.

Also it should be noted this is mostly preventing an user error and not adding very much “security”. With this in mind, the reset command could also ask for a nonce such as current datetime string.

@mabar
Copy link
Contributor

mabar commented Jan 6, 2018

I would like to add new configuration option to extension. Something like registerResetCommand. Simple, two lines of code solution.

@f3l1x
Copy link
Author

f3l1x commented Oct 28, 2020

Closing it, don't need it anymore.

@f3l1x f3l1x closed this as completed Oct 28, 2020
@dakur
Copy link

dakur commented Jan 28, 2021

@f3l1x Why have you closed this? There is similar issue #84 and it is not still resolved as there is still simple way to destroy whole production database in a moment. You don't want to allow such thing without any confirmation. Can we please reopen it and agree on some resolution?

@jkuchar
Copy link

jkuchar commented Feb 12, 2024

Isn't it possible to just deregister the command from DI services?

@dakur
Copy link

dakur commented Feb 12, 2024

Yes, use:

services:
	migrations.resetCommand: false

@jkuchar
Copy link

jkuchar commented Feb 13, 2024

To be precise, we use a environment based config, that is loaded only in production environment, where it deregisters that command:

image

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

6 participants