- Manually check whether SEV is among the CPU flags:
grep -w sev /proc/cpuinfo- Follow the similar steps mentioned here to enable the AMD security features SME, SEV, and SEV-ES in BIOS/UEFI.
- Enable SEV in the kernel, append these parameters to
/etc/default/grub:
mem_encrypt=on kvm_amd.sev=1- After rebooting the host, you should see SEV being enabled in the kernel:
$ cat /sys/module/kvm_amd/parameters/sev
Y
- Check SEV support in the virt stack Reference: https://libvirt.org/kbase/launch_security_sev.html
02 Use virt-manager (Virtual Machine Manager) to manage CVMs
- Create a VM with virt-manager with OVMF as its UEFI firmware.
- Duplicate a xml configuration file as the template for creating a CVM.
- Modify the
nameanduid. - Modify the nvram file
nvram, disksourceand MAC addressmac address. - Append a
launchSecurityproperty to the xml file of the CVM.
<memoryBacking>
<locked/>
</memoryBacking>
<launchSecurity type='sev'>
<cbitpos>47</cbitpos>
<reducedPhysBits>1</reducedPhysBits>
<policy>0x0005</policy>
</launchSecurity>- Boot the CVM as the Host to deploy the model and the monitor.
- Create a project with a virtual environment (Commands might slightly differ on Windows).
$ cd model-deploy
$ python3 -m venv venv- Activate it
$ . venv/bin/activateor on Windows
venv\\Scripts\\activate- Install Flask and PyTorch
$ pip install Flask
$ pip install torch torchvision- Install gunicorn
pip install gunicorn- Run the models
gunicorn -b 127.0.0.1:5000 local_keras:app-
Replace the files in
SFAIR/assessor/input, but must have the subfolder namedmenandwomen. For fairness, useblackmen,blackwomen,whitemen,whitewomen. -
Then run
ground_truth.pyto get the ground truth file; the results are saved inground_truth.json.
- Run
register.pyto register the remote model. The results are saved inmodel.json.
python register.py <path_to_the_model>- Run
monitor.pyinSFAIR/monitor. This should not output anything before runningassessor.py.
python monitor.py-
Boot another CVM to run the assessor that assesses the property of the model.
-
Run
assessor.pyto get the assessment results.
python assessor.py