나는 Splunk Forwarder를 설정하는 요리 책을 가지고 있습니다. 필자는 구성 파일에 대한 serverspec 테스트를 여러 번 통합했습니다. 특히 /opt/splunkforwarder/etc/apps/search/local/inputs.conf
은 다른 파일이 통과하는 모든 테스트에 실패합니다. 내 코드는 다음과 같습니다.serverspec은 단 하나의 파일에서 계속 실패합니다.
require 'spec_helper'
describe file('/opt/splunkforwarder/etc/apps/search/local/') do
it { should be_directory }
it { should be_owned_by 'nobody' }
it { should be_mode 755 }
end
describe file('/opt/splunkforwarder/etc/system/local/') do
it { should be_directory }
it { should be_owned_by 'nobody' }
it { should be_mode 755 }
end
describe file('/opt/splunkforwarder/etc/system/local/outputs.conf') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 600 }
end
describe file('/opt/splunkforwarder/etc/system/local/inputs.conf') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 600 }
end
describe file('/opt/splunkforwarder/etc/apps/search/local/inputs.conf}') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 600 }
end
describe file('/opt/splunkforwarder/etc/apps/SplunkUniversalForwarder/default/limits.conf') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 444 }
end
describe file('/opt/splunkforwarder/etc/system/local/web.conf') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 600 }
end
/opt/splunkforwarder/etc/apps/search/local/inputs.conf
을 제외하고이 파일의 모든 파일과 디렉토리가 전달됩니다. 나는 도커 인스턴스를 사용하고 있는데 내가 로그인 할 때 테스트 주방은 그렇게 찾을 :
- 파일은
- 파일은 "아무도"파일이 600 권한
다른 여러 파일과 똑같습니다. 또한 Chef 컨버전스의 표준에서 올바른 사용 권한과 소유권 및 컨텐트로 생성 된 파일을 볼 수 있습니다.
부모 디렉토리 중 하나가 올바르게 소유되어 있지 않거나 통과 한 다른 파일과 다른 권한을 가지고 있는지 확인했습니다. 그렇지 않은 경우입니다.
나는 이것이 왜지나 가지 않는지 전혀 알지 못합니다.
해당 테스트에 대한 자세한 실패 출력은 무엇입니까? –
SELinux를 활성화하고 적용합니까? 그렇다면 audits.log에 inputs.conf에 대한 항목이 있습니까? – jayhendren