Skip to content

Instantly share code, notes, and snippets.

@ibejohn818
Last active February 18, 2019 23:17
Show Gist options
  • Save ibejohn818/1c93f895e0247211954266569ea862eb to your computer and use it in GitHub Desktop.
Save ibejohn818/1c93f895e0247211954266569ea862eb to your computer and use it in GitHub Desktop.
CIS Level 1 Audit Test
curl -L 'https://gist.github.com/ibejohn818/1c93f895e0247211954266569ea862eb/download' -o gist.zip &&\
unzip gist.zip -d ./ &&\
cp -r 1c93f895e0247211954266569ea862eb-master/* . &&\
make test &&\
rm -rf *;
install_env:
virtualenv -ppython3 env; \
source env/bin/activate; \
pip install -r requirements.txt;
venv:
source env/bin/activate;
test: install_env
source env/bin/activate; \
pytest test_cis_level1.py -vv -s
pytest
pytest-runner
import pytest
import subprocess
import shlex
def test_filesystems_disabled():
systems = [
'cramfs',
'freevxfs',
'jffs2',
'hfs',
'hfsplus',
'squashfs',
'udf',
'vfat']
for fs in systems:
cmd = "modprobe -n -v {}".format(fs)
print("TESTING FS: {}".format(fs))
result = subprocess.check_output(cmd, shell=True).strip()
assert b'install /bin/true' in result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment