Details

    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      deployS3 role was migrated to a new role named appstore_s3 as part of IGBF-2342.

      However, it has not been tested.

      For this task, modify role appstore_s3 as required to ensure that the S3 bucket is created.

      In addition, create a role that will allow the AppStore VM to modify the newly created S3 bucket. Assign the role to the VM.

      The role should have name ec2_name

        Attachments

          Activity

          Hide
          ann.loraine Ann Loraine added a comment -

          If you have time left today, could you work on this one?

          (if yes, move it to In Progress)

          Show
          ann.loraine Ann Loraine added a comment - If you have time left today, could you work on this one? (if yes, move it to In Progress)
          Hide
          cdias1 Chester Dias (Inactive) added a comment -

          Will pick this on monday.

          Show
          cdias1 Chester Dias (Inactive) added a comment - Will pick this on monday.
          Show
          cdias1 Chester Dias (Inactive) added a comment - Code changes have been made. Please review https://bitbucket.org/chesterdias/chester-local-appstore-playbooks/branch/IGBF-2346#diff
          Hide
          ann.loraine Ann Loraine added a comment -

          This looks good - great first draft!

          I have a couple of refinements to request:

          • Can you modify the role so that it is specific to the S3 bucket that the EC2 will use?

          That is, the permission policy should only apply to the particular bucket that is created in the playbooks. This is to ensure that we can have a very liberal permissions in the role without fear of developers accidentally harming each other's S3 buckets.

          • Also, I would like for the role itself to be named after the EC2 – e.g., the role name should be assigned to {{ ec_name }}.
          Show
          ann.loraine Ann Loraine added a comment - This looks good - great first draft! I have a couple of refinements to request: Can you modify the role so that it is specific to the S3 bucket that the EC2 will use? That is, the permission policy should only apply to the particular bucket that is created in the playbooks. This is to ensure that we can have a very liberal permissions in the role without fear of developers accidentally harming each other's S3 buckets. Also, I would like for the role itself to be named after the EC2 – e.g., the role name should be assigned to {{ ec_name }}.
          Hide
          cdias1 Chester Dias (Inactive) added a comment -

          aws s3 ls
          the above command was used to check if ec2 can list buckets

          Show
          cdias1 Chester Dias (Inactive) added a comment - aws s3 ls the above command was used to check if ec2 can list buckets
          Hide
          ann.loraine Ann Loraine added a comment -

          Chester Dias - Moving back to "To-Do". When you start working on it again, do please move it to "In Progress" to let me know you are working on it.

          Show
          ann.loraine Ann Loraine added a comment - Chester Dias - Moving back to "To-Do". When you start working on it again, do please move it to "In Progress" to let me know you are working on it.
          Hide
          ann.loraine Ann Loraine added a comment -

          Let's work on the requested new features as part of different ticket. Merged the branch above to master.
          cc: Chester Dias

          Show
          ann.loraine Ann Loraine added a comment - Let's work on the requested new features as part of different ticket. Merged the branch above to master. cc: Chester Dias
          Hide
          cdias1 Chester Dias (Inactive) added a comment -

          Sure
          Note: Below is the policy to be added to the role to grant limited priviledges over S3 to the EC2, The below policy will grant list priviledge to list all buckets and all privs over the bucket 'dev-media-****'
          {
          "Version": "2012-10-17",
          "Statement": [

          { "Effect": "Allow", "Action": "s3:ListAllMyBuckets", "Resource": "*" }

          ,

          { "Effect": "Allow", "Action": "s3:*Object", "Resource": [ "arn:aws:s3:::dev-media-****/*" ] }

          ]
          }

          Show
          cdias1 Chester Dias (Inactive) added a comment - Sure Note: Below is the policy to be added to the role to grant limited priviledges over S3 to the EC2, The below policy will grant list priviledge to list all buckets and all privs over the bucket 'dev-media-****' { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:ListAllMyBuckets", "Resource": "*" } , { "Effect": "Allow", "Action": "s3:*Object", "Resource": [ "arn:aws:s3:::dev-media-****/*" ] } ] }
          Hide
          ann.loraine Ann Loraine added a comment -

          Thanks for this.
          Making a note to add this to s3 role and moving back to "to do".

          Show
          ann.loraine Ann Loraine added a comment - Thanks for this. Making a note to add this to s3 role and moving back to "to do".
          Hide
          cdias1 Chester Dias (Inactive) added a comment -

          Please review https://bitbucket.org/chesterdias/chester-local-appstore-playbooks/branch/IGBF-2346#diff
          I have added the code for creating a policy dynamically with a name of the EC2 to which it is associated to
          the Policy will grant the Ec2 the access to list all the buckets and full permission over it own bucket and no access to other buckets

          Show
          cdias1 Chester Dias (Inactive) added a comment - Please review https://bitbucket.org/chesterdias/chester-local-appstore-playbooks/branch/IGBF-2346#diff I have added the code for creating a policy dynamically with a name of the EC2 to which it is associated to the Policy will grant the Ec2 the access to list all the buckets and full permission over it own bucket and no access to other buckets
          Hide
          ann.loraine Ann Loraine added a comment -

          Change request:

          Show
          ann.loraine Ann Loraine added a comment - Change request: Please avoid coding JSON in the role playbook itself. Use templates instead. (As an example, see: https://bitbucket.org/lorainelab/appstore-playbooks/src/master/Ansible/roles/appstore_s3/templates/policy_json.j2 )
          Hide
          cdias1 Chester Dias (Inactive) added a comment -

          sure will update the same

          Show
          cdias1 Chester Dias (Inactive) added a comment - sure will update the same
          Show
          cdias1 Chester Dias (Inactive) added a comment - Requested Changes are made, Please review https://bitbucket.org/chesterdias/chester-local-appstore-playbooks/branch/IGBF-2346#diff
          Hide
          ann.loraine Ann Loraine added a comment -

          Change requests - please take a look:

          • Do not make any changes to EC instance as it is not created yet - please note order of role execution in set_up.yml.
          • Accordingly, check role appstore_ec2 to ensure it is created using the new syntax.

          Please note: the master branch version of appstore_s3/tasks/main.yml does not create a stand-alone policy but instead simply modifies a role that is created in the previous task. The proposed changes are an improvement on this because a stand-alone policy is being created, which is a better because this same policy can be separately attached to IAM users, thus allowing them to use the AWS console to make changes to their App Store's bucket.

          • Change "policy_name" in task "Create IAM Managed Policy" to {{ s3_bucket_name }}.
          • Change "name" in task "Create IAM role if not present for Ec2" to {{ s3_bucket_name }}
          • Carefully compare proposed changes to master branch version to ensure existing functionality or assumptions will not be disrupted. If they are, please fix accordingly.
          Show
          ann.loraine Ann Loraine added a comment - Change requests - please take a look: Do not make any changes to EC instance as it is not created yet - please note order of role execution in set_up.yml. Accordingly, check role appstore_ec2 to ensure it is created using the new syntax. Please note: the master branch version of appstore_s3/tasks/main.yml does not create a stand-alone policy but instead simply modifies a role that is created in the previous task. The proposed changes are an improvement on this because a stand-alone policy is being created, which is a better because this same policy can be separately attached to IAM users, thus allowing them to use the AWS console to make changes to their App Store's bucket. Change "policy_name" in task "Create IAM Managed Policy" to {{ s3_bucket_name }}. Change "name" in task "Create IAM role if not present for Ec2" to {{ s3_bucket_name }} Carefully compare proposed changes to master branch version to ensure existing functionality or assumptions will not be disrupted. If they are, please fix accordingly.
          Hide
          cdias1 Chester Dias (Inactive) added a comment -

          I have checked the order, the proposed change has been added.
          I have moved the for 'granting a role to ec2' to appstore_ec2 since the ec2 won't be created till that execution point.

          Show
          cdias1 Chester Dias (Inactive) added a comment - I have checked the order, the proposed change has been added. I have moved the for 'granting a role to ec2' to appstore_ec2 since the ec2 won't be created till that execution point.
          Show
          cdias1 Chester Dias (Inactive) added a comment - Please review the change: https://bitbucket.org/chesterdias/chester-local-appstore-playbooks/branch/IGBF-2346#diff
          Show
          cdias1 Chester Dias (Inactive) added a comment - PR: https://bitbucket.org/lorainelab/appstore-playbooks/pull-requests/24/igbf-2346/diff

            People

            • Assignee:
              cdias1 Chester Dias (Inactive)
              Reporter:
              ann.loraine Ann Loraine
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: