Skip to content

Commit

Permalink
Avoid the need for python inside the agent container
Browse files Browse the repository at this point in the history
Replace the python payload action with a shell payload action to avoid
the need for python inside the agent container.

Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
  • Loading branch information
ansasaki committed Aug 21, 2023
1 parent 60f675b commit 626d9ef
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
local_action_modify_payload.py
local_action_modify_payload.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

MY_UUID="d432fbb3-d2f1-4a97-9ef7-75bd81c00000"

if [ ! -f "$1" ]; then
echo "Input JSON file \"$1\" not found"
exit 1
fi

TYPE=$(grep -o "\"type\":[ ]*\"\([^\"]*\)\"" "$1" | sed -e 's/\"type\":[ ]*\"\([^\"]*\)\"/\1/g')

if [ "$TYPE" != "revocation" ]; then
echo "Input JSON type is not revocation"
exit 1
fi

EVENT_UUID=$(grep -o "\"agent_id\":[ ]*\"\([^\"]*\)\"" "$1" | sed -e 's/\"agent_id\":[ ]*\"\([^\"]*\)\"/\1/g')
EVENT_IP=$(grep -o "\"ip\":[ ]*\"\([^\"]*\)\"" "$1" | sed -e 's/\"ip\":[ ]*\"\([^\"]*\)\"/\1/g')

echo "A node in the network has been compromised: $EVENT_IP"
echo "my UUID: $MY_UUID, event UUID: $EVENT_UUID"

# is this revocation meant for me?
if [[ "$MY_UUID" == "$EVENT_UUID" ]]; then
rm /var/lib/keylime/test_payload_file
fi

0 comments on commit 626d9ef

Please sign in to comment.