Commit Graph

87 Commits (3660b8f8292c1e4b2ccc6284ead0ef96bae561ff)

Author SHA1 Message Date
Victor Julien b55b327db1 detect/analyzer: suggest modern keywords 5 years ago
Victor Julien 57f7612ffd detect/analyzer: fix json output for warnings/notes 5 years ago
Philippe Antoine 707f027231 protos: renaming ALPROTO_HTTP* constants
Having now ALPROTO_HTTP1, ALPROTO_HTTP2 and ALPROTO_HTTP

Run with 3 sed commands
git grep ALPROTO_HTTP | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP/ALPROTO_HTTP1/g'
git grep ALPROTO_HTTP12 | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP12/ALPROTO_HTTP2/g'
git grep ALPROTO_HTTP1_ANY | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP1_ANY/ALPROTO_HTTP/g'

and then running clang-format
6 years ago
Victor Julien 0eb692e500 mingw: fix format string warnings 6 years ago
Victor Julien 7facf5785f detect/analyzer: convert to jsonbuilder 6 years ago
Shivani Bhardwaj 6f7d8e50c8 src: use FatalError whenever possible
Replaces all patterns of SCLogError() followed by exit() with
FatalError(). Cocci script to do this:

@@
constant C;
constant char[] msg;
@@

