Skip to content

policy: add App Connector support#2987

Closed
matanbaruch wants to merge 6 commits into
juanfont:mainfrom
matanbaruch:main
Closed

policy: add App Connector support#2987
matanbaruch wants to merge 6 commits into
juanfont:mainfrom
matanbaruch:main

Conversation

@matanbaruch
Copy link
Copy Markdown

@matanbaruch matanbaruch commented Jan 1, 2026

Implement App Connector functionality for Headscale, allowing nodes to advertise as app connectors and receive domain-based routing configuration from the control plane. This addresses issue #1651.

Changes

Core Implementation

  • Add appConnectors field to Policy struct for defining app connector configurations in ACLs
  • Parse app connector configuration including name, connectors (tags or "*"), domains (with wildcard support), and optional routes
  • Add validation for app connector configuration (domains, tags, etc.)
  • Add AppConnectorConfigForNode method to PolicyManager to get matching configurations for nodes advertising as app connectors
  • Update mapper to add tailscale.com/app-connectors capability to CapMap in MapResponse for nodes advertising as app connectors

Tests

  • Add comprehensive unit tests for app connector functionality (hscontrol/policy/v2/appconnector_test.go)
  • Add integration tests (integration/appconnector_test.go):
    • TestAppConnectorBasic: Tests tagged nodes receive app connector configuration
    • TestAppConnectorNonMatchingTag: Tests non-matching tags are excluded
    • TestAppConnectorWildcardConnector: Tests wildcard connector matching

Documentation

  • Add App Connectors section to docs/ref/acls.md with configuration examples
  • Add App Connectors to feature list in docs/about/features.md
  • Add CHANGELOG.md entry

Example ACL Configuration

{
  "tagOwners": {
    "tag:connector": ["user@example.com"]
  },
  "appConnectors": [
    {
      "name": "Internal Apps",
      "connectors": ["tag:connector"],
      "domains": ["internal.example.com", "*.corp.example.com"],
      "routes": ["10.0.0.0/8"]
    }
  ]
}

How It Works

  1. Configure tagged nodes as app connectors in your ACL policy
  2. Nodes with the specified tags that advertise themselves as app connectors (tailscale set --advertise-connector) will receive the domain configuration
  3. When clients query DNS for the configured domains, traffic is automatically routed through the connector nodes

Closes #1651

  • have read the CONTRIBUTING.md file
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

@m3wt
Copy link
Copy Markdown

m3wt commented Jan 23, 2026

@matanbaruch, have you tested the functionality of this patch set?

After applying the patches, I tagged an app connector node, enabled the app connector in tailscaled, published a connector domain within my tailscale policy, however tailscale appc-routes on the app connector does not return any results.

matanbaruch and others added 2 commits February 11, 2026 06:07
Implement App Connector functionality for Headscale, allowing nodes to
advertise as app connectors and receive domain-based routing configuration
from the control plane. This addresses issue juanfont#1651.

Changes:
- Add `appConnectors` field to Policy struct for defining app connector
  configurations in ACLs
- Parse app connector configuration including name, connectors (tags or "*"),
  domains (with wildcard support), and optional routes
- Add validation for app connector configuration (domains, tags, etc.)
- Add `AppConnectorConfigForNode` method to PolicyManager to get matching
  configurations for nodes advertising as app connectors
- Update mapper to add `tailscale.com/app-connectors` capability to CapMap
  in MapResponse for nodes advertising as app connectors
- Add comprehensive unit tests for app connector functionality

Example ACL configuration:
```json
{
  "tagOwners": {
    "tag:connector": ["user@example.com"]
  },
  "appConnectors": [
    {
      "name": "Internal Apps",
      "connectors": ["tag:connector"],
      "domains": ["internal.example.com", "*.corp.example.com"],
      "routes": ["10.0.0.0/8"]
    }
  ]
}
```

Closes juanfont#1651

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add App Connectors section to docs/ref/acls.md with configuration examples
- Add App Connectors to feature list in docs/about/features.md
- Add CHANGELOG.md entry for App Connector support
- Add integration tests for app connector functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…r tests

- Set DOCKER_API_VERSION to 1.44 if not already defined to maintain compatibility with newer Docker daemons.
- Update app connector tests to use netip.Prefix for route definitions and improve validation checks for netmap and capability maps.
- Refactor assertions in tests for better clarity and consistency.

This enhances the reliability of integration tests and ensures proper interaction with Docker APIs.
@matanbaruch
Copy link
Copy Markdown
Author

matanbaruch commented Feb 11, 2026

@matanbaruch, have you tested the functionality of this patch set?

After applying the patches, I tagged an app connector node, enabled the app connector in tailscaled, published a connector domain within my tailscale policy, however tailscale appc-routes on the app connector does not return any results.

Hey @m3wt, yes I've tested this locally and the app connector capability is working correctly.
Regarding tailscale appc-routes returning empty - that's expected at this stage. That command shows routes the app connector has discovered by resolving DNS queries. The capability is
delivered via the netmap (which you can verify with tailscale debug netmap), but actual route discovery only happens when a client on the tailnet queries one of the configured domains.
The headscale side (this PR) is responsible for delivering the configuration to the node - the route discovery itself is handled by the Tailscale client.

Make sure you're using a tagged pre-auth key (not a regular one) - the node must have tag:connector for the policy to match.

@matanbaruch
Copy link
Copy Markdown
Author

@kradalby Is is possible to get this test running?

matanbaruch and others added 2 commits February 21, 2026 19:33
- Added tests for App Connector Basic, Non-Matching Tag, and Wildcard Connector to enhance coverage.
- Improved assertions in existing tests to ensure proper validation of node capabilities and tags.
- Minor formatting adjustments in test files for better readability.

These changes aim to strengthen the integration testing framework for app connectors.
@matanbaruch
Copy link
Copy Markdown
Author

@kradalby Re-run? :)

- Added whitespace for better readability in the TestAppConnectorBasic and TestAppConnectorWildcardConnector functions.
- These minor formatting adjustments enhance the clarity of the test code without altering functionality.
@matanbaruch
Copy link
Copy Markdown
Author

@kradalby I think we are ready. Re-run :)

@matanbaruch matanbaruch mentioned this pull request Feb 21, 2026
6 tasks
@kradalby
Copy link
Copy Markdown
Collaborator

Seems like it's hanging, you might need to close and reopen

@matanbaruch matanbaruch closed this Mar 1, 2026
@matanbaruch
Copy link
Copy Markdown
Author

@kradalby Done #3121

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.

FR: support for App Connectors

3 participants