# -*- mode: ruby -*- # vi: set ft=ruby : # Default user # ---------------------- # login: vagrant # pass: vagrant Vagrant.configure("2") do |config| # Basic configuration config.vm.provider "virtualbox" config.vm.box = "generic/centos9s" config.ssh.forward_agent = true # 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 "../../..", "/home/vagrant/Rublon-Linux" config.vm.provider "virtualbox" do |vb| # Display the VirtualBox GUI when booting the machine vb.gui = true # Fix for 'SSH auth method: Private key' stuck vb.customize ["modifyvm", :id, "--cableconnected1", "on"] end # Enable provisioning with a shell script. Additional provisioners such as # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the # documentation for more information about their specific syntax and use. config.vm.provision "shell", inline: <<-SHELL yum update yum install -y gcc openssl-devel libcurl-devel pam-devel git rapidjson-devel cmake policycoreutils-devel checkpolicy # get dependencies git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git mkdir socket.io-client-cpp/build; cd socket.io-client-cpp/build cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release .. cmake --build . --target install #handle semodule cd /home/vagrant/Rublon-Linux/service checkmodule -M -m -o login_rublon.mod login_rublon.te semodule_package -o login_rublon.pp -m login_rublon.mod # Build project cd /home/vagrant/Rublon-Linux cmake -B build && cmake --build build # Install sudo cmake --install build sudo install -m 644 rsc/rublon.config.defaults /etc/rublon.config #handle semodule cd /home/vagrant/Rublon-Linux/service semodule -i login_rublon.pp # Register Rublon pam #grep -q -e '#auth substack password-auth' /etc/pam.d/sshd || sed -i -e 's/auth substack password-auth/#auth substack password-auth/g' /etc/pam.d/sshd #grep -q -e 'auth requisite pam_unix.so' /etc/pam.d/sshd || sed -i '\$aauth requisite pam_unix.so' /etc/pam.d/sshd #grep -q -e 'auth required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aauth required pam_rublon.so' /etc/pam.d/sshd #grep -q -e 'account required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aaccount required pam_rublon.so' /etc/pam.d/sshd useradd -s /bin/bash -m bwi echo "bwi:bwi"|chpasswd systemctl restart sshd.service SHELL end