Skip to content

Commit

Permalink
New whiteboards
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthebrit committed Aug 2, 2022
1 parent 2ae8968 commit f418ca3
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
3 changes: 3 additions & 0 deletions AzureAZCheck/Check-AzureAZs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ function Check-AzureAzs {
$r = Invoke-RestMethod -Uri "https://management.azure.com/subscriptions/$subID/providers/Microsoft.Resources/checkZonePeers/?api-version=2020-01-01" -Method POST -Body $Body -Headers $authHeader
}

Register-AzProviderFeature -FeatureName AvailabilityZonePeering -ProviderNamespace Microsoft.Resources
Get-AzProviderFeature -FeatureName AvailabilityZonePeering -ProviderNamespace Microsoft.Resources

Check-AzureAzs @("466c1a5d-e93b-4138-91a5-670daf44b0f8","5a7b82eb-ba40-42b9-80d9-8d33e15d6193") 'eastus'

$subList = @("466c1a5d-e93b-4138-91a5-670daf44b0f8","5a7b82eb-ba40-42b9-80d9-8d33e15d6193")
Expand Down
43 changes: 31 additions & 12 deletions AzureVMs/EnableJIT.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,40 @@ Connect-AzAccount -Identity
}
#>

$VMID = 'VMRESOURCEIDHERE'
$CIDRRange = '10.0.12.0/24'
# Input bindings are passed in via param block.
param($Timer)

# Get the current universal time in the default string format.
$currentUTCtime = (Get-Date).ToUniversalTime()

# The 'IsPastDue' property is 'true' when the current function invocation is later than scheduled.
if ($Timer.IsPastDue) {
Write-Host "PowerShell timer is running late!"
}

# Write an information log with the current time.
Write-Host "Running the JIT enable: $currentUTCtime"

$VMIDs = @('ID1','ID2')
$CIDRRange = '10.0.12.0/24' #Azure Firewall
$CIDRRange2 = '10.0.4.0/24' #Azure Bastion

#end time in 20 hours
$EndTime = (Get-Date -asutc).addhours(20) | Get-Date -format o
$EndTime = (Get-Date).addhours(20) | Get-Date -format o

foreach($VMID in $VMIDs)
{

$JitPolicyVm1 = (@{
id=$VMID;
ports=(@{
number=3389;
endTimeUtc=$EndTime;
allowedSourceAddressPrefix=@($CIDRRange)})})
$JitPolicyVm = (@{
id=$VMID;
ports=(@{
number=3389;
endTimeUtc=$EndTime;
allowedSourceAddressPrefix=@($CIDRRange,$CIDRRange2)})})

$JitPolicyArr=@($JitPolicyVm1)
$JitPolicyArr=@($JitPolicyVm)

$VMInfo = Get-AzResource -Id $VMID
$VMInfo = Get-AzResource -Id $VMID

Start-AzJitNetworkAccessPolicy -ResourceGroupName $($VMInfo.ResourceGroupName) -Location $VMInfo.Location -Name "default" -VirtualMachine $JitPolicyArr
Start-AzJitNetworkAccessPolicy -ResourceGroupName $($VMInfo.ResourceGroupName) -Location $VMInfo.Location -Name "default" -VirtualMachine $JitPolicyArr
}
Binary file added Whiteboards/AADjoinedADaccess.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Whiteboards/AVNMDeepDiveWhiteboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f418ca3

Please sign in to comment.