GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update permissions aren't being enforced in registry server · Issue #4444 · feast-dev/feast

Update permissions aren't being enforced in registry server #4444

New issue
Copy link
New issue
Copy link
Closed
#4449
Closed
Update permissions aren't being enforced in registry server#4444
#4449
Copy link
Labels
kind/bugpriority/p2

Description

@tokoko
tokoko
opened on Aug 25, 2024
Issue body actions

Current Behavior

apply_x methods in registry server check permissions on the object that's passed in the request. This is correct for object creation, but overlooks updates. During updates we should be checking permissions on the existing object as well. With current behavior, user is allowed to overwrite objects even when updates aren't allowed.

Possible Solution

Pseudocode for a typical apply method should look something like this:

  • Check if the object already exists in the registry
  • Assert update permission on the existing object (if it exists)
  • Assert create permission on the object contained in the request
  • Proceed with apply

Activity

  1. tokoko
    added
    kind/bug
    priority/p2
    on Aug 25, 2024
  2. dmartinol commented on Aug 26, 2024

    @dmartinol
    dmartinol
    on Aug 26, 2024
    Contributor
    More actions

    @tokoko could you explain why the following code is not covering the update use case?

            self.proxied_registry.apply_entity(
                entity=cast(
                    Entity,
                    assert_permissions(
                        resource=Entity.from_proto(request.entity),
                        actions=CRUD,
                    ),
                ),
                project=request.project,
                commit=request.commit,
            )

    IIUC, it runs the assert check before trying the apply, so the update should not happen if not authorized.

  3. tokoko commented on Aug 26, 2024

    @tokoko
    tokoko
    on Aug 26, 2024
    CollaboratorAuthor
    More actions

    The problem isn't the order, it's the fact that assert is happening on a wrong object. Say I have an update permission on objects tagged like {"team": "A"} and I'm applying an update to an entity that already exists and is tagged like {"team": "B"}. The code above checks only the fact that I'm authorized to create entities of team A and overwrites team B's object because existing object is never touched during permission assertion.

    There should be two separate asserts, one on the object that's already in the registry and another one on the object that's supplied as part of the request.

    Reacted by Daniele Martinoli
  4. dmartinol commented on Aug 26, 2024

    @dmartinol
    dmartinol
    on Aug 26, 2024
    Contributor
    More actions

    Please TAL at #4449

    Reacted by Tornike Gurgenidze
  5. tokoko
    closed this as completedin #4449on Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugpriority/p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.