Harden ARM-TTK execution and download - #14906
Open
idoshabi07 wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ccff4d4a-3094-4de9-a5c0-d00c63d96a37
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Hardens ARM-TTK execution by removing Invoke-Expression, adding explicit parameter passing, and pinning/verifying an ARM-TTK release download before extraction/import.
Changes:
- Replaced
Invoke-Expressionwith direct script invocation (&) and named arguments. - Added
param()support torun-arm-ttk-in-automation.ps1for-SolutionName. - Pinned ARM-TTK download to a specific GitHub release and added SHA-256 verification plus safer extraction/move logic.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Tools/Create-Azure-Sentinel-Solution/createSolution.ps1 | Calls ARM-TTK scripts via & instead of Invoke-Expression. |
| Tools/Create-Azure-Sentinel-Solution/common/commonFunctions.ps1 | Updates ARM-TTK invocation to pass -SolutionName directly. |
| Tools/Create-Azure-Sentinel-Solution/arm-ttk/run-arm-ttk-in-automation.ps1 | Introduces param() and switches from $args[0] to -SolutionName. |
| Tools/Create-Azure-Sentinel-Solution/arm-ttk/download-arm-ttk.ps1 | Pins and validates ARM-TTK archive by SHA-256, then extracts/imports module. |
| Tools/Create-Azure-Sentinel-Solution/V2/createSolutionV2.ps1 | Updates ARM-TTK invocation to direct script call and named parameter. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
12
to
18
| $repoRoot = $(git rev-parse --show-toplevel) | ||
| $root="$repoRoot/Solutions" | ||
| $tmp="$PSScriptRoot/tmp" | ||
| $solutionName=$args[0] | ||
|
|
||
| if(!$(Get-Command Test-AzTemplate -ErrorAction SilentlyContinue)){ | ||
| Import-Module "$tmp/arm-ttk/arm-ttk.psd1" | ||
| } |
| Invoke-WebRequest -Uri "https://aka.ms/arm-ttk-latest" -OutFile $ttkZip -Verbose | ||
| Expand-Archive -Path $ttkZip -DestinationPath $tmp -Force | ||
| try { | ||
| Invoke-WebRequest -Uri $armTtkUri -OutFile $ttkZip -UseBasicParsing |
Comment on lines
+1
to
+2
| # ARM-TTK release 20260213 (module 0.27), commit | ||
| # 0ec9a41a4503e970a0ec8efb0cd08415cc172175. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces Invoke-Expression with direct script invocation and argument passing, pins ARM-TTK to release 20260213, and verifies its SHA-256 before extraction and import.
AI scan items
Validation
PowerShell parsing passed; the pinned archive checksum and download/extraction path were verified.