From lc-advanced-skills
Deploys temporary LimaCharlie EDR sensor on local Linux/Mac host for testing detection rules, investigating sensor behavior, or development. Auto-cleans up after use.
npx claudepluginhub refractionpoint/lc-ai --plugin lc-advanced-skillsThis skill is limited to using the following tools:
Deploy a temporary LimaCharlie EDR sensor on the local Linux or Mac OS host for testing purposes. The sensor runs in the background with automatic cleanup when stopped.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Compresses source documents into lossless, LLM-optimized distillates preserving all facts and relationships. Use for 'distill documents' or 'create distillate' requests.
Deploy a temporary LimaCharlie EDR sensor on the local Linux or Mac OS host for testing purposes. The sensor runs in the background with automatic cleanup when stopped.
Prerequisites: Run
/init-lcto initialize LimaCharlie context.
All LimaCharlie operations use the limacharlie CLI directly:
limacharlie <noun> <verb> --oid <oid> --output yaml [flags]
For command help and discovery: limacharlie <command> --ai-help
| Rule | Wrong | Right |
|---|---|---|
| CLI Access | Call MCP tools or spawn api-executor | Use Bash("limacharlie ...") directly |
| Output Format | --output json | --output yaml (more token-efficient) |
| Filter Output | Pipe to jq/yq | Use --filter JMESPATH to select fields |
| LCQL Queries | Write query syntax manually | Use limacharlie ai generate-query first |
| Timestamps | Calculate epoch values | Use date +%s or date -d '7 days ago' +%s |
| OID | Use org name | Use UUID (call limacharlie org list if needed) |
Use this skill when:
This skill performs a two-phase deployment:
The sensor:
Before starting, ensure you have:
First, get the list of available organizations:
limacharlie org list --output yaml
This returns your available organizations. Use AskUserQuestion to let the user select one, or if they need a new org, create one with limacharlie org create --name "<name>" --output yaml.
Check for existing "Test EDR" installation key:
limacharlie installation-key list --oid <SELECTED_ORG_ID> --filter "[?description=='Test EDR'] | [0]" --output yaml
If "Test EDR" key exists: Extract the key value from the response.
If not exists: Create one:
limacharlie installation-key create --description "Test EDR" --tags "test-edr,temporary" --oid <SELECTED_ORG_ID> --output yaml
Save the returned key value for the next phase.
Step 1: Detect platform and create temp directory:
OS_TYPE=$(uname -s)
ARCH=$(uname -m)
TEMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/lc-edr-test-XXXXXX")
echo "Platform: $OS_TYPE ($ARCH), Temp dir: $TEMP_DIR"
Step 2: Download the appropriate sensor binary:
if [ "$OS_TYPE" = "Darwin" ]; then
if [ "$ARCH" = "arm64" ]; then
DOWNLOAD_URL="https://downloads.limacharlie.io/sensor/mac/arm64"
else
DOWNLOAD_URL="https://downloads.limacharlie.io/sensor/mac/64"
fi
else
DOWNLOAD_URL="https://downloads.limacharlie.io/sensor/linux/64"
fi
curl -sSL "$DOWNLOAD_URL" -o "$TEMP_DIR/lc_sensor"
chmod +x "$TEMP_DIR/lc_sensor"
echo "Sensor downloaded to: $TEMP_DIR"
Step 3: Run the sensor in background (as root):
if [ "$OS_TYPE" = "Darwin" ]; then
sudo nohup "$TEMP_DIR/lc_sensor" -d <INSTALLATION_KEY> > /dev/null 2>&1 &
else
sudo setsid "$TEMP_DIR/lc_sensor" -d <INSTALLATION_KEY> > /dev/null 2>&1 &
fi
echo "Sensor started in $TEMP_DIR"
Important:
setsid to create a new session and fully detach from the terminalnohup which achieves similar process detachmentTEMP_DIR path for cleanup laterlc_sensor - use this for stoppingAfter starting, the sensor should appear in your LimaCharlie organization within a few seconds. Verify by listing sensors with a selector that matches the installation key's iid (Installation ID, a UUID):
limacharlie sensor list --selector "iid == \`<INSTALLATION_KEY_IID>\`" --oid <SELECTED_ORG_ID> --output yaml
Replace <INSTALLATION_KEY_IID> with the iid UUID from the installation key used. This selector fetches only the sensor enrolled with that specific installation key, rather than listing all sensors in the organization.
When the user wants to stop the test EDR:
Single command to stop and clean up (recommended):
sudo pkill -9 -f lc_sensor; sudo rm -rf <TEMP_DIR>; echo "Cleanup complete"
Important notes:
-9 (SIGKILL) for reliable termination of detached processes; instead of && - pkill returns non-zero exit codes even on success (e.g., 144 when the signal is delivered)KillShell to stop the sensor - always use pkillVerify cleanup succeeded:
ps aux | grep "[l]c_sensor" || echo "Sensor stopped"
The [l] bracket trick prevents grep from matching itself in the output.
User: "I want to test the LimaCharlie EDR on my machine"
Steps:
limacharlie org list --output yaml
Response shows: [{"name": "My Test Org", "oid": "abc123-def456-..."}]
Ask user to select org (via AskUserQuestion)
Check for existing installation key:
limacharlie installation-key list --oid abc123-def456-... --filter "[?description=='Test EDR'] | [0]" --output yaml
limacharlie installation-key create --description "Test EDR" --tags "test-edr,temporary" --oid abc123-def456-... --output yaml
Returns: {"iid": "test-edr", "key": "abc123:def456:..."}
OS_TYPE=$(uname -s)
ARCH=$(uname -m)
TEMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/lc-edr-test-XXXXXX")
if [ "$OS_TYPE" = "Darwin" ]; then
if [ "$ARCH" = "arm64" ]; then
DOWNLOAD_URL="https://downloads.limacharlie.io/sensor/mac/arm64"
else
DOWNLOAD_URL="https://downloads.limacharlie.io/sensor/mac/64"
fi
else
DOWNLOAD_URL="https://downloads.limacharlie.io/sensor/linux/64"
fi
curl -sSL "$DOWNLOAD_URL" -o "$TEMP_DIR/lc_sensor"
chmod +x "$TEMP_DIR/lc_sensor"
if [ "$OS_TYPE" = "Darwin" ]; then
sudo nohup "$TEMP_DIR/lc_sensor" -d "abc123:def456:..." > /dev/null 2>&1 &
else
sudo setsid "$TEMP_DIR/lc_sensor" -d "abc123:def456:..." > /dev/null 2>&1 &
fi
echo "Sensor started in $TEMP_DIR"
iid:limacharlie sensor list --selector "iid == \`<IID_FROM_INSTALLATION_KEY>\`" --oid abc123-def456-... --output yaml
sudo pkill -f lc_sensor).User: "Stop the test EDR"
Steps:
sudo pkill -9 -f lc_sensor; sudo rm -rf /tmp/lc-edr-test-XXXXXX; echo "Cleanup complete"
ps aux | grep "[l]c_sensor" || echo "Sensor stopped"
limacharlie sensor delete --sid <SENSOR_ID> --confirm --oid abc123-def456-...
test-edr and temporary tags for easy identification; not && when chaining cleanup commands since pkill returns non-zero exit codes even on successdetection-engineering: For creating D&R rules to test with the sensorsensor-health: To check if your test sensor is reporting properlycase-investigation: To investigate events from your test sensor