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

Restrict AutoUpdateVersion to be created/updated for cloud #49008

Merged
merged 7 commits into from
Dec 12, 2024

Conversation

vapopov
Copy link
Contributor

@vapopov vapopov commented Nov 14, 2024

In this PR added validation to restrict modify AutoUpdateVersion for cloud users

Related:

> [!NOTE]
> Client tools configuration is broken into two resources to [prevent
> updates](https://github.com/gravitational/teleport/blob/master/lib/modules/modules.go#L332-L355)
> to `autoupdate_version` on Cloud.
>
> While Cloud customers will be able to use `autoupdate_config` to
> turn client tools automatic updates `off` and self-manage updates, they will
> not be able to control the version of client tools in `autoupdate_version`.
> That will continue to be managed by the Teleport Cloud team.

@vapopov vapopov added the no-changelog Indicates that a PR does not require a changelog entry label Nov 14, 2024
@github-actions github-actions bot requested review from mvbrock and zmb3 November 14, 2024 20:16
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-49008.d3pp5qlev8mo18.amplifyapp.com

lib/modules/modules.go Outdated Show resolved Hide resolved
@hugoShaka
Copy link
Contributor

hugoShaka commented Nov 14, 2024

If I understand correctly, this will render any version invalid on cloud.
This means cloud themselves will not be able to set version using tctl and local admin.

lib/services/presets.go Outdated Show resolved Hide resolved
@@ -292,6 +293,11 @@ func (s *Service) CreateAutoUpdateVersion(ctx context.Context, req *autoupdate.C
return nil, trace.Wrap(err)
}

if modules.GetModules().Features().Cloud && !isAdmin(authCtx) {
return nil, trace.AccessDenied("only role %q is allowed to modifying %q in cloud",
Copy link
Contributor

@hugoShaka hugoShaka Dec 10, 2024

Choose a reason for hiding this comment

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

This error is not very actionable for users. I think we should have something more user-oriented like:

This Teleport instance is running on Teleport Cloud and the "autoupdate_version" resource is managed by the Teleport Cloud team. You can use the "autoupdate_config" resource to opt-in, opt-out or configure update schedules.

@vapopov
Copy link
Contributor Author

vapopov commented Dec 12, 2024

would appreciate one more review

@vapopov vapopov requested a review from espadolini December 12, 2024 19:14
@vapopov vapopov added this pull request to the merge queue Dec 12, 2024
Merged via the queue into master with commit 13cf4eb Dec 12, 2024
40 of 41 checks passed
@vapopov vapopov deleted the vapopov/autoupdate-version-cloud-restriction branch December 12, 2024 21:09
@public-teleport-github-review-bot

@vapopov See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Failed
branch/v17 Failed

vapopov added a commit that referenced this pull request Dec 13, 2024
* Restrict AutoUpdateVersion to be created/updated for cloud

* Check builtin Admin role and Cloud feature

* More informative error message

* Remove KindAutoUpdateAgentRollout from editor role preset
vapopov added a commit that referenced this pull request Dec 13, 2024
* Restrict AutoUpdateVersion to be created/updated for cloud

* Check builtin Admin role and Cloud feature

* More informative error message

* Remove KindAutoUpdateAgentRollout from editor role preset
vapopov added a commit that referenced this pull request Dec 13, 2024
* Restrict AutoUpdateVersion to be created/updated for cloud

* Check builtin Admin role and Cloud feature

* More informative error message

* Remove KindAutoUpdateAgentRollout from editor role preset
github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2024
…50242)

* Restrict AutoUpdateVersion to be created/updated for cloud

* Check builtin Admin role and Cloud feature

* More informative error message

* Remove KindAutoUpdateAgentRollout from editor role preset
github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2024
…50243)

* Restrict AutoUpdateVersion to be created/updated for cloud

* Check builtin Admin role and Cloud feature

* More informative error message

* Remove KindAutoUpdateAgentRollout from editor role preset
github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2024
…50244)

* Restrict AutoUpdateVersion to be created/updated for cloud

* Check builtin Admin role and Cloud feature

* More informative error message

* Remove KindAutoUpdateAgentRollout from editor role preset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants