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

Update MSI validation resource to prevent false change reports #636

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

murdok5
Copy link
Contributor

@murdok5 murdok5 commented Jul 7, 2020

What does this PR do?
The MSI validation resource (Exec) currently reports corrective change on each run. This modifies the resource with an unless parameter to prevent false positives on reporting.

Motivation
Working on this integration for a customer.

Additional Notes
n/a

Describe your test plan
I tested this on Windows 2016 and 2019 in my lab.

@murdok5 murdok5 requested a review from a team as a code owner July 7, 2020 23:38
Copy link
Contributor

@albertvaka albertvaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the (bad) behavior here! Is the syntax you used in unless documented somewhere? I had never seen it before.

@murdok5
Copy link
Contributor Author

murdok5 commented Jul 8, 2020

@albertvaka yeah exec statements can be hard because they will always report "change" even if they do nothing. There are 2 parameters that can have other execs to gate the "real" exec. these are unless and onlyif.

Aside from that, is there a reason to check for those specific hashes? Eventually I assume those installers would not exist anywhere and thus be unnecessary in the code as a check.

@albertvaka
Copy link
Contributor

The syntax I was more curious about was the use of @(ACCEPTABLE) and | ACCEPTABLE within the onlyif block, and the fact that the whole script is not a quoted string (while it always is in the docs you link). It's quite more readable this way!

About the hash check... honestly it is not that useful anymore unless you are installing the MSI from an internal mirror (since, as you said, the bad versions do not exist anymore on our repo). We decided to keep the check for those installing from local mirrors, but we should revisit that at some point for the sake of code simplicity.

@albertvaka albertvaka merged commit 2198fde into DataDog:master Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants