Skip to content

Commit 09070af

Browse files
committed
camp 1 cleanup
1 parent 2161096 commit 09070af

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#!/bin/bash
22
set -e
33

4-
echo "🔐 Camp 1: Enable Managed Identity"
4+
echo "Camp 1: Enable Managed Identity"
55
echo "=================================="
66

77
# Load azd environment variables
8-
echo "📦 Loading azd environment..."
8+
echo "Loading azd environment..."
99
eval "$(azd env get-values | sed 's/^/export /')"
1010

1111
# Verify we have the necessary variables
1212
if [ -z "${AZURE_MANAGED_IDENTITY_PRINCIPAL_ID}" ]; then
13-
echo "Error: AZURE_MANAGED_IDENTITY_PRINCIPAL_ID not found in azd environment."
13+
echo "Error: AZURE_MANAGED_IDENTITY_PRINCIPAL_ID not found in azd environment."
1414
echo "Make sure you've run 'azd provision' first."
1515
exit 1
1616
fi
1717

18-
echo "Managed Identity Principal ID: ${AZURE_MANAGED_IDENTITY_PRINCIPAL_ID}"
18+
echo "Managed Identity Principal ID: ${AZURE_MANAGED_IDENTITY_PRINCIPAL_ID}"
1919
echo ""
2020

2121
echo "🔍 Verifying Key Vault role assignment..."
@@ -26,5 +26,5 @@ az role assignment list \
2626
-o table
2727

2828
echo ""
29-
echo "Managed Identity setup complete!"
29+
echo "Managed Identity setup complete!"
3030
echo "The Container App can now access Key Vault secrets without passwords."
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/bin/bash
22
set -e
33

4-
echo "🔑 Camp 1: Migrate Secrets to Key Vault"
4+
echo "Camp 1: Migrate Secrets to Key Vault"
55
echo "======================================="
66

77
# Load azd environment variables
8-
echo "📦 Loading azd environment..."
8+
echo "Loading azd environment..."
99
eval "$(azd env get-values | sed 's/^/export /')"
1010

1111
# Verify we have the necessary variables
1212
if [ -z "${AZURE_KEY_VAULT_NAME}" ]; then
13-
echo "Error: AZURE_KEY_VAULT_NAME not found in azd environment."
13+
echo "Error: AZURE_KEY_VAULT_NAME not found in azd environment."
1414
echo "Make sure you've run 'azd provision' first."
1515
exit 1
1616
fi
@@ -22,7 +22,7 @@ echo ""
2222
USER_OBJECT_ID=$(az ad signed-in-user show --query id -o tsv)
2323

2424
# Grant current user Key Vault Secrets Officer role to create secrets
25-
echo "📋 Granting you Key Vault Secrets Officer role..."
25+
echo "Granting you Key Vault Secrets Officer role..."
2626
az role assignment create \
2727
--role "Key Vault Secrets Officer" \
2828
--assignee "${USER_OBJECT_ID}" \
@@ -34,28 +34,28 @@ sleep 10
3434

3535
# Create sample secrets
3636
echo ""
37-
echo "📝 Creating demo-api-key..."
37+
echo "Creating demo-api-key..."
3838
az keyvault secret set \
3939
--vault-name "${AZURE_KEY_VAULT_NAME}" \
4040
--name "demo-api-key" \
4141
--value "sk-secure-$(openssl rand -hex 8)" \
4242
--output none
4343

44-
echo "📝 Creating external-service-secret..."
44+
echo "Creating external-service-secret..."
4545
az keyvault secret set \
4646
--vault-name "${AZURE_KEY_VAULT_NAME}" \
4747
--name "external-service-secret" \
4848
--value "secret-$(openssl rand -hex 8)" \
4949
--output none
5050

5151
echo ""
52-
echo "Secrets created in Key Vault!"
52+
echo "Secrets created in Key Vault!"
5353
echo ""
54-
echo "📋 Current secrets:"
54+
echo "Current secrets:"
5555
az keyvault secret list \
5656
--vault-name "${AZURE_KEY_VAULT_NAME}" \
5757
--query "[].{Name:name, Enabled:attributes.enabled}" \
5858
-o table
5959

6060
echo ""
61-
echo "💡 These secrets are now accessible by the secure server via Managed Identity!"
61+
echo "These secrets are now accessible by the secure server via Managed Identity!"

camps/camp1-identity/scripts/verify-security.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
set -e
33

4-
echo "Camp 1: Security Validation"
4+
echo "Camp 1: Security Validation"
55
echo "=============================="
66

77
# Load azd environment variables
8-
echo "📦 Loading azd environment..."
8+
echo "Loading azd environment..."
99
eval "$(azd env get-values | sed 's/^/export /')"
1010

1111
# Track overall validation status
@@ -23,7 +23,7 @@ SECRET_COUNT=$(az keyvault secret list \
2323
--query "length(@)" -o tsv)
2424

2525
if [ "${SECRET_COUNT}" -gt 0 ]; then
26-
echo "Found ${SECRET_COUNT} secrets in Key Vault"
26+
echo "Found ${SECRET_COUNT} secrets in Key Vault"
2727
az keyvault secret list \
2828
--vault-name "${AZURE_KEY_VAULT_NAME}" \
2929
--query "[].{Name:name, Enabled:attributes.enabled}" \
@@ -44,7 +44,7 @@ ROLE_COUNT=$(az role assignment list \
4444
--query "[?roleDefinitionName=='Key Vault Secrets User'] | length(@)" -o tsv)
4545

4646
if [ "${ROLE_COUNT}" -gt 0 ]; then
47-
echo "Managed Identity has Key Vault Secrets User role"
47+
echo "Managed Identity has Key Vault Secrets User role"
4848
az role assignment list \
4949
--assignee "${AZURE_MANAGED_IDENTITY_PRINCIPAL_ID}" \
5050
--all \
@@ -62,7 +62,7 @@ echo ""
6262
echo "Check 3: Container App Identity"
6363
echo "--------------------------------"
6464
# Note: This check requires the container app name, which would come from azd
65-
echo "Checking if container apps have managed identity assigned..."
65+
echo "Checking if container apps have managed identity assigned..."
6666
CA_LIST=$(az containerapp list \
6767
--resource-group "${AZURE_RESOURCE_GROUP}" \
6868
--query "[].{Name:name, Identity:identity.type}" \
@@ -76,15 +76,15 @@ fi
7676

7777

7878
if [ ${VALIDATION_FAILED} -eq 0 ]; then
79-
echo "🎉 Security Validation Complete!"
79+
echo "Security Validation Complete!"
8080
echo "=============================="
8181
echo ""
82-
echo "Verified:"
82+
echo "Verified:"
8383
echo " - Secrets stored in Key Vault (not env vars)"
8484
echo " - Managed Identity has RBAC permissions"
8585
echo " - Container Apps use Managed Identity"
8686
echo ""
87-
echo "🔒 Security posture: SECURE"
87+
echo "Security posture: SECURE"
8888
echo " Ready for production!"
8989
else
9090
echo "❌ Security Validation Failed!"

0 commit comments

Comments
 (0)