From a740e92784c3a896993bf60d6e5943f6642fc5a7 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Fri, 15 Apr 2022 15:40:34 +0200 Subject: [PATCH] Envs: Rename api/monkey endpoint to api/agent * Remove 32-bitness * Fix api/agent/download endpoint --- envs/os_compatibility/README.md | 10 ++-- envs/os_compatibility/terraform/instances.tf | 52 +------------------- 2 files changed, 7 insertions(+), 55 deletions(-) diff --git a/envs/os_compatibility/README.md b/envs/os_compatibility/README.md index e0ad30dec..f8b0586d0 100644 --- a/envs/os_compatibility/README.md +++ b/envs/os_compatibility/README.md @@ -2,9 +2,9 @@ ## About -OS compatibility is an environment on AWS that +OS compatibility is an environment on AWS that is designed to test monkey binary compatibility on -different operating systems. +different operating systems. This environment is deployed using terraform scripts located in this directory. @@ -33,7 +33,7 @@ terraform apply 1. Launch os_compat_ISLAND machine and upload your binaries/update island. Reset island environment. 2. Launch/Reboot all other os_compat test machines (Can be filtered with tag "Purpose: os_compat_instance") 3. Wait until machines boot and run monkey -4. Launch `test_compatibility.py` pytest script with island ip parameter +4. Launch `test_compatibility.py` pytest script with island ip parameter (e.g. `test_compatibility.py --island 111.111.111.111:5000`) ## Machines @@ -68,13 +68,13 @@ Example commands: ```cmd [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue -Invoke-WebRequest -Uri 'https://10.0.0.251:5000/api/monkey/download/monkey-windows-64.exe' -OutFile 'C:\windows\temp\monkey-windows-64.exe' -UseBasicParsing +Invoke-WebRequest -Uri 'https://10.0.0.251:5000/api/agent/download/windows' -OutFile 'C:\windows\temp\monkey-windows-64.exe' -UseBasicParsing C:\windows\temp\monkey-windows-64.exe m0nk3y -s 10.0.0.251:5000 ``` - Bash: ```shell script -wget --no-check-certificate -q https://10.0.0.251:5000/api/monkey/download/monkey-linux-64 -O ./monkey-linux-64 || curl https://10.0.0.251:5000/api/monkey/download/monkey-linux-64 -k -o monkey-linux-64 +wget --no-check-certificate -q https://10.0.0.251:5000/api/agent/download/linux -O ./monkey-linux-64 || curl https://10.0.0.251:5000/api/agent/download/linux -k -o monkey-linux-64 chmod +x ./monkey-linux-64 ./monkey-linux-64 m0nk3y -s 10.0.0.251:5000 ``` diff --git a/envs/os_compatibility/terraform/instances.tf b/envs/os_compatibility/terraform/instances.tf index 44b2f8a3d..065f5039c 100644 --- a/envs/os_compatibility/terraform/instances.tf +++ b/envs/os_compatibility/terraform/instances.tf @@ -47,37 +47,10 @@ Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="userdata.txt" #!/bin/bash rm ./monkey-linux-64 -wget --no-check-certificate -q https://10.0.0.251:5000/api/monkey/download/monkey-linux-64 -O ./monkey-linux-64 || curl https://10.0.0.251:5000/api/monkey/download/monkey-linux-64 -k -o monkey-linux-64 +wget --no-check-certificate -q https://10.0.0.251:5000/api/agent/download/linux -O ./monkey-linux-64 || curl https://10.0.0.251:5000/api/agent/download/linux -k -o monkey-linux-64 chmod +x ./monkey-linux-64 ./monkey-linux-64 m0nk3y -s 10.0.0.251:5000 --// -EOF - - user_data_linux_32 = < true -EOF - - user_data_windows_32 = < -add-type @" - using System.Net; - using System.Security.Cryptography.X509Certificates; - public class TrustAllCertsPolicy : ICertificatePolicy { - public bool CheckValidationResult( - ServicePoint srvPoint, X509Certificate certificate, - WebRequest request, int certificateProblem) { - return true; - } - } -"@ -[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy -Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue -Invoke-WebRequest -Uri 'https://10.0.0.251:5000/api/monkey/download/monkey-windows-32.exe' -OutFile 'C:\windows\temp\monkey-windows-32.exe' -UseBasicParsing -C:\windows\temp\monkey-windows-32.exe m0nk3y -s 10.0.0.251:5000 - -true EOF }