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

Add Osquery CC #10

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Add Osquery CC #10

merged 1 commit into from
Jul 9, 2024

Conversation

np5
Copy link
Owner

@np5 np5 commented Jul 9, 2024

No description provided.

Copy link

github-actions bot commented Jul 9, 2024

Terraform Plan Output

Click to expand
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # zentral_osquery_configuration_pack.default-compliance-checks will be created
  + resource "zentral_osquery_configuration_pack" "default-compliance-checks" {
      + configuration_id = 1
      + id               = (known after apply)
      + pack_id          = (known after apply)
      + tag_ids          = (known after apply)
    }

  # zentral_osquery_pack.compliance-checks will be created
  + resource "zentral_osquery_pack" "compliance-checks" {
      + description       = "The compliance checks for our macOS client"
      + discovery_queries = (known after apply)
      + id                = (known after apply)
      + name              = "Compliance checks"
      + slug              = (known after apply)
        # (1 unchanged attribute hidden)
    }

  # zentral_osquery_query.santa-sysext-cc will be created
  + resource "zentral_osquery_query" "santa-sysext-cc" {
      + compliance_check_enabled = true
      + description              = "Check if the Santa system extension is activated, running and up-to-date"
      + id                       = (known after apply)
      + name                     = "Santa system extension check"
      + platforms                = [
          + "darwin",
        ]
      + scheduling               = {
          + can_be_denylisted   = true
          + interval            = 3600
          + log_removed_actions = false
          + pack_id             = (known after apply)
          + snapshot_mode       = true
        }
      + sql                      = <<-EOT
            WITH expected_sysexts(team, identifier, min_version) AS (
              VALUES ('EQHXZ8M8AV', 'com.google.santa.daemon', '2024.5')
            ), found_sysexts AS (
              SELECT expected_sysexts.*, system_extensions.version, system_extensions.state,
              CASE
                WHEN system_extensions.version >= expected_sysexts.min_version
                  AND system_extensions.state == 'activated_enabled'
                THEN 'OK'
                ELSE 'FAILED'
              END individual_ztl_status
              FROM expected_sysexts
              LEFT JOIN system_extensions ON (
                system_extensions.team = expected_sysexts.team
                AND system_extensions.identifier = expected_sysexts.identifier
              )
            ) SELECT team, identifier, version, state, MAX(individual_ztl_status) OVER () ztl_status
            FROM found_sysexts
        EOT
      + value                    = ""
      + version                  = (known after apply)
    }

Plan: 3 to add, 0 to change, 0 to destroy.

Copy link
Collaborator

@whoami-np5 whoami-np5 left a comment

Choose a reason for hiding this comment

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

LGTM

@whoami-np5 whoami-np5 merged commit 3b3c734 into main Jul 9, 2024
2 checks passed
@whoami-np5 whoami-np5 deleted the 20240709_osquery_cc branch July 9, 2024 19:49
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.

2 participants