News for hackers. Stuff that matters.

Ask HN: How to check/enforce best practices on infrastructure?

Dear HN,

In my company we use Infrastructure as Code approach to deal with complexity and chaos.

We use pull requests and code reviews to ensure code/resulting infrastructure quality.

However, we would like to go deeper and spend less human time on this. For conventional programming languages we have lots of linters and other quality control tools that help us a lot, so we don't search for stupid Python or Go errors manually.

But does anybody have any idea if there are similar tools that check common infrastructure (for example: Terraform) "fxckups" like passwords and API keys being put in cleartext form or database server (e.g. RDS) created with "public" access allowed to the whole world?

Currently I can use things like serverspec/inspec to check out infra after deployment and this works pretty well, but maybe there any tools we could apply BEFORE the deploy the [potentially flawed or broken] infrastructure?

Thank YOU!!!

( 5 comments | 6 points | on HN )
Re:Ask HN: How to check/enforce best practices on infrastruc... by mtmail on Wednesday February 13, 2019 @07:49AM (#19152616)
For the https://www.chef.sh/ there's http://www.foodcritic.io/ For Terraform there seems to exist a linter as well https://github.com/wata727/tflint
Re:Ask HN: How to check/enforce best practices on infrastruc... by apodobnik on Wednesday February 13, 2019 @09:46AM (#19153444)
I've used tflint in a pipeline and it works well.
Re:Ask HN: How to check/enforce best practices on infrastruc... by ivanilves on Sunday February 17, 2019 @11:00AM (#19185056)
Looks awesome. Thanks!
Re:Ask HN: How to check/enforce best practices on infrastruc... by chatmasta on Wednesday February 13, 2019 @11:29AM (#19154229)
I know you're asking about pre-deploy, but for post-deployment, you might want to check out Bash Automated Testing System (BATS) [0].

[0] https://github.com/sstephenson/bats

Re:Ask HN: How to check/enforce best practices on infrastruc... by JeffRosenberg on Wednesday February 13, 2019 @12:57PM (#19155003)
As a fellow user of that project, FYI it has been migrated to https://github.com/bats-core/bats-core