Deploy Falcon Sensor for Linux with a Helm chart

အားလုံးပဲ မင်္ဂလာပါခင်ဗျာ။ ဒီနေ့မှာတော့ ကျွန်တော်တို့ရဲ့ kubernetes cluster ထဲကို CrowdStrike Falcon Sensor ကို installation လုပ်တဲ့အကြောင်းကို ပြောပြပေးမှာပဲဖြစ်ပါတယ်။
Overview
CrowdStrike Falcon Sensor ကို ဒီ lab မှာတော့ Helm Chart ကိုအသုံးပြုပြီး install လုပ်မှာဖြစ်ပါတယ်။ Helm Chart ကတော့ kubernetes ပေါ်တွင် falcon sensor install လုပ်ရန် အတွက် လိုအပ်တဲ့ kubernetes resource တွေကို pre-configured လုပ်ပေးထားမည်ဖြစ်ပြီးတော့ helm chart နဲ့ installation လုပ်သည့်အခါတွင် falcon-sensor pod လေးကတော့ Daemonset အနေနဲ့ run သွားမှာပဲဖြစ်ပါတယ်။ ဒီနေရာမှာတော့ Helm တို့ Daemonset အကြောင်းတွေကိုတော့ ပြောသွားတော့မှာမဟုတ်ပါဘူး။
Prerequisites
Prerequisites အနေကတော့ အောက်ပါအတိုင်းပဲဖြစ်ပါသည်။
you have Helm 3.x or later installed
your kubernetes cluster nodes are either x86_64 or ARM64, but not both
your kubernetes vendor supports Helm 3
you must be a cluster administrator to deploy a Helm chart to the cluster.
By default, the Helm chart is installed in the default namespace. Best practice is to create a new namespace. See Install the chart archive for info.
The Falcon sensor for Linux as a DaemonSet should be used as the container image to deploy to a Kubernetes node.
The Falcon sensor for Linux as a DaemonSet must run as a privileged container so that the sensor can access the kernel.
The Falcon sensor for Linux as a DaemonSet should be deployed to a Kubernetes environment that grants node access or installation via a Kubernetes DaemonSet.
The Falcon sensor for Linux as a DaemonSet creates /opt/CrowdStrike on the Kubernetes nodes. Do not delete this folder.
နောက်ထပ်သိရမှာကတော့ CrowdStrike က Region ပေါ်အခြေခံပြီးတော့ သူ့ရဲ့ Cloud Domain URL တွေကလည်းမတူညီပါဘူး။ ဒါတွေကိုသိအောင်လို့ ကျွန်တော်အောက်မှာ List လုပ်ပေးထားပါတယ်။
Cloud domains for US-1
ts01-b.cloudsink.net
lfodown01-b.cloudsink.net
lfoup01-b.cloudsink.net
https://falcon.crowdstrike.com
https://assets.falcon.crowdstrike.com
https://assets-public.falcon.crowdstrike.com
https://api.crowdstrike.com
https://firehose.crowdstrike.com
CrowdStrike Cloud US-2 domains
ts01-gyr-maverick.cloudsink.net
lfodown01-gyr-maverick.cloudsink.net
lfoup01-gyr-maverick.cloudsink.net
https://falcon.us-2.crowdstrike.com
https://assets.falcon.us-2.crowdstrike.com
https://assets-public.falcon.us-2.crowdstrike.com
https://api.us-2.crowdstrike.com
https://firehose.us-2.crowdstrike.com
CrowdStrike Cloud EU-1 domains
ts01-lanner-lion.cloudsink.net
lfodown01-lanner-lion.cloudsink.net
lfoup01-lanner-lion.cloudsink.net
https://falcon.eu-1.crowdstrike.com
https://assets.falcon.eu-1.crowdstrike.com
https://assets-public.falcon.eu-1.crowdstrike.com
https://api.eu-1.crowdstrike.com
https://firehose.eu-1.crowdstrike.com
CrowdStrike Cloud US-GOV-1 domains
ts01-laggar-gcw.cloudsink.net
sensorproxy-laggar-g-524628337.us-gov-west-1.elb.amazonaws.com
lfodown01-laggar-gcw.cloudsink.net
ELB-Laggar-P-LFO-DOWNLOAD-1265997121.us-gov-west-1.elb.amazonaws.com
https://falcon.laggar.gcw.crowdstrike.com
laggar-falconui01-g-245478519.us-gov-west-1.elb.amazonaws.com
https://api.laggar.gcw.crowdstrike.com
https://firehose.laggar.gcw.crowdstrike.com
falconhose-laggar01-g-720386815.us-gov-west-1.elb.amazonaws.com
CrowdStrike Cloud US-GOV-2 domains
ts01-us-gov-2.cloudsink.crowdstrike.mil
lfodown01-us-gov-2.cloudsink.crowdstrike.mil
https://falcon.us-gov-2.crowdstrike.mil
https://api.us-gov-2.crowdstrike.mil
https://firehose.us-gov-2.crowdstrike.mil
တို့ပဲဖြစ်ပါတယ်။
Multi-architecture sensor image
CrowdStrike ရဲ့ Falcon Sensor ကတော့ Linux image version 7.15 နဲ့ နောက်ပိုင်းတွေမှာတော့ Multi-Architecture နဲ့လုပ်ထားတဲ့ image တွေဖြစ်လာပါတယ်။ ဆိုလိုရင်းကတော့ Falcon Sensor ရဲ့ ဒီ Image တစ်ခုတည်းကိုပဲ x86_64 and aarch64 nodes တွေပေါ်မှာ တစ်ပြိုင်နက်အသုံးပြုလို့ရလာတာပဲဖြစ်ပါတယ်။ နမူနာအနေနဲ့ အောက်မှာ Linux image version 7.15 နဲ့ 7.14 ကို ယှဥ်ပြပေးထားပါတယ်။
The Falcon sensor for Linux Image 7.15 and later
Syntax: falcon-sensor:<release_number>-<build_number>-<baseImage_number>.falcon-linux.Release.<cloud-env>
Example: falcon-sensor:7.15.0-15501-1.falcon-linux.Release.US-1
The Falcon sensor for Linux Image 7.14 and earlier
Syntax: falcon-sensor:<release_number>-<build_number>-<baseImage_number>.falcon-linux.<architecture>.Release.<cloud-env>
Example: falcon-sensor:7.14.0-14401-1.falcon-linux.x86_64.Release.US-1
Example အတိုင်း 7.14 နဲ့ အစောပိုင်း version တွေဆိုရင် falcon sensor image တွေကို x86_64 Architecture အတွက်ဆို release သပ်သပ် aarch64 အတွက်ဆို release သပ်သပ်ထုတ်ခဲ့ပါတယ်။ 7.15 version ကနေစပြီးတော့ falcon sensor image တွေကို သပ်သပ်မထုတ်တော့ပဲ multi-architecture အဆင်ပြေအောင် ထုတ်ခဲ့တာပဲဖြစ်ပါတယ်။
Deploy with Helm
Step 1: Create an API client ID and secret
အရင်ဆုံး အနေနဲ့ CrowdStrike falcon sensor ရဲ့ image ကို pull လို့ရဖို့အတွက် ကျွန်တော်တို့ရဲ့ CrowdStrike Portal ထဲကနေ API client id နဲ့ secret ကို create လုပ်ပေးရမှာပဲဖြစ်ပါတယ်။ ဘယ်မှာသွား create ရမလဲဆိုတော့ https://falcon.crowdstrike.com ထဲကို ဝင်ပြီးတော့ Support and resources > Resources and tools > API clients and keys ထဲမှာ အသစ် create လုပ်ပေးရပါမယ်။

