Skip to content

Commit e35750d

Browse files
committed
ci: validate Arsenal Image Mounter downloads hash
This commits adds a content hash match for the Arsenal Image Mounter files to validate that the content of the files we download are as expected.
1 parent c3b5b72 commit e35750d

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

.circleci/config.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,7 @@ commands:
8888
# Useful resources for AIM: http://reboot.pro/index.php?showtopic=22068
8989
name: 'Arsenal Image Mounter (RAM Disk)'
9090
command: |
91-
# Download AIM Drivers
92-
Invoke-WebRequest 'https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/988930e4b3180ec34661504e6f9906f98943a022/DriverSetup/DriverFiles.zip' -OutFile 'aim_drivers.zip' -UseBasicParsing
93-
Expand-Archive -Path 'aim_drivers.zip'
94-
95-
# Download AIM CLI
96-
Invoke-WebRequest 'https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/988930e4b3180ec34661504e6f9906f98943a022/Command%20line%20applications/aim_ll.zip' -OutFile 'aim_ll.zip' -UseBasicParsing
97-
Expand-Archive -Path 'aim_ll.zip'
98-
99-
# Install AIM drivers
100-
./aim_ll/x64/aim_ll.exe --install ./aim_drivers
101-
102-
# Setup RAM disk mount. Same parameters as ImDisk
103-
# See: https://support.circleci.com/hc/en-us/articles/4411520952091-Create-a-windows-RAM-disk
104-
./aim_ll/x64/aim_ll.exe -a -s 5G -m X: -p "/fs:ntfs /q /y"
91+
pwsh ./.circleci/win-ram-disk.ps1
10592
- run: nvm install 16.10
10693
- run: nvm use 16.10
10794
- run: npm install -g [email protected]

.circleci/win-ram-disk.ps1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Download AIM Drivers and validate hash
2+
Invoke-WebRequest "https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/988930e4b3180ec34661504e6f9906f98943a022/DriverSetup/DriverFiles.zip" -OutFile "aim_drivers.zip" -UseBasicParsing
3+
$aimDriversDownloadHash = (Get-FileHash aim_drivers.zip -a sha256).Hash
4+
If ($aimDriversDownloadHash -ne "1F5AA5DD892C2D5E8A0083752B67C6E5A2163CD83B6436EA545508D84D616E02") {
5+
throw "aim_drivers.zip hash is ${aimDriversDownloadHash} which didn't match the known version."
6+
}
7+
Expand-Archive -Path "aim_drivers.zip"
8+
9+
# Download AIM CLI and validate hash
10+
Invoke-WebRequest "https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/988930e4b3180ec34661504e6f9906f98943a022/Command%20line%20applications/aim_ll.zip" -OutFile "aim_ll.zip" -UseBasicParsing
11+
$aimCliDownloadHash = (Get-FileHash aim_ll.zip -a sha256).Hash
12+
If ($aimCliDownloadHash -ne "9AD3058F14595AC4A5E5765A9746737D31C219383766B624FCBA4C5ED96B20F3") {
13+
throw "aim_ll.zip hash is ${aimCliDownloadHash} which didn't match the known version."
14+
}
15+
Expand-Archive -Path "aim_ll.zip"
16+
17+
# Install AIM drivers
18+
./aim_ll/x64/aim_ll.exe --install ./aim_drivers
19+
20+
# Setup RAM disk mount. Same parameters as ImDisk
21+
# See: https://support.circleci.com/hc/en-us/articles/4411520952091-Create-a-windows-RAM-disk
22+
./aim_ll/x64/aim_ll.exe -a -s 5G -m X: -p "/fs:ntfs /q /y"

0 commit comments

Comments
 (0)