Skip to content

[v18] fix: Prevent an App from setting a public address that conflicts with a Teleport Proxy public address 👮#58766

Merged
cthach merged 3 commits intobranch/v18from
cthach/backport-restrict-public-addr-v18
Sep 5, 2025
Merged

[v18] fix: Prevent an App from setting a public address that conflicts with a Teleport Proxy public address 👮#58766
cthach merged 3 commits intobranch/v18from
cthach/backport-restrict-public-addr-v18

Conversation

@cthach
Copy link
Copy Markdown
Contributor

@cthach cthach commented Sep 4, 2025

Backport #58475 to branch/v18

Fixes https://github.com/gravitational/teleport-private/issues/2104

changelog: Prevents an application from being registered if its public address matches a Teleport cluster address.

… a Teleport Proxy public address 👮🏾 (#58475)

* fix: apps should not be able to set public_addr to the web proxy address

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* feat: add API validation

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* test: add coverage for UpsertApplicationServer

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* refactor: polish

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* refactor: make consistent

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* refactor: use ValidateApp func everywhere. Revert changes to Check* method.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* refactor: dedupe

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* refactor: improve error messages for application address conflicts and add validation check in connections handler

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* ux: bubble up friendly error to UI

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* refactor: revert unnecessary change

* fix: app public address in redirect

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* fix: streamline proxy address validation in ValidateApp function

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* refactor: remove contact cluster admin in favor of self-service. Add logging.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Apply suggestions from code review

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>

* fix: skip proxy servers with unset public addresses in ValidateApp function

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* refactor: simplify error messages for application public address conflicts with proxy

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* fix: logging in the wrong spot

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* fix: handle when a server has multiple public addrs

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

---------

Signed-off-by: Chris Thach <chris.thach@goteleport.com>
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
@cthach cthach self-assigned this Sep 4, 2025
@cthach cthach added security Security Issues application-access backport size/md sec-internal Security Vulnerability - Reported by employees or auditors, no known exploitation labels Sep 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 4, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
cthach/backport-restrict-public-addr-v18 4ce0e59 3 ✅SUCCEED cthach-backport-restrict-public-addr-v18 2025-09-05 11:52:41

@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from r0mant September 5, 2025 12:22
@cthach cthach added this pull request to the merge queue Sep 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2025
@cthach cthach added this pull request to the merge queue Sep 5, 2025
Merged via the queue into branch/v18 with commit 68ee48e Sep 5, 2025
43 checks passed
@cthach cthach deleted the cthach/backport-restrict-public-addr-v18 branch September 5, 2025 15:04
@doggydogworld doggydogworld mentioned this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

application-access backport documentation sec-internal Security Vulnerability - Reported by employees or auditors, no known exploitation security Security Issues size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants