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

Add ability to disable an entity #4353

Merged
merged 3 commits into from
Apr 14, 2018
Merged

Add ability to disable an entity #4353

merged 3 commits into from
Apr 14, 2018

Conversation

jefferai
Copy link
Member

This disallows its associated tokens to be used, but doesn't revoke
them.

This disallows its associated tokens to be used, but doesn't revoke
them.
@jefferai jefferai added this to the 0.10.1 milestone Apr 13, 2018
@@ -110,6 +110,10 @@ message Entity {
// MFASecrets holds the MFA secrets indexed by the identifier of the MFA
// method configuration.
//map<string, mfa.Secret> mfa_secrets = 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m suspicious having this commented out might break if a user upgrades from oss -> ent

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be fine so long as the number is distinct.

@meirish meirish added the ui label Apr 13, 2018
@@ -802,6 +802,10 @@ func (c *Core) checkToken(ctx context.Context, req *logical.Request, unauth bool
}
}

if entity != nil && entity.Disabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also be disallowing the entity from getting tokens?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

briankassouf
briankassouf previously approved these changes Apr 13, 2018
Copy link
Contributor

@briankassouf briankassouf left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -1466,6 +1477,12 @@ func (c *Core) StepDown(req *logical.Request) (retErr error) {
return retErr
}

if entity != nil && entity.Disabled {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should do this before audit logging.

Copy link
Member Author

Choose a reason for hiding this comment

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

No -- for the same reason that we attempt to log whatever we get back from the token store before fully checking validity. The fact that a request is invalid doesn't mean it wasn't an attempted request.

vault/core.go Outdated
@@ -1327,12 +1338,6 @@ func (c *Core) sealInitCommon(ctx context.Context, req *logical.Request) (retErr
// for validation and the operation should be performed. But for now,
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove these comments?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I should move them down.

vishalnayak
vishalnayak previously approved these changes Apr 13, 2018
Copy link
Member

@vishalnayak vishalnayak left a comment

Choose a reason for hiding this comment

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

Left minor comments. Other than that LGTM!

@jefferai jefferai dismissed stale reviews from vishalnayak and briankassouf via 48e22bd April 14, 2018 01:48
@jefferai jefferai merged commit b65832d into master Apr 14, 2018
@jefferai jefferai deleted the disable-entity branch April 14, 2018 01:49
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.

4 participants