Bash Utils (BU) is a simple bash script that will make it easy and convenient for you to interact with KM and simplify many other bash related tasks and interactions.
NOTE: The prerequisite to securely install BU is COSIGN tool that will guarantee the integrity of the files you want to download, you MUST install it before proceeding.
Simplified Setup Example
Bash
Copy
# assume root permissions
sudo -s
# Install essential dependencies
apt-get install -y wget
# Define version of BU you want to install
TOOLS_VERSION="v0.3.42"
# Download and install BU
FILE_NAME="bash-utils.sh" && \
UBUNTU_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36" && \
wget --user-agent="$UBUNTU_AGENT" "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/${FILE_NAME}" -O ./$FILE_NAME && \
chmod +x ./$FILE_NAME && ./$FILE_NAME bashUtilsSetup && ./etc/profile
# Verify version of BU
bu bashUtilsVersion
# NOTE: The COSIGN tool is automatically installsed or updated by BU if it was not present or if the version of COSIGN is lower then v2.0.0
cosign version
Secure Setup Example
Bash
Copy
# assume root permissions
sudo -s
# Install essential dependencies
apt-get -y wget
# Define version of BU you want to install
TOOLS_VERSION="v0.3.42"
# Save KIRA public key allowing to verify signed releases
KIRA_COSIGN_PUB=/usr/keys/kira-cosign.pub && mkdir -p /usr/keys && \
cat > $KIRA_COSIGN_PUB << EOL
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/IrzBQYeMwvKa44/DF/HB7XDpnE+
f+mU9F/Qbfq25bBWV2+NlYMJv3KvKHNtu3Jknt6yizZjUV4b8WGfKBzFYw==
-----END PUBLIC KEY-----
EOL
# Download BU script
cd /tmp && FILE_NAME="bash-utils.sh" && rm -rfv ./$FILE_NAME ./${FILE_NAME}.sig && \
UBUNTU_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36" && \
wget --user-agent="$UBUNTU_AGENT" "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/${FILE_NAME}" -O ./$FILE_NAME && \
wget --user-agent="$UBUNTU_AGENT" "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/${FILE_NAME}.sig" -O ./${FILE_NAME}.sig
# Verify cosign release
cosign verify-blob --key "$KIRA_COSIGN_PUB" --signature "/tmp/${FILE_NAME}.sig" "/tmp/$FILE_NAME" --insecure-ignore-tlog --insecure-ignore-sct
# Install BU
chmod +x ./$FILE_NAME && ./$FILE_NAME bashUtilsSetup && ./etc/profile
# Verify version of BU
bu bashUtilsVersion