How to Secure Your Penetration Testing Environment with Full Disk Encryption
By Red Siege | September 3, 2024
by Douglas Berdeaux, Senior Security Consultant
As penetration testers, ensuring the security and integrity of our tools and data is paramount. One key aspect of this is creating a secure “gold image”—a master copy of an operating system that we use as a base for all assessments. In this blog, I’ll guide you through setting up a fully encrypted Linux environment in a virtualized setting, specifically designed for penetration testing. This process will cover creating a gold image, encrypting the filesystem, and configuring logical volumes. Let’s dive in!
A gold image is a standardized template for deploying virtual machines (VMs). It’s continuously updated with the latest tools, custom scripts, and configurations, ensuring consistency across all testing environments. However, this image is never directly used in assessments. Instead, we create a linked clone from this gold image for each new engagement. This clone acts as a secure, isolated container for client data, ensuring each assessment remains separate and protected.
Encrypting the entire filesystem of our gold image is crucial. Let’s consider a scenario: you’re conducting an on-site assessment, and your laptop gets stolen while you’re momentarily away. Even with a locked host OS, a determined attacker could boot up your VM or mount its virtual disk, potentially accessing sensitive client data. By encrypting the VM’s filesystem, we add a vital layer of security that safeguards data, even if the device falls into the wrong hands.
Encryption also helps maintain compliance with industry standards and regulations. Data breaches resulting from unencrypted storage can lead to significant financial and reputational damage. As penetration testers, we must ensure our practices do not introduce additional risks to our clients.
For this setup, we’ll be using:
sudo access and leave the root password blank to disable root login via SSH./boot using the ext2 filesystem. This partition remains unencrypted to allow the system to boot.pentestvmvg./root, /var, /tmp, /home, and swap. Allocate space according to your needs:
/root: 40 GB for penetration testing tools and environments./var: 10 GB for server logs and other data./tmp: 5 GB for temporary files.swap: 10 GB for swap space, ensuring that it’s also encrypted./home: Use the remaining space.ext4 as the filesystem for each logical volume and set appropriate mount points (/, /var, /tmp, /home, and swap for swap area)./dev/sda.cryptsetup luksChangeKey.By following this guide, you’ve created a secure, fully encrypted gold image tailored for penetration testing. This setup not only protects sensitive data but also ensures compliance with security standards, providing peace of mind for both you and your clients. Remember, security is an ongoing process—always update your tools, review your configurations, and adapt to new threats.
Happy testing!
About Douglas Berdeaux, Senior Security Consultant

Douglas was a manager of a Red Team for a consulting company and has performed penetration testing for clients with high security maturity on internal networks, internal and externally facing web applications, and desktop applications. Douglas was a full-stack enterprise-class web developer for close to a decade building, securing, and testing the security of business-critical web and mobile applications. He has taught cybersecurity as an adjunct professor for Duquesne University and has published multiple books and articles about penetration testing, hardware hacking, and programming.
Certifications:
OSWP, OSCP
Related Stories
View MoreBy Red Siege | November 5, 2026
by Jason Downey This is Dig Dug. A Red Siege tool for avoiding av/edr can offer valuable solutions for penetration testers and red teamers. If you spend any amount of […]
Learn MoreBy Red Siege | October 5, 2026
by Stuart Rorer Most weeks, the tests I run are fairly routine: web applications, externals, and internals with a tight scope. But mobile application assessments have a way of getting […]
Learn MoreBy Red Siege | October 1, 2026
by Mike Saunders The AWS ReadOnlyAccess policy might be providing more access than you’re intending to grant. On a recent assessment, we observed widespread use of IAM roles with the […]
Learn More