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

resolves #4698 #4699

Merged
merged 3 commits into from
Jul 11, 2023
Merged

resolves #4698 #4699

merged 3 commits into from
Jul 11, 2023

Conversation

wdower
Copy link
Contributor

@wdower wdower commented Jul 10, 2023

The fast-xml-parser module was set to strip out the namespace prefix from XML tags (ex the cm in <cm:compliance-check-name) using the removeNSPrefix option for parseXML.

Problem was that the nessus mapper was looking for XML tags that had not had the namespace stripped out. So parseXML was (correctly) returning values like compliance-check-name as attributes, but the mapper was looking for cm:compliance-check-name.

@wdower wdower added the bug Something isn't working label Jul 10, 2023
@wdower wdower self-assigned this Jul 10, 2023
Copy link
Contributor

@georgedias georgedias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a big oversight, given that the fast-xml-parser was striping the attributes prefixes, great catch.

I would make use of const for the attributes being searched, there is, use:

const COMPLIANCE_CHEK_NAME = 'compliance-check-name';
const COMPLIANCE_INFO = 'compliance-info';
const COMPLIANCE_SOLUTION = 'compliance-solution';
const COMPLIANCE_RESULT = 'compliance-result';
const COMPLIANCE_ACTUAL_VALUE = 'compliance-actual-value';

@wdower wdower requested a review from georgedias July 11, 2023 13:47
Signed-off-by: wdower <will@dower.dev>
Signed-off-by: wdower <will@dower.dev>
Signed-off-by: wdower <will@dower.dev>
Copy link
Contributor

@georgedias georgedias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates

Copy link
Contributor

@Amndeep7 Amndeep7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can get an anonymized sample file that would test against this, it would be great. Can you ask your sponsor to see if they would mind if we attempted to anonymize their data? Doesn't need to be a blocker for this pr.

@sonarcloud
Copy link

sonarcloud bot commented Jul 11, 2023

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

@wdower wdower merged commit 9b87b1a into master Jul 11, 2023
15 checks passed
@mergify mergify bot deleted the nessus-fix branch July 11, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants