Last active
December 7, 2018 00:19
-
-
Save jerryaldrichiii/a895b2bf52a549684404312ebe39944d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
control 'kube-1.0' do | |
title 'CVE-2018-1002105' | |
impact 1.0 | |
version = command('kubectl version --short').stdout.match(/Server Version: v(.*)/)[1] | |
case version | |
when /1.[0-9]\./ | |
describe 'Kube version 1.0.x - 1.9.x' do | |
it 'should be greater or equal to 1.10.0' do | |
expect(version).to be >= '1.10.0' | |
end | |
end | |
when /1\.10/ | |
describe 'Kube version 1.10.x' do | |
it 'should be greater than 1.10.10' do | |
expect(version).to be > '1.10.10' | |
end | |
end | |
when /1\.11/ | |
describe 'Kube version 1.11.x' do | |
it 'should be greater than 1.11.4' do | |
expect(version).to be > '1.11.4' | |
end | |
end | |
when /1\.12/ | |
describe 'Kube version 1.12.x' do | |
it 'should be greater than 1.12.2' do | |
expect(version).to be > '1.12.2' | |
end | |
end | |
else | |
describe 'Kube version' do | |
it 'should be an expected value' do | |
fail("Version '#{version}' is not expected") | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment