F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

HawkEye40_24248's avatar
HawkEye40_24248
Icon for Nimbostratus rankNimbostratus
Jan 07, 2016

need help adding 2 iRules please - I am a NOOB so let's get that out there up front

Hey guys/gals - Will start with I'm an idiot. Took on two ticket requests that nobody else would take, requestor is hounding me, and.... I dunno how to write up the requested iRules. (re-read the subject line as often as you like)

 

1) this is the most ambiguous one. 'add secure cookies irule for a specific web address'. Let's just give it https://google.com

 

Is there a default iRule for adding secure cookies for a specific web address?

 

2) this one actually has a partial iRule in the ticket that I'm not sure would even work. 'please create an iRule along these lines:'

 

when HTTP_RESPONSE { HTTP::header insert Strict-Transport-Security "max-age=31536000; includeSubDomains;" }

 

Is this even legit? Unfortunately have no resources to turn to with this, and have a guy basically sitting on me to deliver. Was given this site as "the best F5 resource" - and appreciate in advance any suggestions, advice, and/or assistance.

 

Thank You, HawkEye40

 

1 Reply

  • I think more clarification would be needed to answer the first question... like what do they mean by secure cookies. There's the secure flag on a cookie. When it says to only send the cookie over HTTPS. You can take a look at the HTTP::cookie command to get an idea as to what you can do within an iRule with cookies.

    For the second request, I think that iRule would work fine. The syntax looks good, and it'll send that Header on every response. Only thing I'd change is from insert to replace so that if the header already exists, then it'll just replace it instead of adding another one.

    when HTTP_RESPONSE { 
        HTTP::header replace Strict-Transport-Security "max-age=31536000; includeSubDomains;" 
    }