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

problem in csv when in comment column several lines or special characters #88

Open
pepjm opened this issue Feb 9, 2024 · 2 comments
Open

Comments

@pepjm
Copy link

pepjm commented Feb 9, 2024

Hi
problem in csv when in comment column several lines or special characters

  • For example
    • if several lines in comments of the rules the CSV is cutted in several lines
    • if several lines in description of the objects the CSV is cutted in several lines
  • check also with host having a space in name ( Checkpoint convert it to special characters ) could be potentiel a issue
    Thank you
@chkp-edenbr
Copy link
Contributor

Hi @pepjm ,
Could you please upload examples? Are you experiencing any failures due to this?
Regards,
Eden

@pepjm
Copy link
Author

pepjm commented Feb 12, 2024

This happens in fields
object description
rules comments,
rules additionalfiled1, filed2, field3
Because you can insert several lines .
In the CSV the line is cut in the place of the ‘\n’ . Therefore the csv is cutted

I have done a quick and dirty hack to solve it replacing \n with something here ‘%0d’.
It could be that some other special characters or not UTF-8 conduct to other issues
In utils.py function write_data:
for oneline in res:
for col in oneline:
if '\n' in col:
col=col.replace('\n',' %0d ')

Example

RULE 1:
Accept,false,,any,false,Any,, POC,,false,true,Policy Targets,,5,false,,false,Any,,false,none,false,false,false,None,Any,export_error_CpmiVsClusterNetobj_b2fd6-cc1c-42ca-95f0-2e5df2_fw00,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,snmp,snmp-trap,icmp-requests,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Example1 Server,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

RULE 2: cutted in the comment
Accept,false,"Ticket 000937
RFC 0087 (removal)
C0044",any,false,Any,,IM00018,,false,true,Policy Targets,,6,false,,false,Any,,false,none,false,true,false,Log,Any,export_error_checkpoint-host_569732-6860-11d8-8795-c0a0a0_fw02,fw01,export_error_CpmiVsClusterNetobj_b2fdc9d6-cc1c-42ca-95f0-2e5f46227df2_fvfwc7aslb00,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,FWmanagePorts,ssh,ftp_,https,icmp-requests,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,export_error_checkpoint-host_569dd732-6860-11d8-8795-c0a8c902a0a0_fw02,pcadmin,groupBackup,grouptele,export_error_CpmiVsClusterNetobj_b2fdc-cc1c-42ca-95f0-2e27df2_fw00,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
RULE 3:
Accept,false,"needed ND …….. …. … … … … … …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants