An HTTP server is enabled on the device-juniper-junos

An HTTP server is enabled on the device-juniper-junos
0

An HTTP server is enabled on the device-juniper-junos

Vendor: juniper

OS: junos

Description:
Indeni will check if a device has the HTTP service enabled. HTTP is not encrypted and is therefore a security risk.

Remediation Steps:
Disable the HTTP server on the device.

How does this work?
If “telnet” and “http” are enabled on the device, it is recommanded to disable them and enable “ssh” and “https” instead to remediate the security risks.

Why is this important?
The system services “telnet” and “http” are not recommanded to enable on the device for security reasons.

Without Indeni how would you find this?
An administrator could log on to the device to identify whether telnet and http are enabled.

junos-show-configuration-system-services

name: junos-show-configuration-system-services
description: identify whether telnet and http services are enabled
type: monitoring
monitoring_interval: 10 minute
requires:
    vendor: juniper
    os.name: junos
comments:
    telnet-enabled: null
    http-server-enabled:
        why: |
            The system services "telnet" and "http" are not recommanded to enable on the device for security reasons.
        how: |
            If "telnet" and "http" are enabled on the device, it is recommanded to disable them and enable "ssh" and "https" instead to remediate the security risks.
        without-indeni: |
            An administrator could log on to the device to identify whether telnet and http are enabled.
        can-with-snmp: false
        can-with-syslog: false
steps:
-   run:
        type: SSH
        command: show configuration system services | display set
    parse:
        type: AWK
        file: show-configuration-system-services.parser.1.awk

cross_vendor_http_server_enabled

// Deprecation warning : Scala template-based rules are deprecated. Please use YAML format rules instead.

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

import com.indeni.ruleengine.expressions.conditions.{Equals => RuleEquals, Not => RuleNot, Or => RuleOr}
import com.indeni.ruleengine.expressions.data.SnapshotExpression
import com.indeni.server.rules.RuleContext
import com.indeni.server.rules.library.templates.SingleSnapshotValueCheckTemplateRule
import com.indeni.server.rules.RemediationStepCondition
import com.indeni.server.rules.library.RuleHelper

/**
  *
  */
case class cross_vendor_http_server_enabled() extends SingleSnapshotValueCheckTemplateRule(
  ruleName = "cross_vendor_http_server_enabled",
  ruleFriendlyName = "All Devices: An HTTP server is enabled on the device",
  ruleDescription = "Indeni will check if a device has the HTTP service enabled. HTTP is not encrypted and is therefore a security risk.",
  metricName = "http-server-enabled",
  alertDescription = "The HTTP server allows unencrypted control traffic to network devices. It transmits all data in clear text, including passwords and other potentially confidential information.",
  baseRemediationText = "Disable the HTTP server on the device.",
  complexCondition = RuleEquals(RuleHelper.createComplexStringConstantExpression("true"), SnapshotExpression("http-server-enabled").asSingle().mostRecent().value().noneable))(
  RemediationStepCondition.VENDOR_CISCO ->
    """|
      |1. Disable the HTTP server on the device. You can do so by using the "no feature http-server" configuration command.
      |2. You can verify that HTTP has been disabled by using the "show http-server" command.""".stripMargin
)