Skip to content

add CA filters to CA watchers#36361

Merged
GavinFrazar merged 1 commit intomasterfrom
gavinfrazar/add-ca-filters
Jan 9, 2024
Merged

add CA filters to CA watchers#36361
GavinFrazar merged 1 commit intomasterfrom
gavinfrazar/add-ca-filters

Conversation

@GavinFrazar
Copy link
Copy Markdown
Contributor

@GavinFrazar GavinFrazar commented Jan 5, 2024

Related to (and a release pre-req for) the DB CA split: #35949

This PR makes CA watchers in both CertAuthorityWatcher and the cache use filters.

For the cache, all the For<thing> setup config function will use CA filters, except ForAuth - filtering there is pointless, and for best backwards compatibility auth should not have a CA filter. If it did have a filter, and we backported some future new CA type, then auth would reject watchers that specify the new CA type in their filter since auth's filter would not Contain the client watch's filter.

The idea is that once this change is released, all Teleport components other than auth will use a CA filter when watching CAs such that they only receive OpPut events for CAs that they recognize, avoiding the need for any future CA filter injection hacks (hacks that we had to do for both the introduction of the Database CA and now the DB CA split).

It will make the release process much easier for the DB CA split, because simultaneous release and last minute changes won't be necessary to get the filter-injection version ranges correct in each backport - instead I can just target cutoff ranges to the release versions that contain this change.

@GavinFrazar GavinFrazar added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v12 labels Jan 5, 2024
@github-actions github-actions Bot requested a review from Tener January 5, 2024 23:08
Copy link
Copy Markdown
Contributor

@espadolini espadolini left a comment

Choose a reason for hiding this comment

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

Can you add some test coverage for (CertAuthorityFilter).Contains?

Comment thread api/types/authority.go Outdated
Comment thread lib/services/local/events.go
@GavinFrazar
Copy link
Copy Markdown
Contributor Author

Can you add some test coverage for (CertAuthorityFilter).Contains?

Oh, I added tests for that to the WatchKind contains tests in 89dba54

Comment thread api/types/authority.go Outdated
@GavinFrazar GavinFrazar requested review from greedy52 and removed request for rosstimothy January 9, 2024 00:48
Comment thread api/types/events_test.go Outdated
* fix WatchKind.Contains for ca filter
* add CA filter to caCollector
* require CA types in CA watcher config
* apply ca filter in EventsService parser
@GavinFrazar GavinFrazar force-pushed the gavinfrazar/add-ca-filters branch from 758e0ee to ee3de2a Compare January 9, 2024 18:13
@GavinFrazar GavinFrazar enabled auto-merge January 9, 2024 18:15
@GavinFrazar GavinFrazar added this pull request to the merge queue Jan 9, 2024
Merged via the queue into master with commit 3fd10a9 Jan 9, 2024
@GavinFrazar GavinFrazar deleted the gavinfrazar/add-ca-filters branch January 9, 2024 19:01
@public-teleport-github-review-bot
Copy link
Copy Markdown

@GavinFrazar See the table below for backport results.

Branch Result
branch/v12 Failed
branch/v13 Failed
branch/v14 Create PR

GavinFrazar added a commit that referenced this pull request Jan 9, 2024
github-merge-queue Bot pushed a commit that referenced this pull request Jan 10, 2024
* [v13] add CA filter for all known CAs to cache configs

Backport #36361 to branch/v13.

* dont backport AGPL license header
github-merge-queue Bot pushed a commit that referenced this pull request Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants