Skip to content

vmware/nsx-alb-datascript-samples-library

Repository files navigation

DataScript Examples

Content Switching

HTTP Host Switching
HTTP Host Switching using Host Header
HTTP Host Switching using Host Header and String Groups
HTTP URI Switching - Simple
HTTP URI Switching - Advanced
HTTP IP Switching
HTTP Content Switch based on HTTP POST / REQUEST DATA
HTTP URI Switching using String Groups - Advanced

L4 Traffic Management

Radius-DHCP-HTTPS SNI Based Content Switching L4 SSL Offload
SNI Based Content Switching L4 Passthrough

Availability

HTTP Retry 500 Errors
Fall back to secondary pool or custom maintenance page
Load Balancing during Maintenance Window
HTTP redirect based on Client location taken from source IP address
GEO Location database lookup based on source IP
Rewrite HTTP redirect response from 301 to 302
Ratio based Load Balancing
Location header rewrite with non-standard port
Prepend request path
Append string(www) and redirect to http(s) host
Custom connection timeout for specific URI path or pool
Rewrite single HTTP query option from the existing set of query options - Advanced
URI Encoding Function
Managing Proxy Auto-Configuration (PAC) file
TLS Version Check with HTML Page Response

Persistence

Header Persistence
JSessionID Persistence
Site Persistence using Cookie - Solution A
Site Persistence using Cookie - Solution B
Site Persistence using Cookie - Solution C
Site Persistence Leveraging Server Persistence Cookie for Two Sites Scenario
Persistence using URI with options for timeout
Load Balance/Persist using Custom Consistent Hash

Security

HTTP to HTTPS Port Redirect
Client Cert check
Block SSLv3.0, TLSv1.0 or cipher suites that don't provide encryption
Blacklist Specific URIs using String Group
Disable HTTP Processing For Selective HTTP Methods
Mitigate Microsoft vulnerability MS15-034 and CVE-2015-1635
Computing HMAC
Controlling Bots
Cross Origin Resource Sharing Implementation
Parse and Log Username from HTTP requests
Retrieve SAML Attribute from session cookie and expose it as Header and as Avi Logging attribute
Client SSL Certificate Validation with Header Insertion
Generate Custom Session ID based on time, ip address and GET request id hash value
Add SameSite attribute to Cookies that do not have it
Check For text4shell Attacks (CVE-2022-42889)
Check For log4j Attacks (CVE-2021-44228)
TLS version and IP address group check

Security - Cookie

Validate String Characters in Cookie / Cookie Sanitizer
Cookie Encryption Gateway
Cookie Rewrite / Cookie Sanitizer
Update Cookie Domain
Client Auth using cookies

Security - Header

X-Forwarded-For Header Insert
X-Client-IP allow requests from range of IPs
Header Insertion for Content Security
Remove X-* and Server Headers from Response
Close Connections without Host header
Redirect Location header validator
Let's Encrypt Server chanllange response
True Client IP on Header
Add Pool Server IP Header
True Client IP replace X-Forwarded-For (XFF)

Acceleration

Client Cache Control Behavior

Rate Limiting

Setting up Rate Limiter to use in DataScript
Add Custom Headers to Local Response
Enforce a Penalty Timeout for Blacklisted Clients
HTTP Header Rate Limiter

Troubleshooting

Log SSL Version
Log HTTP Headers

Misc

Pseudo-random hex character generator
Random Letter generator