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

APM users should not use the built-in "superuser" role #2977

Closed
barkbay opened this issue Apr 28, 2020 · 2 comments · Fixed by #3010
Closed

APM users should not use the built-in "superuser" role #2977

barkbay opened this issue Apr 28, 2020 · 2 comments · Fixed by #3010
Assignees
Labels
>bug Something isn't working v1.2.0

Comments

@barkbay
Copy link
Contributor

barkbay commented Apr 28, 2020

I think there has been a regression regarding the role of the user used in the APM/ES association. The superuser built-in role is used while we should use one of the roles introduced in #2777

UserSecretSuffix: "apm-user",
ESUserRole: esuser.SuperUserBuiltinRole,
})

@barkbay barkbay added >bug Something isn't working v1.2.0 labels Apr 28, 2020
@sebgl
Copy link
Contributor

sebgl commented Apr 28, 2020

:o my bad it probably happened concurrently with the recent refactoring!

@barkbay
Copy link
Contributor Author

barkbay commented Apr 28, 2020

I guess we have to replace ESUserRole with a something like:

type AssociationInfo struct {
   ...
   ESUserRole func(commonv1.Associated) (string, error)
}

And then try to convert the interface to its implementation in the APM association controller:

// getRoles returns for a given version of the APM Server the set of required roles.
func getRoles(associated commonv1.Associated) (string, error) {
	apmServer, ok := associated.(*apmv1.ApmServer)
	if !ok {
		return "", errors.New(".....")
	}

	v, err := version.Parse(apmServer.Spec.Version)
	if err != nil {
		return "", err
	}
...

I will try to work on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v1.2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants