Skip to content

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

Merged
cthach merged 2 commits intobranch/v17from
cthach/backport-restrict-public-addr-v17
Sep 5, 2025
Merged

[v17] fix: Prevent an App from setting a public address that conflicts with a Teleport Proxy public address 👮#58767
cthach merged 2 commits intobranch/v17from
cthach/backport-restrict-public-addr-v17

Conversation

@cthach
Copy link
Copy Markdown
Contributor

@cthach cthach commented Sep 4, 2025

Backport #58475 to branch/v17

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

changelog: Prevented 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>
Signed-off-by: Chris Thach <chris.thach@goteleport.com>
@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-v17 8cbe45e 2 ✅SUCCEED cthach-backport-restrict-public-addr-v17 2025-09-05 11:52:28

@cthach cthach added security Security Issues sec-internal Security Vulnerability - Reported by employees or auditors, no known exploitation backport labels Sep 4, 2025
@cthach cthach self-assigned this Sep 4, 2025
@cthach cthach marked this pull request as ready for review September 4, 2025 22:26
@cthach cthach enabled auto-merge September 4, 2025 22:26
@cthach cthach requested review from avatus and rosstimothy September 4, 2025 22:26
@cthach cthach added this pull request to the merge queue Sep 5, 2025
Merged via the queue into branch/v17 with commit 702d2f6 Sep 5, 2025
41 checks passed
@cthach cthach deleted the cthach/backport-restrict-public-addr-v17 branch September 5, 2025 15:20
@camscale camscale mentioned this pull request Sep 8, 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