-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the parameter from apache to httpd #28
Comments
Normally the InSpec apache resource should detect httpd, see https://github.com/inspec/inspec/blob/master/lib/resources/apache.rb#L31-L42 Since InSpec deprecated the resource, we should make it part of this benchmark and then adapt what is required to make if work for your environment. Step one would be to identify, why your httpd server is not detected? On which os are you running? PRs to make this happen are welcome. |
Hello Chris, Profile: DevSec Apache Baseline (apache-baseline) ↺ apache-01: Apache should be running Profile Summary: 0 successful controls, 0 control failures, 14 controls skipped |
That is strange. Seems like a bug in InSpec. Can you run the inspec shell to verify what is going on? I tested it againt a centos 7 with httpd installed.
|
This is what I am getting the results for inspec shell execute commands. You are currently running on:
inspec> apache.service
|
can you also check |
inspec> command(apache.service).exist? |
can you check why the httpd command is not available on that machine? I assume you run inspec with not enough privileges. |
ok, incase of privileges issue. now I've ran with sudo and same results. You are currently running on:
inspec> command(apache.service).exist? |
I did simple test by executing another .rb file and it is fine. describe service 'httpd' do describe port 80 do Profile: tests from inspec_httpd.rb (tests from inspec_httpd.rb) System Package httpd Test Summary: 4 successful, 0 failures, 0 skipped |
The issue is https://github.com/dev-sec/apache-baseline/blob/master/controls/apache_spec.rb#L24-L26 and since |
I think we should probably change:
to
|
Thank you, I've tested with modifying the code on my fork https://github.com/gadilasr/apache-baseline repo and it works. × apache-01: Apache should be running (1 failed) |
Cool, are you going to open a PR? |
Applied the fix and Created PR - #29 |
* Update apache_spec.rb changed from apache to httpd because of the httpd installed on CCS servers. Signed-off-by: Sreeni Gadila <sreenivas.gadila@gdit.com> * Update apache_spec.rb Signed-off-by: Sreeni Gadila <sreenivas.gadila@gdit.com> * Update apache_spec.rb rolledback with one change. Signed-off-by: Sreeni Gadila <sreenivas.gadila@gdit.com> * Update apache_spec.rb update1 Signed-off-by: Sreeni Gadila <sreenivas.gadila@gdit.com> * Update apache_spec.rb only_if update cond... Signed-off-by: Sreeni Gadila <sreenivas.gadila@gdit.com> * Update apache_spec.rb comment if condition Signed-off-by: Sreeni Gadila <sreenivas.gadila@gdit.com> * Update apache_spec.rb adddded package('htppd').installed? || Signed-off-by: Sreeni Gadila <sreenivas.gadila@gdit.com> * Update apache_spec.rb Signed-off-by: Sreeni Gadila <sreenivas.gadila@gdit.com> * Update apache_spec.rb updated from: command(apache.service).exist? to: command(apache.service).exist? || file(apache.conf_dir).exist? || service(apache.service).installed? Signed-off-by: Sreeni Gadila <sreenivas.gadila@gdit.com>
Fixed via #29 |
Hello,
I am looking to use this profile to scan httpd installed server. The current one supports if the web server installed with apache service.
Please let me know what are the changes needed for scanning the httpd service installed web server.
From:
only_if do
command(apache.service).exist?
end
To:
only_if do
command(httpd.service).exist?
end
The text was updated successfully, but these errors were encountered: