Skip to content

Add firewall section to check-config.sh#13234

Merged
dereknola merged 3 commits intok3s-io:mainfrom
dereknola:firewall_check
Dec 18, 2025
Merged

Add firewall section to check-config.sh#13234
dereknola merged 3 commits intok3s-io:mainfrom
dereknola:firewall_check

Conversation

@dereknola
Copy link
Copy Markdown
Member

@dereknola dereknola commented Nov 20, 2025

Signed-off-by: Derek Nola derek.nola@suse.com

Proposed Changes

Anther take on #12847, placing firewall checks inside the check-config.sh script. Looks for ufw and firewalld. This approach should work better at balancing "does every user need this" with "people want an easy way to check" for firewall statuses.

  • If no firewall is found, no output occurs.
  • If an active firewall is found, a warning is printed:
  • If specific tcp ports are blocked a failure is printed
Clipboard_2025-11-20-12-10-19

Also fixed a random nit around how apparmor status was printing

Before After
image image

Removed a 6 year old unused section of the check-config.sh

Types of Changes

Utility Script Improvements

Verification

./contrib/util/check-config.sh on Ubuntu (with and without ufw rules) and on Rocky 9 (with and without firewalld rules)

Testing

Linked Issues

User-Facing Change


Further Comments

Signed-off-by: Derek Nola <derek.nola@suse.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.74%. Comparing base (9130056) to head (085b95e).
⚠️ Report is 56 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13234      +/-   ##
==========================================
- Coverage   21.87%   21.74%   -0.14%     
==========================================
  Files         186      186              
  Lines       15202    15284      +82     
==========================================
- Hits         3325     3323       -2     
- Misses      11438    11522      +84     
  Partials      439      439              
Flag Coverage Δ
unittests 21.74% <ø> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dereknola dereknola marked this pull request as ready for review November 20, 2025 21:08
@dereknola dereknola requested a review from a team as a code owner November 20, 2025 21:08
brandond
brandond previously approved these changes Nov 20, 2025
manuelbuil
manuelbuil previously approved these changes Nov 21, 2025
Signed-off-by: Derek Nola <derek.nola@suse.com>
@dereknola dereknola dismissed stale reviews from manuelbuil and brandond via a41c155 November 25, 2025 19:16
@dereknola
Copy link
Copy Markdown
Member Author

Updated PR with udp warnings and fixed firewalld checks

image

manuelbuil
manuelbuil previously approved these changes Nov 26, 2025
Copy link
Copy Markdown
Contributor

@manuelbuil manuelbuil left a comment

Choose a reason for hiding this comment

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

cool!

mgfritch
mgfritch previously approved these changes Dec 2, 2025
Copy link
Copy Markdown
Contributor

@mgfritch mgfritch left a comment

Choose a reason for hiding this comment

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

Add TCP/UDP context to avoid confusion, otherwise lgtm!

Signed-off-by: Derek Nola <derek.nola@suse.com>
@dereknola dereknola dismissed stale reviews from mgfritch and manuelbuil via 085b95e December 8, 2025 17:12
@dereknola dereknola merged commit 54b792e into k3s-io:main Dec 18, 2025
90 of 91 checks passed
@dereknola dereknola deleted the firewall_check branch December 18, 2025 19:31
dereknola added a commit to dereknola/k3s that referenced this pull request Dec 29, 2025
* Add firewall section to check-config.sh

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request Dec 29, 2025
* Add firewall section to check-config.sh

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request Dec 29, 2025
* Add firewall section to check-config.sh

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request Dec 29, 2025
* Add firewall section to check-config.sh

Signed-off-by: Derek Nola <derek.nola@suse.com>
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.

4 participants