ရလာတဲ့ api clients and keys ကို မှတ်ထားပြီးတော့ ကျွန်တော်တို့ရဲ့ စက်ထဲမှာပဲ environment variables ကြေညာပေးရမှာဖြစ်ပါတယ်။
export FALCON_CLIENT_ID=<YOUR_FALCON_CLIENT_ID>
export FALCON_CLIENT_SECRET=<YOUR_FALCON_CLIENT_SECRET>
Step 2: Get your CID with checksum
နောက်တစ်ဆင့်အနေနဲ့ Falcon console ထဲကနေပဲ Customer ID checksum ကိုသွားယူပြီး variable အဖြစ်ကြေညာပေးရမှာပဲဖြစ်ပါတယ်။
export FALCON_CID=<YOUR_CID_WITH_CHECKSUM>
Pull the image from the CrowdStrike registry
နောက်ထပ်အနေနဲ့ CrowdStrike registry က falcon-sensor image ကို pullလုပ်ရမှာပဲဖြစ်ပါတယ်။
curl -sSL -o falcon-container-sensor-pull.sh "https://raw.githubusercontent.com/CrowdStrike/falcon-scripts/main/bash/containers/falcon-container-sensor-pull/falcon-container-sensor-pull.sh"
chmod +x falcon-container-sensor-pull.sh
ပြီးသွားရင်တော့ ကျွန်တော်တို့စက်ထဲရောက်လာသည့် falcon-container-sensor-pull.sh script လေးကို အောက်ပါအတိုင်း run ပေးရပါမယ်။
./falcon-container-sensor-pull.sh \
-u $FALCON_CLIENT_ID \
-s $FALCON_CLIENT_SECRET \
--list-tags \
-t falcon-sensor
အဲ့တာဆိုရင်တော့ OUTPUT အနေနဲ့
{
"name" : "falcon-sensor",
"tags" : [ "6.35.0-13206.falcon-linux.x86_64.Release.US-2",
…
"7.15.0-15501-1.falcon-linux.Release.US-2" ]
}
အခုလိုမျိုးပြမှာပဲဖြစ်ပါတယ်။
နောက်ထပ်အနေနဲ့ CrowdStrike registry နဲ့ image tag တို့ကို variable အနေနဲ့ သတ်မှတ်ပေးရမှာဖြစ်ပါတယ်။
Set variables for the CrowdStrike registry and the image tag:
export FALCON_IMAGE_REPO=registry.crowdstrike.com/falcon-sensor/<cloud_tag>/release/falcon-sensor
export FALCON_IMAGE_TAG=7.15.0-15501-1.falcon-linux.Release.<cloud_region>
Note: <cloud_tag> မှာတော့ မိမိရဲ့ crowdstrike cloud domain ကိုထည့်ပေးရမည်ဖြစ်ပါသည်။ region အလိုက် <cloud_tag> တွေက ကွဲမှာဖြစ်ပြီးတော့ us-1, us-2, eu-1, govcloud စသဖြင့် မိမိ region အလိုက်ထည့်ပေးရမှာပဲ ဖြစ်ပါတယ်။ <cloud_region> လဲထိုနည်းတူစွာပါပဲ <cloud_region> မှာ သူရဲ့သက်ဆိုင်ရာ region - US-1, US-2, EU-1, GOV-1 တို့ကို ထည့်ပေးရပါမယ်။ ကျွန်တော်ကတော့ ပုံပါအတိုင်း US-2 region ဖြစ်တယ့်အတွက် <cloud_tag> နေရာမှာ us-2 ကို ထည့်ပေးရမည်ဖြစ်ပြီး <cloud_region> နေရာမှာ US-2 ဆိုပြီး change ပေးရမှာပဲဖြစ်ပါတယ်။
အပေါ်က variable သတ်မှတ်ခဲ့တယ့် အဆင့်တွေ အကုန်လုပ်ဆောင်ပြီးရင်တော့ CrowdStrike registry ကနေ image ကို directly pull လုပ်လို့ရဖို့အတွက် pull token တွေကို create လုပ်ပေးရမှာပဲဖြစ်ပါတယ်။
Set variables for the CrowdStrike registry:
./falcon-container-sensor-pull.sh \
-u $FALCON_CLIENT_ID \
-s $FALCON_CLIENT_SECRET \
--dump-credentials
အခုလိုမျိုး run လိုက်တာနဲ့ Output အနေနဲ့ CrowdStrike registry username နဲ့ password ရမှာပဲဖြစ်ပါတယ်။
OUTPUT
CSRegistryUsername:fc-<userName>
CSRegistryPassword:ABC...123
အဲ့ဒီရလာတဲ့ registry Username နဲ့ Password ကို Image Pull လို့ရဖို့အတွက် variables သတ်မှတ်ပေးရမှာပဲဖြစ်ပါတယ်။
Create the pull token to pull images directly from the CrowdStrike registry:
export PARTIALPULLTOKEN=$(echo -n "$FALCON_ART_USERNAME:$FALCON_ART_PASSWORD" | base64 -w 0)
export FALCON_IMAGE_PULL_TOKEN=$(echo "{\"auths\":{\"registry.crowdstrike.com\":{\"auth\":\"$PARTIALPULLTOKEN\"}}}" | base64 -w 0)
Note: The pull token for the CrowdStrike registry does not expire.
Step 4: Add the CrowdStrike Helm chart client
နောက်တစ်ဆင့်အနေနဲ့ CrowdStrike ရဲ့ Helm Chart repo ကိုထည့်သွင်းပေးရမှာဖြစ်ပါတယ်။
helm repo add crowdstrike https://crowdstrike.github.io/falcon-helm
helm repo update
helm repo list
helm repo list လုပ်ကြည့်လိုက်တာနဲ့ crowdstrike repo ကိုမြင်နေရမှာပဲဖြစ်ပါတယ်။
NAME URL
crowdstrike https://crowdstrike.github.io/falcon-helm
နောက်ထပ် Falcon sensor repo ကို variables သတ်မှတ်ပေးရပါမယ်။
Set a variable for the Falcon sensor Helm chart:
export FALCON_SENSOR_REPO=crowdstrike/falcon-sensor
Step 5: Install the Falcon sensor on your cluster
အပေါ်ကအဆင့်တွေအားလုံးပြီးသွားပြီဆိုရင်တော့ Falcon sensor ကို ကျွန်တော်တို့ရဲ့ kubernetes cluster ထဲမှာ Install လုပ်လို့ရပီပဲဖြစ်ပါတယ်။
Create a namespace for the sensor and set the security context:
export FALCON_NAMESPACE=falcon-system
kubectl create namespace $FALCON_NAMESPACE
kubectl label ns --overwrite $FALCON_NAMESPACE pod-security.kubernetes.io/enforce=privileged
နောက်ထပ်တစ်ဆင့်အနေနဲ့ pod တွေကို label ထိုးပေးမှာပဲဖြစ်ပါတယ်။ ဒါကတော့ Optional ဖြစ်ပြီးတော့ namespace ထဲမှာရှိနေတဲ့ pod တွေကို specific configuration နဲ့ resources တွေအတွက်ကို policies တွေသတ်မှတ်ရလွယ်ကူစေမှာပဲဖြစ်ပါတယ်။
Install the Falcon sensor in the namespace:
helm install falcon-sensor $FALCON_SENSOR_REPO \
-n $FALCON_NAMESPACE \
--set falcon.cid=$FALCON_CID \
--set node.image.repository=$FALCON_IMAGE_REPO \
--set node.image.tag=$FALCON_IMAGE_TAG \
--set node.image.registryConfigJSON=$FALCON_IMAGE_PULL_TOKEN
Install လုပ်တာ successfully ဖြစ်ရင်တော့ အောက်ပါအတိုင်း output ရမှာပဲဖြစ်ပါတယ်။
NAME: falcon-sensor
LAST DEPLOYED: Wed Oct 11 14:20:01 2023
NAMESPACE: falcon-sensor
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Thank you for installing the CrowdStrike Falcon Helm Chart!
Access to the Falcon Linux and Container Sensor downloads at registry.crowdstrike.com are
required to complete the install of this Helm chart. If an internal registry is used instead of registry.crowdstrike.com.
the containerized sensor must be present in a container registry accessible from Kubernetes installation.
CrowdStrike Falcon sensors will deploy across all nodes in your Kubernetes cluster after
installing this Helm chart. The default image name to deploy a kernel sensor to a node is `falcon-node-sensor`.
When utilizing your own registry, an extremely common error on installation is accidentally forgetting to add your containerized
sensor to your local image registry prior to executing `helm install`. Please read the Helm Chart's readme
for more deployment considerations.
အဲ့တာဆိုရင်တော့ falcon-sensor pod တွေ running ဖြစ်မဖြစ်သိအောင်လို့ စစ်ကြည့်ပါမယ်။
kubectl get pod -n falcon-system
Output:
kubectl get pod -n falcon-system
NAME READY STATUS RESTARTS AGE
falcon-sensor-2z8nf 1/1 Running 13 (66d ago) 120d
falcon-sensor-ckz89 1/1 Running 9 (66d ago) 120d
falcon-sensor-nfjk2 1/1 Running 7 (66d ago) 120d
falcon-sensor-wvz85 1/1 Running 9 (66d ago) 120d
falcon-sensor-zpjn2 1/1 Running 1 (66d ago) 112d
running ဖြစ်နေပီဆိုတော့ ကျွန်တော်တို့ ရဲ့ deployment state ကအောင်မြင်သွားပီပဲဖြစ်ပါတယ်။
ကျွန်တော်ရေးခဲ့တာ အမှားများပါခဲ့ရင်လဲ လာရောက်ပြောကြားနိုင်ပါတယ်ခင်ဗျ။ အားလုံးပဲ အချိန်ပေးပြီးဖတ်ရှုပေးတယ့်အတွက်ကျေးဇူးတင်ပါတယ်။
Author By: Sc3p73R
Reference: CrowdStrike Documentation




