Debug mode enabled-f5-False

error
false
best-practices
f5
Debug mode enabled-f5-False
0

#1

Debug mode enabled-f5-False

Vendor: f5

OS: False

Description:
Indeni will alert if one of the debug mechanisms on a device is enabled when the default is for it to be disabled.

Remediation Steps:
Turn off the debug as soon as possible.
Follow the applicable remediation steps. mcpd-force-reload: Delete the file /service/mcpd/forceload (https://support.f5.com/csp/article/K13030), tm.rstcause.log: https://support.f5.com/csp/article/K13223, tm.rstcause.pkt: https://support.f5.com/csp/article/K13223

How does this work?
This alert logs into the F5 load balancer and verifies that the debug daemon is not activated by checking where the sym link /etc/alternatives/tmm is pointing to.

Why is this important?
The tmm.debug daemon can be enabled in order to gather additional metrics when the F5 unit crashes. However, this state is not desireable in a normal set-up as the tmm debug daemon performs slower than the default version.

Without Indeni how would you find this?
Login to the device with SSH and run “ls -l /etc/alternatives/tmm” and verify that the sym link is not pointing to “/usr/bin/tmm.debug”

f5-ls-etc-alternatives-tmm

#! META
name: f5-ls-etc-alternatives-tmm
description: See if the tmm processes is in debug mode
type: monitoring
monitoring_interval: 30 minutes
requires:
    vendor: "f5"
    product: "load-balancer"
    linux-based: "true"
    shell: "bash"

#! COMMENTS
debug-status:
    why: |
        The tmm.debug daemon can be enabled in order to gather additional metrics when the F5 unit crashes. However, this state is not desireable in a normal set-up as the tmm debug daemon performs slower than the default version.
    how: |
        This alert logs into the F5 load balancer and verifies that the debug daemon is not activated by checking where the sym link /etc/alternatives/tmm is pointing to.
    without-indeni: |
        Login to the device with SSH and run "ls -l /etc/alternatives/tmm" and verify that the sym link is not pointing to "/usr/bin/tmm.debug"
    can-with-snmp: false
    can-with-syslog: false
    vendor-provided-management: Unknown  
    
#! REMOTE::SSH
${nice-path} -n 15 /bin/ls -l /etc/alternatives/tmm

#! PARSER::AWK

#Source article about enabling/disabling this debug process
#https://support.f5.com/kb/en-us/solutions/public/11000/400/sol11490.html

#lrwxrwxrwx. 1 root webusers 18 2016-11-06 12:52 /etc/alternatives/tmm -> /usr/bin/tmm.debug
/tmm/{
	
	debugTags["name"] = "tmm-process"
	
	if($NF == "/usr/bin/tmm.debug"){	
		status = 1
	} else {
		status = 0
	}
	writeDoubleMetricWithLiveConfig("debug-status", debugTags, "gauge", 300, status, "TMM Debug", "state", "")
}

cross_vendor_debug_on

package com.indeni.server.rules.library.templatebased.crossvendor

import com.indeni.server.rules.RuleContext
import com.indeni.server.rules.library.ConditionalRemediationSteps
import com.indeni.server.rules.library.templates.StateDownTemplateRule

/**
  *
  */
case class cross_vendor_debug_on() extends StateDownTemplateRule(
  ruleName = "cross_vendor_debug_on",
  ruleFriendlyName = "All Devices: Debug mode enabled",
  ruleDescription = "Indeni will alert if one of the debug mechanisms on a device is enabled when the default is for it to be disabled.",
  metricName = "debug-status",
  applicableMetricTag = "name",
  alertIfDown = false,
  alertItemsHeader = "Debugs Enabled",
  alertDescription = "One or more debug flags or components is enabled. Leaving debug on for too long may result in performance issues.",
  baseRemediationText = "Turn off the debug as soon as possible.",
  itemSpecificDescription = Seq(
    "^watchdog$".r -> "In the event of a system lock-up, the watchdog process ensures that the BIG-IP system restarts and fails over. In order to force the BIG-IP system to produce a core file for diagnostic purposes, administrators must disable the watchdog process to allow the core file to be written to disk before the system restarts. Re-enable the watchdog.",
    "^mcpd-force-reload$".r -> "If /service/mcpd/forceload exists any reboot would take longer than usual. In case of an outage together with a degraded cluster this could mean increased downtime in case a cluster member is restarted.",
    "^tm\\.rstcause\\.log$".r -> "Enabling RST cause logging uses additional system resources when connections are reset. This can be used for additional traction by an attacked performing a DDOS attack. This is not recommended to leave enabled unless it is for troubleshooting purposes.",
    "^tm\\.rstcause\\.pkt$".r -> "Enabling RST cause information in the packet payload may disclose details about your environment to a potential attacker. This is not recommended to leave enabled unless it is for troubleshooting purposes.",
    ".*".r -> ""
  )
)(
  ConditionalRemediationSteps.VENDOR_F5 -> "Follow the applicable remediation steps. mcpd-force-reload: Delete the file /service/mcpd/forceload (https://support.f5.com/csp/article/K13030), tm.rstcause.log: https://support.f5.com/csp/article/K13223, tm.rstcause.pkt: https://support.f5.com/csp/article/K13223 ",
  ConditionalRemediationSteps.VENDOR_CP -> "If the above list includes kernel debugging, run \"fw ctl debug 0\" to clear the debugs.",
  ConditionalRemediationSteps.VENDOR_PANOS -> "Log into the device using SSH, type \"debug \" and then begin typing the items listed above. Usually the last term in the command can be replaced with a \"show\" or something similar to identify the current settings.\nFor a list of debug commands and purpose, refer to this table: https://indeni.atlassian.net/wiki/spaces/IKP/pages/536117271/Palo+Alto+Networks+Debugs+Cheat+Sheet",
  ConditionalRemediationSteps.OS_NXOS ->
    """|
      |1. Use the "show debug" NX-OS command to display the current debug status and the "undebug all" command to disable all debugging.""".stripMargin
)