Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions vault-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ FIRST_SECRET_NO_PREFIX=${FIRST_SECRET#"secret/data/"}

UPDATED_JSON=$(echo $BASE_JSON | jq --arg path "secret/$FIRST_SECRET_NO_PREFIX" --argjson kv "$KEY_VALUES" '.path_values_map[$path] = $kv')

echo "$UPDATED_JSON" | jq .
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This echo command outputs sensitive information including vault secret values (from KEY_VALUES) and S3 presigned URLs. This data will be exposed in logs and could pose a security risk. Consider either:

  1. Wrapping this in a conditional check like if [ "$VAULT_BACKUP_ENABLE_DEBUG" == "TRUE" ] (similar to line 67-69), or
  2. Removing this debug output entirely if it's not needed for production use.

If debug output is required, ensure logs are properly secured and access-controlled.

Suggested change
echo "$UPDATED_JSON" | jq .
if [ "$VAULT_BACKUP_ENABLE_DEBUG" == "TRUE" ]; then
echo "$UPDATED_JSON" | jq .
fi

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug output is inconsistent with the existing pattern in the script. Line 67-69 uses VAULT_BACKUP_ENABLE_DEBUG to conditionally enable debug output. This unconditional echo should follow the same pattern for consistency.

Suggested change
echo "$UPDATED_JSON" | jq .
if [ "$VAULT_BACKUP_ENABLE_DEBUG" == "TRUE" ]; then
echo "$UPDATED_JSON" | jq .
fi

Copilot uses AI. Check for mistakes.

echo "Validating Backup now....."
curl glueops-backup-and-exports.glueops-core-backup.svc.cluster.local:8080/api/v1/validate --fail-with-body -X POST -d "${UPDATED_JSON}"
Loading