script
24 TopicsMicrosoft 365 IP Steering python script
Hello! Hola! I have created a small and rudimentary script that generates a datagroup with MS 365 IPv4 and v6 addresses to be used by an iRule or policy. There are other scripts that solve this same issue but either they were: based on iRulesLX, which forces you to enable iRuleLX only for this, and made me run into issues when upgrading (memory table got filled with nonsense) based on the XML version of the list, which MS changed to a JSON file. This script is a super simple bash script that calls another super simple python file, and a couple of helper files. The biggest To Do are: Add a more secure approach to password usage. Right now, it is stored in a parameters file locked away with permissions. There should be a better way. Add support for URLs. You can find the contents here:https://github.com/teoiovine-novared/fetch-office365/tree/main I appreciate advice, (constructive) criticism and questions all the same! Thank you for your time.105Views1like3CommentsHSTS is not working.
Hi there, We have one irule is configured on VIP which is redirecting to maintenance page if user access the wrong url on that page HSTS is not working but if we access the right url then HSTS is working. We have enabled HSTS in http profile and that is attached to the same VIP with irule. Is there any way to enable HSTS on maintenance page or any remediation to fix that issue. if { $DEBUG } { log local0. "TEST - Source IP address: [IP::client_addr]" } switch -glob $uri_ext { "/httpfoo*" {set uri_int [string map {"/httpfoo" "/adapter_plain"} $uri_ext]} "/httptest*" {set uri_int [string map {"/httptest" "/adapter_plain"} $uri_ext]} default { HTTP::respond 200 content [ifile get ifile_service_unavailable_html] set OK 0 } } Many thanks in advance.Solved103Views0likes1CommentHi - Need to export VIP name, IP, status (offline/available/unknown), pool and Poolmembers
Hi, I went through many articles but couldn't find any script for a consolidated report that would have these details: VIP name VIP IP VIP Status (offline/available/unknown) pool poolmembers I did find separate articles though but not a consolidated one. I am new and not verse with scripting. https://my.f5.com/manage/s/article/K72255145 https://my.f5.com/manage/s/article/K000135606 If anyone can please help with this required script it would be of great help. Thanks in advance. Regards, Ravi59Views0likes1CommentCOPYING OF OBJECTS AND OTHER CONFIGS FROM BIG-IP 5050 TO WORKING BIG-IP VPR-B2250
Hi Team, From BIG-IP 5050 TO WORKING (BIG-IP VPR-B2250) to BIG-IP 5050 TO WORKING (BIG-IP VPR-B2250), we intend to copy the objects and other configurations. If someone knows how to do it using script, please let me know. I want to copy the items below. virtual, nodes, pools, monitor instances interfaces, nats, self ips,snats,trunks, tunnels, vlans. Thank you521Views0likes5CommentsREST API authorization in a cronjob, recommendation
I'd like to run an automatic script via cronjob to trigger REST API calls on a BIG-IQ (the script is located on the BIG-IQ itself). What possibilities are available in regards to authorization, especially from a security point of view, meaning avoiding placing credentials in the script. Is there maybe an option to use mutual SSL as trust? Right now doing manual testing I first create a token with basic credentials and then doing the REST-call with this token. But having an automatic script, there is no posibility to enter the password, means it needs to be placed somewhere. Any ideas would be very helpful. Thank you! Regards Stefan 🙂585Views0likes3Commentstmsh script to change a profile in all virtual servers in all partitions
Inspired by some articles on devcentral ( in special Stop Using the Base TCP Profile! and Rapid iRule Removal via Tmsh Script ), I decided to write a tmsh script to replace a profile for all virtual servers in all partitions. Maybe someone can use it or has any hints for optimization. Example: root@(lab1)(cfg-sync Standalone)(Active)(/Common)(tmos) create cli alias shared changeprofile command "run cli script changeProfile.tcl" root@(lab1)(cfg-sync Standalone)(Active)(/Common)(tmos) changeprofile /Common/tcp /Common/tcp-lan-optimized The /Common/tcp profile was replaced with the /Common/tcp-lan-optimized profile for the following virtuals in partition /Common : The /Common/tcp profile was replaced with the /Common/tcp-lan-optimized profile for the following virtuals in partition /LAB1 : testvip1-http testvip1-https testvip2-https tmsh script: cli script changeProfile.tcl { proc script::init {} { set ::info "Usage: changeprofile IMPORTANT: ALL virtual servers in ALL partitions!" } proc script::run {} { if { $tmsh::argc != 3 } { puts $::info exit 0 } set old_profile [lindex $tmsh::argv 1] set new_profile [lindex $tmsh::argv 2] set all_partitions [tmsh::get_config auth partition] foreach partition $all_partitions { set current_partition "/[lindex [split $partition " "] 2]" tmsh::cd $current_partition set profiles "" set vips [tmsh::get_config /ltm virtual] puts "The $old_profile profile was replaced with the $new_profile profile for the following virtuals in partition $current_partition : " tmsh::begin_transaction foreach vip $vips { set profiles [tmsh::get_field_value $vip "profiles"] if { $profiles contains $old_profile } { tmsh::modify /ltm virtual [tmsh::get_name $vip] profiles delete "{" $old_profile "}" profiles add "{" $new_profile "}" puts "\t[tmsh::get_name $vip]" } } tmsh::commit_transaction } } proc script::help {} { if { $tmsh::argc != 3 } { tmsh::add_help $::info } } proc script::tabc {} { if { $tmsh::argc != 3 } { tmsh::add_tabc $::info } } }394Views0likes0CommentsScript that generates tmsh commands
I found the following awesome command on devcentral that creates a file named commands.sh that contains all of the tmsh commands needed to modify the 3rd octet of every VIP on the unit: echo '!/bin/bash' > /shared/commands.sh; tmsh list ltm virtual destination | tr '\n' ' ' | sed 's/ \+/ /g;s/ltm virtual/\ntmsh modify ltm virtual/g;s/nation 10\.23\.206/nation 10.23.207/g' >> /shared/commands.sh; chmod 755 /shared/commands.sh What I need is a much simpler version of this command that will create a file named commands.sh that contains all of the tmsh commands needed to re-create all of the nodes on an existing unit, on a brand new unit. So the result would be: tmsh create ltm node address tmsh create ltm node address tmsh create ltm node address etc... I know there are easier ways to do this, like copying the node portion of the existing config and pasting it into the new config, but I have my reasons for wanting to do it the above way that I won't go into. Any help is much appreciated.397Views0likes6CommentsCombine and Modify Grep Output
Hi, I'm trying to write a script to output virtual server stats. Can anyone help me modify the output? Right now the GREP output looks like this: Ltm::Virtual Server: www.website.com.443 Bits In 2.1G 0 - Bits Out 2.3G 0 - Ltm::Virtual Server: www.website.com.80 Bits In 1.4G 0 - Bits Out 740.8M 0 - I need help making the output like this: www.website.com.443 Bits In 2.1G Bits Out 2.3G www.website.com.80 Bits In 1.4G Bits Out 740.8M Afterwards, I can diff files from different dates, and figure out which VIPS are not being used.378Views0likes2CommentsConverting NGINX script to F5 iRules
Hii Everyone, Can i ask about converting NGINX script to iRules F5? I have a NGINX script : [root@webdplk conf.d]# cat simponi.conf server { listen 80; listen 443; server_name dplk.bni.co.id; location / { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_pass http://192.168.3.187; } location /mobile { rewrite /mobile(.*) /$1 break; proxy_pass http://192.168.3.186:7005/; } } server { listen 7005; server_name dplk.bni.co.id; location / { rewrite /mobile(.*) /$1 break; proxy_pass http://192.168.3.186:7005/; } } [root@webdplk conf.d]# How if that script if convert to F5 IRules?? Thankyouu978Views0likes1Commenttmsh script and pool members
Hi, Probably easy one but not for me 😞 I am looking for simplest and fastest way to verify settings of pool member in given pool/s - for example description. Right now I have such code that is working but maybe there is simpler way? set pool_names [lrange $tmsh::argv 1 end] foreach pn1 $pool_names { foreach obj1 [tmsh::get_config /ltm pool $pn1] { puts $obj1 tmsh::modify /ltm pool $pn1 description "Orange" tmsh::log "Description is [tmsh::get_field_value $obj1 description]" foreach member1 [tmsh::get_field_value $obj1 members] { puts $member1 puts "Pool member desc: \"[tmsh::get_field_value $member1 description ]\"" } } } puts are just for testing of course. So last puts returns description for each pool member in a pool. What puzzles me as well is why after using tmsh::modify /ltm pool $pn1 description "Orange" tmsh::log reports previous value. After script is finished value is set to "Orange" but inside script even after modify old value is reported. I assume as well that there is no need for tmsh save sys config to permanently save changes? Piotr346Views0likes2Comments