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

Netpolicy logging should also log destination port #3168

Closed
jsalatiel opened this issue Jan 3, 2022 · 4 comments
Closed

Netpolicy logging should also log destination port #3168

jsalatiel opened this issue Jan 3, 2022 · 4 comments
Assignees
Labels
area/network-policy Issues or PRs related to network policies. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@jsalatiel
Copy link

Describe the problem/challenge you have
Log to /var/log/antrea/networkpolicy/np.log should contain destination port.
The current format for the logging looks like:

2022/01/03 12:47:48.092090 EgressDefaultRule AntreaClusterNetworkPolicy:**default-cluster-deny** Reject 170 SRC: 10.42.0.219 DEST: 192.0.73.2 60 TCP

Although useful, it would be a lot more useful if it contained the destination port, so it would help to debug.

Describe the solution you'd like
The destination port should also be logged

Anything else you would like to add?
I can't find any documentation about the meaning of that number after the policy and before the protocol. it would be nice to have that documented.

Eg: Reject 170 SRC: 10.42.0.219 DEST: 192.0.73.2 60 TCP

@jsalatiel jsalatiel added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 3, 2022
@antoninbas
Copy link
Contributor

170 is an implementation detail (priority of the OVS flow which implements the policy)
60 is the packet length

I agree that we should add some more info to https://github.com/antrea-io/antrea/blob/main/docs/antrea-network-policy.md#audit-logging-for-antrea-native-policies. And including the source and destination ports sounds good to me. @qiyueyao could you take a look at this?

@antoninbas antoninbas added the area/network-policy Issues or PRs related to network policies. label Jan 3, 2022
@jsalatiel
Copy link
Author

HI @qiyueyao , this is probably low priority on your list, but will you be able to implement it?
I am having a hard time debugging network policies without the destination port on the logs.

Thanks!

@antoninbas antoninbas added this to the Antrea v1.6 release milestone Jan 26, 2022
@qiyueyao
Copy link
Contributor

qiyueyao commented Jan 26, 2022

HI @qiyueyao , this is probably low priority on your list, but will you be able to implement it? I am having a hard time debugging network policies without the destination port on the logs.

Thanks!

Yes of course, didn't know it was a roadblock😔. PR targeted for 1.6 release.

@tnqn
Copy link
Member

tnqn commented Feb 23, 2022

Closed by #3277

@tnqn tnqn closed this as completed Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/network-policy Issues or PRs related to network policies. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants