Skip to content
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 v14.1 #9839

Closed

Conversation

catenacyber
Copy link
Contributor

@catenacyber catenacyber commented Nov 19, 2023

Link to redmine tickets:
https://redmine.openinfosecfoundation.org/issues/3827
https://redmine.openinfosecfoundation.org/issues/5977
https://redmine.openinfosecfoundation.org/issues/6500
https://redmine.openinfosecfoundation.org/issues/6501
preliminary work for https://redmine.openinfosecfoundation.org/issues/5053 and app-layer plugins

Describe changes:

  • Fix setup-app-layer script so that it adds app-layer metadata to alerts
  • add krb5 metadata to alerts
  • add ftp metadata to alerts
  • add tftp metadata to alerts

After that, there is still to take from #9812

  • behavioral change for dns alert metadata
  • reusing these SimpleTxLogFunc from a JsonGenericLogger to remove many C files

#9797 rebased and referencing improved S-V tests

SV_BRANCH=pr/1482

OISF/suricata-verify#1482

catenacyber and others added 4 commits November 19, 2023 21:25
Especially fix setup-app-layer script to not forget this part

This allows, for simple loggers, to have a unique definition
of the actual logging function with the jsonbuilder.
This way, alerts, files, and app-layer event can share the code
to output the same data.

Ticket: OISF#3827
Copy link

codecov bot commented Nov 19, 2023

Codecov Report

Merging #9839 (c4f763e) into master (d2b25af) will decrease coverage by 0.01%.
The diff coverage is 95.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9839      +/-   ##
==========================================
- Coverage   82.42%   82.42%   -0.01%     
==========================================
  Files         972      972              
  Lines      273929   273780     -149     
==========================================
- Hits       225788   225658     -130     
+ Misses      48141    48122      -19     
Flag Coverage Δ
fuzzcorpus 64.30% <95.78%> (+<0.01%) ⬆️
suricata-verify 61.06% <94.73%> (-0.03%) ⬇️
unittests 62.91% <0.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 16647

@@ -208,4 +208,13 @@ void OutputLoggerExitPrintStats(ThreadVars *, void *);
void OutputSetupActiveLoggers(void);
void OutputClearActiveLoggers(void);

typedef bool (*SimpleJsonTxLogFunc)(void *, struct JsonBuilder *);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this "SimpleJson" name space. I would like to move all our Eve related logic to start using the Eve namespace. So I guess here we'd use EveSimpleTxLogFunc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I've moved some Json stuff to "Eve" in the past, I have recently been questioning this. JSON logging is straightforward and requires no explanation. What is "Eve" logging? What does it stand for? :) It always requires more explanation than JSON logging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming to EveJsonSimpleTxLogFunc then

SimpleJsonTxLogFunc LogTx;
} SimpleJsonAppLayerLogger;

SimpleJsonAppLayerLogger *GetAppProtoSimpleJsonLogger(AppProto alproto);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets also start with the namespace here, so EveSimpleGetLogger or some variant of that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess SCEve... as its in public namespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming to SCEveJsonSimpleGetLogger

@catenacyber
Copy link
Contributor Author

Replaced by #9851

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants