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

machine configuration to manage firewall #4421

Closed
Tracked by #7561
smira opened this issue Oct 22, 2021 · 1 comment · Fixed by #7999
Closed
Tracked by #7561

machine configuration to manage firewall #4421

smira opened this issue Oct 22, 2021 · 1 comment · Fixed by #7999
Assignees

Comments

@smira
Copy link
Member

smira commented Oct 22, 2021

See https://github.com/sbezverk/nftableslib

First goal: define minimal but usable rule configuration we could put to the machine configuration. Format should be extensible in the future if we want to expand later.

  • only ingress traffic
  • if the port is defined in the rule, block everything which is not listed in ingress: section
  • if the port is not defined in any rule, NetworkDefaultAction is applied
kind: NetworkRuleConfig
portSelector:
  ports: [6443, 10250]
  protocol: tcp
ingress:
  - cidr: 10.0.0.0/8
  - cidr: 2000:fd00::/16
---
kind: NetworkRuleConfig
portSelector:
  ports: [80, 1000-2000]
  protocol: tcp
ingress:
  - cidr: 192.168.0.0/16
    except: 192.168.64.0/24
---
kind: NetworkDefaultActionConfig
ingress: allow/block
@reyvonger
Copy link

reyvonger commented Sep 21, 2022

I will be very happy to implement this feature 😀

@smira smira assigned smira and unassigned Ulexus Nov 7, 2023
smira added a commit to smira/talos that referenced this issue Nov 17, 2023
Implement initial set of backend controllers/resources to handle
nftables chains/rules etc.

Replace the KubeSpan nftables operations with controller-based.

See siderolabs#4421

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this issue Nov 17, 2023
Implement initial set of backend controllers/resources to handle
nftables chains/rules etc.

Replace the KubeSpan nftables operations with controller-based.

See siderolabs#4421

Signed-off-by: Andrey Smirnov <[email protected]>
talos-bot pushed a commit that referenced this issue Nov 27, 2023
Implement initial set of backend controllers/resources to handle
nftables chains/rules etc.

Replace the KubeSpan nftables operations with controller-based.

See #4421

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this issue Nov 28, 2023
smira added a commit to smira/talos that referenced this issue Nov 28, 2023
smira added a commit to smira/talos that referenced this issue Nov 29, 2023
Many changes to the nftables backend which will be used in the follow-up
PR with siderolabs#4421.

1. Add support for chain policy: drop/accept.
2. Properly handle match on all IPs in the set (`0.0.0.0/0` like).
3. Implement conntrack state matching.
4. Implement multiple ifname matching in a single rule.
5. Implement anonymous counters.

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this issue Nov 29, 2023
Many changes to the nftables backend which will be used in the follow-up
PR with siderolabs#4421.

1. Add support for chain policy: drop/accept.
2. Properly handle match on all IPs in the set (`0.0.0.0/0` like).
3. Implement conntrack state matching.
4. Implement multiple ifname matching in a single rule.
5. Implement anonymous counters.

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this issue Nov 29, 2023
Many changes to the nftables backend which will be used in the follow-up
PR with siderolabs#4421.

1. Add support for chain policy: drop/accept.
2. Properly handle match on all IPs in the set (`0.0.0.0/0` like).
3. Implement conntrack state matching.
4. Implement multiple ifname matching in a single rule.
5. Implement anonymous counters.

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this issue Nov 29, 2023
smira added a commit to smira/talos that referenced this issue Nov 30, 2023
Fixes siderolabs#4421

See documentation for details on how to use the feature.

With `talosctl cluster create`, firewall can be easily test with
`--with-firewall=accept|block` (default mode).

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this issue Nov 30, 2023
Fixes siderolabs#4421

See documentation for details on how to use the feature.

With `talosctl cluster create`, firewall can be easily test with
`--with-firewall=accept|block` (default mode).

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this issue Nov 30, 2023
Fixes siderolabs#4421

See documentation for details on how to use the feature.

With `talosctl cluster create`, firewall can be easily test with
`--with-firewall=accept|block` (default mode).

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this issue Nov 30, 2023
Fixes siderolabs#4421

See documentation for details on how to use the feature.

With `talosctl cluster create`, firewall can be easily test with
`--with-firewall=accept|block` (default mode).

Signed-off-by: Andrey Smirnov <[email protected]>
smira added a commit to smira/talos that referenced this issue Nov 30, 2023
Fixes siderolabs#4421

See documentation for details on how to use the feature.

With `talosctl cluster create`, firewall can be easily test with
`--with-firewall=accept|block` (default mode).

Signed-off-by: Andrey Smirnov <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants