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

import policy for ranger is not working properly if updateifexist parameter is passed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.1.0
    • Ranger
    • None

    Description

      Problem Statement:

      Currently, Import Policy API provide option to updateIfExist all policies of given service but it update the non matching policy.

      Current Imlementation
      'updateIfExists' flag : API shall update existing policies with new policy json based on either of the following conditions.
      a) existing and new policy guid is matching
      b) existing and new policy name, service and zone are matching
      c) existing and new policy name and service are matching.

      If there is a policy which matches the resource, the policy should be updated with the data provided.

      If there is no policy which matches the resource, a new policy should be created with the data provided.

      Proposed Solution :

      Patch shall compare resource signature of existing policy with new policy provide if it matches then update otherwise create new policy.

      Behaviour of the Import API shall be:
      1) 'Override' flag : API shall delete all the policies of given target service and shall create the new policies from the received json.
      2) 'deleteIfExists' flag : API shall delete those existing policies which are exactly matching after comparing with new policy based on their resources. After deleting the existing policy, API shall create the new policy from the given json file.
      3) 'updateIfExists' flag with polResource input : API shall delete all the existing policies from target service of which resources are exactly matching with given policies resources.
      4) 'updateIfExists' flag without resource input : API shall update existing policies with new policy json based on following conditions.
          a) existing and new policy should match by resource signature
      5) 'mergeIfExists' flag : API shall merge the existing policy's policy-items with the new policy of which resources will match exactly with available policies.
      6) 'deleteIfExists' flag and 'updateIfExists' : delete the policies of which resources are exactly matching. update the policies which are matching else will create the policy.

      If none of the cases are matching then API shall try to create the policy. Policy creation validation will be done before creating the policy.

       

      Attachments

        Issue Links

          Activity

            People

              dineshkumar-yadav Dineshkumar Yadav
              dineshkumar-yadav Dineshkumar Yadav
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: