High Assurance Modeling and Rapid Engineering (HAMR) for Embedded Systems
Total Page:16
File Type:pdf, Size:1020Kb
High Assurance Modeling and Rapid Engineering (HAMR) for Embedded Systems AADL Tool Expo – October 28, 2019 John Hatcliff Robby Jason Belt, University Distinguished Professor Professor Hariharan Thiagarajan Lucas-Rathbone Professor of Kansas State University Engineering Research Associates Kansas State University Kansas State University In collaboration with AdventiuM Labs, SEI, and Collins Aerospace This Material is based on research sponsored by the Department of HoMeland Security (DHS) Science and Technology Directorate, Homeland Security Advanced Research Projects Agency (HSARPA), Cyber Security Division (DHS S&T/HSARPA/CDS) BAA HSHQDC- 14-R-B0005, the GovernMent of Israel and the National Cyber Bu- reau in the GovernMent of Israel via contract nuMber D16PC00057, as well as the US National Science Foundation FDA Scholar-in-Residence PrograM. DARPA CASE Approach DARPA CASE provides tools to develop cyber-resiliency requirements, refactor/transform system architectures, and generate code/builds of Modified systeMs that achieve cyber-resiliency n Capture requirements for cyber-resiliency n Analyze design n Transform design TransforM Control non-interference by allocating coMponents to Architecture different partitions in n Verify new microkernel design against requirements n Build / Deploy On DARPA CASE, KSU is partnered with AdventiuM Labs, Collins Aerospace, Data61 (SeL4 verified Microkernel) Wrap legacy untrusted Insert attestation Managers coMponent in a VM in to ensure data is coMing micro-kernel partition AADL Tool Expo - Oct 2019 froM a trusted source. 2 Deeply Integrate Models and Programming Across Multiple Levels of Abstraction SysteM Modeling and Analysis (AADL) Code Generation -- Slang + AADL Run-TiMe Reference IMpleMentation AADL OSATE Source Code, SiMulation, Analysis, Verification Analyses - InforMation Flow - Functional Integration Constraints (coMponent contracts - Scheduleability - … Semantic Consistency Deployment on Embedded/Distributed PlatforMs Micro-kernels & OS Slang – Subset of Scala for critical systems • SeL4 • Minex 3 (enhanced) • Xen • Linux • FreeRTOS Code Generation, e.g., • C + Platform Run-TiMe SysteM (priMitives for Analysis and verification results Moved up and down abstraction layers controlling coMMunication between partitions in a partitioning architecture) Partitioned Architectures • C coMpatible with CoMpCERT verified coMpiler AADL Tool Expo - Oct 2019 3 Example Domains Medical Devices (US Dept of HoMeland Security) n Targetting developMent and Code deployed using verification of eMbedded Genode OS fraMework using Xen systems Hypervisor and SeL4 microkernel n EMphasizing platforM development on using separation kernel and Building Controls (US Dept of HoMeland Security) hypervisor technology Code deployed using n Introduce rigorous use of enhanced Minix 3 micro-kernel Modeling and abstractions Containment labs for critical agriculture without significant disruption experiMents of workflows UxAS – UnManned (AFRL, DARPA) NASA/JPL Code deployed on machine-verified micro-kernel SEL4 UnManned SysteMs AutonoMy Services AADL Tool Expo - Oct 2019 4 AADL Computational Model Developer configures coMputational AADL Thread AADL Port & Connection model Property Options Property Options Periodic Event Sporadic Data Hybrid TeMporal … Separation … Selected thread Implied API Selected pattern Pattern for coMMunication pattern application code to access AADL Run-TiMe Services AADL Tool Expo - Oct 2019 5 HAMR Code Generation Code gen for Application APIs Code gen for Code gen for Component & Communication Threading Infrastructure Infrastructure Application Code System Development Build Application Application Auto-Generated Auto-Generated Application Code Code Run-TiMe Run-TiMe Code Communication Communication Infrastructure Infrastructure Auto-generated Code for PlatforM Auto-generated Code for PlatforM Auto-generated Component Infrastructure Component Infrastructure Code for PlatforM Code for PlatforM Component Infrastructure Code for PlatforM PlatforM configuration information AADL Tool Expo - Oct 2019 6 HAMR Code Generation Use Case: Example HAMR instantiation for C-based development on SeL4 microKernel (e.g., DARPA CASE) - PlatforM independent C code generation for AADL RT APIs Code generation pathways for SeL4 SeL4 Application code in Interpartition C -- PlatforM- Communication independent in C because it only talks Component Infrastucture to AADL RT APIs in C, talking to SeL4 coMMunication mechanisms The “platforM independent” story above applies to application logic, not hardware based I/O e.g., for AADL Tool Expo - Oct 2019 sensors, actuators. 7 HAMR Code Generation Use Case: Example HAMR instantiation for C-based development on Linux (e.g., DARPA CASE) - PlatforM independent C code generation for AADL RT APIs Code generation pathways for Linux Linux inter- Application code in process C -- PlatforM- coMMunication independent in C because it only talks Component Infrastucture to AADL RT APIs in C, talking to Linux inter-proocess coMMunication The “platforM independent” story above applies to application logic, not hardware based I/O e.g., for AADL Tool Expo - Oct 2019 sensors, actuators. 8 HAMR Code Generation Use Case: High-Assurance DevelopMent in Slang, with a C-based deployMent SysteM Modeling and Analysis …in AADL AADL to Slang Code Generation Source Code, SiMulation, Analysis, Verification …in Slang – a safety- critical subset of Scala Slang to C Code Generation Deployment on Embedded/Distributed PlatforMs …ie.g., in C with platforM infrastructure AADL Tool Expo - Oct 2019 9 HAMR Run-time Reference Implementation The Slang-based infrastructure of AADL run-tiMe provides a reference implementation SysteM Modeling and Analysis …in AADL Reference Implementation for AADL CoMputational Model in Slang n HAMR AADL reference iMpleMentation is analogous to an abstract machine for analyzeable real-time embedded computation n Because Slang (subset of Scala) is a JVM-based language it is easy to integrate with Java resources to obtain a simulation, visualization, and run-time verification environment for AADL-derived applications n Sensor, actuator, UI eleMents not a part of core application logic can be Mocked up in Java or Scala AADL Tool Expo - Oct 2019 10 High Assurance High-Level Development in Slang (subset of Scala) In addition to supporting C developMent, we also support “higher- level” developMent in Slang (subset of Scala) which supports integration with Java n Slang -- A verifiable subset of a Modern programMing language — Scala n imperative OO & FP: generics, pattern matching, higher-order functions, etc. n benefits: existing Java ecosystems and talent pools, available (custoMizable) industrial tool support, including coMpiler toolchain & IDEs n … yet able to generate code suitable for safety/security-critical eMbedded systeMs n (Currently) supports two memory models: n SPARK/Ada-like (static memory allocation): targeted for embedded systems n Swift-like (DAG, immutable sharing, automatic reference counting): targeted for large-application development n including for developing SireuM/Slang itself! AADL Tool Expo - Oct 2019 11 Slang-to-C Translations n C Standard: C99, Compilers: CoMpCert (proven correct C coMpiler), clang, gcc n OS/platforms: MacOS, Linux, Windows, and others (opportunity-based) n Memory models: static alloc. (done); ref-counting & full tracing-GC (future) n Platform BacKends n Conventional C applications running on Linux, Windows, MacOS n SeL4 (part of Rockwell Collins, AdventiuM, Data61 team on DARPA CASE) n ExperiMental translations for… n Genode operating system framework n Minix 3 enhanced for separation (DHS CPSSec project) n FreeRTOS AADL Tool Expo - Oct 2019 12 Abstraction Levels – AADL State Machines The siMulation has a dynaMic visualization of the BLESS/BA state machines of each AADL thread AADL State Machine Specifications Simulation CoMpilation to, e.g., C ArMy SBIR ”GUMBO” AdventiuM/KSU AADL Tool Expo - Oct 2019 13 Component Implementations in Slang handle …Slang can be used to iMpleMent coMponent business logic (corresponding to event handlers for incoMing interface events) AADL Tool Expo - Oct 2019 14 Component Implementations in Slang …Slang iMpleMentations include calls to publish events on output ports and get/set values of data Get Send ports Reading a value froM the currentTeMp data port (behind the scenes mapped to generic AADL RT service GetValue) Sending an event (with ‘cmd’ payload) out the fanCmd port (behind the scenes mapped to generic AADL RT service PutValue) AADL Tool Expo - Oct 2019 15 SEI ISSE HAMRFY’19 Run-time Monitoring & Visualization The HAMR Debugging infrastructure provides hooks for registering call-bacK methods that get invoked where there is an action on an output port or input port, or when the value of a application component local variable changes. SysteM Modeling and Analysis …in AADL Tapping into the Slang Reference Implementation for execution events and state changes to drive run-time Input port Output State monitoring action port action Change StreaM Processing Libraries Visualizations & Run-tiMe monitoring for Call-back Methods teMporal property for events of interests satisfaction Inspector/Injector FraMework AADL Tool Expo - Oct 2019 Event Stream 16 Example Event Stream Filtering StreaM Processing Libraries Input Output State port port Change action action https://akka.io Call-back Methods I’d like to visualize events on for events of interests the teMp sensor fault mitigation path Inspector/Injector FraMework Event