Virtual Machine Sandboxes for Secure Multi-Tenant Code Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Cloud-based application servers face challenges in enforcing resource usage limits and ensuring security when executing custom code from multiple tenants, particularly with non-platform-specific languages like Java, which can lead to uneven resource distribution and data access issues across virtual machine sandboxes.

Innovation Solution

Implementing usage checks and instrumentation within the virtual machine to monitor and enforce CPU and heap memory limits, using bytecode rewriting to inject resource usage checks and a security manager to restrict access to sensitive functions, and maintaining a whitelist of allowed classes to ensure fair resource usage and secure multi-tenant operation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If users are allowed to run custom code at the application server, then the robustness of supported applications is improved, but the ability to enforce protections at the application server deteriorates

Engineering Contradiction:
Improverobustness of supported applicationsVSAvoidresource overuse and security risks
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent divides the application server into multiple isolated sandboxes, each running custom code from different tenants in separate secure sub-environments. This segmentation prevents any single custom code execution from affecting the entire server or other tenants, resolving the contradiction by enabling custom code execution while maintaining enforcement capabilities through isolation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a security manager as an intermediary layer between the custom code and the application server resources. This security manager enforces usage checks, monitors resource consumption, and controls access to sensitive functions, allowing custom code to run while preventing resource overuse and maintaining protections.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If custom code is executed without usage checks, then the ease of operation is improved, but the resource distribution fairness deteriorates

Engineering Contradiction:
Improvesimplicity of code executionVSAvoidresource distribution fairness
Core Design Contradiction:
Ease of operationVSProductivity

Solution Approach 1:

The patent implements usage checks that continuously monitor resource consumption by custom code and provide feedback to the security manager. When resource usage thresholds are approached or exceeded, the system can intervene to prevent unfair resource distribution, thus maintaining both ease of operation and resource fairness through automated monitoring and control.

Inventive Principle:
Principle #23Feedback

3Adaptability or versatility

If non-platform-specific languages are supported, then the adaptability is improved, but the security control deteriorates

Engineering Contradiction:
Improvelanguage support flexibilityVSAvoidunauthorized data access
Core Design Contradiction:
Adaptability or versatilityVSObject-affected harmful factors

Solution Approach 1:

The patent applies different security measures to different parts of the system: the security manager enforces specific usage checks and access controls for each sandboxed execution environment. This localized security approach allows diverse language support while maintaining appropriate security controls for each execution context, preventing unauthorized data access even as adaptability increases.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS11263033B2Usage checks for code running within a secure sub-environment of a virtual machine
Publication Date: 2022.03.01 SALESFORCE INC
  • US11263033B2 patent drawing
  • US11263033B2 patent drawing
  • US11263033B2 patent drawing

AI summary

A system may include an application server and one or more tenants served by the application server. The application server may host a virtual machine with multiple isolated sub-environments. Each tenant of the application server may request to run a program in a tenant-specific sub-environment of the virtual machine. The sub-environments may be configured so the execution of one tenant's code does not affect execution of another tenant's code or the hosting virtual machine, for example, by considering the resources used to execute the code. The application server may implement techniques to securely execute “untrusted” code, programmed using one or more different programming languages, in the sub-environments by enforcing resource restrictions and restricting the sub-environments from accessing the host's local file system. In this way, one tenant's code does not negatively impact execution of another tenant's code by using too many resources of the virtual machine.