Applications running in Trusted Execution Environments (TEEs) commonly use untrusted external services such as host File System. Adversaries may maliciously alter the normal service behavior to trigger subtle application bugs that would have never occurred under correct service operation, causing data leaks and integrity violations. Unfortunately, existing manual protections are incomplete and ad-hoc, whereas formally-verified ones require special expertise. We introduce GateKeeper, a framework to develop mitigations and vulnerability checkers for such attacks by leveraging lightweight formal models of untrusted services. With the attack seen as a violation of a services' functional correctness, GateKeeper takes a novel approach to develop a comprehensive model of a service without requiring formal methods expertise. We harness available testing suites routinely used in service development to tighten the model to known correct service implementation. GateKeeper uses the resulting model to automatically generate (1) a correct-by-construction runtime service validator in C that is linked with a trusted application and guards each service invocation to conform to the model; and (2) a targeted model-driven vulnerability checker for analyzing black-box applications. We evaluate GateKeeper on Intel SGX enclaves. We develop comprehensive models of a POSIX file system and OS synchronization primitives while using thousands of existing test suites to tighten their models to the actual Linux implementations. We generate the validator and integrate it with Graphene-SGX, and successfully protect unmodified Memcached and SQLite with negligible overheads. The generated vulnerability checker detects novel vulnerabilities in the Graphene-SGX protection layer and production applications.
翻译:在信任执行环境中运行的应用程序通常使用不可信的外部服务,如主机文件系统。 逆差可能会恶意地改变正常服务行为,以触发在正确服务操作下从未发生过的微妙应用错误,造成数据泄漏和完整性侵犯。 不幸的是,现有的人工保护不完整和临时性,而正式核查需要特殊的专门知识。 我们引入了“ 守门员”这一框架, 以利用轻量正规的不受信任服务正规模式开发此类袭击的缓解和脆弱性检查器。 由于袭击被视为违反服务功能正确性, 守门员采取了一种新颖的方法, 开发一种服务的全面模式, 不需要正规方法的专门知识。 我们利用在服务开发中常用的测试套套件来收紧模型, 以正确执行服务。 守门员使用由此生成的模型自动生成(1) 校正运行时间服务验证器, 与可信赖的应用程序连接, 保护每个服务都符合模型; 以及 用于分析黑箱应用程序的有针对性的模型驱动脆弱性检查器。 我们使用智能操作器进行实际的硬质操作器检查, 同时使用硬质操作系统进行硬质SGIS系统, 和硬质SGIS系统进行升级的升级的升级的升级操作。