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

Fix create token sudo non-root namespace check #7224

Merged
merged 4 commits into from
Aug 5, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions vault/dynamic_system_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package vault
import (
"context"
"fmt"
"strings"
"time"

"github.com/hashicorp/errwrap"
Expand Down Expand Up @@ -88,6 +89,9 @@ func (d dynamicSystemView) SudoPrivilege(ctx context.Context, path string, token
return false
}

// AllowOperation path should be namespace scoped
path = strings.TrimPrefix(path, tokenNS.Path)
calvn marked this conversation as resolved.
Show resolved Hide resolved

// Add identity policies from all the namespaces
entity, identityPolicies, err := d.core.fetchEntityAndDerivedPolicies(ctx, tokenNS, te.EntityID)
if err != nil {
Expand Down