- Security Automation with Ansible 2
- Madhu Akula Akash Mahajan
- 110字
- 2021-07-02 21:59:59
Hardening a database service
We have seen setting up the database. The following code snippet shows how we can harden the MySQL service by binding it to localhost and the required interfaces for interacting with the application. It then removes the anonymous user and test databases:
- name: delete anonymous mysql user for localhost
mysql_user:
user: ""
state: absent
login_password: "{{ mysql_root_password }}"
login_user: root
- name: secure mysql root user
mysql_user:
user: "root"
password: "{{ mysql_root_password }}"
host: "{{ item }}"
login_password: "{{ mysql_root_password }}"
login_user: root
with_items:
- 127.0.0.1
- localhost
- ::1
- "{{ ansible_fqdn }}"
- name: removes mysql test database
mysql_db:
db: test
state: absent
login_password: "{{ mysql_root_password }}"
login_user: root
推薦閱讀
- 亮劍.NET:.NET深入體驗(yàn)與實(shí)戰(zhàn)精要
- 計(jì)算機(jī)圖形圖像處理:Photoshop CS3
- B2B2C網(wǎng)上商城開發(fā)指南
- 21天學(xué)通Visual C++
- AutoCAD 2012中文版繪圖設(shè)計(jì)高手速成
- 運(yùn)動(dòng)控制器與交流伺服系統(tǒng)的調(diào)試和應(yīng)用
- Implementing Oracle API Platform Cloud Service
- 完全掌握AutoCAD 2008中文版:機(jī)械篇
- 大數(shù)據(jù)驅(qū)動(dòng)的機(jī)械裝備智能運(yùn)維理論及應(yīng)用
- Grome Terrain Modeling with Ogre3D,UDK,and Unity3D
- SAP Business Intelligence Quick Start Guide
- Excel 2010函數(shù)與公式速查手冊(cè)
- INSTANT Munin Plugin Starter
- 步步驚“芯”
- 計(jì)算機(jī)組裝與維修實(shí)訓(xùn)