Skip to content

User security groups are ignored #806

Closed

Description

@mik1234mc

ArcadeDB Version: ArcadeDB Server v22.12.1 (build 08eb71f/1672872283148/UNKNOWN)

JDK Version: openjdk 11.0.16 2022-07-19

OS: debian11

Expected behavior

A user specified with no group or group with empty access list or with only "readRecord" should not be able to insert database records. In general, it seems to me that user group mechanism is ignored at all, may be I am doing something wrong. How to restrict a user to not create nay record or just records of certain types..

Actual behavior

I have user 'test' in config/server-users.jsonl assigned to a single 'tmp' database (this works as expected). I tried empty and "noaccess"(see below) groups, but the user can still create records:

{"databases":{"tmp":[]}, "password":"PBKDF2WithHmacSHA256$65536$n5YWl487BgXz+b4fkrjRoqTDTq2bE5Y26iKqXGjX8dk=$y6oqAKX0AuCAS8//jvnHNOigJtkfNhLCEhIVdRrML/g=","name":"test"}

I have the following in config/server-groups.json:

{
  "databases": {
   "tmp": {
      "groups": {
        "admin": {
          "access": [
            "updateSecurity",
            "updateSchema"
          ],
          "resultSetLimit": -1,
          "readTimeout": -1,
          "types": {
            "*": {
              "access": [
                "createRecord",
                "readRecord",
                "updateRecord",
                "deleteRecord"
              ]
            }
          }
        },
        "noaccess": {
          "access": [],
          "resultSetLimit": -1,
          "readTimeout": -1,
          "types": {
            "*": {
              "access": ["readRecord"]
            }
          }
        }
        }
        },
    "*": {
      "groups": {
        "admin": {
          "access": [
            "updateSecurity",
            "updateSchema"
          ],
          "resultSetLimit": -1,
          "readTimeout": -1,
          "types": {
            "*": {
              "access": [
                "createRecord",
                "readRecord",
                "updateRecord",
                "deleteRecord"
              ]
            }
          }
        },
        "*": {
          "access": [],
          "resultSetLimit": -1,
          "readTimeout": -1,
          "types": {
            "*": {
              "access": []
            }
          }
        }
      }
    }
  },
  "version": 1
}

Activity

  1. lvca commented on Jan 26, 2023

    @lvca
    Member

    Strange, we have a specific test case for it:

    void userDefaultAccessCannotAccessDatabase() throws Throwable {
    .

  2. lvca commented on Jan 26, 2023

    @lvca
    Member

    I was able to reproduce the issue. Our test cases on security are mostly unit tests, we're missing some integration test cases. Working on it.

  3. lvca commented on Jan 26, 2023

    @lvca
    Member

    It's fixed in main branch. Leaving this issue open to finalize new test cases to avoid future regressions.

  4. lvca commented on Jan 26, 2023

    @lvca
    Member

    Added new test cases to check on that. The issue is closed. Thanks for the report @mik1234mc

  5. self-assigned this
    on Jan 26, 2023
  6. added this to the 23.1.2 milestone on Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions