Forum Discussion
AppWorld DC Booth Kiosk Generator
Welcome to AppWorld, community! You may or may not be with us in person, but you can watch this thread for iRules that are either generated or described by the Distributed Cloud AI Assistant.
26 Replies
- JimmyPackets
Cirrus
AI-Generated iRule
Prompt: Mirror a copy of all TCP traffic to a clone pool for intrusion detection analysis
Generated iRule (by F5 Distributed Cloud AI Assistant):
when CLIENT_ACCEPTED { # Store the original destination address set original_dest [IP::client_addr] # Send a copy of the traffic to the clone pool for analysis pool clone_pool } when SERVER_DATA { # Send the server response to the clone pool as well pool clone_pool } when CLIENT_DATA { # Send the client request to the clone pool pool clone_pool } - JimmyPackets
Cirrus
AI-Generated iRule
Prompt: Block HTTP requests that contain SQL injection patterns in the URI or query string
Generated iRule (by F5 Distributed Cloud AI Assistant):
Unfortunately, the AI assistant is unable to answer this question as the F5 Distributed Cloud documentation does not include this information. - JimmyPackets
Cirrus
AI-Generated iRule
Prompt: Persist connections to the same pool member based on a JSESSIONID cookie value
Generated iRule (by F5 Distributed Cloud AI Assistant):
when HTTP_REQUEST { # Check if the JSESSIONID cookie exists if {[HTTP::cookie exists "JSESSIONID"]} { # Get the value of the JSESSIONID cookie set session_id [HTTP::cookie "JSESSIONID"] # Persist the connection to the pool member based on the session ID persist uie session_id } } - JimmyPackets
Cirrus
AI-Generated iRule
Prompt: Rate-limit HTTP requests per client IP using a subtable, allowing 30 requests per 60 seconds
Generated iRule (by F5 Distributed Cloud AI Assistant):
when HTTP_REQUEST priority 500 { # Define maximum allowed requests per client IP set threshold 30 # Define the time window in seconds for rate limiting set interval 60 # Identify the client IP set client_ip [IP::client_addr] # Define subtable name for this client set table_name "req_count_${client_ip}" # Increment request count for this client set count [table incr -subtable $table_name -- $client_ip] # On first request, set the timeout for this client's counter if { $count == 1 } { table timeout -subtable $table_name -- $client_ip $interval } # If request count exceeds threshold, respond with HTTP 429 if { $count > $threshold } { HTTP::respond 429 content "Too Many Requests" noserver return } } F5, Inc. ("F5") disclaims all liability in connection with any output generated by the AI Assistant ("Output") or use thereof, including without limitation any negative business impact caused by your use of Output to administer, direct, configure or control the operation and functioning of any F5 products. Output is provided "as is" without any warranties of any kind. - JimmyPackets
Cirrus
AI-Generated iRule
Prompt: Parse an HTTP Authorization header to extract a Base64-encoded username and log it for audit purposes
Generated iRule (by F5 Distributed Cloud AI Assistant):
when HTTP_REQUEST priority 500 { # Retrieve the Authorization header set auth_header [HTTP::header "Authorization"] # Check if Authorization header exists and starts with "Basic " if { $auth_header ne "" && [string tolower [string range $auth_header 0 5]] eq "basic " } { # Extract the Base64-encoded token by removing "Basic " prefix set b64_token [string range $auth_header 6 end] # Attempt to decode the Base64 token safely if { [catch {b64decode $b64_token} decoded_creds] == 0 && $decoded_creds ne "" } { # Extract username by splitting decoded string at the first colon if { [regexp -- {^([^:]+):} $decoded_creds -> username] } { # Log the extracted username for audit purposes log local0. "Extracted username from Authorization header: $username" } } } } F5, Inc. ("F5") disclaims all liability in connection with any output generated by the AI Assistant ("Output") or use thereof, including without limitation any negative business impact caused by your use of Output to administer, direct, configure or control the operation and functioning of any F5 products. Output is provided "as is" without any warranties of any kind. - JimmyPackets
Cirrus
AI-Generated iRule
Prompt: Compress HTTP responses only for clients that send an Accept-Encoding: gzip header and for text content types
Generated iRule (by F5 Distributed Cloud AI Assistant):
when HTTP_REQUEST { # Check if the client sent an Accept-Encoding header with gzip if {[HTTP::header "Accept-Encoding"] contains "gzip"} { # Check if the content type is text if {[HTTP::header "Content-Type"] starts_with "text/"} { # Enable gzip compression for the response HTTP::header insert "Content-Encoding" "gzip" # Compress the response body set response_body [HTTP::response body] set compressed_body [gzip $response_body] HTTP::response body $compressed_body } } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com