Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support catching infrastructure drift / New check to analyze customer tags #2678

Open
ckdake opened this issue Aug 4, 2023 · 2 comments
Open
Assignees
Labels
feature-request New feature request for Prowler. need information new check idea provider/aws Issues/PRs related with the AWS provider severity/informational Cosmetic or nice-to-have. status/awaiting-reponse Waiting response from Issue owner

Comments

@ckdake
Copy link
Contributor

ckdake commented Aug 4, 2023

New feature motivation

I'd like to be able to use prowler to detect, at least a subset of, infrastructure drift: where infrastructure no longer matches what is in configuration. This would allow me to identify resources that were created/modified outside of my infrastructure automation tooling, which ensures the security controls I have implemented in my tooling are actually applied in production.

Solution Proposed

A first step of a check that would be useful to me is an "untagged_resources" flag for each check that prowler performs against AWS, that would "fail" a check if a resource in aws is missing a tag specified in prowler configuration. For example, I apply a default tag of managed_by=terraform. If prowler finds a resource that is missing that tag, it should fail the check. I can do this by hand using "Resource Explorer" on AWS to search for untagged resources. This wouldn't catch changes to managed resources, but would catch unmanaged resources which is a bigger concern. (e.g. I can run terraform apply every day to ensure that things are applied, but terraform can't find things that are no in terraform).

A more robust implementation would work similar to how driftctl works, looking at terraform state and the resources in the upstream provider (e.g. AWS), and catching differences, but this would require pulling in an interface to tfstate and having access to the state.

Describe alternatives you've considered

https://github.com/snyk/driftctl has been put into maintenance mode, and doesn't work with terraform state created with the newest version of the terraform provider. The end result is that driftctl is no longer usable. I built https://github.com/ckdake/driftctl2asff to get driftctl results into SecurityHub. It's not super robust, but you can read the driftctl2asff.py to get an idea of the things driftctl was checking.

Other tooling to detect drift has a variety of maturity, and is another stack to run/operate.

It would be fantastic to be able to use prowler to detect when infrastructure has drifted from configuration.

Additional context

No response

@ckdake ckdake added feature-request New feature request for Prowler. status/needs-triage Issue pending triage labels Aug 4, 2023
@jfagoagas jfagoagas self-assigned this Aug 4, 2023
@jfagoagas
Copy link
Member

Hi @ckdake, this is a great idea and we can explore it in the following weeks. I'll get back to you next week or the week after.

Thanks!

@jfagoagas jfagoagas added the provider/aws Issues/PRs related with the AWS provider label Aug 4, 2023
@toniblyx
Copy link
Member

toniblyx commented Oct 5, 2023

Hey @ckdake, as you said what if we write a check that looks for custom tags (based on user configuration), would that make the trick? Something like Ensure resources are customer tagged, other ideas?

@toniblyx toniblyx added need information new check idea status/awaiting-reponse Waiting response from Issue owner severity/informational Cosmetic or nice-to-have. and removed status/needs-triage Issue pending triage labels Oct 5, 2023
@toniblyx toniblyx changed the title Support catching infrastructure drift Support catching infrastructure drift / New check to analyze customer tags Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request for Prowler. need information new check idea provider/aws Issues/PRs related with the AWS provider severity/informational Cosmetic or nice-to-have. status/awaiting-reponse Waiting response from Issue owner
Projects
None yet
Development

No branches or pull requests

3 participants