Skip to content

Remove SAML connector and tests#18285

Merged
camscale merged 7 commits intomasterfrom
camh/remove-saml
Nov 28, 2022
Merged

Remove SAML connector and tests#18285
camscale merged 7 commits intomasterfrom
camh/remove-saml

Conversation

@camscale
Copy link
Copy Markdown
Contributor

@camscale camscale commented Nov 9, 2022

Remove the SAML connector from the OSS repository. It has been migrated
to the enterprise repository.

Issue: https://github.com/gravitational/teleport.e/issues/525


NOTE: This PR should be reviewed in conjunction with https://github.com/gravitational/teleport.e/pull/597
which adds the SAML connector to the enterprise repo.

@camscale camscale force-pushed the camh/remove-saml branch 2 times, most recently from b52d83f to 7e9fb1f Compare November 9, 2022 06:31
@camscale camscale force-pushed the camh/sso-to-e branch 2 times, most recently from 22d628c to e6a0d70 Compare November 16, 2022 02:50
Base automatically changed from camh/sso-to-e to master November 16, 2022 03:24
@camscale camscale force-pushed the camh/remove-saml branch 2 times, most recently from 2cc2f7e to 468004b Compare November 16, 2022 06:47
@camscale camscale marked this pull request as ready for review November 16, 2022 11:13
Comment thread lib/auth/fuzz_test.go
"github.com/stretchr/testify/require"
)

func FuzzParseSAMLInResponseTo(f *testing.F) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not familiar with this part of the codebase, but are we okay with removing this fuzz test completely? From what I see, it wasn't moved to teleport.e.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The reference to this test can be also found in

FuzzParseSAMLInResponseTo fuzz_parse_saml_in_response_to

So probably we need to remove it from there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah yes. I over-zealously removed this (the always-failing CIFuzz annoys me no end), and forgot to see what I needed to do to move it to the new repo. I'll get onto that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oss-fuzz-build.sh fixed in 340df18

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've added the fuzz test to the enterprise PR. As yet there is nothing to run it as there is no CI job there to do fuzz testing. I can't figure out how the fuzz/oss-fuzz-build.sh script is meant to work - I think I'm missing the context in which it runs - there look to be undefined functions and variables, so I suspect OSSFuzz provides this context and corpora. A similar setup will need to be done on the enterprise repo.

@reedloden Is there any feedback you can add?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OSS-Fuzz runs fuzz/oss-fuzz-build.sh from the config in https://github.com/google/oss-fuzz/tree/master/projects/teleport.

OSS-Fuzz only works on open source projects. We can use https://fuzzbuzz.io/ for teleport.e, but it's not configured yet. As long as you ensure Go-native fuzzing is set up (by way of the fuzz test existing), when we do get Fuzzbuzz working, it will Just Work(TM).

Comment thread lib/auth/fuzz_test.go
"github.com/stretchr/testify/require"
)

func FuzzParseSAMLInResponseTo(f *testing.F) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The reference to this test can be also found in

FuzzParseSAMLInResponseTo fuzz_parse_saml_in_response_to

So probably we need to remove it from there.

if err := a.authConnectorAction(apidefaults.Namespace, types.KindSAML, types.VerbUpdate); err != nil {
return trace.Wrap(err)
}
if !modules.GetModules().Features().SAML {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wonder if there is a case when a client can have a Enterprise product without SAML feature ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not currently as far as I'm aware. This check is still performed but in a different way. If the enterprise startup does not register the SAML connector, you'll still get this error message from the code in lib/auth/saml.go in the OSS repo. If we do get a scenario where we can have an enterprise product without SAML, we can revise the error message then since I don't know how to word it otherwise right now.

@camscale
Copy link
Copy Markdown
Contributor Author

@ravicious @smallinsky This PR has a failing test for the operator that I did not notice before as it is not run from make test-go on the command line. I've raised #18634 to keep some auth/SAML methods in auth.Server. Once I get that merged, I'll rebase this and the other PR on top of that. I think some of the tests that moved across will end up staying now as those related to Upsert/Delete of the connector will be fully implemented in this OSS repo.

@camscale camscale force-pushed the camh/remove-saml branch 2 times, most recently from b4173ea to e0051ff Compare November 21, 2022 06:54
@camscale camscale changed the base branch from master to camh/narrow-saml-interface November 21, 2022 06:57
@camscale camscale force-pushed the camh/narrow-saml-interface branch from 0ea5f94 to 550a864 Compare November 24, 2022 04:29
Remove the SAML connector code as it now lives in the enterprise
repository. All that is left behind is a small forwarding stub that
returns a NotImplemented error if a SAMLService is not plugged into the
auth.Server.
Remove the SAML tests that were not in `saml_test.go`. These tests have
already been moved to the enterprise repository along with the SAML
connector.
This fuzz test has moved to the enterprise repository, so remove the run
from here.
Add `TestSAMLValidation` back to `grpcserver_test.go` as it does not do
actual SAML auth, just creating a connector. That is fully supported in
OSS - only the auth path required enterprise.
@camscale camscale changed the base branch from camh/narrow-saml-interface to master November 25, 2022 02:06
Add a "fmt" import that got lost in a rebase.
@camscale camscale merged commit 45642fb into master Nov 28, 2022
@camscale camscale deleted the camh/remove-saml branch April 6, 2023 06:37
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.

4 participants