Skip to content

Commit

Permalink
🔒️ Disable xmlrpc by default (#1467)
Browse files Browse the repository at this point in the history
  • Loading branch information
retlehs authored Feb 12, 2023
1 parent 48405a1 commit d4f46d2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions group_vars/development/wordpress_sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ wordpress_sites:
provider: self-signed
cache:
enabled: false
xmlrpc:
enabled: false
2 changes: 2 additions & 0 deletions group_vars/production/wordpress_sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ wordpress_sites:
provider: letsencrypt
cache:
enabled: false
xmlrpc:
enabled: false
2 changes: 2 additions & 0 deletions group_vars/staging/wordpress_sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ wordpress_sites:
provider: letsencrypt
cache:
enabled: false
xmlrpc:
enabled: false
8 changes: 8 additions & 0 deletions roles/wordpress-setup/templates/wordpress-site.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ server {
}
{% endblock %}

{% block disable_xmlrpc -%}
{% if item.value.xmlrpc.enabled is defined and item.value.xmlrpc.enabled == false %}
location ~* xmlrpc\.php$ {
return 444;
}
{% endif %}
{% endblock %}

{% block h5bp -%}
{% if h5bp_cache_file_descriptors_enabled -%}
include h5bp/directive-only/cache-file-descriptors.conf;
Expand Down

0 comments on commit d4f46d2

Please sign in to comment.