- Security Automation with Ansible 2
- Madhu Akula Akash Mahajan
- 143字
- 2021-07-02 22:00:00
Hardening WordPress
This includes basic checks for WordPress security misconfigurations. Some of them include:
- Directory and file permissions:
- name: update the file permissions
file:
path: "{{ WordPress_install_directory }}"
recurse: yes
owner: "{{ new_user_name }}"
group: www-data
- name: updating file and directory permissions
shell: "{{ item }}"
with_items:
- "find {{ WordPress_install_directory }} -type d -exec chmod
755 {} \;"
- "find {{ WordPress_install_directory }} -type f -exec chmod
644 {} \;"
- Username and attachment enumeration blocking. The following code snippet is part of nginx's configuration:
# Username enumeration block
if ($args ~ "^/?author=([0-9]*)"){
return 403;
}
# Attachment enumeration block
if ($query_string ~ "attachment_id=([0-9]*)"){
return 403;
}
- Disallowing file edits in the WordPress editor:
- name: update the WordPress configuration
lineinfile:
path: /var/www/html/wp-config.php
line: "{{ item }}"
with_items:
- define('FS_METHOD', 'direct');
- define('DISALLOW_FILE_EDIT', true);
There are many other checks we can add as the configuration changes and updates.
推薦閱讀
- 基于C語言的程序設(shè)計
- 玩轉(zhuǎn)智能機器人程小奔
- 三菱FX3U/5U PLC從入門到精通
- Mobile DevOps
- Windows 8應(yīng)用開發(fā)實戰(zhàn)
- 數(shù)據(jù)產(chǎn)品經(jīng)理:解決方案與案例分析
- 嵌入式操作系統(tǒng)
- PVCBOT機器人控制技術(shù)入門
- 精通數(shù)據(jù)科學(xué):從線性回歸到深度學(xué)習(xí)
- R Machine Learning Projects
- Cloud Security Automation
- 計算機組成與操作系統(tǒng)
- Learning Linux Shell Scripting
- Puppet 3 Beginner’s Guide
- Hands-On DevOps