Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1317261 - Migration of SCAP from Sat 6.1 to Sat 6.2
Summary: Migration of SCAP from Sat 6.1 to Sat 6.2
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: SCAP Plugin
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: Unspecified
Assignee: Shlomi Zadok
QA Contact: Kedar Bidarkar
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-13 13:26 UTC by Shlomi Zadok
Modified: 2019-09-26 14:35 UTC (History)
4 users (show)

Fixed In Version: rubygem-foreman_openscap-0.5.3.5-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:43:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14477 0 None None None 2016-04-22 16:16:00 UTC

Description Shlomi Zadok 2016-03-13 13:26:39 UTC
Description of problem:
In 6.1, all the ARF reports were saved as XML in the Foreman database. That caused us a lot of pain (future pain, even...) so during refactoring of foreman_openscap we did two things:
1. Move all OpenSCAP processing to the capsule
2. Save ARF reports as files in the capsule and send a report (similar to Puppet reports) back to Foreman.
This is how it is intended to play in 6.2

The problem: when upgrading from old OpenSCAP to the new one, the migration is taking the XML files from database and recreates them as foreman_openscap reports. Then we drop the tables with the XML files. That may raise an issue with existing users, who will not have the original XML file.

Proposed solution:
5. convert the migration process to an external task (rake task), similar to the existing migration logic and:
a. check if a proxy is already installed and running, then move the reports one at a time (so you can handle failure if someone stopped the process in the middle or something).
b. delete the table only if its empty (maybe even part of the rake task so when its done it can remove the table).
c. have the ability to execute the data migration script manually (very similar to how trends data was converted between 6.1 to 6.2) and then it becomes a documentation section?

Comment 1 Shlomi Zadok 2016-04-05 12:53:12 UTC
Created redmine issue http://projects.theforeman.org/issues/14477 from this bug

Comment 5 Kedar Bidarkar 2016-07-22 14:04:43 UTC
Migration of SCAP from Sat6.1 to Sat6.2 requires 2 steps, for which we need release notes and a bug is raised for it, https://bugzilla.redhat.com/show_bug.cgi?id=1358309

1) Also for the "View full report" and "Download XML in bzip" to be possible, we need to assign "oscap proxy" to the host. So for that to be done for multiple hosts, I did the following:

a) Assign the "oscap-proxy" to host_group.
b) And make sure all the hosts are setup with a "oscap proxy", even for the older hosts and new hosts that would be created.
c) One way which I tried to do is to search for hosts via "content_source" and "os_major" , and unassign and reassign the host-group for the hosts so that the oscap-proxy is set for all the hosts in one go.

2) Ran this command, foreman-rake foreman_openscap:migrate[1]

3) Tested for the following compliance reports, for "View full reports" and "download xml in bzip format" and it works fine.

a) from managed hosts of sat6.1 migrated to sat6.2
b) from unmanaged hosts of sat6.1 migrated to sat6.2
c) from newly provisioned hosts of sat6.2 after upgrade.


VERIFIED with sat62-snap21.1(GA)

Comment 6 Bryan Kearney 2016-07-27 11:43:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501


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