|
62 | 62 | become: yes
|
63 | 63 | shell: |
|
64 | 64 | echo "[$(date +%H:%M:%S)]: Running apt-fast install..."
|
65 |
| - apt-fast -qq install -y jq whois build-essential git mysql-server redis-server python-pip unzip htop yq |
| 65 | + apt-fast -qq install -y jq whois build-essential git mysql-server redis-server python3-pip unzip htop yq libcairo2-dev libjpeg-turbo8-dev libpng-dev libtool-bin libossp-uuid-dev libavcodec-dev libavutil-dev libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libvncserver-dev libtelnet-dev libssl-dev libvorbis-dev libwebp-dev tomcat9 tomcat9-admin tomcat9-user tomcat9-common |
66 | 66 | register: apt_install_prerequisites
|
67 | 67 | failed_when: "'error' in apt_install_prerequisites.stderr"
|
68 | 68 |
|
|
88 | 88 | executable: /bin/bash
|
89 | 89 | become: yes
|
90 | 90 | shell: |
|
91 |
| - for package in jq whois build-essential git unzip yq mysql-server redis-server python-pip; do |
| 91 | + for package in jq whois build-essential git unzip yq mysql-server redis-server python3-pip; do |
92 | 92 | echo "[$(date +%H:%M:%S)]: [TEST] Validating that $package is correctly installed..."
|
93 | 93 | # Loop through each package using dpkg
|
94 | 94 | if ! dpkg -S $package >/dev/null; then
|
|
128 | 128 | if ! grep 'interface "eth1"' /etc/dhcp/dhclient.conf; then
|
129 | 129 | echo -e 'interface "eth1" {
|
130 | 130 | send host-name = gethostname();
|
131 |
| - send dhcp-requested-address 192.168.38.105; |
| 131 | + send dhcp-requested-address 192.168.56.105; |
132 | 132 | }' >>/etc/dhcp/dhclient.conf
|
133 | 133 | netplan apply
|
134 | 134 | fi
|
135 | 135 | # Fix eth1 if the IP isn't set correctly
|
136 | 136 | ETH1_IP=$(ip -4 addr show eth1 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
|
137 |
| - if [ "$ETH1_IP" != "192.168.38.105" ]; then |
| 137 | + if [ "$ETH1_IP" != "192.168.56.105" ]; then |
138 | 138 | echo "Incorrect IP Address settings detected. Attempting to fix."
|
139 | 139 | ifdown eth1
|
140 | 140 | ip addr flush dev eth1
|
141 | 141 | ifup eth1
|
142 | 142 | ETH1_IP=$(ifconfig eth1 | grep 'inet addr' | cut -d ':' -f 2 | cut -d ' ' -f 1)
|
143 |
| - if [ "$ETH1_IP" == "192.168.38.105" ]; then |
144 |
| - echo "[$(date +%H:%M:%S)]: The static IP has been fixed and set to 192.168.38.105" |
| 143 | + if [ "$ETH1_IP" == "192.168.56.105" ]; then |
| 144 | + echo "[$(date +%H:%M:%S)]: The static IP has been fixed and set to 192.168.56.105" |
145 | 145 | else
|
146 | 146 | echo "[$(date +%H:%M:%S)]: Failed to fix the broken static IP for eth1. Exiting because this will cause problems with other VMs."
|
147 | 147 | exit 1
|
|
471 | 471 | cd /opt || exit 1
|
472 | 472 | git clone https://github.com/OISF/suricata-update.git
|
473 | 473 | cd /opt/suricata-update || exit 1
|
474 |
| - pip install pyyaml |
475 |
| - python setup.py install |
| 474 | + pip3 install pyyaml |
| 475 | + python3 setup.py install |
476 | 476 |
|
477 | 477 | cp /vagrant/resources/suricata/suricata.yaml /etc/suricata/suricata.yaml
|
478 | 478 | crudini --set --format=sh /etc/default/suricata '' iface eth1
|
|
530 | 530 | shell: |
|
531 | 531 | echo "[$(date +%H:%M:%S)]: Installing Zeek..."
|
532 | 532 | if ! grep 'zeek' /etc/apt/sources.list.d/security:zeek.list; then
|
533 |
| - sh -c "echo 'deb http://download.opensuse.org/repositories/security:/zeek/xUbuntu_18.04/ /' > /etc/apt/sources.list.d/security:zeek.list" |
| 533 | + sh -c "echo 'deb http://download.opensuse.org/repositories/security:/zeek/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/security:zeek.list" |
534 | 534 | fi
|
535 |
| - wget -nv https://download.opensuse.org/repositories/security:zeek/xUbuntu_18.04/Release.key -O /tmp/Release.key |
| 535 | + wget -nv https://download.opensuse.org/repositories/security:zeek/xUbuntu_20.04/Release.key -O /tmp/Release.key |
536 | 536 | apt-key add - </tmp/Release.key &>/dev/null
|
537 | 537 |
|
538 | 538 | - name: Install Zeek Packages
|
539 | 539 | become: yes
|
540 | 540 | apt:
|
541 |
| - name: ['zeek', 'crudini', 'python-pip'] |
| 541 | + name: ['zeek', 'crudini', 'python3-pip'] |
542 | 542 | update_cache: yes
|
543 | 543 |
|
544 | 544 | - name: Install Zeek Continued
|
|
549 | 549 | # Environment variables
|
550 | 550 | NODECFG=/opt/zeek/etc/node.cfg
|
551 | 551 | export PATH=$PATH:/opt/zeek/bin
|
552 |
| - pip install zkg==2.1.1 |
| 552 | + pip3 install zkg |
553 | 553 | zkg refresh
|
554 | 554 | zkg autoconfig
|
555 | 555 | zkg install --force salesforce/ja3
|
|
617 | 617 | executable: /bin/bash
|
618 | 618 | become: yes
|
619 | 619 | shell: |
|
620 |
| - echo "[$(date +%H:%M:%S)]: Installing Guacamole..." |
621 |
| - cd /opt |
622 |
| - apt-get -qq install -y libcairo2-dev libjpeg62-dev libpng-dev libossp-uuid-dev libfreerdp-dev libpango1.0-dev libssh2-1-dev libssh-dev tomcat8 tomcat8-admin tomcat8-user |
623 |
| - wget --progress=bar:force "http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/1.0.0/source/guacamole-server-1.0.0.tar.gz" -O guacamole-server-1.0.0.tar.gz |
624 |
| - tar -xf guacamole-server-1.0.0.tar.gz && cd guacamole-server-1.0.0 |
625 |
| - ./configure &>/dev/null && make --quiet &>/dev/null && make --quiet install &>/dev/null || echo "[-] An error occurred while installing Guacamole." |
| 620 | + echo "[$(date +%H:%M:%S)]: Setting up Guacamole..." |
| 621 | + cd /opt || exit 1 |
| 622 | + echo "[$(date +%H:%M:%S)]: Downloading Guacamole..." |
| 623 | + wget --progress=bar:force "https://apache.org/dyn/closer.lua/guacamole/1.3.0/source/guacamole-server-1.3.0.tar.gz?action=download" -O guacamole-server-1.3.0.tar.gz |
| 624 | + tar -xf guacamole-server-1.3.0.tar.gz && cd guacamole-server-1.3.0 || echo "[-] Unable to find the Guacamole folder." |
| 625 | + echo "[$(date +%H:%M:%S)]: Configuring Guacamole and running 'make' and 'make install'..." |
| 626 | + ./configure --with-init-dir=/etc/init.d && make --quiet &>/dev/null && make --quiet install &>/dev/null || echo "[-] An error occurred while installing Guacamole." |
626 | 627 | ldconfig
|
627 |
| - cd /var/lib/tomcat8/webapps |
628 |
| - wget --progress=bar:force "http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/1.0.0/binary/guacamole-1.0.0.war" -O guacamole.war |
| 628 | + cd /var/lib/tomcat9/webapps || echo "[-] Unable to find the tomcat9/webapps folder." |
| 629 | + wget --progress=bar:force "https://apache.org/dyn/closer.lua/guacamole/1.3.0/binary/guacamole-1.3.0.war?action=download" -O guacamole.war |
629 | 630 | mkdir /etc/guacamole
|
630 |
| - mkdir /usr/share/tomcat8/.guacamole |
| 631 | + mkdir /etc/guacamole/shares |
| 632 | + sudo chmod 777 /etc/guacamole/shares |
| 633 | + mkdir /usr/share/tomcat9/.guacamole |
631 | 634 | cp /vagrant/resources/guacamole/user-mapping.xml /etc/guacamole/
|
632 | 635 | cp /vagrant/resources/guacamole/guacamole.properties /etc/guacamole/
|
633 | 636 | cp /vagrant/resources/guacamole/guacd.service /lib/systemd/system
|
634 |
| - sudo ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat8/.guacamole/ |
635 |
| - sudo ln -s /etc/guacamole/user-mapping.xml /usr/share/tomcat8/.guacamole/ |
| 637 | + sudo ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat9/.guacamole/ |
| 638 | + sudo ln -s /etc/guacamole/user-mapping.xml /usr/share/tomcat9/.guacamole/ |
| 639 | + # Thank you Kifarunix: https://kifarunix.com/install-guacamole-on-debian-11/ |
| 640 | + useradd -M -d /var/lib/guacd/ -r -s /sbin/nologin -c "Guacd User" guacd |
| 641 | + mkdir /var/lib/guacd |
| 642 | + chown -R guacd: /var/lib/guacd |
| 643 | + systemctl daemon-reload |
636 | 644 | systemctl enable guacd
|
637 |
| - systemctl enable tomcat8 |
| 645 | + systemctl enable tomcat9 |
638 | 646 | systemctl start guacd
|
639 |
| - systemctl start tomcat8 |
| 647 | + systemctl start tomcat9 |
| 648 | + echo "[$(date +%H:%M:%S)]: Guacamole installation complete!" |
640 | 649 | register: install_guacamole
|
641 |
| - failed_when: "'error' in install_guacamole.stderr" |
642 | 650 |
|
643 | 651 | - name: Postinstall Tasks
|
644 | 652 | args:
|
|
0 commit comments