Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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.
Description of problem:
There are 2 issues when scanning image using atomic configuration compliance scan with invalid profile (profile which does not apply to the scanned image, for example, scanning fedora image with DISA STIG profile):
1. By default (without --verbose), atomic scan just reports that image is not supported for the scan and does not report any user-friendly error for the user.
2. When using --verbose option, atomic scan reports error (although not very informative), but it also tracebacks which is incorrect behavior which needs to be fixed.
This issue is also reported in upstream: https://github.com/OpenSCAP/openscap-daemon/issues/113
Version-Release number of selected component (if applicable):
openscap-daemon-0.1.6-1.el7.noarch
- issue is also reproducible on the latest upstream release 0.1.8
How reproducible:
100%
Steps to Reproduce:
1. Without --verbose:
# atomic scan --scan_type configuration_compliance \
--scanner_args profile=xccdf_org.ssgproject.content_profile_stig-rhel7-disa fedora
fedora (4ef26f1dc556e54)
fedora is not supported for this scan.
Files associated with this scan are in /var/lib/atomic/openscap/2017-10-06-07-33-06-118905.
2. With --verbose:
# atomic scan --verbose --scan_type configuration_compliance \
--scanner_args profile=xccdf_org.ssgproject.content_profile_stig-rhel7-disa fedora
INFO:OpenSCAP Daemon one-off evaluator 0.1.7
WARNING:Can't import the 'docker' package. Container scanning functionality will be disabled.
INFO:Creating tasks directory at '/var/lib/oscapd/tasks' because it didn't exist.
INFO:Creating results directory at '/var/lib/oscapd/results' because it didn't exist.
INFO:Creating results work in progress directory at '/var/lib/oscapd/work_in_progress' because it didn't exist.
INFO:Evaluated EvaluationSpec, exit_code=0.
INFO:Found 3 profile choices in '/usr/share/xml/scap/ssg/content/ssg-fedora-ds.xml' with tailoring file 'None'.
ERROR:'ProfileSuffixMatchError' object has no attribute 'message'
Traceback (most recent call last):
File "/usr/bin/oscapd-evaluate", line 174, in scan_worker
args.profile = es.select_profile_by_suffix(args.profile)
File "/usr/lib/python3.6/site-packages/openscap_daemon/evaluation_spec.py", line 373, in select_profile_by_suffix
profile_suffix
openscap_daemon.evaluation_spec.ProfileSuffixMatchError: No profile with suffix xccdf_org.ssgproject.content_profile_stig-rhel7-disa
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/oscapd-evaluate", line 179, in scan_worker
% (args.profile, target, e.message)
AttributeError: 'ProfileSuffixMatchError' object has no attribute 'message'
INFO:[100.00%] Scanned target 'chroot:///scanin/4ef26f1dc556e54d5b957593a7f678644f4f02ae30d5a115f18bf6916f322c19'
Fatal error encountered while evaluating! Failed to evaluate at least 0 targets!
docker run -t --rm -v /etc/localtime:/etc/localtime -v /run/atomic/2017-10-06-07-33-04-259506:/scanin -v /var/lib/atomic/openscap/2017-10-06-07-33-04-259506:/scanout:rw,Z -v /etc/oscapd:/etc/oscapd:ro test/openscap_base oscapd-evaluate scan --targets chroots-in-dir:///scanin --output /scanout --no-cve-scan --fix_type bash -j1 --profile xccdf_org.ssgproject.content_profile_stig-rhel7-disa
fedora (4ef26f1dc556e54)
fedora is not supported for this scan.
Files associated with this scan are in /var/lib/atomic/openscap/2017-10-06-07-33-04-259506.
The first point of not having any error message if the scanning fails can't be fixed, because Atomic hides stdout and stderr of the container, unless the --verbose option is given.
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-2018:1093