From 696b74dd2ed0c9de3511eccdf33d40216f9b542d Mon Sep 17 00:00:00 2001 From: Ryan Thorn <106628688+rthorn-nr@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:58:03 -0700 Subject: [PATCH] chore: Add crowdstrike deploy tasks (#1055) --- .../roles/configure/tasks/main.yml | 25 ++++++++++++++++ .../ubuntu20-infra-crowdstrike.json | 30 +++++++++++++++++++ .../infra-agent/ubuntu20-infra.json | 21 ++++++------- 3 files changed, 66 insertions(+), 10 deletions(-) create mode 100644 test/deploy/crowdstrike/roles/configure/tasks/main.yml create mode 100644 test/manual/definitions/infra-agent/ubuntu20-infra-crowdstrike.json diff --git a/test/deploy/crowdstrike/roles/configure/tasks/main.yml b/test/deploy/crowdstrike/roles/configure/tasks/main.yml new file mode 100644 index 000000000..07a7ae184 --- /dev/null +++ b/test/deploy/crowdstrike/roles/configure/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- debug: + msg: Deploy CrowdStrike Falcon Sensor + + +- name: Install CrowdStrike Falcon Sensor + block: + - include_role: + name: newrelic.crowdstrike_provision.install_crowdstrike_falcon + become: true + vars: + falcon_client_id: "{{ lookup('env', 'CROWDSTRIKE_CLIENT_ID') }}" + falcon_client_secret: "{{ lookup('env', 'CROWDSTRIKE_CLIENT_SECRET') }}" + falcon_customer_id: "{{ lookup('env', 'CROWDSTRIKE_CUSTOMER_ID') }}" + api_base_url: "https://api.laggar.gcw.crowdstrike.com" + +- name: Validate sensor is running + shell: ps -e | grep falcon-sensor | grep -v grep | wc -l + register: is_sensor_running + become: true + +- name: Ensure Falcon is started + ansible.builtin.fail: + msg: falcon-sensor is not running + when: is_sensor_running.stdout|int == 0 diff --git a/test/manual/definitions/infra-agent/ubuntu20-infra-crowdstrike.json b/test/manual/definitions/infra-agent/ubuntu20-infra-crowdstrike.json new file mode 100644 index 000000000..4963c9221 --- /dev/null +++ b/test/manual/definitions/infra-agent/ubuntu20-infra-crowdstrike.json @@ -0,0 +1,30 @@ +{ + "global_tags": { + "owning_team": "virtuoso", + "Environment": "development", + "Department": "product", + "Product": "virtuoso" + }, + "resources": [ + { + "id": "infracsubuntu20", + "provider": "aws", + "type": "ec2", + "size": "t3.nano", + "ami_name": "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-????????", + "user_name": "ubuntu" + } + ], + "instrumentations": { + "resources": [ + { + "id": "crowdstrike", + "resource_ids": [ + "infracsubuntu20" + ], + "source_repository": "https://github.com/newrelic/open-install-library", + "deploy_script_path": "test/deploy/crowdstrike/roles" + } + ] + } +} diff --git a/test/manual/definitions/infra-agent/ubuntu20-infra.json b/test/manual/definitions/infra-agent/ubuntu20-infra.json index b69cd41d2..2df97eca3 100644 --- a/test/manual/definitions/infra-agent/ubuntu20-infra.json +++ b/test/manual/definitions/infra-agent/ubuntu20-infra.json @@ -5,13 +5,14 @@ "Department": "product", "Product": "virtuoso" }, - - "resources": [{ - "id": "infraubuntu20", - "provider": "aws", - "type": "ec2", - "size": "t3.nano", - "ami_name": "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-????????", - "user_name": "ubuntu" - }] -} \ No newline at end of file + "resources": [ + { + "id": "infraubuntu20", + "provider": "aws", + "type": "ec2", + "size": "t3.nano", + "ami_name": "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-????????", + "user_name": "ubuntu" + } + ] +}