Skip to content

Commit

Permalink
Add validator in rotation script to check custom munge key size
Browse files Browse the repository at this point in the history
  • Loading branch information
hehe7318 committed Sep 20, 2023
1 parent b32d548 commit 390d074
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ if [ -n "${SECRET_ARN}" ]; then
exit 1
fi

# Check munge key size
key_size=$(echo "${decoded_key}" | wc -c)
if [ $key_size -lt 32 ] || [ $key_size -gt 1024 ]; then
echo "Fetched munge key size is out of valid range [256-8192 bits]."
exit 1
fi

echo "${decoded_key}" > ${MUNGE_KEY_FILE}

# Set ownership on the key
Expand Down

0 comments on commit 390d074

Please sign in to comment.