|
1 | 1 | --- |
2 | | -pcx_content_type: navigation |
3 | 2 | title: Magic Firewall fields |
4 | | -external_link: /ruleset-engine/rules-language/fields/magic-firewall/ |
| 3 | +pcx_content_type: reference |
| 4 | +head: |
| 5 | + - tag: title |
| 6 | + content: Magic Firewall fields |
| 7 | +--- |
| 8 | + |
| 9 | +import { Type } from "~/components"; |
| 10 | + |
| 11 | +:::note |
| 12 | +Some Magic Firewall fields are available only to customers who purchased Magic Firewall's advanced features. Refer to [Magic Firewall plans](/magic-firewall/plans/) for more information. |
| 13 | +::: |
| 14 | + |
| 15 | +## `cf.colo.name` |
| 16 | + |
| 17 | +`cf.colo.name` <Type text='String' /> |
| 18 | + |
| 19 | +The data center that is handling this traffic. |
| 20 | + |
| 21 | +Example value: `sfo06` |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## `cf.colo.region` |
| 26 | + |
| 27 | +`cf.colo.region` <Type text='String' /> |
| 28 | + |
| 29 | +Region of the data center that is handling this traffic. |
| 30 | + |
| 31 | +Example value: `WNAM` |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## `icmp` |
| 36 | + |
| 37 | +`icmp` <Type text='String' /> |
| 38 | + |
| 39 | +The raw ICMP packet as a list of bytes. It should be used in conjunction with the bit_slice function when other structured fields are lacking. |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## `icmp.type` |
| 44 | + |
| 45 | +`icmp.type` <Type text='Number' /> |
| 46 | + |
| 47 | +The [ICMP type](https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#header_type). Only applies to ICMP packets. |
| 48 | + |
| 49 | +Example value: `8` |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## `icmp.code` |
| 54 | + |
| 55 | +`icmp.code` <Type text='Number' /> |
| 56 | + |
| 57 | +The [ICMP code](https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#header_code). Only applies to ICMP packets. |
| 58 | + |
| 59 | +Example value: `2` |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## `ip` |
| 64 | + |
| 65 | +`ip` <Type text='String' /> |
| 66 | + |
| 67 | +The raw IP packet as a list of bytes. It should be used in conjunction with the bit_slice function when other structured fields are lacking. |
5 | 68 |
|
6 | 69 | --- |
| 70 | + |
| 71 | +## `ip.dst` |
| 72 | + |
| 73 | +`ip.dst` <Type text='IP address' /> |
| 74 | + |
| 75 | +The destination address as specified in the IP packet. |
| 76 | + |
| 77 | +Example value: `192.0.2.2` |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +## `ip.dst.country` |
| 82 | + |
| 83 | +`ip.dst.country` <Type text='String' /> |
| 84 | + |
| 85 | +Represents the 2-letter country code associated with the server IP address in [ISO 3166-1 Alpha 2](https://www.iso.org/obp/ui/#search/code/) format. |
| 86 | + |
| 87 | +Example value: `GB` |
| 88 | + |
| 89 | +For more information on the ISO 3166-1 Alpha 2 format, refer to [ISO 3166-1 Alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) on Wikipedia. |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## `ip.src.country` |
| 94 | + |
| 95 | +`ip.src.country` <Type text='String' /> |
| 96 | + |
| 97 | +Represents the 2-letter country code associated with the client IP address in [ISO 3166-1 Alpha 2](https://www.iso.org/obp/ui/#search/code/) format. |
| 98 | + |
| 99 | +Example value: `GB` |
| 100 | + |
| 101 | +For more information on the ISO 3166-1 Alpha 2 format, refer to [ISO 3166-1 Alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) on Wikipedia. |
| 102 | + |
| 103 | +For Magic Firewall, the `ip.geoip.country` field (which is deprecated) will match on either source or destination address. The `ip.geoip.country` field is still available for new and existing rules, but you should use the `ip.src.country` and/or `ip.dst.country` fields instead. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## `ip.hdr_len` |
| 108 | + |
| 109 | +`ip.hdr_len` <Type text='Number' /> |
| 110 | + |
| 111 | +The length of the IPv4 header in bytes. |
| 112 | + |
| 113 | +Example value: `5` |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +## `ip.len` |
| 118 | + |
| 119 | +`ip.len` <Type text='Number' /> |
| 120 | + |
| 121 | +The length of the packet including the header. |
| 122 | + |
| 123 | +Example value: `60` |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## `ip.opt.type` |
| 128 | + |
| 129 | +`ip.opt.type` <Type text='Number' /> |
| 130 | + |
| 131 | +The first byte of [IP options field](https://en.wikipedia.org/wiki/IPv4#Options), if the options field is set. |
| 132 | + |
| 133 | +Example value: `25` |
| 134 | + |
| 135 | +--- |
| 136 | + |
| 137 | +## `ip.proto` |
| 138 | + |
| 139 | +`ip.proto` <Type text='String' /> |
| 140 | + |
| 141 | +The transport layer for the packet, if it can be determined. |
| 142 | + |
| 143 | +Example values: `icmp`, `tcp` |
| 144 | + |
| 145 | +--- |
| 146 | + |
| 147 | +## `ip.src` |
| 148 | + |
| 149 | +`ip.src` <Type text='IP address' /> |
| 150 | + |
| 151 | +The source address of the IP Packet. |
| 152 | + |
| 153 | +--- |
| 154 | + |
| 155 | +## `ip.src.country` |
| 156 | + |
| 157 | +`ip.src.country` <Type text='String' /> |
| 158 | + |
| 159 | +Represents the 2-letter country code associated with the client IP address in [ISO 3166-1 Alpha 2](https://www.iso.org/obp/ui/#search/code/) format. |
| 160 | + |
| 161 | +Example value: `GB` |
| 162 | + |
| 163 | +For more information on the ISO 3166-1 Alpha 2 format, refer to [ISO 3166-1 Alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) on Wikipedia. |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +## `ip.ttl` |
| 168 | + |
| 169 | +`ip.ttl` <Type text='Number' /> |
| 170 | + |
| 171 | +The time-to-live of the IP Packet. |
| 172 | + |
| 173 | +Example values: `54` |
| 174 | + |
| 175 | +--- |
| 176 | + |
| 177 | +## `sip` |
| 178 | + |
| 179 | +`sip` <Type text='Boolean' /> |
| 180 | + |
| 181 | +Determines if packets are valid L7 protocol [SIP](https://datatracker.ietf.org/doc/html/rfc2543). Requires UDP packets to operate. |
| 182 | + |
| 183 | +Use a guard clause as shown below to ensure the packet is UDP (wirefilter): |
| 184 | + |
| 185 | +`ip.proto == "udp"` |
| 186 | + |
| 187 | +--- |
| 188 | + |
| 189 | +## `tcp` |
| 190 | + |
| 191 | +`tcp` <Type text='String' /> |
| 192 | + |
| 193 | +The raw TCP packet as a list of bytes. It should be used in conjunction with the bit_slice function when other structured fields are lacking. |
| 194 | + |
| 195 | +--- |
| 196 | + |
| 197 | +## `tcp.flags` |
| 198 | + |
| 199 | +`tcp.flags` <Type text='Number' /> |
| 200 | + |
| 201 | +The numeric value of the TCP flags byte. |
| 202 | + |
| 203 | +--- |
| 204 | + |
| 205 | +## `tcp.flags.ack` |
| 206 | + |
| 207 | +`tcp.flags.ack` <Type text='Boolean' /> |
| 208 | + |
| 209 | +TCP acknowledgment flag. |
| 210 | + |
| 211 | +--- |
| 212 | + |
| 213 | +## `tcp.flags.cwr` |
| 214 | + |
| 215 | +`tcp.flags.cwr` <Type text='Boolean' /> |
| 216 | + |
| 217 | +TCP congestion window reduced flag. |
| 218 | + |
| 219 | +--- |
| 220 | + |
| 221 | +## `tcp.flags.ecn` |
| 222 | + |
| 223 | +`tcp.flags.ecn` <Type text='Boolean' /> |
| 224 | + |
| 225 | +TCP ECN-Echo flag. |
| 226 | + |
| 227 | +--- |
| 228 | + |
| 229 | +## `tcp.flags.fin` |
| 230 | + |
| 231 | +`tcp.flags.fin` <Type text='Boolean' /> |
| 232 | + |
| 233 | +TCP flag indicating this is the last packet from sender. |
| 234 | + |
| 235 | +--- |
| 236 | + |
| 237 | +## `tcp.flags.push` |
| 238 | + |
| 239 | +`tcp.flags.push` <Type text='Boolean' /> |
| 240 | + |
| 241 | +TCP push flag. |
| 242 | + |
| 243 | +--- |
| 244 | + |
| 245 | +## `tcp.flags.reset` |
| 246 | + |
| 247 | +`tcp.flags.reset` <Type text='Boolean' /> |
| 248 | + |
| 249 | +TCP reset flag. |
| 250 | + |
| 251 | +--- |
| 252 | + |
| 253 | +## `tcp.flags.syn` |
| 254 | + |
| 255 | +`tcp.flags.syn` <Type text='Boolean' /> |
| 256 | + |
| 257 | +TCP synchronize flag. |
| 258 | + |
| 259 | +--- |
| 260 | + |
| 261 | +## `tcp.flags.urg` |
| 262 | + |
| 263 | +`tcp.flags.urg` <Type text='Boolean' /> |
| 264 | + |
| 265 | +TCP urgent flag. |
| 266 | + |
| 267 | +--- |
| 268 | + |
| 269 | +## `tcp.srcport` |
| 270 | + |
| 271 | +`tcp.srcport` <Type text='Number' /> |
| 272 | + |
| 273 | +Source port number of the IP packet. Only applies to TCP packets. |
| 274 | + |
| 275 | +--- |
| 276 | + |
| 277 | +## `tcp.dstport` |
| 278 | + |
| 279 | +`tcp.dstport` <Type text='Number' /> |
| 280 | + |
| 281 | +Destination port number of the IP packet. Only applies to TCP packets. |
| 282 | + |
| 283 | +--- |
| 284 | + |
| 285 | +## `udp` |
| 286 | + |
| 287 | +`udp` <Type text='String' /> |
| 288 | + |
| 289 | +The raw UDP packet as a list of bytes. It should be used in conjunction with the bit_slice function when other structured fields are lacking. |
| 290 | + |
| 291 | +--- |
| 292 | + |
| 293 | +## `udp.dstport` |
| 294 | + |
| 295 | +`udp.dstport` <Type text='Number' /> |
| 296 | + |
| 297 | +Destination port number of the IP packet. Only applies to UDP packets. |
| 298 | + |
| 299 | +--- |
| 300 | + |
| 301 | +## `udp.srcport` |
| 302 | + |
| 303 | +`udp.srcport` <Type text='Number' /> |
| 304 | + |
| 305 | +Source port number of the IP packet. Only applies to UDP packets. |
| 306 | + |
| 307 | +--- |
| 308 | + |
| 309 | +_GeoIP is the registered trademark of MaxMind, Inc._ |
0 commit comments