Skip to content

Improving handling of XCCDF fields that may contain HTML#4971

Merged
mergify[bot] merged 1 commit into
mitre:masterfrom
candrews:stopNodes
Sep 20, 2023
Merged

Improving handling of XCCDF fields that may contain HTML#4971
mergify[bot] merged 1 commit into
mitre:masterfrom
candrews:stopNodes

Conversation

@candrews

Copy link
Copy Markdown
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 <candrews@integralblue.com>
@sonarqubecloud

Copy link
Copy Markdown

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

Amndeep7 commented Sep 20, 2023

Copy link
Copy Markdown
Contributor

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