3 ms·
One really useful tool: setup a tag policy in your account / organization and make sure that all of your project teams have the ability to view it so finding no
by acdha 6y ago
One really useful tool: setup a tag policy in your account / organization and make sure that all of your project teams have the ability to view it so finding non-compliant resources can be self-service without having a human in the loop:
https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html https://docs.aws.amazon.com/organizations/latest/userguide/o...
- time0ut 6y agoYou would think the most obvious feature of something called "tag policies" would be the ability to prevent creation of resources that violate the policy. Of course, due to the way the AWS APIs work, it can't do this. Such a disappointment in practice. I do agree it is still useful in the capacity you described.
- acdha 6y agoThere are an increasing number of APIs where you can do this with IAM conditions but it’s definitely harder than it should be. The big thing you need is to be comfortable breaking anything you use until someone can update it (maybe forking a third-party IaC project or vendor stack, etc.) so it’s definitely less friction to remediate afterwards.
- time0ut 6y agoI'm sure over time they will retrofit their APIs to better support tag policy enforcement. I am glad they err on the side of maintaining a stable API, so I can see why things are the way they are. For now, we enforce our policy during code review. Everything is deployed via terraform/terragrunt so it is pretty easy. We have plans to mostly automate this via static code analysis.
- acdha 6y agoDitto — I think tools like Sentinel policies are a great answer here because it doesn't prevent your administrators from doing something in a hurry but it means that your normal flow of releases will catch missed tags. We're already using that for things like tflint/tfsec/Checkov/etc. so it's a familiar workflow.
- wulfmann 6y agoYou can do this with enforced_for properties https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_example-tag-policies.html https://docs.aws.amazon.com/organizations/latest/userguide/o...
- time0ut 6y agoThis only applies to tagging operations, which are often separate from resource creation operations. For example, you can require a particular tag on an S3 bucket, but you can still just create a completely untagged bucket. The policy doesn't come into play unless you try to tag the bucket.
- philsnow 6y agoOne thing to watch out for, since they're managed under Organizations you might expect that they inherit in the same way that Service Control Policies do... and they kind of do (in that a tag policy attached to a root or OU applies to every downstream OU and account), but these policies have "value-setting operators" and "child control operators" [0] that let downstream tag policies carve out exceptions in a way that I haven't quite wrapped my head around yet. SCPs are conceptually very simple and easy to reason about. Not so with tag policies (and, I guess, "backup policies" or "Artificial Intelligence (AI) services opt-out policies", which are both new since the last time I looked at this documentation). [0]
- jasonladuke0311 6y agoWe have gates so you can't deploy an instance without requisite tags for the instance and volume.
- acdha 6y agoThat’s what I recommend as well but I see this as a situation where you want to do both: put checks into your normal processes but unless you’re able to have 100% consistency across every team and account, you deploy tag policies to ensure that you catch manual work, experiments, vendor-provided stacks, etc. Tag policies cover all resources which support tagging so it’ll include things like those IAM roles you created for security monitoring outside of your normal development flow, etc.