News for hackers. Stuff that matters.
Re:Show HN: Policy_sentry, an AWS IAM Least Privilege Policy... by vageli on Tuesday October 15, 2019 @05:21PM (#21263951)
Is there any way to block the creation of policies containing specific permissions or resources? I know this can be trivially circumvented but if this tool is used in ci/cd it can be a good gate.
Re:Show HN: Policy_sentry, an AWS IAM Least Privilege Policy... by kmcquade on Tuesday October 15, 2019 @05:32PM (#21264069)
In the Terraform use case, that is probably possible if you hack together an analysis of the JSON policy files generated by the Terraform module and then allow/warn/deny based on the results. Alternatively, you could run the IAM analysis portion of this tool after Terraform apply.

I should also mention that the IAM authoring aspect of this tool is more mature than the policy analysis feature.

In CI/CD, if you are using Terraform, I suggest using Open Policy Agent for blocking access to certain resources by evaluating a Terraform plan. I suppose it's also possible to use OPA to evaluate the JSON output of a policy_sentry YML file.

Hope this helps.

Re:Show HN: Policy_sentry, an AWS IAM Least Privilege Policy... by philsnow on Tuesday October 15, 2019 @06:29PM (#21264680)
https://www.openpolicyagent.org/docs/latest/terraform/ very neat, I hadn't seen opa used in this way before.
Re:Show HN: Policy_sentry, an AWS IAM Least Privilege Policy... by kmcquade on Tuesday October 15, 2019 @06:46PM (#21264840)
Oh yeah it's super powerful. And it's not vendor-dependent like Sentinel & TF Enterprise (although I really love TF Cloud).

Here's an example of using OPA + Conftest with Terraform that you might be interested in: https://github.com/kmcquade/conftest-terraform-multifolder-p...

Re:Show HN: Policy_sentry, an AWS IAM Least Privilege Policy... by philsnow on Tuesday October 15, 2019 @06:32PM (#21264709)
Hashicorp has a tool/framework for this, Sentinel https://www.hashicorp.com/sentinel/

I haven't used it in production. It uses an even-more-baroque syntax than terraform's HCL dialect, and using it kind of assumes that all your modifications go through terraform.

Re:Show HN: Policy_sentry, an AWS IAM Least Privilege Policy... by kmcquade on Tuesday October 15, 2019 @06:47PM (#21264856)
Yep. Sentinel is for paid customers only, so it has to go through Terraform enterprise.
Re:Show HN: Policy_sentry, an AWS IAM Least Privilege Policy... by jcims on Tuesday October 15, 2019 @05:45PM (#21264228)
Not sure I understand your question fully but if this doesn't support it you can tack on permission boundaries if you wish to apply a permission blacklist to a specific role. If it's account wide you can apply service control policies via AWS organizations.
Re:Show HN: Policy_sentry, an AWS IAM Least Privilege Policy... by kmcquade on Tuesday October 15, 2019 @05:49PM (#21264280)
+1 on the Service control policies