Giter Club home page Giter Club logo

f5-waf-enforce-sig-cve-2021-44228's Introduction

f5-waf-enforce-sigs-CVE-2021-44228

This enforces signatures for CVE-2021-44228 across all policies on a BIG-IP ASM device

Overview

This script enforces all signatures present in the list below related to CVE-2021-44228 across all policies in blocking mode in the Adv. WAF/ASM.

sigs = ['200104768', '200104769', '200004450', '200004451','200004474','200104770','200104771']

https://support.f5.com/csp/article/K19026212

This was tested on BIG-IP ASM/Adv.WAF v15.x but I expect this to work in v13/v14/v16 as well.

Prerequisites

Python 3.7+

The host machine needs to have connection to the BIG-IP management interface.

How to Use

usage: f5-waf-enforce-sig-CVE-2021-44228 device

positional arguments:
  device      File with IP adrresses of the target BIG-IP devices separated by line

f5-waf-enforce-sig-cve-2021-44228's People

Contributors

irgoncalves avatar stanislaspiron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

f5-waf-enforce-sig-cve-2021-44228's Issues

error when executing script

Hello,
when i run the script, the following error message appears :

[ijjo5560@rcxxxxx1:Active:Standalone] f5-waf-enforce-sig-CVE-2021-44228-main # python f5-waf-enforce-sig-CVE-2021-44228.py device
Enter your username: root
Traceback (most recent call last):
File "f5-waf-enforce-sig-CVE-2021-44228.py", line 123, in
username = input('Enter your username: ')
File "", line 1, in
NameError: name 'root' is not defined

Thank you for your help

One request to update matching signatures

Hi,

To improve this code, you can add required signatures in filter instead of loop on each signatures

This URL matches all staging signatures matching IDs

https:///mgmt/tm/asm/policies//signatures?$expand=signatureReference&$filter=inPolicy+eq+true+and+performStaging+eq+true+and+signature/signatureId+in('200104768','200104769','200004450','200004451','200004474','200104770','200104771')

You can replace following lines

    # enforce each signature
    for s in sigs:
        url_cve_sigs  = 'https://%s/mgmt/tm/asm/policies/%s/signatures?$expand=signatureReference&$filter=inPolicy+eq+true+and+signature/signatureId+eq+\'%s\'' % (device,policy_id,s)
        r = bigip.patch(url_cve_sigs,payload_enfor)
        print("Status code for enforcement: " + str(r.status_code))
    

by

    # enforce each signature
    url_cve_sigs  = 'https://%s/mgmt/tm/asm/policies/%s/signatures?$expand=signatureReference&$filter=inPolicy+eq+true+and+signature/signatureId+in+(\'%s\')' % (device,policy_id, "','".join(sigs))
    r = bigip.patch(url_cve_sigs,payload_enfor)
    print("Status code for enforcement: " + str(r.status_code))
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.