Add parameter filtering to redact SNMP community strings from logs

This commit is contained in:
Graham McIntire 2026-01-05 13:48:39 -06:00
parent af39c7e9fd
commit 4242044cbd
No known key found for this signature in database
2 changed files with 3 additions and 11 deletions

View file

@ -51,19 +51,10 @@ const SensorChart = {
const canvas = this.el.querySelector('canvas')
const ctx = canvas.getContext('2d')
const unit = this.el.dataset.unit || '%'
console.log('Raw attributes:', {
autoScale: this.el.dataset.autoScale,
showZeroLine: this.el.dataset.showZeroLine,
unit: this.el.dataset.unit
})
const autoScale = this.el.dataset.autoScale === 'true' || this.el.dataset.autoScale === true
const showZeroLine = this.el.dataset.showZeroLine === 'true' || this.el.dataset.showZeroLine === true
const chartType = unit === 'bps' ? 'bar' : 'line'
console.log('Chart config:', { unit, autoScale, showZeroLine, chartType, datasetsCount: data.datasets.length })
// Generate colors for each dataset
const colors = [
'rgb(59, 130, 246)', // blue
@ -127,8 +118,6 @@ const SensorChart = {
// Add 10% padding, ensure minimum of 1000 (1 Kbps)
maxAbsValue = Math.max(maxAbsValue * 1.1, 1000)
console.log('Traffic graph scale:', { maxAbsValue, min: -maxAbsValue, max: maxAbsValue })
yAxisConfig = {
min: -maxAbsValue,
max: maxAbsValue,

View file

@ -22,6 +22,9 @@ config :logger, :default_formatter,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
# Filter sensitive parameters from logs
config :phoenix, :filter_parameters, ["password", "snmp_community", "secret", "token", "api_key"]
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason