Skip to content

[client] Add block inbound flag to disallow inbound connections of any kind #3897

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

Merged
merged 4 commits into from
Jun 3, 2025

Conversation

lixmal
Copy link
Contributor

@lixmal lixmal commented May 29, 2025

Describe your changes

This option prevents adding any inbound rules (peer + route ACLs) and ssh

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

@Copilot Copilot AI review requested due to automatic review settings May 29, 2025 16:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a block inbound flag to disallow inbound connections and propagates that flag through the UI, configuration, protocol definitions, and firewall logic.

  • Added a new "Block Inbound Connections" option in the client UI with corresponding label and description changes.
  • Updated configuration, proto messages, and engine logic to support blocking inbound connections.
  • Modified command-line flags and login request setup to incorporate the new block inbound functionality.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
client/ui/const.go Updated menu description strings and added block inbound menu text.
client/ui/client_ui.go Added the block inbound checkbox and updated configuration update logic.
client/server/server.go Propagated the new block inbound flag in login requests and config responses.
client/proto/daemon.proto Introduced new proto fields for block inbound connections.
client/internal/engine.go Adjusted firewall and SSH server initialization logic using BlockInbound.
client/internal/connect.go Integrated block inbound flag into engine configuration and login request.
client/internal/config.go Added BlockInbound field in configuration and updated its application logic.
client/internal/acl/manager.go Removed duplicate firewall nil check since it's already handled earlier.
client/firewall/* Updated IP forwarding and nat rule management to reflect block inbound changes.
client/cmd/* Introduced new command-line flags for block inbound and updated config setup.
Comments suppressed due to low confidence (2)

client/cmd/up.go:263

  • The function runInForegroundMode returns only an error. Change 'return nil, err' to 'return err' to match the function signature.
return nil, err

client/cmd/up.go:361

  • The function runInDaemonMode returns only an error. Change 'return nil, err' to 'return err' to adhere to the expected signature.
return nil, err

@lixmal lixmal force-pushed the add-blocked-inbound branch from 027853c to d06f080 Compare May 29, 2025 17:08
hakansa
hakansa previously approved these changes Jun 3, 2025
Copy link

sonarqubecloud bot commented Jun 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
9.9% Duplication on New Code (required ≤ 5%)

See analysis details on SonarQube Cloud

@lixmal lixmal merged commit 1ce4ee0 into main Jun 3, 2025
29 of 32 checks passed
@lixmal lixmal deleted the add-blocked-inbound branch June 3, 2025 08:53
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.

2 participants