4. InSpec is an open-source testingInSpec is an open-source testing
framework for infrastructure with aframework for infrastructure with a
human-readable language for specifyinghuman-readable language for specifying
compliance, security and other policycompliance, security and other policy
requirements.requirements.
6. Profile: tests fromProfile: tests from
{:path=>"/home/attachmentgenie/Devshed/Projects/attachmentgenie/attachme{:path=>"/home/attachmentgenie/Devshed/Projects/attachmentgenie/attachme
ntgenie-ssh/test/integration/default"} (tests fromntgenie-ssh/test/integration/default"} (tests from
{:path=>".home.attachmentgenie.Devshed.Projects.attachmentgenie.attachmen{:path=>".home.attachmentgenie.Devshed.Projects.attachmentgenie.attachmen
tgenie-ssh.test.integration.default"})tgenie-ssh.test.integration.default"})
Version: (not specified)Version: (not specified)
Target: ssh://vagrant@127.0.0.1:2200Target: ssh://vagrant@127.0.0.1:2200
✔✔ client 01: Verify ssh clientclient 01: Verify ssh client
✔✔ System Package openssh-client should be installedSystem Package openssh-client should be installed
✔✔ server 01: Verify ssh serviceserver 01: Verify ssh service
✔✔ Service ssh should be enabledService ssh should be enabled
✔✔ Service ssh should be installedService ssh should be installed
✔✔ Service ssh should be runningService ssh should be running
× keys 01: Verify authorized keys for user vagrant (1 failed)× keys 01: Verify authorized keys for user vagrant (1 failed)
✔✔ File /home/vagrant/.ssh/authorized_keys should existFile /home/vagrant/.ssh/authorized_keys should exist
✔✔ File /home/vagrant/.ssh/authorized_keys should be fileFile /home/vagrant/.ssh/authorized_keys should be file
7. The intern just “solved” the problem withThe intern just “solved” the problem with
$product by “fixing” the SSH config$product by “fixing” the SSH config
9. InspecInspec
controlcontrol 'sshd-06''sshd-06' dodo
impactimpact 1.01.0
titletitle 'Server: Do not permit root-based login or do not allow'Server: Do not permit root-based login or do not allow
password and keyboard-interactive authentication'password and keyboard-interactive authentication'
descdesc 'Reduce the potential risk to gain full privileges access of'Reduce the potential risk to gain full privileges access of
the system because of weak password and keyboard-interactivethe system because of weak password and keyboard-interactive
authentication, do not allow logging in as the root user or withauthentication, do not allow logging in as the root user or with
password authentication.'password authentication.'
describedescribe sshd_configsshd_config dodo
itsits(('PermitRootLogin''PermitRootLogin') {) { shouldshould matchmatch((//no|without-passwordno|without-password//) }) }
endend
endend
11. InSpec supports the creation ofInSpec supports the creation of
complex test and compliance profiles,complex test and compliance profiles,
which organize controls to supportwhich organize controls to support
dependency management and codedependency management and code
reusereuse