Skip to content

Instantly share code, notes, and snippets.

@jerryaldrichiii
Last active December 7, 2018 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jerryaldrichiii/a895b2bf52a549684404312ebe39944d to your computer and use it in GitHub Desktop.
Save jerryaldrichiii/a895b2bf52a549684404312ebe39944d to your computer and use it in GitHub Desktop.
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