-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Output alert applayer v5 #8922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output alert applayer v5 #8922
Changes from 1 commit
9d7a421
a00fc00
09830fd
18bb970
19688ba
30c8fb6
c0eeac3
f01e8d6
f941be0
ac58f4d
ee833ff
00d8267
4248f4d
3be26a4
9c5f0f4
89483ce
d203d3a
81f8576
4430125
5c7b7c1
51e94c4
1fc1088
31608fc
f8bb8ef
1ff1ad8
d5a2864
41b36b2
9ccda72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -263,7 +263,7 @@ typedef struct LogDnsLogThread_ { | |
| OutputJsonThreadCtx *ctx; | ||
| } LogDnsLogThread; | ||
|
|
||
| JsonBuilder *JsonDNSLogQuery(void *txptr) | ||
| static JsonBuilder *JsonDNSLogQuery(void *txptr) | ||
| { | ||
| JsonBuilder *queryjb = jb_new_array(); | ||
| if (queryjb == NULL) { | ||
|
|
@@ -292,7 +292,7 @@ JsonBuilder *JsonDNSLogQuery(void *txptr) | |
| return queryjb; | ||
| } | ||
|
|
||
| JsonBuilder *JsonDNSLogAnswer(void *txptr) | ||
| static JsonBuilder *JsonDNSLogAnswer(void *txptr) | ||
| { | ||
| if (!rs_dns_do_log_answer(txptr, LOG_ALL_RRTYPES)) { | ||
| return NULL; | ||
|
|
@@ -304,6 +304,21 @@ JsonBuilder *JsonDNSLogAnswer(void *txptr) | |
| } | ||
| } | ||
|
|
||
| bool AlertJsonDns(void *txptr, JsonBuilder *js) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this return false if both calls return NULL?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likely so, this is a behavioral change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Not a big one right? It would allow the caller to reset to mark to prevent an empty
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not look a big one #9005 is the part without behavior changes Then I intend to do the behavioral changes about alerts : addition of protocols missing alert metadata (like krb5) + behavioral change for dns alert metadata |
||
| { | ||
| JsonBuilder *qjs = JsonDNSLogQuery(txptr); | ||
| if (qjs != NULL) { | ||
| jb_set_object(js, "query", qjs); | ||
| jb_free(qjs); | ||
| } | ||
| JsonBuilder *ajs = JsonDNSLogAnswer(txptr); | ||
| if (ajs != NULL) { | ||
| jb_set_object(js, "answer", ajs); | ||
| jb_free(ajs); | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| static int JsonDnsLoggerToServer(ThreadVars *tv, void *thread_data, | ||
| const Packet *p, Flow *f, void *alstate, void *txptr, uint64_t tx_id) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this commit does a lot more than the commit message indicates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, so, any ideas about the commit segmentation ?
One big commit ? One commit per protocol ? (but if so, the first commit introducing the generic changes should also be applied on some protocol, otherwise, commit-check will fail because of unused functions)
Should I split this PR ?