Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ansible files #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Computer-Networks/CN_R1/installation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/sh
############## quagga installation ###############
cd /usr/share/doc/quagga/examples
sudo chmod * 640
sudo rename 's/\.conf.sample$/\.conf/' *.conf.sample
sudo cp * /etc/quagga
39 changes: 27 additions & 12 deletions Computer-Networks/CN_R1/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- hosts: Computer-Networks
- hosts: Computer-Networks
become: yes
tasks:
tasks:
- name: Install Software for Computer Networks Lab
apt:
pkg: "{{ item }}"
Expand All @@ -22,17 +22,18 @@
- echoping
- tftp
- telnet
- mate-desktop-environment-extras
- mate-desktop-environment-extras
- mate-themes
- lightdm
- lightdm-gtk-greeter
- ubuntu-artwork
- lightdm
- lightdm-gtk-greeter
- ubuntu-artwork
- update-manager
- traceroute
- tree
- snmp
- psad
- quagga-doc

#- name: Install snort and fwsnort
# shell: "{{ item }}"
# with_items:
# - DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server ethtool build-essential libpcap-dev libpcre3-dev libdumbnet-dev bison flex zlib1g-dev liblzma-dev openssl libssl-dev snort fwsnort

- name: Copy Configuration files
copy:
Expand All @@ -45,5 +46,19 @@
src: ~/ansible/ComputerNetworks/CN_R1/lightdm/
dest: /etc/lightdm/

- name: Disable lightdm
shell: systemctl disable lightdm.service
- name: Copy installation script
copy:
src: ~/ansible/ComputerNetworks/CN_R1/installation.sh
dest: /tmp/

- name: Run the Installation script
shell: sh /tmp/installation.sh

- name: Enable lightdm
shell: "{{ item }}"
with_items:
- ln -s /lib/systemd/system/lightdm.service /etc/systemd/systemd/display-manager.service
- systemctl enable lightdm.service

- name: Disable dhcpd
shell: systemctl disable isc-dhcp-server
48 changes: 48 additions & 0 deletions Computer-Networks/CN_R2/installation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/sh
############### snort installation #################

sudo apt install -y gcc g++ flex bison libpcap-dev libpcre3-dev autoconf libtool libdumbnet-dev zlib1g-dev pkg-config libssl-dev libpcre3-dev fwsnort
autoreconf -f -i
cd /home/student/
sudo wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz
sudo wget https://www.snort.org/downloads/snort/snort-2.9.9.0.tar.gz
tar -xvzf daq-2.0.6.tar.gz
tar -xvzf snort-2.9.9.0.tar.gz

cd /home/student/snort_src/daq-2.0.6
./configure && make && sudo make install
cd /home/student/snort_src/snort-2.9.9.0
./configure && make && sudo make install

sudo ldconfig

