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

Implement proper ACL checks and suid permission #157

Closed
wants to merge 1 commit into from

Conversation

pkit
Copy link
Member

@pkit pkit commented Sep 11, 2014

Placeholder, not finished yet.

Tests needed still:

Anonymous (api/1.0):

  • simple denial case
  • if we reference two containers, 1 has setuid, 1 does not (api container has, other doesn't, and vice versa) <--- should be denied
  • if setuid and read, should be allowed
  • setuid on api container, and setuid and no acl on another container, check if we can write to other container (that is, create objects there)
  • if job has read permissions and no setuid, anonymous should not work in this case (authorized users would be allowed, though-- because other user will be billed instead of the owner-- and we can't bill anonymous users, sadly =P )

@pkit
Copy link
Member Author

pkit commented Sep 11, 2014

Needs the following:

  • tests for anonymous access
  • tests for "/open" for zapp (has one)
  • tests for "/api"
  • tests for "/open" an object with specific "content_type"

sink_req.content_length = source_resp.content_length
sink_req.content_type = source_resp.headers['Content-Type']
sink_req.etag = source_resp.etag
req_iter = iter(source_resp.app_iter)
req = sink_req
self.authorize_job(req, remove_auth=False)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't there be a acl= argument here? Perhaps: self.authorize_job(req, acl='read_acl', remove_auth=False)?

Copy link
Member

Choose a reason for hiding this comment

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

@pkit ^

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, job can be pre-authorized by owner only. No read or write permissions matter here.

Copy link
Member

Choose a reason for hiding this comment

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

Okay. By the way, I'm unable to get anonymous access working. Have you exercised this functionality yet?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did not do any anonymous stuff tests yet, and there should be bugs there.

@larsbutler
Copy link
Member

@pkit Can you give me some ideas about how to set up the tests for /api and /open? I've been trying for several hours and can't make any sense of it.

@larsbutler
Copy link
Member

For example, I can't figure out how--with the test utils and fixtures--to set up a zapp to handle requests for /open/account/container/foo.zapp, or set the suid, or anything. I'm lost.

@@ -45,6 +45,8 @@ def handle_chain(self, env, start_response):
new_req.environ['chain.input'] = env['chain.input']
new_req.environ['chain.input_size'] = env['chain.input_size']
new_req.environ['chain.input_type'] = env['chain.input_type']
if 'zerovm.source' in env:
Copy link
Member

Choose a reason for hiding this comment

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

Why is this being copied? There's no explanation in comments or in a commit message.

Copy link
Member Author

Choose a reason for hiding this comment

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

We need to know which chains come from api/1.0 requests and which are just user-created. Only api/1.0 ones need to be checked on suid secirity.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, can you please add a comment explaining that here?

@larsbutler
Copy link
Member

According to the spec for this feature, the suid stuff should only apply to api/1.0 and open/1.0 features. However, the tests so far implemented on this branch test suid features of everything BUT the REST features.

Why is that? Do we need to update the spec?

@pkit
Copy link
Member Author

pkit commented Oct 13, 2014

Added example with API/1.0 call, fixed a bug regarding anonymous access to API endpoint.

@larsbutler
Copy link
Member

See #172 for a rebased version of this branch.

@larsbutler larsbutler closed this Nov 11, 2014
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.

2 participants