Skip to content

Instantly share code, notes, and snippets.

@lancewf
Created June 6, 2020 00:51
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 lancewf/60fc39cb2f31ccfe87832a31ab96ae8a to your computer and use it in GitHub Desktop.
Save lancewf/60fc39cb2f31ccfe87832a31ab96ae8a to your computer and use it in GitHub Desktop.
removed InSpec control test truncation
{
"type":"compliance_failure",
"total_number_of_tests":1,
"total_number_of_skipped_tests":0,
"total_number_of_passed_tests":0,
"total_number_of_failed_tests":1,
"number_of_failed_critical_tests":1,
"number_of_critical_tests":1,
"node_uuid":"97cac616-2248-4b25-9204-7046e9973848",
"node_name":"debian(2)-zeta-linux(f)-apache(p)-failed",
"inspec_version":"2.1.10",
"failure_snippet":"InSpec found a critical control failure on [debian(2)-zeta-linux(f)-apache(p)-failed](https://a2-dev.test/compliance/reporting/nodes/97cac616-2248-4b25-9204-7046e9973848)",
"failed_critical_profiles":[
{
"version":"2.0.1",
"title":"DevSec Linux Security Baseline",
"supports":[
],
"summary":"Test-suite for best-preactice os hardening",
"sha256":"b53ca05fbfe17a36363a40f3ad5bd70aa20057eaf15a9a9a8124a84d4ef08015",
"number_of_controls":1,
"name":"linux-baseline",
"maintainer":"",
"license":"",
"copyright_email":"hello@hardening.io",
"copyright":"Hardening Framework Team",
"controls":[
{
"title":"Check owner and permissions for /etc/shadow",
"status":"failed",
"source_location":{
"ref":"./.tmp/profiles/dist/unpacked/linux-baseline-2.0.1.tar.gz/linux-baseline-2.0.1/controls/os_spec.rb",
"line":33
},
"results":[
{
"status":"failed",
"start_time":"2018-02-09T10:17:23+01:00",
"skip_message":"",
"run_time":1.3800000306218863e-4,
"message":"\nexpected: \"root\"\n got: \"shadow\"\n\n(compared using ==)\n",
"code_desc":"File /etc/shadow group should eq \"root\""
},
{
"status":"failed",
"start_time":"2018-02-09T10:17:23+01:00",
"skip_message":"",
"run_time":1.3800000306218863e-4,
"message":"\nexpected: \"root\"\n got: \"shadow\"\n\n(compared using ==)\n",
"code_desc":"File /etc/shadow group should eq \"root\""
},
{
"status":"failed",
"start_time":"2018-02-09T10:17:23+01:00",
"skip_message":"",
"run_time":1.3800000306218863e-4,
"message":"\nexpected: \"root\"\n got: \"shadow\"\n\n(compared using ==)\n",
"code_desc":"File /etc/shadow group should eq \"root\""
},
{
"status":"failed",
"start_time":"2018-02-09T10:17:23+01:00",
"skip_message":"",
"run_time":1.7100000695791095e-4,
"message":"expected File /etc/shadow not to be readable by group",
"code_desc":"File /etc/shadow should not be readable by group"
}
],
"refs":[
],
"number_of_tests":311,
"number_of_failed_tests":154,
"impact":1.0,
"id":"os-02",
"desc":"Check periodically the owner and permissions for /etc/shadow",
"code":"control 'os-02' do\n impact 1.0\n title 'Check owner and permissions for /etc/shadow'\n desc 'Check periodically the owner and permissions for /etc/shadow'\n describe file('/etc/shadow') do\n it { should exist }\n it { should be_file }\n it { should be_owned_by 'root' }\n its('group') { should eq 'root' }\n it { should_not be_executable }\n it { should be_writable.by('owner') }\n it { should be_readable.by('owner') }\n it { should_not be_readable.by('group') }\n it { should_not be_readable.by('other') }\n end\n tag 'tag1': 'value1'\nend\n"
}
],
"attributes":[
{
"options":{
"description":"Chef Role"
},
"name":"role_name"
},
{
"options":{
"description":"An int id"
},
"name":"profile_id"
},
{
"options":{
"description":"A bool flag"
},
"name":"do.this?"
},
{
"options":{
"description":"A bloody array"
},
"name":"take_this"
},
{
"options":{
"description":""
},
"name":"bloody_hash"
},
{
"options":{
"description":"Default is for lazies!"
},
"name":"no_default"
}
]
}
],
"automate_fqdn":"a2-dev.test",
"automate_failure_url":"https://a2-dev.test/compliance/reporting/nodes/97cac616-2248-4b25-9204-7046e9973848"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment