Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-4486

ZoneV2 partial update allows duplicate principals and tagServices

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • admin
    • None

    Description

      In RANGER-4398 , we added support for incremental updates with the PUT API - /service/public/v2/api/zones-v2/{zoneId}/partial. This allows addition of duplicate principals (admin and auditor UGR) and tagServices.

      Steps to reproduce. Create a security-zone and update with above PUT API:

      {
          "id": 5,
          "isEnabled": true,
          "createdBy": "Admin",
          "updatedBy": "Admin",
          "createTime": 1697718906795,
          "updateTime": 1697718906796,
          "name": "zone10",
          "services": {
              "hive1": {
                  "resources": [
                      {
                          "id": 1,
                          "resource": {
                              "database": [
                                  "db10"
                              ]
                          }
                      }
                  ]
              }
          },
          "tagServicesToAdd": [
              "tag1"
          ],
          "adminsToAdd": [
              {
                  "type": "USER",
                  "name": "mark"
              }
          ]
      }

      If we call the same API with same request again, it creates duplicate adminUser and tagService as below:

      {
          "id": 5,
          "isEnabled": true,
          "createdBy": "Admin",
          "updatedBy": "Admin",
          "createTime": 1697718906795,
          "updateTime": 1697719001243,
          "name": "zone10",
          "services": {
              "hive1": {
                  "resources": [
                      {
                          "id": 1,
                          "resource": {
                              "database": [
                                  "db10"
                              ]
                          }
                      }
                  ]
              }
          },
          "tagServices": [
              "tag1",
              "tag1"
          ],
          "admins": [
              {
                  "type": "USER",
                  "name": "mark"
              },
              {
                  "type": "USER",
                  "name": "mark"
              }
          ],
          "auditors": [
              {
                  "type": "USER",
                  "name": "mark"
              }
          ]
      }

      Attachments

        Activity

          People

            suchnit Subhrat Chaudhary
            suchnit Subhrat Chaudhary
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: