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

Log policy #18

Merged
merged 3 commits into from
Feb 8, 2024
Merged

Log policy #18

merged 3 commits into from
Feb 8, 2024

Conversation

kkvarfordt
Copy link
Contributor

🗣 Description

Add global log policy attributes to the logging streams. This enables Zeek log filtering on the contents of the log files as well as which log files are generated.

https://docs.zeek.org/en/master/frameworks/logging.html#filtering-log-records

💭 Motivation and context

Motivated by ICSNPP issue cisagov/ICSNPP#14

…zeek documentation, the analyzer_confirmation method signature was deprecated in version 5.2.2. See version 5.2.2 of the documentation found here: https://docs.zeek.org/en/v5.2.2/scripts/base/bif/event.bif.zeek.html compared against the 5.1.3 documentation fount here: https://docs.zeek.org/en/v5.1.3/scripts/base/bif/event.bif.zeek.html
…s it doesn't exist when built using 'cmake .' followed by 'make'
@kkvarfordt
Copy link
Contributor Author

kkvarfordt commented Feb 8, 2024

Example Zeek script with associated hook for removing the generation of the crc_calculated column from the genisys.log file. NOTE: In order to successfully delete a column it must be an &optional column.

File: column-killer.zeek

hook GENISYS::log_policy_genisys(rec: GENISYS::Message,  id: Log::ID, filter: Log::Filter) { 
  delete rec$crc_calculated;
}

Example Command:
zeek -Cr ../tests/traces/genisys.pcap ../genisys.hlto ../analyzer/*.zeek local ../column-killer.zeek

Copy link
Contributor

@mmguero mmguero left a comment

Choose a reason for hiding this comment

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

looks good to me

@mmguero mmguero merged commit 9143b43 into cisagov:main Feb 8, 2024
@kkvarfordt kkvarfordt deleted the log_policy branch February 15, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants