Squashed commit of the following:
commit
eee6084bae7e383f5b2dce1728b324cd2a4dd2e4
Author: Nihal Desai <nihdesai@cisco.com>
Date: Sun May 16 23:32:05 2021 -0400
http2_inspect: rule options and doc clean up
to your snort.lua configuration file.
-Everything has a beginning and for http2_inspect this is the beginning of
-the beginning.
-
-Currently http2_inspect will divide an HTTP/2 connection into individual
-frames. Two new rule options are available for looking at HTTP/2 frames:
-http2_frame_header provides the 9-octet frame header.
-
- alert tcp any any -> any any (msg:"Frame type"; flow:established,
- to_client; http2_frame_header; content:"|06|", offset 3, depth 1;
- sid:1; rev:1; )
-
-This will match if the Type byte of the frame header is 6 (PING).
-
To smooth the transition to inspecting HTTP/2, rules that specify
service:http will be treated as if they also specify service:http2.
Thus:
"service http,http2;" if that is the desired behavior. Eventually
support for http implies http2 may be deprecated and removed.
-In the future, http2_inspect will be fully integrated with http_inspect to
-provide full inspection of the individual HTTP/1.1 streams.
-
const char* Http2Api::classic_buffer_names[] =
{
- "http2_frame_type",
- "http2_raw_frame",
+#ifdef REG_TEST
+ "http2_frame_header",
"http2_decoded_header",
+#endif
nullptr
};
nullptr
};
+#ifdef REG_TEST
extern const BaseApi* ips_http2_frame_header;
extern const BaseApi* ips_http2_decoded_header;
+#endif
#ifdef BUILDING_SO
SO_PUBLIC const BaseApi* snort_plugins[] =
#endif
{
&Http2Api::http2_api.base,
+#ifdef REG_TEST
ips_http2_frame_header,
ips_http2_decoded_header,
+#endif
nullptr
};
// Message buffers available to clients
// This enum must remain synchronized with Http2Api::classic_buffer_names[]
-enum HTTP2_BUFFER { HTTP2_BUFFER_FRAME_HEADER = 1, HTTP2_BUFFER_FRAME_DATA,
- HTTP2_BUFFER_DECODED_HEADER, HTTP2_BUFFER__MAX };
+enum HTTP2_BUFFER { HTTP2_BUFFER_FRAME_HEADER = 1, HTTP2_BUFFER_DECODED_HEADER, HTTP2_BUFFER__MAX };
// Peg counts
// This enum must remain synchronized with Http2Module::peg_names[] in http2_tables.cc
{
case HTTP2_BUFFER_FRAME_HEADER:
return header;
- case HTTP2_BUFFER_FRAME_DATA:
- return data;
default:
return Field::FIELD_NULL;
}
return MATCH;
}
+#ifdef REG_TEST
//-------------------------------------------------------------------------
// http2_frame_header
//-------------------------------------------------------------------------
Http2IpsOption::opt_dtor,
nullptr
};
+#endif
+#ifdef REG_TEST
//-------------------------------------------------------------------------
// http2_decoded_header
//-------------------------------------------------------------------------
Http2IpsOption::opt_dtor,
nullptr
};
+#endif
//-------------------------------------------------------------------------
// plugins
//-------------------------------------------------------------------------
-
+#ifdef REG_TEST
const BaseApi* ips_http2_frame_header = &frame_header_api.base;
const BaseApi* ips_http2_decoded_header = &decoded_header_api.base;
+#endif