inspec/test/unit/resources/auditd_rules_test.rb

22 lines
677 B
Ruby
Raw Normal View History

2015-09-05 21:07:00 +00:00
# encoding: utf-8
2015-10-06 16:55:44 +00:00
# author: Christoph Hartmann
# author: Dominik Richter
2015-09-05 21:07:00 +00:00
require 'helper'
2015-10-26 03:04:18 +00:00
require 'inspec/resource'
2015-09-05 21:07:00 +00:00
2015-10-26 03:04:18 +00:00
describe 'Inspec::Resources::AuditDaemonRules' do
2015-09-22 16:33:05 +00:00
it 'check audit policy parsing' do
2015-10-26 11:16:38 +00:00
resource = MockLoader.new(:windows).load_resource('auditd_rules')
2015-09-22 16:33:05 +00:00
_(resource.send('LIST_RULES')).must_equal [
'exit,always syscall=rmdir,unlink',
'exit,always auid=1001 (0x3e9) syscall=open',
'exit,always watch=/etc/group perm=wa',
'exit,always watch=/etc/passwd perm=wa',
'exit,always watch=/etc/shadow perm=wa',
'exit,always watch=/etc/sudoers perm=wa',
'exit,always watch=/etc/secret_directory perm=r',
]
2015-09-05 21:07:00 +00:00
end
end