Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving handling of XCCDF fields that may contain HTML #4971

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

candrews
Copy link
Contributor

Use the stopNodes feature of fast-xml-parser to avoid parsing the HTML in these fields so they can be treated as text. The HTML tags are then stripped from the text as tools expect only text (and not HTML) in these fields.

This PR implements the idea first proposed at #4255 (comment) which is now possible because the stopNodes feature of fast-xml-parser was fixed in version 4.3.0 by NaturalIntelligence/fast-xml-parser#608

Use the stopNodes feature of fast-xml-parser to avoid parsing the HTML in these fields so they can be treated as text.
The HTML tags are then stripped from the text as tools expect only text (and not HTML) in these fields.

Signed-off-by: Craig Andrews <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Amndeep7
Copy link
Contributor

Amndeep7 commented Sep 20, 2023

image

fantastic - that looks a lot better now! i'll merge when all the tests pass. could you also make a corresponding PR in the SAF CLI to update the xccdf sample files over there?

@candrews

@Amndeep7 Amndeep7 added the ready-to-merge Used by mergify to identify if a PR is ready to merge into master. label Sep 20, 2023
@mergify mergify bot merged commit 96ed379 into mitre:master Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Used by mergify to identify if a PR is ready to merge into master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants