question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Revisit authorization logic

See original GitHub issue

Problem description

  1. The authorization subsystem doesn’t give adequate information to the authorization handler, to disambiguate between scope creation and scope use. One is unable to grant to the administrator the ability to create scopes, and grant to a user the ability to create streams within a given scope (but not to create scopes). Similar situation for scope deletion.

  2. Similar situation for streams with respect to scopes; e.g. the ability to write to a stream without the ability to create streams.

  3. Some of the calls are marked as requiring READ_UPDATE whereas READ may be sufficient:

  • getCurrentSegments
  • getSegments
  • getURI
  • isStreamCutValid
  • getDelegationToken (varies by situation?)

Problem location

  • io.pravega.controller.server.rpc.grpc.v1.ControllerServiceImpl
  • io.pravega.controller.server.rest.resources.StreamMetadataResourceImpl

Suggestions for an improvement Adjust the argument passed to the authorize call on the auth handler, such that a call to create or delete a sub-resource has the parent resource as the argument. For example:

action logic
list scopes authorize("/", READ)
create scope authorize("/", READ_UPDATE)
delete scope authorize("/", READ_UPDATE)
list streams authorize(scopeName, READ)
create stream authorize(scopeName, READ_UPDATE)
delete stream authorize(scopeName, READ_UPDATE)
read stream authorize(scopeName + "/" + streamName, READ)
write stream authorize(scopeName + "/" + streamName, READ_UPDATE)

Be sure to update ControllerServiceImpl and StreamMetadataResourceImpl since the logic is duplicated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
EronWrightcommented, Feb 5, 2019

@ravisharda your table has ‘delete’ operations that are inconsistent with that in the description, and consequently doesn’t solve the original problem.

I don’t see a compelling reason to change the resource argument format, because the handler is not designed to provide a generic hierarchical auth model.

Regarding the question of access rules, we use a fancy policy engine (Keycloak) which is very flexible. We strive to avoid embedding policy into the auth handler. e.g. the concept of roles, sentinel values such as ‘Admin’, permission inheritance.

1reaction
ravishardacommented, Jan 31, 2019

@EronWright and @sarlaccpit FYI, I’ve started working on this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Constructive Authorization Logics - Carnegie Mellon University
Independence of logical connectives from each other. • Intuitive interpretation. • Amenable to meta-theoretic analysis (exploration!) • Open-ended design ( ...
Read more >
(PDF) Revisiting the Foundations of Authentication Logics
To illustrate this statement, we describe a formal logic for security protocol analysis based on well-understood modal operators, knowledge, ...
Read more >
Revisiting the Foundations of Authentication Logics - School of ...
Revisiting the Foundations of Authentication Logics ... The idea is simply to define a logic to put protocol analysis on a firm formal...
Read more >
Authentication & Authorization in Web Apps | Jscrambler Blog
Traditionally, we use a combination of username and password to authenticate a user. The authentication logic has to be maintained locally so we ......
Read more >
Filtering data using authorization logic - Cerbos
Cerbos helps you offload hardcoded authorization logic out of your source ... With these points in mind, let's revisit the condition in the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found