Skip to content

Commit 4f1e912

Browse files
akeslejpipkin1
andauthored
Replace Fastly VCL cstr_escape w/ json.escape (#5065)
Co-authored-by: John Pipkin (Sumo Logic) <[email protected]>
1 parent b40c0a9 commit 4f1e912

File tree

1 file changed

+58
-58
lines changed

1 file changed

+58
-58
lines changed

docs/integrations/saas-cloud/fastly.md

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -69,39 +69,39 @@ When you configure the Sumo Logic endpoint in Fastly:
6969
"protocol": "%{req.proto}V",
7070
"host": "%{req.http.Fastly-Orig-Host}V",
7171
"origin_host": "%{req.http.Host}V",
72-
"url": "%{cstr_escape(req.url)}V",
72+
"url": "%{json.escape(req.url)}V",
7373
"is_ipv6": "%{if(req.is_ipv6, \"true\", \"false\")}V",
7474
"is_tls": "%{if(req.is_ssl, \"true\", \"false\")}V",
75-
"tls_client_protocol": "%{cstr_escape(tls.client.protocol)}V",
76-
"tls_client_servername": "%{cstr_escape(tls.client.servername)}V",
77-
"tls_client_cipher": "%{cstr_escape(tls.client.cipher)}V",
78-
"tls_client_cipher_sha": "%{cstr_escape(tls.client.ciphers_sha)}V",
79-
"tls_client_tlsexts_sha": "%{cstr_escape(tls.client.tlsexts_sha)}V",
75+
"tls_client_protocol": "%{json.escape(tls.client.protocol)}V",
76+
"tls_client_servername": "%{json.escape(tls.client.servername)}V",
77+
"tls_client_cipher": "%{json.escape(tls.client.cipher)}V",
78+
"tls_client_cipher_sha": "%{json.escape(tls.client.ciphers_sha)}V",
79+
"tls_client_tlsexts_sha": "%{json.escape(tls.client.tlsexts_sha)}V",
8080
"is_h2": "%{if(fastly_info.is_h2, \"true\", \"false\")}V",
8181
"is_h2_push": "%{if(fastly_info.h2.is_push, \"true\", \"false\")}V",
8282
"h2_stream_id": "%{fastly_info.h2.stream_id}V",
83-
"request_referer": "%{cstr_escape(req.http.Referer)}V",
84-
"request_user_agent": "%{cstr_escape(req.http.User-Agent)}V",
85-
"request_accept_content": "%{cstr_escape(req.http.Accept)}V",
86-
"request_accept_language": "%{cstr_escape(req.http.Accept-Language)}V",
87-
"request_accept_encoding": "%{cstr_escape(req.http.Accept-Encoding)}V",
88-
"request_accept_charset": "%{cstr_escape(req.http.Accept-Charset)}V",
89-
"request_connection": "%{cstr_escape(req.http.Connection)}V",
90-
"request_dnt": "%{cstr_escape(req.http.DNT)}V",
91-
"request_forwarded": "%{cstr_escape(req.http.Forwarded)}V",
92-
"request_via": "%{cstr_escape(req.http.Via)}V",
93-
"request_cache_control": "%{cstr_escape(req.http.Cache-Control)}V",
94-
"request_x_requested_with": "%{cstr_escape(req.http.X-Requested-With)}V",
95-
"request_x_forwarded_for": "%{cstr_escape(req.http.X-Forwarded-For)}V",
83+
"request_referer": "%{json.escape(req.http.Referer)}V",
84+
"request_user_agent": "%{json.escape(req.http.User-Agent)}V",
85+
"request_accept_content": "%{json.escape(req.http.Accept)}V",
86+
"request_accept_language": "%{json.escape(req.http.Accept-Language)}V",
87+
"request_accept_encoding": "%{json.escape(req.http.Accept-Encoding)}V",
88+
"request_accept_charset": "%{json.escape(req.http.Accept-Charset)}V",
89+
"request_connection": "%{json.escape(req.http.Connection)}V",
90+
"request_dnt": "%{json.escape(req.http.DNT)}V",
91+
"request_forwarded": "%{json.escape(req.http.Forwarded)}V",
92+
"request_via": "%{json.escape(req.http.Via)}V",
93+
"request_cache_control": "%{json.escape(req.http.Cache-Control)}V",
94+
"request_x_requested_with": "%{json.escape(req.http.X-Requested-With)}V",
95+
"request_x_forwarded_for": "%{json.escape(req.http.X-Forwarded-For)}V",
9696
"status": "%{resp.status}V",
97-
"content_type": "%{cstr_escape(resp.http.Content-Type)}V",
97+
"content_type": "%{json.escape(resp.http.Content-Type)}V",
9898
"cache_status": "%{regsub(fastly_info.state, \"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\", \"\\2\\3\")}V",
9999
"is_cacheable": "%{if(fastly_info.state~\"^(HIT|MISS)$\", \"true\", \"false\")}V",
100-
"response_age": "%{cstr_escape(resp.http.Age)}V",
101-
"response_cache_control": "%{cstr_escape(resp.http.Cache-Control)}V",
102-
"response_expires": "%{cstr_escape(resp.http.Expires)}V",
103-
"response_last_modified": "%{cstr_escape(resp.http.Last-Modified)}V",
104-
"response_tsv": "%{cstr_escape(resp.http.TSV)}V",
100+
"response_age": "%{json.escape(resp.http.Age)}V",
101+
"response_cache_control": "%{json.escape(resp.http.Cache-Control)}V",
102+
"response_expires": "%{json.escape(resp.http.Expires)}V",
103+
"response_last_modified": "%{json.escape(resp.http.Last-Modified)}V",
104+
"response_tsv": "%{json.escape(resp.http.TSV)}V",
105105
"geo_datacenter": "%{server.datacenter}V",
106106
"geo_city": "%{client.geo.city}V",
107107
"geo_country_code": "%{client.geo.country_code}V",
@@ -152,39 +152,39 @@ If you have Fastly's Web Application Firewall (WAF), perform these steps to upda
152152
"protocol": "%{req.proto}V",
153153
"host": "%{req.http.Fastly-Orig-Host}V",
154154
"origin_host": "%{req.http.Host}V",
155-
"url": "%{cstr_escape(req.url)}V",
155+
"url": "%{json.escape(req.url)}V",
156156
"is_ipv6": "%{if(req.is_ipv6, \"true\", \"false\")}V",
157157
"is_tls": "%{if(req.is_ssl, \"true\", \"false\")}V",
158-
"tls_client_protocol": "%{cstr_escape(tls.client.protocol)}V",
159-
"tls_client_servername": "%{cstr_escape(tls.client.servername)}V",
160-
"tls_client_cipher": "%{cstr_escape(tls.client.cipher)}V",
161-
"tls_client_cipher_sha": "%{cstr_escape(tls.client.ciphers_sha)}V",
162-
"tls_client_tlsexts_sha": "%{cstr_escape(tls.client.tlsexts_sha)}V",
158+
"tls_client_protocol": "%{json.escape(tls.client.protocol)}V",
159+
"tls_client_servername": "%{json.escape(tls.client.servername)}V",
160+
"tls_client_cipher": "%{json.escape(tls.client.cipher)}V",
161+
"tls_client_cipher_sha": "%{json.escape(tls.client.ciphers_sha)}V",
162+
"tls_client_tlsexts_sha": "%{json.escape(tls.client.tlsexts_sha)}V",
163163
"is_h2": "%{if(fastly_info.is_h2, \"true\", \"false\")}V",
164164
"is_h2_push": "%{if(fastly_info.h2.is_push, \"true\", \"false\")}V",
165165
"h2_stream_id": "%{fastly_info.h2.stream_id}V",
166-
"request_referer": "%{cstr_escape(req.http.Referer)}V",
167-
"request_user_agent": "%{cstr_escape(req.http.User-Agent)}V",
168-
"request_accept_content": "%{cstr_escape(req.http.Accept)}V",
169-
"request_accept_language": "%{cstr_escape(req.http.Accept-Language)}V",
170-
"request_accept_encoding": "%{cstr_escape(req.http.Accept-Encoding)}V",
171-
"request_accept_charset": "%{cstr_escape(req.http.Accept-Charset)}V",
172-
"request_connection": "%{cstr_escape(req.http.Connection)}V",
173-
"request_dnt": "%{cstr_escape(req.http.DNT)}V",
174-
"request_forwarded": "%{cstr_escape(req.http.Forwarded)}V",
175-
"request_via": "%{cstr_escape(req.http.Via)}V",
176-
"request_cache_control": "%{cstr_escape(req.http.Cache-Control)}V",
177-
"request_x_requested_with": "%{cstr_escape(req.http.X-Requested-With)}V",
178-
"request_x_forwarded_for": "%{cstr_escape(req.http.X-Forwarded-For)}V",
166+
"request_referer": "%{json.escape(req.http.Referer)}V",
167+
"request_user_agent": "%{json.escape(req.http.User-Agent)}V",
168+
"request_accept_content": "%{json.escape(req.http.Accept)}V",
169+
"request_accept_language": "%{json.escape(req.http.Accept-Language)}V",
170+
"request_accept_encoding": "%{json.escape(req.http.Accept-Encoding)}V",
171+
"request_accept_charset": "%{json.escape(req.http.Accept-Charset)}V",
172+
"request_connection": "%{json.escape(req.http.Connection)}V",
173+
"request_dnt": "%{json.escape(req.http.DNT)}V",
174+
"request_forwarded": "%{json.escape(req.http.Forwarded)}V",
175+
"request_via": "%{json.escape(req.http.Via)}V",
176+
"request_cache_control": "%{json.escape(req.http.Cache-Control)}V",
177+
"request_x_requested_with": "%{json.escape(req.http.X-Requested-With)}V",
178+
"request_x_forwarded_for": "%{json.escape(req.http.X-Forwarded-For)}V",
179179
"status": "%{resp.status}V",
180-
"content_type": "%{cstr_escape(resp.http.Content-Type)}V",
180+
"content_type": "%{json.escape(resp.http.Content-Type)}V",
181181
"cache_status": "%{regsub(fastly_info.state, \"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\", \"\\2\\3\")}V",
182182
"is_cacheable": "%{if(fastly_info.state~\"^(HIT|MISS)$\", \"true\", \"false\")}V",
183-
"response_age": "%{cstr_escape(resp.http.Age)}V",
184-
"response_cache_control": "%{cstr_escape(resp.http.Cache-Control)}V",
185-
"response_expires": "%{cstr_escape(resp.http.Expires)}V",
186-
"response_last_modified": "%{cstr_escape(resp.http.Last-Modified)}V",
187-
"response_tsv": "%{cstr_escape(resp.http.TSV)}V",
183+
"response_age": "%{json.escape(resp.http.Age)}V",
184+
"response_cache_control": "%{json.escape(resp.http.Cache-Control)}V",
185+
"response_expires": "%{json.escape(resp.http.Expires)}V",
186+
"response_last_modified": "%{json.escape(resp.http.Last-Modified)}V",
187+
"response_tsv": "%{json.escape(resp.http.TSV)}V",
188188
"geo_datacenter": "%{server.datacenter}V",
189189
"geo_city": "%{client.geo.city}V",
190190
"geo_country_code": "%{client.geo.country_code}V",
@@ -214,7 +214,7 @@ If you have Fastly's Web Application Firewall (WAF), perform these steps to upda
214214
"waf_rule_id": "%{waf.rule_id}V",
215215
"waf_severity": "%{waf.severity}V",
216216
"waf_passed": "%{waf.passed}V",
217-
"waf_logdata": "%{cstr_escape(waf.logdata)}V",
217+
"waf_logdata": "%{json.escape(waf.logdata)}V",
218218
"waf_executed": "%{waf.executed}V",
219219
"waf_anomaly_score": "%{waf.anomaly_score}V",
220220
"waf_sql_score": "%{waf.sql_injection_score}V",
@@ -225,7 +225,7 @@ If you have Fastly's Web Application Firewall (WAF), perform these steps to upda
225225
"waf_php_score": "%{waf.php_injection_score}V",
226226
"waf_rce_score": "%{waf.rce_score}V",
227227
"waf_session_fixation_score": "%{waf.session_fixation_score}V",
228-
"waf_message": "%{cstr_escape(waf.message)}V"
228+
"waf_message": "%{json.escape(waf.message)}V"
229229
}
230230
```
231231
</details>
@@ -251,10 +251,10 @@ If you have Fastly's Web Application Firewall (WAF), perform these steps to add
251251
"request": "%{req.request}V",
252252
"protocol": "%{req.proto}V",
253253
"origin_host": "%{req.http.Host}V",
254-
"url": "%{cstr_escape(req.url)}V",
255-
"request_referer": "%{cstr_escape(req.http.Referer)}V",
256-
"request_user_agent": "%{cstr_escape(req.http.User-Agent)}V",
257-
"request_accept_content": "%{cstr_escape(req.http.Accept)}V",
254+
"url": "%{json.escape(req.url)}V",
255+
"request_referer": "%{json.escape(req.http.Referer)}V",
256+
"request_user_agent": "%{json.escape(req.http.User-Agent)}V",
257+
"request_accept_content": "%{json.escape(req.http.Accept)}V",
258258
"cache_status": "%{regsub(fastly_info.state, \"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE|NONE)).*\", \"\\2\\3\")}V",
259259
"geo_datacenter": "%{server.datacenter}V",
260260
"geo_city": "%{client.geo.city}V",
@@ -268,7 +268,7 @@ If you have Fastly's Web Application Firewall (WAF), perform these steps to add
268268
"waf_rule_id": "%{waf.rule_id}V",
269269
"waf_severity": "%{waf.severity}V",
270270
"waf_passed": "%{waf.passed}V",
271-
"waf_logdata": "%{cstr_escape(waf.logdata)}V",
271+
"waf_logdata": "%{json.escape(waf.logdata)}V",
272272
"waf_executed": "%{waf.executed}V",
273273
"waf_anomaly_score": "%{waf.anomaly_score}V",
274274
"waf_sql_score": "%{waf.sql_injection_score}V",
@@ -279,7 +279,7 @@ If you have Fastly's Web Application Firewall (WAF), perform these steps to add
279279
"waf_php_score": "%{waf.php_injection_score}V",
280280
"waf_rce_score": "%{waf.rce_score}V",
281281
"waf_session_fixation_score": "%{waf.session_fixation_score}V",
282-
"waf_message": "%{cstr_escape(waf.message)}V"
282+
"waf_message": "%{json.escape(waf.message)}V"
283283
}
284284
```
285285

0 commit comments

Comments
 (0)