Giter Site home page Giter Site logo

ansible-zeek-deploy's Introduction

Ansible Zeek Standalone Deployment

This is a small example of automating, or mostly automating, a Zeek Standalone deployment. Not for Production. The included playbooks will install an Ubuntu 22.04 compatible binary of Zeek, in addition to a third party Zeek module, with the ability to add more. The following module included:

Recommended testing environment:

  • One virtual machine to install Ansible and deploy the playbooks from; will be referred to as the ansible-controller.
  • One virtual machine where we will deploy Zeek using Ansible. This will be known as the zeek-instance.
  • The ansible-controller must be able to ssh to the zeek-instance.
  • Both the ansible-controller and the zeek-instance must be able to apt install other packages from the internet.

Building the Ansible Controller and Zeek Instance

Create a virtual machine that will be your ansible-controller, then git clone this repo to that VM. Once this is done, cd ansible_zeek_deploy and then mkdir keys within. This keys directory will be used to store our ssh keypairs. Once the keys directory is made, cd keys and then use the following command to generate the zeek ssh key, with no password:

ansible-controller$ ssh-keygen -t ed25519 -N "" -f zeek_key

Once the ssh keypair are made, go back to the ansible_zeek_deploy directory and then execute sudo bash ansible_deploy.sh and let it run. It will install the necessary dependencies to run Ansible on your ansible-controller. Your ansible-controller is now ready.

Go make another virtual machine, which will be our zeek-instance. Once the zeek-instance is created, do not update it and no not install anything for now, just record the IP address or domain name you need to ssh to it from the ansible-controller. The zeek-instance now ready.

Go back to the ssh keypair you made earlier on ansible-controller. Copy the zeek_key.pub contents and paste it all into the /home/ubuntu/.ssh/authorized_keys file on zeek-instance.

Once you have done this, go ahead and test the connection from your ansible-controller to your zeek-instance, to verify connectivity to the zeek-instance from the ansible-controller:

ansible-controller$ ssh -i <Where/your/private/zeek_key/is/located ubuntu@<IP_addr_of_zeek_instance>

On the ansible-controller, modify inventory/zeek-instance file and replace <IP4/6_ADDR or DOMAIN> with the same address you used earlier to ssh to the zeek-instance.

Prepping the Playbooks

From the ansible-controller, run the ssh-agent:

ansible-controller$ eval "$(ssh-agent)"

Add your zeek ssh key (Not your .pub key):

ansible-controller$ ssh-add <where/zeek_key/is/located>

Activate the Ansible venv:

ansible-controller$ source /opt/ansible/venv/bin/activate

Running the Playbooks

From ansible-controller, build Zeek on the zeek-instance:

ansible-controller$ ansible-playbook -i inventories/zeek-instance plays/ansible_zeek_build.yml

Then configure zeek:

ansible-controller$ ansible-playbook -i inventories/zeek-instance plays/ansible_zeek_configure.yml

And then once you're done with Zeek, you can teardown:

ansible-controller$ ansible-playbook -i inventories/zeek-instance plays/ansible_zeek_teardown.yml

ansible-zeek-deploy's People

Contributors

aester3 avatar

Watchers

Micheal Jones avatar Joe Topjian avatar Byron Chu avatar  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.