Precompressed content-type found in HTTP Compression profile-f5-all

Precompressed content-type found in HTTP Compression profile-f5-all
0

Precompressed content-type found in HTTP Compression profile-f5-all

Vendor: f5

OS: all

Description:
Using the F5 device to compress content is a way of accelerating application content delivery. However, compressing content that is already pre-compressed results in longer response times and is using up system resources in vain. indeni will alert when already-compressed content types are set for compression.

Remediation Steps:
Remove any pre-compressed content type from the HTTP Compression profile. For each profile mentioned below, the specific content types that should be removed are listed.

How does this work?
This alert logs into the F5 through SSH and looks through all compression profiles for pre-compressed content-types.

Why is this important?
Using the F5 device to compress content is a way of accelerating application content delivery. However, compressing content that is already pre-compressed results in longer response times to clients and uses system resources in vain. This metric retrieves profiles with pre-compressed content.

Without Indeni how would you find this?
Log into the device through SSH. Enter TMSH and issue the command “cd /;list ltm profile http-compression content-type-include”. Look through each entry in the list and look for pre-compressed content-types.

f5-tmsh-list-ltm-profile-http-compression

name: f5-tmsh-list-ltm-profile-http-compression
description: Find use content-types that is already compressed
type: monitoring
monitoring_interval: 60 minutes
requires:
    vendor: f5
    product: load-balancer
    linux-based: 'true'
    shell: bash
comments:
    f5-compression-profile-precompressed-content-types:
        why: |
            Using the F5 device to compress content is a way of accelerating application content delivery. However, compressing content that is already pre-compressed results in longer response times to clients and uses system resources in vain. This metric retrieves profiles with pre-compressed content.
        how: |
            This alert logs into the F5 through SSH and looks through all compression profiles for pre-compressed content-types.
        without-indeni: |
            Log into the device through SSH. Enter TMSH and issue the command "cd /;list ltm profile http-compression content-type-include". Look through each entry in the list and look for pre-compressed content-types.
        can-with-snmp: false
        can-with-syslog: false
steps:
-   run:
        type: SSH
        command: ${nice-path} -n 15 tmsh -q -c "cd /;list ltm profile http-compression
            recursive content-type-include"
    parse:
        type: AWK
        file: tmsh-list-ltm-profile-http-compression.parser.1.awk

f5_precompressed_content_in_compression_profile

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

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

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.MultiSnapshotValueCheckTemplateRule
import com.indeni.server.rules.library.RuleHelper

/**
  *
  */
case class f5_precompressed_content_in_compression_profile() extends MultiSnapshotValueCheckTemplateRule(
  ruleName = "f5_precompressed_content_in_compression_profile",
  ruleFriendlyName = "F5 Devices: Precompressed content-type found in HTTP Compression profile",
  ruleDescription = "Using the F5 device to compress content is a way of accelerating application content delivery. However, compressing content that is already pre-compressed results in longer response times and is using up system resources in vain. indeni will alert when already-compressed content types are set for compression.",
  metricName = "f5-compression-profile-precompressed-content-types",
  applicableMetricTag = "name",
  alertItemsHeader = "Profiles Affected",
  alertDescription = "Using the F5 device to compress content is a way of accelerating application content delivery. However, compressing content that is already pre-compressed results in longer response times and is using up system resources in vain.\n\nThis alert was added per the request of <a target=\"_blank\" href=\"https://se.linkedin.com/in/patrik-jonsson-6527932\">Patrik Jonsson</a>.",
  baseRemediationText = "Remove any pre-compressed content type from the HTTP Compression profile. For each profile mentioned below, the specific content types that should be removed are listed.",
  complexCondition = RuleNot(RuleEquals(RuleHelper.createEmptyComplexArrayConstantExpression(), SnapshotExpression("f5-compression-profile-precompressed-content-types").asMulti().mostRecent().value().noneable)))()