Skip to content

Conversation

@Pavani-Panakanti
Copy link
Collaborator

Issue #, if available:
DENY's should always be logged irrespective of log level. Move them to highest log level

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Pavani-Panakanti Pavani-Panakanti requested a review from a team as a code owner August 11, 2025 18:32
dropCountTotal.WithLabelValues(direction).Add(float64(1))
dropBytesTotal.WithLabelValues(direction).Add(float64(rb.PacketSz))
log().Infof("Flow Info: Src IP: %s Src Port: %d Dest IP: %s Dest Port: %d Proto: %s Verdict: %s Direction: %s", utils.ConvByteToIPv6(rb.SourceIP).String(), rb.SourcePort,
log().Errorf("Flow Info: Src IP: %s Src Port: %d Dest IP: %s Dest Port: %d Proto: %s Verdict: %s Direction: %s", utils.ConvByteToIPv6(rb.SourceIP).String(), rb.SourcePort,
Copy link
Contributor

Choose a reason for hiding this comment

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

but it is not error right? This will provide incorrect signal during troubleshooting.

Copy link
Contributor

@yash97 yash97 Aug 11, 2025

Choose a reason for hiding this comment

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

Ideally we should update this interface https://github.com/aws/aws-network-policy-agent/blob/main/pkg/logger/logger.go#L12 to support V method where we can optionally set log level.

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed. if we want to log DENY irrespective of log level, we should de-couple it from current log config which is being set from outside (would a new logger whose config is explicitly set in code work?)

Copy link
Contributor

Choose a reason for hiding this comment

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

we can also de-couple the policy log event to a separate log file like policy-events.log. that would also give better segregating of application log vs policy event logs

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.

3 participants