Skip to content

Commit

Permalink
add vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Nov 25, 2018
1 parent 8c33c44 commit 036fcbd
Show file tree
Hide file tree
Showing 6 changed files with 561 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
*.pdf
*.bu
kaspersky.key
.vagrant/
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,28 @@ RUN buildDeps='libreadline-dev:i386 \
&& echo "===> Install Kaspersky..." \
&& wget https://products.s.kaspersky-labs.com/multilanguage/file_servers/kavlinuxserver8.0/kav4fs_8.0.4-312_i386.deb -P /tmp \
&& DEBIAN_FRONTEND=noninteractive dpkg --force-architecture -i /tmp/kav4fs_8.0.4-312_i386.deb \
&& chmod a+s /opt/kaspersky/kav4fs/bin/kav4fs-setup.pl \
&& chmod a+s /opt/kaspersky/kav4fs/bin/kav4fs-control \
&& chmod 0777 /etc/kaspersky/license.key \
&& /etc/init.d/kav4fs-supervisor start; sleep 10 && /opt/kaspersky/kav4fs/bin/kav4fs-control --install-active-key /etc/kaspersky/license.key \
&& echo "===> Clean up unnecessary files..." \
&& apt-get purge -y --auto-remove $buildDeps \
# && apt-get purge -y --auto-remove $buildDeps \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives /tmp/* /var/tmp/*

# Ensure ca-certificates is installed for elasticsearch to use https
RUN apt-get update -qq && apt-get install -yq --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY install.conf /tmp
COPY config/docker.conf /etc/kaspersky/docker.conf
RUN /etc/init.d/kav4fs-supervisor start; sleep 10 \
&& /opt/kaspersky/kav4fs/bin/kav4fs-setup.pl --auto-install=/tmp/install.conf
&& /opt/kaspersky/kav4fs/bin/kav4fs-setup.pl --auto-install=/etc/kaspersky/docker.conf

RUN \
echo "===> Updating AV..." \
&& /etc/init.d/kav4fs-supervisor start; sleep 10 \
&& /opt/kaspersky/kav4fs/bin/kav4fs-control --start-task 6 \
&& /opt/kaspersky/kav4fs/bin/kav4fs-control --progress 6
# RUN \
# echo "===> Updating AV..." \
# && /etc/init.d/kav4fs-supervisor start; sleep 10 \
# && /opt/kaspersky/kav4fs/bin/kav4fs-control --start-task 6 \
# && /opt/kaspersky/kav4fs/bin/kav4fs-control --progress 6

# Add EICAR Test Virus File to malware folder
ADD http://www.eicar.org/download/eicar.com.txt /malware/EICAR
Expand Down
76 changes: 76 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "ubuntu/trusty64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder ".", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:

config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = false
vb.name = "kaspersky-box"
# Customize the amount of memory on the VM:
vb.memory = "2048"
end

# View the documentation for the provider you are using for more
# information on available options.

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
dpkg --add-architecture i386
apt-get update
apt-get install -y libc6-i386
wget https://products.s.kaspersky-labs.com/multilanguage/file_servers/kavlinuxserver8.0/kav4fs_8.0.4-312_i386.deb -P /tmp
DEBIAN_FRONTEND=noninteractive dpkg --force-architecture -i /tmp/kav4fs_8.0.4-312_i386.deb
chmod a+s /opt/kaspersky/kav4fs/bin/kav4fs-control
chmod a+s /opt/kaspersky/kav4fs/bin/kav4fs-setup.pl
/opt/kaspersky/kav4fs/bin/kav4fs-setup.pl --auto-install=/vagrant_data/config/vagrant.conf
SHELL
end
12 changes: 12 additions & 0 deletions config/docker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
EULA_AGREED=yes
SERVICE_LOCALE=C.UTF-8
INSTALL_KEY_FILE=/etc/kaspersky/license.key
UPDATER_SOURCE=KLServers
# UPDATER_SOURCE=AKServer
UPDATER_PROXY=no
UPDATER_EXECUTE=yes
# UPDATER_EXECUTE=no
UPDATER_ENABLE_AUTO=no
RTP_BUILD_KERNEL_MODULE=no
RTP_SAMBA_ENABLE=no
RTP_START=no
Loading

0 comments on commit 036fcbd

Please sign in to comment.