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

createst: Allow to exclude certain fields #2110

Conversation

Nancyenos
Copy link
Contributor

@Nancyenos Nancyenos commented Oct 26, 2024

Ticket: #4062
Link to redmine ticket: https://redmine.openinfosecfoundation.org/issues/4062

Ticket

createst.py mytest mypcap --exclude-fields dest_port,tcp.ts_max_regions

Before:

 filter:
    count: 1
    match:
      app_proto: http
      dest_ip: 82.165.177.154
      event_type: flow
      flow.age: 0
      flow.alerted: false
      flow.bytes_toclient: 495
      flow.bytes_toserver: 425
      flow.pkts_toclient: 4
      flow.pkts_toserver: 6
      flow.reason: shutdown
      flow.state: closed
      proto: TCP
      src_ip: 10.16.1.11
      src_port: 54186
      tcp.ack: true
      tcp.fin: true
      tcp.psh: true
      tcp.state: closed
      tcp.syn: true
      tcp.tc_max_regions: 1
      tcp.tcp_flags: 1b
      tcp.tcp_flags_tc: 1b
      tcp.tcp_flags_ts: 1b
      tcp.ts_max_regions: 1

After:

filter:
    count: 1
    match:
      app_proto: http
      dest_ip: 82.165.177.154
      event_type: flow
      flow.age: 0
      flow.alerted: false
      flow.bytes_toclient: 495
      flow.bytes_toserver: 425
      flow.pkts_toclient: 4
      flow.pkts_toserver: 6
      flow.reason: shutdown
      flow.state: closed
      flow_id: 2019292059448498
      proto: TCP
      src_ip: 10.16.1.11
      src_port: 54186
      tcp.ack: true
      tcp.fin: true
      tcp.psh: true
      tcp.state: closed
      tcp.syn: true
      tcp.tc_max_regions: 1
      tcp.tcp_flags: 1b
      tcp.tcp_flags_tc: 1b
      tcp.tcp_flags_ts: 1b
      timestamp: 2016-07-13T22:42:07.011401+0000

@jufajardini jufajardini added outreachy Contributions made by Outreachy applicants framework Has a suricata-verify framework change labels Oct 28, 2024
Copy link
Contributor

@jufajardini jufajardini left a comment

Choose a reason for hiding this comment

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

Thanks! Did a couple of tests, including (or so I hope) the comment by Jason from #997 (comment)

Do think we should add a bit more explanation in the README, though (see inline comment)

@@ -237,6 +237,8 @@ options:
Adds a suricata.yaml to the test
--features <features>
Adds specified features
--exclude-fields [EXCLUDE_FIELDS]
Exclude specified fields from filter block
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably a good idea to indicate that they're comma-separated, like we have for allow-events :)

@Nancyenos
Copy link
Contributor Author

Thanks! Did a couple of tests, including (or so I hope) the comment by Jason from #997 (comment)

Do think we should add a bit more explanation in the README, though (see inline comment)

Thank you @jufajardini working on it

@Nancyenos
Copy link
Contributor Author

work continued in #2115

@Nancyenos Nancyenos closed this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework Has a suricata-verify framework change outreachy Contributions made by Outreachy applicants
Development

Successfully merging this pull request may close these issues.

2 participants