Bug 1554250

Summary: CFME: OpenSCAP evaluation report target machine does not show container image name
Product: Red Hat CloudForms Management Engine Reporter: Vladimir Dulava <vdulava>
Component: ProvidersAssignee: Bronagh Sorota <bsorota>
Status: CLOSED CURRENTRELEASE QA Contact: brahmani
Severity: medium Docs Contact:
Priority: medium    
Version: 5.9.0CC: cpelland, gblomqui, gtanzill, ianwatson, jfrey, jhardy, mfeifer, obarenbo, oourfali, vdulava
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1568550 (view as bug list) Environment:
Last Closed: 2019-02-11 14:04:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Container Management Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1568550    
Attachments:
Description Flags
OpenSCAP Evaluation Report none

Description Vladimir Dulava 2018-03-12 08:58:20 UTC
Description of problem:
When performing a OpenSCAP evaluation the target machine shown is the pod name that perform scan rather than the image it is scanning.

For example if the pod name which performs the scan was called inspector-1 and it scans container image called my-rhel-image. Then instead of showing my-rhel-image the target machine shows inspector-1.

Version-Release number of selected component (if applicable):
All

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:
Scan showing the pod name

Expected results:
Scan showing the image name

Additional info:
Ian Watson created a workaround:
In /var/www/miq/vmdb/app/models/manageiq/providers/kubernetes/container_manager/scanning/job.rb in the SmartState appliance add the following line in at position 380 - :hostname => options[:image_full_name].match(/(.*)\/(.*)@(.*)/i).captures[1],

This sets the target machine host name.

In /opt/rh/cfme-gemset/bundler/gems/manageiq-ui-classic-1048ffdbd63f/app/controllers/container_image_controller.rb of the UI appliance amend the send data line to send_data(@record.openscap_result.html, :filename => @record.openscap_result.container_image.full_name.match(/(.*)@(.*)/i).captures[0].concat(".html"))

Comment 3 Gregg Tanzillo 2018-03-26 17:45:26 UTC
I don't think this is an appliance issue. It seems like a provider issue and I think it most likely belongs to the OCP providers team. I believe they did the OpenSCAP work

Comment 7 Nimrod Shneor 2018-03-28 08:48:34 UTC
I'm not sure what you mean by "performing a OpenSCAP evaluation" - can you describe what screen you are using to issue the scan?

Comment 10 Ian Watson 2018-03-29 20:15:30 UTC
Hi

The responsible team is whoever maintains the manageiq-kubernetes provider plugin - https://github.com/ManageIQ/manageiq-providers-kubernetes

That is where the code which is in question resides.

Steps for reproduction:

1. From Cloudforms click Containers -> Container Images. 
2. Click on any image
3. Click Perform Smart State Analysis
4. Wait until its finished
5. Click OpenSCAP HTML Report
6. Puff out comes a report called report.html
7. Open the report and inspect the target hostname.

Let me know if you need any further clarity

Cheers
Ian

Comment 15 brahmani 2018-07-08 11:29:14 UTC
Created attachment 1457270 [details]
OpenSCAP Evaluation Report

Verified on 5.10.0.3.20180705151325_ce4d2b5

On OpenSCAP Evaluation Report the Evaluation target = Scaned Image name