kevoreilly / CAPEv2

Malware Configuration And Payload Extraction
https://capesandbox.com/analysis/
Other
1.89k stars 402 forks source link

ERROR: osProfile': '(InvalidParameter) Required parameter 'osProfile' is missing (null) #2250

Open yveskerbens opened 1 month ago

yveskerbens commented 1 month ago

About accounts on capesandbox.com

This is open source and you are getting free support so be friendly!

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

Complete the installation on azure and get CAPEv2Host to launch guest machine

Current Behavior

After successful installation of CAPEv2host and completing all required configuration for Azure cloud within the az.conf file, the host is unable to create guest machines. After analysis of az.py module, I have found out vmss_vm_profile: ` if self.options.az.spot_instances: vmss_vm_profile = models.VirtualMachineScaleSetVMProfile( storage_profile=vmss_storage_profile, network_profile=vmss_network_profile,

Note: The following key value pairs are for Azure spot instances

            priority=models.VirtualMachinePriorityTypes.spot,
            eviction_policy=models.VirtualMachineEvictionPolicyTypes.delete,
            # Note: This value may change depending on your needs.
            billing_profile=models.BillingProfile(max_price=float(-1)),
        )
    else:
        vmss_vm_profile = models.VirtualMachineScaleSetVMProfile(
            storage_profile=vmss_storage_profile,
            network_profile=vmss_network_profile,
        )`

doesn't seem to contain the osProfile that seem to be required by azure

Failure Information (for bugs)

2024-07-27 16:42:03,426 [lib.cuckoo.core.machinery_manager] INFO: Using MachineryManager[az] with max_machines_count=10 2024-07-27 16:42:03,429 [lib.cuckoo.core.scheduler] INFO: Creating scheduler with max_analysis_count=unlimited 2024-07-27 16:42:31,695 [modules.machinery.az] WARNING: Failed to <bound method VirtualMachineScaleSetsOperations.begin_create_or_update of <azure.mgmt.compute.v2024_03_01.operations._operations.VirtualMachineScaleSetsOperations object at 0x79246d6c6da0>>(('soc_tooling_capev2_sandbox_rg', 'cuckoo1', <azure.mgmt.compute.v2024_03_01.models._models_py3.VirtualMachineScaleSet object at 0x79246d562440>),{'polling_interval': 1}) due to the Azure error '(InvalidParameter) Required parameter 'osProfile' is missing (null). Code: InvalidParameter Message: Required parameter 'osProfile' is missing (null). Target: osProfile': '(InvalidParameter) Required parameter 'osProfile' is missing (null). Code: InvalidParameter Message: Required parameter 'osProfile' is missing (null). Target: osProfile'.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Complete the installation of CAPEv2 on azure cloud according to official guide: https://capev2.readthedocs.io/en/latest/installation/host/cloud.html
  2. Complete the configuration of az.conf machinery file
  3. sudo systemctl restart cape.service
  4. sudo systemctl status cape.service
  5. cd /opt/CAPEv2/
  6. cat log/cuckoo.lo

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. Operating system version, bitness, installed software versions, test sample details/hash/binary (if applicable).

Question Answer
Git commit Type $ git log \| head -n1 to find out
OS version Ubuntu 16.04, Windows 10, macOS 10.12.3

Failure Logs

2024-07-27 16:42:03,426 [lib.cuckoo.core.machinery_manager] INFO: Using MachineryManager[az] with max_machines_count=10 2024-07-27 16:42:03,429 [lib.cuckoo.core.scheduler] INFO: Creating scheduler with max_analysis_count=unlimited 2024-07-27 16:42:31,695 [modules.machinery.az] WARNING: Failed to <bound method VirtualMachineScaleSetsOperations.begin_create_or_update of <azure.mgmt.compute.v2024_03_01.operations._operations.VirtualMachineScaleSetsOperations object at 0x79246d6c6da0>>(('soc_tooling_capev2_sandbox_rg', 'cuckoo1', <azure.mgmt.compute.v2024_03_01.models._models_py3.VirtualMachineScaleSet object at 0x79246d562440>),{'polling_interval': 1}) due to the Azure error '(InvalidParameter) Required parameter 'osProfile' is missing (null). Code: InvalidParameter Message: Required parameter 'osProfile' is missing (null). Target: osProfile': '(InvalidParameter) Required parameter 'osProfile' is missing (null). Code: InvalidParameter Message: Required parameter 'osProfile' is missing (null). Target: osProfile'.

doomedraven commented 1 month ago

Did you Google it? It looks like azure related and not cape related issue, we do not provide official azure support, is completely on community

yveskerbens commented 1 month ago

Did you Google it? It looks like azure related and not cape related issue, we do not provide official azure support, is completely on community No luck with Google. I will be looking to change the image that I am using and see if this solves the issue.

doomedraven commented 1 month ago

you will need till someone from community who uses azure helps you, as this issue is not related to core of cape, so i have no idea what is wrong

ChrisThibodeaux commented 2 days ago

@yveskerbens Can you confirm that you followed this part of the docs when you created the guest image? Must be a "SPECIALIZED" image. You can double-check this by going to your Azure portal -> navigate to your guest's VM image definition -> check value for OS state.

Here is what mine looks like. osprofile

Here is a link to the Microsoft docs explaining why you are seeing the error message and how to fix. In your case, the fix would be to create the image as "SPECIALIZED". Here is the important part:

Error Message: Required parameter 'osProfile' is missing (null)
Cause: The VM is created from a generalized image, and it's missing the admin username, password, or SSH keys. Because generalized images don't retain the admin username, password, or SSH keys, these fields must be specified during creation of a VM or scale set