-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid the need for python inside the agent container
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
Showing
3 changed files
with
27 additions
and
26 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
container/functional/keylime_ipv6_multihost/payload-script/action_list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
local_action_modify_payload.py | ||
local_action_modify_payload.sh |
25 changes: 0 additions & 25 deletions
25
container/functional/keylime_ipv6_multihost/payload-script/local_action_modify_payload.py
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
container/functional/keylime_ipv6_multihost/payload-script/local_action_modify_payload.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |