Skip to content

[BugFix] [Infrastructure] Fix 'test_attestation' links in the produced OVAL documents "ssg-$(PROD)-oval.xml" to be valid URLs pointing to GH SSG Contributors wiki page#581

Merged
redhatrises merged 1 commit intoComplianceAsCode:masterfrom
iankko:fix_oval_test_attestation_links_to_have_valid_url
Jun 19, 2015
Merged

Conversation

@iankko
Copy link
Copy Markdown

@iankko iankko commented Jun 18, 2015

It has been reported via downstream bug:
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1155809

that the 'test_attestation' links we produce in XCCDF and OVAL documents
are not valid links when inspected via tools like e.g. "linklint".

The XCCDF part has been already corrected via PR:
[2] #580

This commit is fixing the very same issue but for the OVAL "ssg-$(PROD)-oval.xml"
documents generated for the different products yet.

The original problem as reported in [1] can be for the OVAL documents reproduced
e.g. as follows (it assumes the linklint executable is accessible on the system in question via the $LINKLINT variable):

# oscap oval eval --results oval_results.xml --report oval_report.html /usr/share/xml/scap/ssg/content/ssg-rhel7-oval.xml
# $LINKLINT -error -net oval_report.html

Current result on unfixed test_attestation links:

# /root/Downloads/linklint-2.3.5/linklint-2.3.5 -error -net oval_report.html 

Checking links locally in /tmp/test
that match: /oval_report.html
1 seed: /oval_report.html

Seed:    /oval_report.html
checking /oval_report.html

Processing ...
#------------------------------------------------------------
# ERROR   1 missing other file
#------------------------------------------------------------
/test_attestation

found   1 directory with files
found   1 html file
found   1 named anchor
ERROR   1 missing other file

Linklint found 1 file in 1 directory and checked 1 html file.
There was 1 missing file. 1 file had broken links.
1 error, no warnings.

Note: It's visible in the above output linklint was unable to found link to /test_attestation

Result on fixed OVAL test_attestation links (result on the same scenario when this patch is applied):

# /root/Downloads/linklint-2.3.5/linklint-2.3.5 -error -net oval_report.html 

Checking links locally in /root
that match: /oval_report.html
1 seed: /oval_report.html

Seed:    /oval_report.html
checking /oval_report.html

Processing ...

found   1 directory with files
found   1 html file
found   1 https link
found   1 named anchor

Linklint found 1 file in 1 directory and checked 1 html file.
There were no missing files. No files had broken links.
No errors, no warnings.

Note: In this case it's visble that linklint reported zero files have broken links. Also the working links can be verified manually by opening oval_report.html file in the browser and following some of the links e.g. RHEL7_20150605 for the service_abrtd_disabled rule that visiting them will point the user to the Contributors page:
[3] https://github.com/OpenSCAP/scap-security-guide/wiki/Contributors

Please review.

Thank you, Jan.

P.S.: Note:

The newly added oval-fix-test-attestation-urls.xslt XSLT transformation fixing the links have been intentionally placed under the transforms/ location on per-product basis (copy of the very same file multiple times for each affected product). I have tried to place it into the shared/ directory, but since it depends on / requires also constants.xslt XSLT change, would need to move constants.xlst to shared/ directory too. But this is not possible to do right now, because yet other product specific XSLT transformations, like e.g. shorthand2xccdf.xslt also depends on constants.xslt-- require it to be present in the product specific /transforms directory. Therefore to be able to move the new oval-fix-test-attestation-urls.xslt XSLT tranformation into shared/ directory, I would need to move all of the existing various XSLT transformations into shared/ directory. While by itself it is not unfeasible, but requires more time that I have currently got (0.1.23 release is very close), for now I have decided to put a separate product copy of oval-fix-test-attestation-urls.xslt into each product, and will merge the existing XSLT transformations later (can't dedicate time to it right now).

OVAL documents "ssg-$(PROD)-oval.xml" to be valid URLs and point to the
SCAP Security Guide Contributors GitHub wiki page.

It has been reported via downstream bug:
  [1] https://bugzilla.redhat.com/show_bug.cgi?id=1155809

that the 'test_attestation' links we produce in XCCDF and OVAL documents
are not valid links when inspected via tools like e.g. "linklint".

The XCCDF part has been already corrected via PR:
  [2] ComplianceAsCode#580

This commit is fixing the very same issue but for the OVAL "ssg-$(PROD)-oval.xml"
documents generated for the different products yet.

Testing report:
---------------
The proposed change has been tested manually (see also testing scenario
in corresponding PR to see the difference) and works fine.
@iankko iankko added bugfix Fixes to reported bugs. Infrastructure Our content build system labels Jun 18, 2015
@iankko iankko added this to the 0.1.23 milestone Jun 18, 2015
@landscape-bot
Copy link
Copy Markdown

Code Health
Code quality remained the same when pulling 3f3f6ce on iankko:fix_oval_test_attestation_links_to_have_valid_url into 0e243df on OpenSCAP:master.

redhatrises added a commit that referenced this pull request Jun 19, 2015
…o_have_valid_url

[BugFix] [Infrastructure] Fix 'test_attestation' links in the produced OVAL documents "ssg-$(PROD)-oval.xml" to be valid URLs pointing to GH SSG Contributors wiki page
@redhatrises redhatrises merged commit 660c7c0 into ComplianceAsCode:master Jun 19, 2015
@redhatrises
Copy link
Copy Markdown
Contributor

LGTM. Ack and thanks @iankko!

@iankko iankko deleted the fix_oval_test_attestation_links_to_have_valid_url branch June 20, 2015 12:19
@iankko
Copy link
Copy Markdown
Author

iankko commented Jun 21, 2015

Thank you too, Gabe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes to reported bugs. Infrastructure Our content build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants