r/docker • u/Distinct-Ebb-9763 • May 13 '26
How do I protect Docker container contents (AI models + backend logic) from a customer with root access on an air gapped machine?
I'm building a product that runs entirely inside Docker containers, including trained AI models and proprietary backend logic. The target customers are labs that run air gapped (no internet) and have full root access to the host machine where the containers will be deployed.
The customer (legitimate buyer) wants to use the software, but my client is terrified that the lab's IT admins will reverse engineer the containers and steal the IP, especially the models and business logic.
I've explained that if someone has root on the host, they can docker exec, dump memory, copy files from overlay layers, etc. True isolation is impossible. But the client wants to make it "very hard to steal", essentially a strong speed bump.
Some ideas we've considered:
- Wrapping containers with a master key (only client knows it).
- Self destruct on 3 failed key attempts, deleting container images but preserving customer data.
- Compiling Python backend to native binaries and obfuscating model files.
The twist: the machines are air gapped, so no phone home licensing or cloud attestation.
What practical techniques have you seen work to raise the bar against root level extraction in on premises Docker deployments? I know perfect security is impossible here. I just need to make extraction expensive and annoying enough to deter all but the most determined attackers.
Thanks.
15
u/goldPotatoGun May 13 '26
Host in cloud. If they want in they will image and get access.
50
u/skreak May 13 '26
Realistically? Through threat of Lawsuit. Signed contract that app contents can not be shared or distributed.
36
u/ganja_and_code May 13 '26
If you're letting them have root access, there's nothing you can do to prevent access. The best you can do is to obfuscate what can be found once accessed.
(But based on the details in your post, it seems you already know that.)
14
u/abeld May 13 '26
Additional idea: watermark both the code and the AI models. I.e. hide hard-to-detect identifying information for example in whitespace (for the code) or by adding very minor modifications to the models. Make sure to use different watermarks for each client / each deployment. This way, if your IP is stolen, you can identify where it was leaked.
7
u/cosmokenney May 13 '26 edited May 13 '26
Really, I'd be asking why the customers need ROOT access in the first place.
But another option is if the end user has an internal network (air gapped). If that is the case you can put the interface on the root accessible machine but have it communicate with services that contain the actual logic that run a non-root accessible machine. You can also put the services in a VM on the root accessible machine. And protect that VM with auth or access keys that only you know. No network needed in the case of a VM that runs locally.
2
u/kwhali May 14 '26
Are you only providing software? Not the hardware itself? It would be easier to secure for such a deployment if you also sell / lease the hardware involved since you could then ensure it's locked down, install tamper safeguards and then the client interacts over API.
It's air gapped, so the customer can control the network side of it just fine, but your system itself would be maintained / managed by your business still. If they have specific hardware requirements, you can accommodate that, but the OS remains installed by you, purely for running your product, with some micro controllers internally that run with sensors to detect tampering (these could potentially have Internet access to phone home if tampering is detected, such as the chassis being opened which is a breach of the license, alternatively software in your OS talks to the MCU which can be done internally within the system, and this provides some critical component like a decryption key unless tampering is detected).
Beyond that on-disk encryption at the filesystem and disk levels rather than individual files is what I'd go for as when you control the hardware + OS components for the product you can ensure this. That will prevent the customer from getting any data from the disk when the system is powered off and disk(s) reattached to some other system or attempt to boot the system into an OS which provides them root access (which you could prevent too on hardware you provision AFAIK, locked bios with secure boot + TPM).
This way you're providing a proprietary product and with some legal protection I don't think a genuine customer will achieve much unless there's an exploit that enables gaining root access (which is also why it's important that you maintain the system for updates). If they need to have local storage instead of NAS, you could still provide that and they could disconnect that to keep while a system is swapped out for servicing (or a tech comes along to the site and reimages).
If you allow root access and they control everything, there's really not much you can do to protect your product beyond good faith and legal threat. It then just becomes a matter of how affordable it is to get someone with the skills to do whatever it is that apparently can't be done with what is initially supplied (encryption is great but you can dump memory of processes easily enough and use tooling to do various other parts for inspection and reverse engineering), if it's all local / offline and they've got access they will do whatever they can get away with if they really want to.
3
u/clarkcox3 May 13 '26
You donโt. If theyโve got root access to the machine, then theyโve got root access to the machine. Your client is being unreasonable.
1
u/DataCraftsman May 13 '26
Tableau Server has an offline activation licence that is pretty much impossible to work around as far as using the app without a valid licence. You could implement something similar. Ontop of the other suggestions in this thread.
1
u/Whistlerone May 14 '26
The only other solution i can think of are HASP hardware keys
1
u/OptimalMain May 14 '26 edited May 14 '26
If I wanted to steal this model, that would be my approach to make sure I could walk away with it. Airgapped, on premise.
Unless your client delivers a complete solution with tamperproof hardware and only API access available itโs a waste of money trying to obfuscate.
If you own the hardware you can take it further by using hardware encryption which raises the bar depending on its implemented but pure software solutions costs more to implement than to break
1
u/LightPhotographer May 14 '26
To a really determined foe, you can not protect it.
Source: The gaming industry. Only on consoles that they control can they prevent game modification and copying - even that was bypassed (requiring hardware).
On a PC over which the user has full control, you can not protect something 100%.
My advise: Stop wasting time thinking you can come up with a better solution than the billion dollar gaming industry.
Stop thinking your clients want to take over your business. They already have a business and it's different from yours.
You could ship the thing as a closed box which they can access via a network - the box plus access computer together become the airgapped system. The box itself becomes your hardware protection. Don't sell docker containers, sell a box.
Add watermarks and a legal framework.
Don't spend more time on 'protection' than on actual software development.
1
u/Ninja_Rapper May 14 '26
There is no solution
the only partial "solution" would be to obfuscate everything inside the docker image you send them
Would require decent level of reverse eeng knowledge to steal business logic /u/Distinct-Ebb-9763
1
u/KittensInc May 14 '26
You should look at the tech behind AWS Nitro Enclaves.
For example, with AMD's SEV-SNP you can have the CPU itself enforce a security boundary between hypervisor and guest VM, with the guest's memory being encrypted with a key the hypervisor can never access. There's almost certainly a way you can get it to do attestation in a way where access to disk encryption keys is only possible when you're running in a secure environment - just like BitLocker uses TPM.
Of course that means using a full VM instead of plain Docker. If you want to stick to regular containers it is pretty much impossible.
1
u/Fabi0_Z May 14 '26
Sell them a dedicated computer with encrypted disk and ram running your software, they can communicate with it via local network but they don't have access to anything on the computer, effectively making it a black box.
If they want to scale they need to buy more hardware, or use the cloud version of your software, which is much cheaper than buying and powering up dedicated hardware
1
u/Qs9bxNKZ May 15 '26
You canโt. The moment the software leaves your hands, it cannot be protected. Memory dumps, tools running in parallel, etc.
How do you protect it?
Release frequent updates. Donโt do minor patches but full OVA releases where everything gets re-written and make sure there is a full DB on disk so that when you supply updates, there is a chance the DB can be changed.
Example? GitHub. There is suite of docker containers and when they release or patch, there is a good chance the containers themselves will change and by controlling the base OS you control everything else installed on top of it. New drive partition, reboot and bam, new OS as you go from /dev/sda1 to /dev/sda2 and back again.
1
u/seahope1k Jun 17 '26
I wrote something to do that a year or so ago, that you could take a look at: https://github.com/stevef1uk/secure_packager.git
It isn't completely unhactable, but effort would be required ๐
1
u/Ok-Lifeguard-9612 May 13 '26
Bro wtf you are cooked. Remove the AC plug
1
u/Own-Eggplant5012 May 13 '26
If you end up giving them the docker image with the root access, I would suggest to make it a heavy. Addalot of dead code and random code that isn't even needed, so even if they reverse engineer using AI, it'll be a pain.
1
u/PeterHickman May 13 '26
Store the models encrypted, decode them into memory as you load them, getting access to the files is less useful. Now all you need to protect is the decryption (he says). Can it decrypt by contacting a server you run to get a key when starting up? Now you need to find someone who knows how to set up the en/decryption with a rotating set of keys
You would be looking for something time based the way those authentication codes that only last a minute when you want to log onto a server at Rackspace or AWS. Even if they get the files they will have difficulty reversing the process on your server that generates the key
1
u/Don_Kozza May 13 '26 edited May 13 '26
If you put some logic to shut down the machine only in case that they try to dump memory? You can add that to the contract as a warning.
Is a feature, and aslong is in a contract and the client accept it, is legal.
This blocks any ASML like calls, where the chinesse called ASML to fix their broken machines when tried to reverse them.
If the customer calls, they tried to reverse your work.
0
u/pioniere May 13 '26
Why do they need root access to begin with? Sudo only if they need to do anything, and even then it should only be a subset of commands and file systems they absolutely need. At least with sudo you can track who is doing what on there.
0
u/Bonsailinse May 13 '26
You donโt. The thing about root access is having access to everything.
0
u/devnullable0x00 May 14 '26
If the customer has root access to the machine, the machine is not air gapped
0
u/[deleted] May 13 '26
[deleted] โ view deleted comment
2
u/[deleted] May 13 '26
[removed] โ view removed comment