[bitnami/wordpress] Add env var to disable XML-RPC #50838
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
This PR implements a new environment variable to the (Apache) Wordpress image called
WORDPRESS_ENABLE_XML_RPC
, that lets you disable/block access to the Wordpress XML-RPC endpoint atxmlrpc.php
, as this endpoint is deprecated in favor of the now used Wordpress Rest API and may have security vulnerabilities.The current best-practice is to disable access to it alltogether if you don't need it, so you should have the abillity to do so in my opinion.
To disable access to the XML-RPC endpoint you can set
WORDPRESS_ENABLE_XML_RPC=no
.This will create a new htaccess rule when WordPress is initialized:
Benefits
By blocking the XML-RPC endpoint you now have one thing less to worry about as a site administrator.
There are also some plugins that do the same, or you could use a filter in the child theme. However, for me, using the htaccess file is the best and safest approach.
Possible drawbacks
Blocking the endpoint could cause problems for users who still use it for access through third-party software.
However, the endpoint has long been deprecated, so further use is already discouraged and it will likely be removed altogether somewhere in the future.
Applicable issues