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

Make stateful filtering configurable #357

Merged
merged 2 commits into from
May 18, 2024

Conversation

lmagyar
Copy link
Contributor

@lmagyar lmagyar commented May 16, 2024

Proposed Changes

TS 1.66.x made stateful-filtering default enabled, but disabling it is required for site-to-site networking to work properly.

stateful-filtering is/can be independent from snat-subnet-routes, so a separate option is the right solution in my opinion.

(The problem is identified by @elcajon in lmagyar#127)

Related Issues

Summary by CodeRabbit

  • New Features

    • Introduced a stateful_filtering option to enable or disable stateful packet filtering on certain nodes.
  • Configuration Updates

    • Added stateful_filtering boolean field to the configuration schema.
    • Updated documentation and translations to reflect the new stateful_filtering option.
  • Networking Enhancements

    • Added support for basic site-to-site networking with configurable stateful filtering.

lmagyar added 2 commits May 16, 2024 23:35
about stateful-filtering and snat-subnet-routes correlation
@frenck frenck added the new-feature New features or options. label May 17, 2024
@frenck
Copy link
Member

frenck commented May 18, 2024

@coderabbitai review

Copy link

coderabbitai bot commented May 18, 2024

Actions Performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

coderabbitai bot commented May 18, 2024

Walkthrough

The recent update to Tailscale introduces stateful packet filtering, enhancing network security by tracking connections and filtering traffic accordingly. This feature is configurable, allowing users to enable or disable it to support various networking needs, including basic site-to-site networking. The changes span several files, updating configurations, documentation, and translations to support this new functionality.

Changes

Files Change Summary
tailscale/DOCS.md Updated documentation to reflect the change in default stateful filtering setting.
tailscale/config.yaml Added stateful_filtering boolean field to the configuration schema.
tailscale/rootfs/etc/s6-overlay/s6-rc.d/... Introduced support for site-to-site networking and controlled stateful filtering based on configuration.
tailscale/translations/en.yaml Added stateful_filtering option with name and description fields for configuration translations.

🐇
In the realm of Tailscale's might,
Stateful filters now take flight.
Configs updated, docs refined,
Network flows are well-defined.
Site-to-site with ease we bring,
In the network, security sings.
🛡️✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Out of diff range and nitpick comments (2)
tailscale/DOCS.md (2)

Line range hint 20-20: Consider rephrasing for clarity and grammatical correctness.

- You can also create an account during the add-on installation processes, however, it is nice to know where you need to go later on.
+ You can also create an account during the add-on installation process; however, it is helpful to know where you need to go later on.

Line range hint 201-201: Correct the infinitive form for grammatical accuracy.

- This option lets you to specify a custom control server instead of the default
+ This option lets you specify a custom control server instead of the default
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between aaafbee and e678e10.
Files selected for processing (4)
  • tailscale/DOCS.md (3 hunks)
  • tailscale/config.yaml (1 hunks)
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run (1 hunks)
  • tailscale/translations/en.yaml (1 hunks)
Files skipped from review due to trivial changes (1)
  • tailscale/config.yaml
Additional Context Used
LanguageTool (17)
tailscale/DOCS.md (17)

Near line 11: Consider a shorter alternative to avoid wordiness.
Context: ...om anywhere you are. ## Prerequisites In order to use this add-on, you'll need a Tailscal...


Near line 20: The word “however” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...during the add-on installation processes, however, it is nice to know where you need to go...


Near line 61: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...You can't change them through the Web UI, because all the changes made there would be los...


Near line 61: Consider adding a comma.
Context: ...the Web UI, because all the changes made there would be lost when the add-on is restar...


Near line 178: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ... on only in case you are troubleshooting, because Tailscale's daemon is quite chatty. If ...


Near line 186: Loose punctuation mark.
Context: ...n issue. Possible values are: - trace: Show every detail, like all called inte...


Near line 187: Loose punctuation mark.
Context: ...all called internal functions. - debug: Shows detailed debug information. - `in...


Near line 188: Loose punctuation mark.
Context: ...ows detailed debug information. - info: Normal (usually) interesting events. - ...


Near line 189: Loose punctuation mark.
Context: ...(usually) interesting events. - notice: Normal but significant events. - `warni...


Near line 190: Loose punctuation mark.
Context: ...rmal but significant events. - warning: Exceptional occurrences that are not er...


Near line 191: Loose punctuation mark.
Context: ...currences that are not errors. - error: Runtime errors that do not require imme...


Near line 192: Loose punctuation mark.
Context: ... not require immediate action. - fatal: Something went terribly wrong. Add-on b...


Near line 201: Using the to-infinitive may not be correct in this context. Consider using the bare infinitive (without “to”) instead.
Context: ...n: login_server This option lets you to specify a custom control server instead of the ...


Near line 265: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...tworking][tailscale_info_site_to_site] (eg. to traverse multiple networks), you can...


Near line 332: Loose punctuation mark.
Context: ...ented based on the following: - MAJOR: Incompatible or major changes. - `MINOR...


Near line 333: Loose punctuation mark.
Context: ...Incompatible or major changes. - MINOR: Backwards-compatible new features and e...


Near line 334: Loose punctuation mark.
Context: ...new features and enhancements. - PATCH: Backwards-compatible bugfixes and packa...

Additional comments not posted (3)
tailscale/translations/en.yaml (1)

67-74: The translation entries for stateful_filtering are clear and consistent with the existing structure.

tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run (1)

58-65: The script correctly handles the stateful_filtering configuration, applying the appropriate Tailscale command-line options based on user settings.

tailscale/DOCS.md (1)

77-77: The documentation for stateful_filtering is clear and informative, correctly explaining its functionality and default behavior.

Also applies to: 271-282

@@ -262,8 +263,23 @@ router, and this simplifies routing configuration.
When not set, this option is enabled by default.

To support advanced [Site-to-site networking][tailscale_info_site_to_site] (eg.
Copy link

Choose a reason for hiding this comment

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

Correct the abbreviation for consistency.

- to traverse multiple networks), you can disable this functionality, and execute steps 2 and 3 as described on [Site-to-site networking][tailscale_info_site_to_site] (eg. to traverse multiple networks), you can...
+ to traverse multiple networks), you can disable this functionality, and execute steps 2 and 3 as described on [Site-to-site networking][tailscale_info_site_to_site] (e.g., to traverse multiple networks), you can...

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
To support advanced [Site-to-site networking][tailscale_info_site_to_site] (eg.
To support advanced [Site-to-site networking][tailscale_info_site_to_site] (e.g., to traverse multiple networks), you can disable this functionality, and execute steps 2 and 3 as described on [Site-to-site networking][tailscale_info_site_to_site] (e.g., to traverse multiple networks), you can...

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @lmagyar 👍

../Frenck

@frenck frenck merged commit 5c961d1 into hassio-addons:main May 18, 2024
11 of 12 checks passed
@lmagyar lmagyar deleted the pr-stateful-filtering-option branch May 18, 2024 16:11
@github-actions github-actions bot locked and limited conversation to collaborators May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-feature New features or options.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants