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

eve: revert ethernet addresses when needed #10498

Closed
wants to merge 1 commit into from

Conversation

regit
Copy link
Contributor

@regit regit commented Feb 25, 2024

Update of #9651 fixing the formatting.

EVE logging has a direction parameter that can cause the logging of an application layer to be done in a direction that is not linked to the packet. As a result the source IP addres could be assigned the MAC address of the destination IP and reverse.

This patch addresses this by propagating the direction to the ethernet logging function and using it there to define the correct mapping.

Issue #6405

Make sure these boxes are signed before submitting your Pull Request -- thank you.

Link to redmine ticket: https://redmine.openinfosecfoundation.org/issues/6405

Describe changes:

  • Fix formatting
  • Rebase on master

Provide values to any of the below to override the defaults.

SV_BRANCH=OISF/suricata-verify#1667

EVE logging has a direction parameter that can cause the logging
of an application layer to be done in a direction that is not linked
to the packet. As a result the source IP addres could be assigned the
MAC address of the destination IP and reverse.

This patch addresses this by propagating the direction to the ethernet
logging function and using it there to define the correct mapping.

Issue OISF#6405
@regit regit marked this pull request as draft February 25, 2024 20:29
@regit
Copy link
Contributor Author

regit commented Feb 25, 2024

It looks like netflow events need a fix. Setting to draft for now.

@regit
Copy link
Contributor Author

regit commented Feb 25, 2024

It looks like netflow events need a fix. Setting to draft for now.

Humm suricata-verify needs an update in fact.

@regit regit marked this pull request as ready for review February 25, 2024 20:42
@suricata-qa
Copy link

Information:

ERROR: QA failed on SURI_TLPW2_autofp_suri_time.

field baseline test %
SURI_TLPW2_autofp_stats_chk
.uptime 101 112 110.89%

Pipeline 18725

dst = p->ethh->eth_dst;
}
break;
case LOG_DIR_FLOW_TOSERVER:
Copy link
Member

Choose a reason for hiding this comment

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

is this the same as LOG_DIR_FLOW?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it is and could do with // fallthrough

@@ -777,8 +813,14 @@ static int CreateJSONEther(JsonBuilder *js, const Packet *p, const Flow *f)
}
jb_close(info.dst);
jb_close(info.src);
jb_set_object(js, "dest_macs", info.dst);
jb_set_object(js, "src_macs", info.src);
/* case is handling netflow too so may need to revert */
Copy link
Member

Choose a reason for hiding this comment

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

this looks hacky

Copy link
Contributor

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

Could you rebase it to get a green CI ?

@catenacyber
Copy link
Contributor

Rebased in #11197

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