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

Rate-limit nat port table being full warning #366

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

PlagueCZ
Copy link
Contributor

@PlagueCZ PlagueCZ commented Aug 31, 2023

The log message is very helpful in operations.

But as it now logs every packet that gets no NAT because of the port table being full, this is a potential attack vector for DoS from attached VMs. (And also an annoyance for reading the logs).

So I introduced a simple log rate-limit that should still provide enough logging and keep limits independent for each VM as I put the timestamp inside the snat_data itself.


While moving the log message (to include all the needed log info), I also noticed an unnecessary table lookup, so that is the change in the first commit.

@github-actions github-actions bot added enhancement New feature or request size/M labels Aug 31, 2023
@PlagueCZ PlagueCZ requested a review from guvenc August 31, 2023 16:13
Copy link
Collaborator

@guvenc guvenc 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. As discussed, lets try to introduce a more generic approach in the middle/long-term similar to the printk rate limiting.

@guvenc
Copy link
Collaborator

guvenc commented Sep 1, 2023

@PlagueCZ Please rebase to main. Thanks.

@PlagueCZ PlagueCZ force-pushed the feature/rate_limit_snat_full_log branch from 7d15961 to 31260dd Compare September 1, 2023 15:28
@guvenc guvenc merged commit 31260dd into main Sep 1, 2023
6 checks passed
@guvenc guvenc deleted the feature/rate_limit_snat_full_log branch September 1, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants