# IaC monitoring with Git

2 messages from 2019-12-19 to 2019-12-20. Participants: Christopher Díaz Riveros, Christian Couder.
Thread: https://gitlist.dev/t/52492

## Christopher Díaz Riveros, 2019-12-19 21:30

Subject: IaC monitoring with Git
Message-ID: <CAHCo6soNwee3hN4i6v0KtxphKHa96v--e41KRqfHKV5i45OqcA@mail.gmail.com>
URL: https://gitlist.dev/e/CAHCo6soNwee3hN4i6v0KtxphKHa96v--e41KRqfHKV5i45OqcA%40mail.gmail.com

```
Hi all,

I'm trying to figure out a git based solution for a use case we have
at my work place. We use IaC for our infrastructure, when we want to
create new instances/accounts/etc we add a certain set of tags in our
files to indicate some key aspects of the instances/accounts.

There is one specific tag, owner, which we use to set a contact point
in case we need someone to make a change. The main issue with this is
that you can set the tag to anything, valid or not, or it could become
invalid over time.

Would a valid approach for first issue be to set a pre-receive hook in
our repositories so that before the PR is merged, we check validity of
the contact email, a.k.a. owner tag (we assume validity means that
email exist), maybe via ldapsearch or another command like this?

For the second case, I'd assume git does not by default monitor
contents of files on a regular basis, does anybody have faced this
issue and successfully found a way to periodically check contents and
trigger alerts on repositories based on same case (email becomes
invalid, then trigger alert)?

Thanks a lot for your help!

```

## Christian Couder, 2019-12-20 09:29

Subject: Re: IaC monitoring with Git
Message-ID: <CAP8UFD231wb124-fKQcv-ddG96xncHanOnZA4jWEU3-shxTkGw@mail.gmail.com>
URL: https://gitlist.dev/e/CAP8UFD231wb124-fKQcv-ddG96xncHanOnZA4jWEU3-shxTkGw%40mail.gmail.com
In-Reply-To: <CAHCo6soNwee3hN4i6v0KtxphKHa96v--e41KRqfHKV5i45OqcA@mail.gmail.com>

```
Hi,

On Thu, Dec 19, 2019 at 10:31 PM Christopher Díaz Riveros
<christopher.diaz.riv@gmail.com> wrote:

> Would a valid approach for first issue be to set a pre-receive hook in
> our repositories so that before the PR is merged, we check validity of
> the contact email, a.k.a. owner tag (we assume validity means that
> email exist), maybe via ldapsearch or another command like this?

You might find it easier and simpler to use CI tools like Travis CI,
Circle CI, GitLab pipelines, GitHub Actions, and so on to run the
checks instead of using a hook.

> For the second case, I'd assume git does not by default monitor
> contents of files on a regular basis, does anybody have faced this
> issue and successfully found a way to periodically check contents and
> trigger alerts on repositories based on same case (email becomes
> invalid, then trigger alert)?

Many CI tools let you schedule jobs regularly.

Best,
Christian.

```
