oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

FortiOS backup is not restorable due to non-printable characters

Open ChistokhinSV opened this issue 5 months ago • 3 comments

Describe the bug Fortigate VM config file is not restorable due to improper metadata command output handling (probably non-printable characters). Not all lines in the metadata are commented, which cause inability to restore backup without modifications

To Reproduce Steps to reproduce the behavior:

  1. Configure ForiGate VM (FortiGate-VM64-KVM v7.4.7,build2731,250120 (GA.M))
  2. Use model 'fortios'
  3. Run backup
  4. See error - not all lines in the metadata section are commented (empty lines between Serial-Number and License status)

That probably applies to other commands/lines in metadata, because this config is NOT RESTORABLE until metadata lines were removed.

# # COMMAND: get system status
# Version: FortiGate-VM64-KVM v7.4.7,build2731,250120 (GA.M)
# First GA patch build date: 230509
# Security Level: High
# Firmware Signature: certified
# Virus-DB <db version stripped>
# Extended DB <db version stripped>
# Extreme DB: <stripped>
# AV AI/ML Model <db version stripped>
# IPS-DB <db version stripped>
# IPS-ETDB <db version stripped>
# APP-DB <db version stripped>
# Proxy-IPS-DB <db version stripped>
# Proxy-IPS-ETDB <db version stripped>
# Proxy-APP-DB <db version stripped>
# FMWP-DB <db version stripped>
# IPS Malicious URL Database <db version stripped>
# IoT-Detect <db version stripped>
# OT-Detect-DB: 0.00000(2001-01-01 00:00)
# OT-Patch-DB: 0.00000(2001-01-01 00:00)
# OT-Threat-DB: 6.00741(2015-12-01 02:30)
# IPS-Engine: 7.00559(2024-12-05 01:13)
# Serial-Number: ---CUT---
# 
         
License Status: Valid
# VM Resources: 1 CPU/1 allowed, 1993 MB RAM/2048 MB allowed
# Log hard disk: Available

oxidized-0.34.2 via docker hub (oxidized/oxidized:latest)

probably should apply this 'non-printable character cleanup' to all other models, not just by commenting it, but preprocess and maybe check if everything is correct.

ChistokhinSV avatar Aug 07 '25 09:08 ChistokhinSV

Looks like this in the Notepad++ with 'show all symbols' enabled Image

ChistokhinSV avatar Aug 07 '25 11:08 ChistokhinSV

This issue is stale because it has been open 90 days with no activity.

github-actions[bot] avatar Nov 06 '25 02:11 github-actions[bot]

Note - I plan to rewrite the fortios model (#3680) - I will clean \r, so it should solve this issue.

robertcheramy avatar Dec 02 '25 11:12 robertcheramy