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

Adds HumioUsers CRD #711

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Adds HumioUsers CRD #711

wants to merge 10 commits into from

Conversation

schofield
Copy link
Contributor

Currently a work in progress, soliciting feedback.

@schofield
Copy link
Contributor Author

I fixed the last remaining bug. This is ready for review.

@schofield schofield marked this pull request as ready for review July 11, 2023 17:34
@schofield schofield requested a review from a team as a code owner July 11, 2023 17:34
Picture string `json:"picture,omitempty"`
// IsRoot is the root setting for the user
IsRoot bool `json:"isRoot,omitempty"`
// CreatedAt is date when the user was created
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this as part of the spec? I can't think of a reason one would want to set this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have seen people use it and it is configurable so I think it should be in the spec.

Copy link
Contributor

Choose a reason for hiding this comment

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

What controls will there be around the IsRoot field? Could anyone push a YAML doc to the API server and give themselves root privileges?

Copy link
Member

Choose a reason for hiding this comment

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

I agree that CreatedAt does seem very strange to add (at least to the Spec of the CRD). The go client involved using Users().Add(...) doesn't use it (same for Users().Update(...). The only use of it that I see is to reflect back the CreatedAt timestamp for a user as for when it was created. This does not make sense in HumioUsers.Spec though. If we really want to ensure our k8s CR's store that data, then we can store it in HumioUsers.Status if we really have to, but I'm not sure we really need it. It definitely doesn't belong in the Spec though, since users cannot specify that themselves, but is given by the user upon user-creation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense, I'll remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What controls will there be around the IsRoot field? Could anyone push a YAML doc to the API server and give themselves root privileges?

Any user that has the ability to create the resource could change the attribute yes but they could also change the cluster resource and change the authentication.

pkg/humio/client.go Outdated Show resolved Hide resolved
Picture string `json:"picture,omitempty"`
// IsRoot is the root setting for the user
IsRoot bool `json:"isRoot,omitempty"`
// CreatedAt is date when the user was created
Copy link
Member

Choose a reason for hiding this comment

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

I agree that CreatedAt does seem very strange to add (at least to the Spec of the CRD). The go client involved using Users().Add(...) doesn't use it (same for Users().Update(...). The only use of it that I see is to reflect back the CreatedAt timestamp for a user as for when it was created. This does not make sense in HumioUsers.Spec though. If we really want to ensure our k8s CR's store that data, then we can store it in HumioUsers.Status if we really have to, but I'm not sure we really need it. It definitely doesn't belong in the Spec though, since users cannot specify that themselves, but is given by the user upon user-creation.

pkg/humio/client.go Outdated Show resolved Hide resolved
pkg/humio/client.go Outdated Show resolved Hide resolved
pkg/humio/client.go Outdated Show resolved Hide resolved
pkg/humio/client_mock.go Outdated Show resolved Hide resolved
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.

5 participants