Skip to content
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

Warn if OpenSCAP binary not available #13878

Merged
merged 1 commit into from
Feb 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ def analyze
end

def collect_compliance_data(image)
unless OpenscapResult.openscap_available?
_log.warn "OpenSCAP Binary missing, skipping scan"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So consider s/Binary/Library/here.

return nil
end
_log.info "collecting compliance data for #{options[:docker_image_id]}"
openscap_result = image.openscap_result || OpenscapResult.new(:container_image => image)
openscap_result.attach_raw_result(image_inspector_client.fetch_oscap_arf)
Expand Down
2 changes: 1 addition & 1 deletion app/models/openscap_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def ascii8bit_to_utf8(string)
end

def with_openscap_arf(raw)
self.class.openscap_available?
return unless self.class.openscap_available?
begin
OpenSCAP.oscap_init
# ARF - nist standardized 'Asset Reporting Format' Full representation if a scap scan result.
Expand Down