Bug 1554250 - CFME: OpenSCAP evaluation report target machine does not show container image name
Summary: CFME: OpenSCAP evaluation report target machine does not show container image...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: GA
: 5.10.0
Assignee: Bronagh Sorota
QA Contact: brahmani
URL:
Whiteboard:
Depends On:
Blocks: 1568550
TreeView+ depends on / blocked
 
Reported: 2018-03-12 08:58 UTC by Vladimir Dulava
Modified: 2021-06-10 15:15 UTC (History)
10 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1568550 (view as bug list)
Environment:
Last Closed: 2019-02-11 14:04:18 UTC
Category: ---
Cloudforms Team: Container Management
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
OpenSCAP Evaluation Report (69.90 KB, image/png)
2018-07-08 11:29 UTC, brahmani
no flags Details

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


Note You need to log in before you can comment on or make changes to this bug.