I have developed a docker wordpress solution and it uses wp-cli to do the required installation from shell. The installation itself required a user to get generated therefore I create a default admin user.

What I want to do now is limit this user for only wl-cli only management, because it may inpose security reasons. How I can do that?

  • if the user has access to WP CLI they can already bypass anything you put in place, the battle has already been lost – Tom J Nowell Jun 29 '18 at 22:18
  • But the command runs inside a docker container from a specific script and is generated due to installation. When instalation is performed I generate an another user for actual management, therefore is pretty much temporary to begin with. – Dimitrios Desyllas Jun 30 '18 at 18:32
  • Can't you just create the user, do the stuff, then destroy the user on the fly? – Tom J Nowell Jun 30 '18 at 21:52
  • No because I want to when wordpress has been installed to register the users I want manually. If only I could install the Db without the need for registering user via wp-cli. – Dimitrios Desyllas Jul 1 '18 at 20:50
  • That doesn't make much sense, if the user needs access to this account to run their own WP CLI commands, then it by definition can't be secured, WP CLI lets them install code, modify code, run SQL queries, modify files, even run raw PHP code as if it were a terminal. Even then, the user could use WP CLI to turn off the code limiting them to WP CLI, opening up the entire install. They could even insert a filter that makes the frontend think it's that user – Tom J Nowell Jul 1 '18 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.