Skip to content

Harden ARM-TTK execution and download - #14906

Open
idoshabi07 wants to merge 1 commit into
Azure:masterfrom
idoshabi07:ai-scan/solution-tooling
Open

Harden ARM-TTK execution and download#14906
idoshabi07 wants to merge 1 commit into
Azure:masterfrom
idoshabi07:ai-scan/solution-tooling

Conversation

@idoshabi07

Copy link
Copy Markdown
Contributor

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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ccff4d4a-3094-4de9-a5c0-d00c63d96a37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-Expression with direct script invocation (&) and named arguments.
  • Added param() support to run-arm-ttk-in-automation.ps1 for -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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants