Ubiquitous computing is revolutionizing the way applications, users, resources, and physical spaces interact. Securing cyber infrastructures for ubiquitous computing environments, such as smart buildings and campuses, can be challenging. A critical cyber infrastructure is necessary that can combine networks, processors, and devices with mechanisms, protocols, and services to offer reliable, fault-tolerant, available, and secure operations. Existing CCI implementations create statically configured, confined networked subsystems that are isolated from the public Internet and are context insensitive. This leads to multiple, incompatible subsystems incapable of interoperating, thus making operations, management, and trust difficult. The Heterogeneous Survivable Trusted Information-Assurance Architecture addresses the problem of securing critical information services in large-scale ubiquitous computing environments. Hestia is a programmable middleware solution implemented as a network of middleboxes. These middleboxes form protective layers that isolate CCI services and mediate authorized access to Hestias services. They also provide a programmable, distributed, object-oriented framework that enables the integration of security, privacy, and reliability mechanisms in service-access interfaces and implementations.