- SCLogError(C,
+ FatalError(SC_ERR_FATAL,
  msg);
- exit(EXIT_FAILURE);

Closes redmine ticket 3188.
6 years ago
Jeff Lucovsky 9c47b8c1bf general: Fix spelling error 6 years ago
Jeff Lucovsky 31e2cff9cb detect/analysis: Warn if required feature missing 7 years ago
Jeff Lucovsky 6c2cdbb5f0 analysis: exit if table entries are stale
This commit causes Suricata to exit when a buffer from the analyzer
table is not recognized.

Since the table must match what's registered, exiting will bring noticed
to the condition.
7 years ago
Jeff Lucovsky fcfb679893 detect/analyzer: Suppress direction warnings
This commit ensures direction warnings for ICMP v4 and v6
are suppressed and corrects check so that both protocols
are checked (instead of the same protocol being checked twice).
7 years ago
Jeff Lucovsky 8f4f1cb633 detect/analyzer: Improved fast pattern display
When transforms are part of a rule, improve information displayed with
fast patterns to include the original buffer name and whether any
transform(s) are applied.
7 years ago
Jeff Lucovsky c88c1f1e14 detect/analyzer: Suppress direction warnings
This commit suppresses direction warnings by the rules analyzer for ICMP
and ICMPV6 since it's not actionable.
7 years ago
Jeff Lucovsky ae198add6d detect/analyzer: Refactor engine analysis code
This commit changes the analysis code to be table driven to better
identify the rule elements covered by the analysis.
7 years ago
Jeff Lucovsky 79d308db73 detect/analyzer: Add missing http_accept_enc handling 7 years ago
Jeff Lucovsky 140bfd7b0c detect/analyzer: remove HAVE_LIBJANSSON cpp guards 7 years ago
Jeff Lucovsky 87bfce025d spelling: correct spelling typo 7 years ago
Jeff Lucovsky dcf5e247ca detect/analyzer: add support for http_content_type 7 years ago
Victor Julien 4dff903b35 detect: introduce pkt mpm engines
Instead of the hardcode L4 matching in MPM that was recently introduced,
add an API similar to the AppLayer MPM and inspect engines.

Share part of the registration code with the AppLayer.

Implement for the tcp.hdr and udp.hdr keywords.
7 years ago
Victor Julien bdf53f449c detect/tcp: rename tcp keyword files 7 years ago
Jeff Lucovsky 0960ca0d00 detect/analyzer Add missing HTTP values
This changeset adds recognition of missing HTTP values
- Raw host
- Header names
- Server body
- User agent
7 years ago
Jeff Lucovsky 462a4e2b5b detect/analyzer: Improve warning message
This changeset modifies the warning printed when a rule
is determined to detect in both directions.
7 years ago
Jeff Lucovsky 1b1fc9fee2 rule-analyzer: Ensure content counts are accurate
Fix for issue 2605.  Make sure that content is counted,
even if none of the specific content types are matched.
7 years ago
Travis Green 1743cf5dcd engine-analysis: add support for http_host buffer
Add support for http_host buffer for more accurate reporting.
Bug: #2798
8 years ago
Victor Julien 014056f686 detect/analyzer: add detection for sigs that could use http keywords 8 years ago
Victor Julien 127937b2dd detect/analyzer: add debug statements 8 years ago
Victor Julien 64d75496b8 detect/analyzer: add notes (and warnings) 8 years ago
Victor Julien 38b698c50f detect/analyzer: show pattern that is used by mpm
Set a new DETECT_CONTENT_MPM flag on the pattern that is selected
during setup.
8 years ago
Victor Julien 35c5ae3458 detect: limit flush logic to sigs that need it
Limit the early 'flush' logic to sigs that actually need to match
on both stream and http bodies.
8 years ago
Victor Julien f35a3bbae0 detect/analyzer: add built-in lists 8 years ago
Victor Julien 6694593cc0 detect/analyzer: add Signature::flags 8 years ago
Victor Julien c0adff3770 detect: remove STATE_MATCH flag use at runtime
Instead, use it only at init time and use Signature::app_inspect
directly at runtime.
8 years ago
Victor Julien 3c72d67635 detect/analyzer: log mask flags and more engine details 8 years ago
Victor Julien 709b3bc1e4 rule analyzer: simple rules to json dumper 9 years ago
Victor Julien 0de86211c6 detect: register dynamic buffers into de_ctx
Register buffers that are created during rule parsing. Currently
this means an existing buffer with one or more transformations.
9 years ago
Victor Julien a499a44f7a detect: move buffer type map into detect ctx
Move previously global table into detect engine ctx. Now that we
can register buffers at rule loading time we need to take concurrency
into account.

Move DetectBufferType to detect.h and update DetectBufferCtx API calls
to include a detect engine ctx reference.
9 years ago
Victor Julien ddd3c0b1df detect/analyzer: formatting fixup 9 years ago
Victor Julien ab1200fbd7 compiler: more strict compiler warnings
Set flags by default:

    -Wmissing-prototypes
    -Wmissing-declarations
    -Wstrict-prototypes
    -Wwrite-strings
    -Wcast-align
    -Wbad-function-cast
    -Wformat-security
    -Wno-format-nonliteral
    -Wmissing-format-attribute
    -funsigned-char

Fix minor compiler warnings for these new flags on gcc and clang.
9 years ago
Victor Julien cfdd934aba dnp3: dynamic buffers/lists 10 years ago
Victor Julien 9ba386a141 tls: dynamic buffers 10 years ago
Victor Julien d9b3ae6cd6 dns: use dynamic buffers 10 years ago
Victor Julien 6f867c3c73 http_raw_uri: dynamic buffer 10 years ago
Victor Julien ee55aefa1c http_client_body: dynamic buffer 10 years ago
Victor Julien e7d5e845c7 http_header / http_raw_header: dynamic buffers 10 years ago
Victor Julien b694d96e22 http_stat_msg: dynamic buffer 10 years ago
Victor Julien 7e3ab4f5ea http_stat_code: dynamic buffer 10 years ago
Victor Julien 67b7d9734e http_cookie: dynamic buffer 10 years ago
Victor Julien 54604c7bf2 http_user_agent: dynamic buffer 10 years ago
Victor Julien 6346a074a7 http_uri: dynamic buffer
Clean up tests
10 years ago
Victor Julien e34102d67a http_method: make list dynamic 10 years ago
Victor Julien 6bd37611ee file_data: dynamic buffer 10 years ago