diff --git a/CHANGELOG.md b/CHANGELOG.md index eb566534e..958523ad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - docker: set LANG=C.UTF-8. Fixes #3690 (@ytti) ### Fixed +- ingate: redact secrets (private keys, passwords, secrets, passphrases, pre-shared keys, tokens and the SNMP community) when remove_secret is set (@thanegill) - siklu: allow parenthesis in prompt. Fixes #3841 (@ytti) - fortios: allow parenthesis in prompt. Fixes #3846 (@ytti) - fortigate: prompt can contain HA cluster status. Fixes #3846 (@robertcheramy) diff --git a/lib/oxidized/model/ingate.rb b/lib/oxidized/model/ingate.rb index 7f228148d..13b97b362 100644 --- a/lib/oxidized/model/ingate.rb +++ b/lib/oxidized/model/ingate.rb @@ -22,7 +22,21 @@ class Ingate < Oxidized::Model end cmd cfg_cb do |cfg| - cfg.gsub! /^# Timestamp:.*$/, '' + cfg.gsub(/^# Timestamp:.*$/, '') + end + + cmd :secret do |cfg| + # Private keys: any *key field whose quoted value is a PEM private key block + # (the value spans multiple lines). + cfg.gsub!(/\b([a-z_]*key)="-----BEGIN [A-Z ]*PRIVATE KEY-----.*?-----END [A-Z ]*PRIVATE KEY-----"/m, + '\1="