sudo mkdir /etc/snort
sudo mkdir /etc/snort/preproc_rules
sudo mkdir /var/log/snort
sudo mkdir /usr/local/lib/snort_dynamicrules
sudo touch /etc/snort/rules/white_list.rules
sudo touch /etc/snort/rules/black_list.rules
sudo touch /etc/snort/rules/local.rules
sudo chmod -R 5775 /etc/snort/
sudo chmod -R 5775 /var/log/snort/
sudo chmod -R 5775 /usr/local/lib/snort
sudo chmod -R 5775 /usr/local/lib/snort_dynamicrules/
cd /home/student/snort_src/snort-2.9.9.0/etc
sudo cp -avr *.conf *.map *.dtd /etc/snort/
sudo cp -avr src/dynamic-preprocessors/build/usr/local/lib/snort_dynamicpreprocessor/* /usr/local/lib/snort_dynamicpreprocessor/

mv /home/student/snortrules-snapshot-2990.tar.gz /etc/snort
cd /etc/snort
tar xvfz snortrules-snapshot-2990.tar.gz

mkdir /home/student/InfectedPcaps
cp /home/student/infected.pcap /home/student/InfectedPcaps


############## quagga installation ###############

cd /usr/share/doc/quagga/examples
sudo chmod * 640
sudo rename 's/\.conf.sample$/\.conf/' *.conf.sample
sudo cp * /etc/quagga

41 changes: 27 additions & 14 deletions Computer-Networks/CN_R2/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- hosts: Computer-Networks
- hosts: Computer-Networks
become: yes
tasks:
tasks:
- name: Install Software for Computer Networks Lab
apt:
pkg: "{{ item }}"
Expand All @@ -22,28 +22,41 @@
- echoping
- tftp
- telnet
- mate-desktop-environment-extras
- mate-desktop-environment-extras
- mate-themes
- lightdm
- lightdm-gtk-greeter
- ubuntu-artwork
- lightdm
- lightdm-gtk-greeter
- ubuntu-artwork
- update-manager

#- name: Install snort and fwsnort
# shell: "{{ item }}"
# with_items:
# - DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server ethtool build-essential libpcap-dev libpcre3-dev libdumbnet-dev bison flex zlib1g-dev liblzma-dev openssl libssl-dev snort fwsnort
- traceroute
- tree
- snmp
- psad
- quagga-doc

- name: Copy Configuration files
copy:
src: ~/ansible/ComputerNetworks/CN_R2/configuration-files/
dest: /etc/


- name: Copy Lightdm Configuration files
copy:
src: ~/ansible/ComputerNetworks/CN_R2/lightdm/
dest: /etc/lightdm/

- name: Disable lightdm
shell: systemctl disable lightdm.service
- name: Copy installation script
copy:
src: ~/ansible/ComputerNetworks/CN_R2/installation.sh
dest: /tmp/

- name: Run the script
shell: sh /tmp/installation.sh

- name: Enable lightdm
shell: "{{ item }}"
with_items:
- ln -s /lib/systemd/system/lightdm.service /etc/systemd/systemd/display-manager.service
- systemctl disable lightdm.service

- name: Disable dhcpd
shell: systemctl disable isc-dhcp-server
48 changes: 48 additions & 0 deletions Computer-Networks/CN_R3/installation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/sh
############### snort installation #################

sudo apt install -y gcc g++ flex bison libpcap-dev libpcre3-dev autoconf libtool libdumbnet-dev zlib1g-dev pkg-config libssl-dev libpcre3-dev fwsnort
autoreconf -f -i
cd /home/student/
sudo wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz
sudo wget https://www.snort.org/downloads/snort/snort-2.9.9.0.tar.gz
tar -xvzf daq-2.0.6.tar.gz
tar -xvzf snort-2.9.9.0.tar.gz

cd /home/student/snort_src/daq-2.0.6
./configure && make && sudo make install
cd /home/student/snort_src/snort-2.9.9.0
./configure && make && sudo make install

sudo ldconfig

sudo mkdir /etc/snort
sudo mkdir /etc/snort/preproc_rules
sudo mkdir /var/log/snort
sudo mkdir /usr/local/lib/snort_dynamicrules
sudo touch /etc/snort/rules/white_list.rules
sudo touch /etc/snort/rules/black_list.rules
sudo touch /etc/snort/rules/local.rules
sudo chmod -R 5775 /etc/snort/
sudo chmod -R 5775 /var/log/snort/
sudo chmod -R 5775 /usr/local/lib/snort
sudo chmod -R 5775 /usr/local/lib/snort_dynamicrules/
cd /home/student/snort_src/snort-2.9.9.0/etc
sudo cp -avr *.conf *.map *.dtd /etc/snort/
sudo cp -avr src/dynamic-preprocessors/build/usr/local/lib/snort_dynamicpreprocessor/* /usr/local/lib/snort_dynamicpreprocessor/

mv /home/student/snortrules-snapshot-2990.tar.gz /etc/snort
cd /etc/snort
tar xvfz snortrules-snapshot-2990.tar.gz

mkdir /home/student/InfectedPcaps
cp /home/student/infected.pcap /home/student/InfectedPcaps


############## quagga installation ###############

cd /usr/share/doc/quagga/examples
sudo chmod * 640
sudo rename 's/\.conf.sample$/\.conf/' *.conf.sample
sudo cp * /etc/quagga

38 changes: 26 additions & 12 deletions Computer-Networks/CN_R3/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- hosts: Computer-Networks
- hosts: Computer-Networks
become: yes
tasks:
tasks:
- name: Install Software for Computer Networks Lab
apt:
pkg: "{{ item }}"
Expand All @@ -22,28 +22,42 @@
- echoping
- tftp
- telnet
- mate-desktop-environment-extras
- mate-desktop-environment-extras
- mate-themes
- lightdm
- lightdm-gtk-greeter
- ubuntu-artwork
- lightdm
- lightdm-gtk-greeter
- ubuntu-artwork
- update-manager
- traceroute
- tree
- snmp
- psad
- quagga-doc

#- name: Install snort and fwsnort
# shell: "{{ item }}"
# with_items:
# - DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server ethtool build-essential libpcap-dev libpcre3-dev libdumbnet-dev bison flex zlib1g-dev liblzma-dev openssl libssl-dev snort fwsnort

- name: Copy Configuration files
copy:
src: ~/ansible/ComputerNetworks/CN_R3/configuration-files/
dest: /etc/

- name: Copy installation script
copy:
src: ~/ansible/ComputerNetworks/CN_R3/installation.sh
dest: /tmp/

- name: Run the script
shell: sh /tmp/installation.sh

- name: Copy Lightdm Configuration files
copy:
src: ~/ansible/ComputerNetworks/CN_R1/lightdm/
dest: /etc/lightdm/

- name: Disable lightdm
shell: systemctl disable lightdm.service
- name: Enable lightdm
shell: "{{ item }}"
with_items:
- ln -s /lib/systemd/system/lightdm.service /etc/systemd/systemd/display-manager.service
- systemctl disable lightdm.service

- name: Disable dhcpd
shell: systemctl disable isc-dhcp-server
48 changes: 48 additions & 0 deletions Computer-Networks/CN_R4/installation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/sh
############### snort installation #################

sudo apt install -y gcc g++ flex bison libpcap-dev libpcre3-dev autoconf libtool libdumbnet-dev zlib1g-dev pkg-config libssl-dev libpcre3-dev fwsnort
autoreconf -f -i
cd /home/student/
sudo wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz
sudo wget https://www.snort.org/downloads/snort/snort-2.9.9.0.tar.gz
tar -xvzf daq-2.0.6.tar.gz
tar -xvzf snort-2.9.9.0.tar.gz

cd /home/student/snort_src/daq-2.0.6
./configure && make && sudo make install
cd /home/student/snort_src/snort-2.9.9.0
./configure && make && sudo make install

sudo ldconfig

sudo mkdir /etc/snort
sudo mkdir /etc/snort/preproc_rules
sudo mkdir /var/log/snort
sudo mkdir /usr/local/lib/snort_dynamicrules
sudo touch /etc/snort/rules/white_list.rules
sudo touch /etc/snort/rules/black_list.rules
sudo touch /etc/snort/rules/local.rules
sudo chmod -R 5775 /etc/snort/
sudo chmod -R 5775 /var/log/snort/
sudo chmod -R 5775 /usr/local/lib/snort
sudo chmod -R 5775 /usr/local/lib/snort_dynamicrules/
cd /home/student/snort_src/snort-2.9.9.0/etc
sudo cp -avr *.conf *.map *.dtd /etc/snort/
sudo cp -avr src/dynamic-preprocessors/build/usr/local/lib/snort_dynamicpreprocessor/* /usr/local/lib/snort_dynamicpreprocessor/

mv /home/student/snortrules-snapshot-2990.tar.gz /etc/snort
cd /etc/snort
tar xvfz snortrules-snapshot-2990.tar.gz

mkdir /home/student/InfectedPcaps
cp /home/student/infected.pcap /home/student/InfectedPcaps


############## quagga installation ###############

cd /usr/share/doc/quagga/examples
sudo chmod * 640
sudo rename 's/\.conf.sample$/\.conf/' *.conf.sample
sudo cp * /etc/quagga

Loading