Zeebrow / quickhost

Make a publicly available server, quickly
GNU General Public License v3.0
0 stars 0 forks source link

Remove all cases of `"Resource": "*"` from policies #20

Open Zeebrow opened 2 years ago

Zeebrow commented 2 years ago

Suggestions:

https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_resource.html

Zeebrow commented 2 years ago

Plan

  1. Enforce tagging policy on user/role with:

    {
            "Effect": "Allow",
            "Action": [
                "ec2:CreateTags"
            ],
            "Resource": [
                "arn:aws:ec2:*:865386952527:key-pair/*",
                "arn:aws:ec2:*:865386952527:security-group/*",
                "resource 3",
                "resource 4"
            ],
            "Condition": {
                "ForAllValues:StringEquals": {
                    "aws:TagKeys": [
                        "Name",
                        "quickhost"
                    ]
                },
                "ForAnyValue:StringEquals": {
                    "aws:TagKeys": ["quickhost"]
                }
            }
    }
    • Allow users to create tags with 'Name', 'quickhost', ... keys
    • Require the 'quickhost' tag key to be present on resources
  2. Require a vpc id in order to create policies