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

prevent watchdog installation for dev environments #1802

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

zackattack01
Copy link
Contributor

There were a few places already where we gate behavior on the KolideServerURL with the same checks. This adds a helper function to check a serverURL against our match criteria, and adds this check to the watchdog installation and log publication routines

RebeccaMahany
RebeccaMahany previously approved these changes Jul 26, 2024

// IsKolideHostedServerURL is a convenience function to enable gating functionality for
// developer (or other non-production) deployments
func IsKolideHostedServerURL(serverURL string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nice improvement

@@ -153,6 +158,17 @@ func (wc *WatchdogController) Interrupt(_ error) {

func (wc *WatchdogController) ServiceEnabledChanged(enabled bool) {
ctx := context.TODO()
// we don't alter watchdog installation (install or remove) if this is a non-prod deployment
Copy link
Contributor

Choose a reason for hiding this comment

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

We could probably also check if we're running as not-root.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh good call, on it!

@zackattack01 zackattack01 force-pushed the zack/prevent_dev_watchdog_installation branch from c7109cd to fa9f97a Compare July 26, 2024 21:02
@zackattack01 zackattack01 added this pull request to the merge queue Jul 29, 2024
Merged via the queue into main with commit 9f63495 Jul 29, 2024
31 checks passed
@zackattack01 zackattack01 deleted the zack/prevent_dev_watchdog_installation branch July 29, 2024 13:29
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