Since it is a global change to add flags to the TS or ASM cookie, I am guessing if you need to add it to a specific policy and not global would involve an irule.
Below is a rule that seems would work but is not for me and I am out of ideas.
The flow is using two vips as we need to limit the number of public ip addresses being used.
public_ip_vip_443 redirected to public_ip_vip_8443. 443 has the client side cert and 8443 has serverside with ASM policy on 8443 vip. This works just fine. Automap as well.
So on the 8443 vip I want to insert the flags for the TS* cookies. Any ideas why the cookies are not being flagged?
when CLIENT_ACCEPTED {
set is_ssl [PROFILE::exists serverssl]
}
when HTTP_RESPONSE {
set cookie_list [HTTP::header values “Set-Cookie”]
HTTP::header remove “Set-Cookie”
if { $is_ssl } then {
foreach cookie $cookie_list {
switch -glob -- [string tolower $cookie] {
“TS*” {
}
“*;*secure*httponly*” - “*;*httponly*secure*” {
}
“*;*httponly*” {
set cookie "[string trimright $cookie "; “]; Secure”
}
“*;*secure*” {
set cookie "[string trimright $cookie "; “]; HttpOnly”
}
default {
set cookie "[string trimright $cookie "; “]; Secure; HttpOnly”
}
}
HTTP::header insert “Set-Cookie” $cookie
}
} else {
foreach cookie $cookie_list {
switch -glob -- [string tolower $cookie] {
“TS*” {
}
“*;*httponly*” {
}
default {
set cookie "[string trimright $cookie "; “]; HttpOnly”
}
}
HTTP::header insert “Set-Cookie” $cookie
}
}
}