Skip to content

Instantly share code, notes, and snippets.

@danielscholl
danielscholl / validation.md
Last active June 30, 2022 12:29
Kind - AAD-Pod-Identity-SP

Validation: AAD Pod Identity with Service Principal

This validation will use Service Principal and Key Vault CSI Secret Driver features to test secret management with Key Vault Secrets.

Create Azure Resources

# Azure CLI Login
az login

OSDU R2 Setup Instructions

Create ADO and Import Projects for R2

This typically takes about 10-15 minutes to complete.

#Install Chocolatey
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
#Assign Chocolatey Packages to Install
$Packages = `
'git', `
'microsoft-edge', `
'visualstudiocode', `
'docker-desktop'
@danielscholl
danielscholl / init-backend-state.sh
Last active December 11, 2019 15:11
Terraform Backend State Manage
#!/usr/bin/env bash
#
# Purpose: Initialize the terraform backend-state
# Usage:
# init-backend-state.sh <resourcegroup> <storageaccount> <keyvault>
# curl https://gist.githubusercontent.com/danielscholl/5974a8f3e6c0ecfb45444b690f4299cd/raw/30356cb760c489cbff922c473864edef8779a059/init-backend-state.sh | bash -s <rg> <sa> <kv>
set -e
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1';
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
./dotnet-install.ps1 -InstallDir '~/.dotnet' -Channel LTS
$RELEASE="20190926.1"
$ID_SCOPE="0ne0004515C"
$REGISTRATION="edge-gateway"
. {Invoke-WebRequest -useb https://github.com/danielscholl/iot-tpm-provision/releases/download/$RELEASE/build.zip -Outfile tpm.zip}
Expand-Archive -Path ".\tpm.zip"
New-Module -Name IoTEdge -ScriptBlock {
<#
# Installs the IoT Edge Security Daemon on Windows.
#>
#requires -Version 5
#requires -RunAsAdministrator
Set-Variable Windows1607 -Value 14393 -Option Constant
timestamp tag value questionable substituted annotated
2019-05-30T01:25:00.000Z OSIDemo_Pump Station _Pump01.Bearing Temperature.258452c3-4a3b-5ecf-157a-34f81f110848 State: 249(Set: 0) False False False
2019-05-30T01:35:00.000Z OSIDemo_Pump Station _Pump01.Bearing Temperature.258452c3-4a3b-5ecf-157a-34f81f110848 197.5291 False False False
2019-05-30T01:40:00.000Z OSIDemo_Pump Station _Pump01.Bearing Temperature.258452c3-4a3b-5ecf-157a-34f81f110848 192.3548 False False False
2019-05-30T01:45:00.000Z OSIDemo_Pump Station _Pump01.Bearing Temperature.258452c3-4a3b-5ecf-157a-34f81f110848 195.4681 False False False
2019-05-30T01:50:00.000Z OSIDemo_Pump Station _Pump01.Bearing Temperature.258452c3-4a3b-5ecf-157a-34f81f110848 177.2453 False False False
2019-05-30T01:55:00.000Z OSIDemo_Pump Station _Pump01.Bearing Temperature.258452c3-4a3b-5ecf-157a-34f81f110848 179.744 False False False
2019-05-30T02:00:00.000Z OSIDemo_Pump Station _Pump01.Bearing Temperature.258452c3-4a3b-5ecf-157a-34f81f110848 177.2966 False False
$destinationFolder = "C:\Users\student01.PISCHOOL\desktop\"
$fileName = "sample"
$suffix = ".csv"
$filePath = "$($destinationFolder)$($fileName)$($suffix)"
Add-Content -Path $filePath -Value 'timestamp,tag,value,questionable,substituted,annotated'
# Start Time and End Time to get Archive Data

Demo (Prepare)

Create an Ubuntu Workstation and use VSCode (Insiders) remote-ssh extension to SSH to it.

Install Azure CLI

# Install CLI
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

Demo (Prepare)

Introduce CloudShell

Install DirEnv in CloudShell

git clone https://github.com/direnv/direnv.git
cd direnv