Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Security Automation with Ansible 2

You're reading from   Security Automation with Ansible 2 Leverage Ansible 2 to automate complex security tasks like application security, network security, and malware analysis

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher Packt
ISBN-13 9781788394512
Length 364 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Akash Mahajan Akash Mahajan
Author Profile Icon Akash Mahajan
Akash Mahajan
MADHU AKULA MADHU AKULA
Author Profile Icon MADHU AKULA
MADHU AKULA
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Introduction to Ansible Playbooks and Roles FREE CHAPTER 2. Ansible Tower, Jenkins, and Other Automation Tools 3. Setting Up a Hardened WordPress with Encrypted Automated Backups 4. Log Monitoring and Serverless Automated Defense (Elastic Stack in AWS) 5. Automating Web Application Security Testing Using OWASP ZAP 6. Vulnerability Scanning with Nessus 7. Security Hardening for Applications and Networks 8. Continuous Security Scanning for Docker Containers 9. Automating Lab Setups for Forensics Collection and Malware Analysis 10. Writing an Ansible Module for Security Testing 11. Ansible Security Best Practices, References, and Further Reading

A complete WordPress installation step-by-step


In this section, we will go ahead and do a complete setup of WordPress, the required database server, hardening, and backup. Our platform of choice is Linux (Ubuntu 16.04) with nginx web server and with PHP-FPM for PHP runtime. We will use duply to set up the backups which will get stored in AWS S3.

Setting up nginx web server

Setting up nginx is as simple as sudo apt-get install nginx, but configuring for our use case and managing the configuration's automated way is where Ansible gives the power. Let's look at the following snippet of nginx's role from the playbook:

- name: adding nginx signing key
  apt_key:
    url: http://nginx.org/keys/nginx_signing.key
    state: present

- name: adding sources.list deb url for nginx
  lineinfile:
    dest: /etc/apt/sources.list
    line: "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx"

- name: update the cache and install nginx server
  apt:
    name: nginx
    update_cache: yes
    state...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime