Skip to content

Commit

Permalink
Check for matching creator & user during connect (#4876)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Quandt <[email protected]>
  • Loading branch information
thquad committed Feb 22, 2021
1 parent e5138f0 commit 6f3567b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/jetstream/authcnsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ func (p *portalProxy) DoLoginToCNSI(c echo.Context, cnsiGUID string, systemShare
if user.Admin {
return nil, echo.NewHTTPError(http.StatusUnauthorized, "Can not connect - admins are not allowed to connect to user created endpoints")
}

if cnsiRecord.Creator != userID {
return nil, echo.NewHTTPError(http.StatusUnauthorized, "Can not connect - non-admins are not allowed to connect to endpoints created by other non-admins")
}
}

// Register as a system endpoint?
Expand Down

0 comments on commit 6f3567b

Please sign in to comment.