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

CSV and XML Problems with various columns #47

Closed
asterictnl-lvdw opened this issue Jul 29, 2022 · 3 comments · Fixed by #48
Closed

CSV and XML Problems with various columns #47

asterictnl-lvdw opened this issue Jul 29, 2022 · 3 comments · Fixed by #48
Assignees
Labels
bug Something isn't working

Comments

@asterictnl-lvdw
Copy link
Contributor

Describe the bug
When you export to a CSV or XML, because of the column limit the Finding, AffectedObjects, Remediation and References property will bug the whole CSV file.

To Reproduce
Steps to reproduce the behavior:

  1. Execute normally
  2. View the .CSV file for the results

Expected behavior
A clean CSV file where you eventually could convert to colums by selecting the , delimiter.

Desktop (please complete the following information):

  • OS: Windows 11

Additional context
To make it work properly you can comment out the Finding, AffectedObjects, Remediation and References Add-Member scripts at both XML and CSV to get a clean .CSV file.

@ThoughtContagion ThoughtContagion self-assigned this Jul 29, 2022
@ThoughtContagion ThoughtContagion added the bug Something isn't working label Jul 29, 2022
@ThoughtContagion
Copy link
Collaborator

We believe the issue is a result of failing to define a delimiter character in the script. Delimiting on a comma character may result in unwanted behavior as some of the affected objects results return comma separated lists.
We will work on a better method of exporting to the various formats.

@asterictnl-lvdw
Copy link
Contributor Author

For now is the workaround to disable the following lines:

$result | Add-Member -MemberType NoteProperty -name Finding -Value $finding.Description -ErrorAction SilentlyContinue
$result | Add-Member -MemberType NoteProperty -name AffectedObjects -Value $("$($finding.AffectedObjects)" | Out-String).Trim() -ErrorAction SilentlyContinue
$result | Add-Member -MemberType NoteProperty -name Remediation -Value $finding.Remediation -ErrorAction SilentlyContinue
$result | Add-Member -MemberType NoteProperty -name References -Value $($refs | Out-String)  -ErrorAction SilentlyContinue

Those lines might have problems with the delimitation and or the objects exceeding more than 255 characters per column.

@asterictnl-lvdw
Copy link
Contributor Author

Looks good. Will test it out with the private version and report back the results.

~Leonardo

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 a pull request may close this issue.

2 participants