Coder Social home page Coder Social logo

shizonic / ansible-playbook-gophish Goto Github PK

View Code? Open in Web Editor NEW

This project forked from justin-p/ansible-playbook-gophish

0.0 1.0 0.0 64 KB

A collection of Ansible Playbooks that deploy https://github.com/gophish/gophish/, including the provision of hosts and DNS records using Terraform.

HTML 16.27% HCL 83.73%

ansible-playbook-gophish's Introduction

ansible-playbook-gophish

A W.I.P. collection of Ansible Playbooks that deploy the gophish application, including the provision of hosts and DNS records using Terraform.

Ansible

Will configure the following items to a existing host:

  • Installs any needed roles locally with ansible-galaxy.
  • Installs any needed packages for Ansible management.
  • Update installed packages to latest version.
  • Setup Firewall (allows in 22, 80, 443)
  • Create user for gophish service.
  • Update the hostname.
  • Postfix for mail relay.
  • Selfsigned SSL certs.
  • NGINX for phishlets.
  • Logrotate for gophish.
  • Install gophish as a service.
  1. Ensure Ansible is installed.

  2. Update the inventory file

    • Point to your IP.
    • Set the correct SSH key.
    • Set the correct SSH user.
  3. Update defaults/main.yml

    • Set domain to your root domain.
    • Set server_hostname to the desired server hostname.
    • Set server_phishlet_hostname to the desired name NGINX will proxy to gophish for phishlets.
    • Update if desired, user and group created to run gophish as gophish_service_account and gophish_service_account_group
  4. Run Playbook

    • ansible-playbook main.yml --inventory inventory.yml
  5. Login to gophish

    • ssh -L 3333:127.0.0.1:3333 user@ip
    • Use your favorite browser and open https://localhost:3333
    • Login using the credentials given to you by the ansible output.

Ansible and Terraform

Deploy on DigitalOcean with CloudFlare DNS

Will create a fresh ubuntu 20.04 droplet and configure the following things:

  • Generates unique SSH keys for each deployment.
  • Setup basic DNS with CloudFlare.
  • Setup up a DigitalOcean Project.
  • Setup up a DigitalOcean Firewall that
    • allows in 22 from "0.0.0.0/0", "::/0"
    • allows 80, 443 in from CloudFlare IP ranges.
  • Setup up a DigitalOcean Droplet.
  • Installs any needed roles locally with ansible-galaxy.
  • Installs any needed packages for Ansible management.
  • Update installed packages to latest version.
  • Setup Firewall (allows in 22, 80 ,443)
  • Create user for gophish service.
  • Update the hostname.
  • Postfix for mail relay.
  • Selfsigned SSL certs (for fallback).
  • NGINX for phishlets.
  • Generate Certificates with certbot and setup auto renewal.
  • Logrotate for gophish.
  • Install gophish as a service.
  1. Ensure Ansible and Terraform are installed.

  2. Copy defaults/main.example.yml to defaults/main.yml

    • Set the correct SSH key folder. (sshkey_folder)
    • Set the correct contact mail for certbot (cerbot_contact_mail)
    • Set the name for the VPS (vps_name)
    • Set domain to your root domain.
    • Set server_hostname to the desired server hostname.
    • Set server_phishlet_hostname to the desired name NGINX will proxy to gophish for phishlets.
    • Update if desired, user and group created to run gophish as gophish_service_account and gophish_service_account_group
    • Other vars should work as is.
  3. Copy defaults/secrets.example.yml to defaults/secrets.yml

  4. Not all Terraform variables are currently 'made available' as Ansible variables. For now they can be overwritten by updating terraform_playbooks\terraform\variables.tf.

  5. Deploy and configure the infrastucture

    • ansible-playbook main.yml
  6. Login to gophish

    • ssh -L 3333:127.0.0.1:3333 user@ip
    • Use your favorite browser and open https://localhost:3333
    • Login using the credentials given to you by the ansible output.
  7. Destroy the infrastructure

    • ansible-playbook main.yml --tags=destroy

Deploy on Hetzer with CloudFlare DNS

Will create a fresh ubuntu 20.04 droplet and configure the following things:

  • Generates unique SSH keys for each deployment.
  • Setup basic DNS with CloudFlare.
  • Setup up a hetzer VPS with correct Reverse DNS.
  • Installs any needed roles locally with ansible-galaxy.
  • Installs any needed packages for Ansible management.
  • Update installed packages to latest version.
  • Setup Firewall (allows in 22, 80, 443)
  • Create user for gophish service.
  • Update the hostname.
  • Postfix for mail relay.
  • Selfsigned SSL certs (for fallback).
  • NGINX for phishlets.
  • Generate Certificates with certbot and setup auto renewal.
  • Logrotate for gophish.
  • Install gophish as a service.
  1. Ensure Ansible and Terraform are installed.

  2. Copy defaults/main.example.yml to defaults/main.yml

    • Set the correct SSH key folder. (sshkey_folder)
    • Set the correct contact mail for certbot (cerbot_contact_mail)
    • Set the name for the vps (vps_name)
    • Set domain to your root domain.
    • Set server_hostname to the desired server hostname.
    • Set server_phishlet_hostname to the desired name NGINX will proxy to gophish for phishlets.
    • Update if desired, user and group created to run gophish as gophish_service_account and gophish_service_account_group
    • Other vars should work as is.
  3. Copy defaults/secrets.example.yml to defaults/secrets.yml

  4. Not all Terraform variables are currently 'made available' as Ansible variables. For now they can be overwritten by updating terraform_playbooks\terraform\variables.tf.

  5. Deploy and configure the infrastucture

    • ansible-playbook main.yml
  6. Login to gophish

    • ssh -L 3333:127.0.0.1:3333 user@ip
    • Use your favorite browser and open https://localhost:3333
    • Login using the credentials given to you by the ansible output.
  7. Destroy the infrastructure

    • ansible-playbook main.yml --tags=destroy

ansible-playbook-gophish's People

Contributors

crypt0rr avatar justin-p avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.