Git Product home page Git Product logo

vbh's Introduction

Virtualization Based Hardening

Description (POC only)

Virtualization Base Hardening (VBH) utilizes Intel Virtualization Technology to provide an infrastructure for other parties to build security policies (such as introspection engine) on top of it in order to protect hardware (Intel platform only), kernel and native container/user space apps. It is implemented as an out-of tree Linux module and supports Linux version 4.4 or above. It has 2 components:

  1. A slim hypervisor, when installed, turns the host into guest
  2. APIs to query and control the hypervisor. The APIs supports the following functionalities:
    • Query and update general guest info
    • vCPU management
    • Event related: to register event callbacks and to report event
    • Memory/EPT related
    • CR and MSR virtualization related
    • Emulation/Single Step related

For a full list of supported functions, please refer to hypervisor_introspection.h.

File Structure

vbh
+-- README.md
+-- sources
|   +-- cpu_switch_debug.c              /* Debug only */
|   +-- cpu_switch_debug.h              /* Header file for debug */
|   +-- guest_info.c                    /* Query and update guest info */
|   +-- hypervisor_introspection.c      /* API functions implementation */
|   +-- hypervisor_introspection.h      /* API function definition */
|   +-- kernelhardending.c              /* MSR and CR virtualization */
|   +-- Makefile                        /* Make file */
|   +-- offsets.h                       /* Register offset */
|   +-- ptable.c                        /* EPT related */
|   +-- vbh_events.c                    /* Event handling */
|   +-- vbh_rt.c                        /* slim hypervisor runtime: mostly for vmexit and vmentry */
|   +-- vbh_setup.c                     /* slim hypervisor initialization */
|   +-- vmexit.S                        /* Assembly for vmexit */
|   +-- vmx_common.h                    /* Shared header file */
+-- tests
|   +-- kernel_hardening_tests          /* tests related to CR and MSR virtualization */
    |   +-- kernel_hardening_test_module_main.c
    |   +-- Makefile
|   +-- query_guest_info_tests          /* tests related to query guest inof */
    |   +-- query_guest_info_tests_module.c
    |   +-- Makefile
|   +-- set_guest_info_tests            /* tests related to set guest info */
    |   +-- set_guest_info_test_module.c
    |   +-- Makefile
|   +-- shared                          /* Shared files to support test infrastructure */
    |   +-- vbh_test_shared.h
    |   +-- vmcall.S

Use Cases

We developed the following use cases so far and we are looking for adding more use cases.

  1. Help prevent hardware from being damaged by unsafe modification of CR and MSR registers. See kernelhardening.c.
  2. Help Prevent privilege escalation attack against Linux kernel. (source code not published)
  3. Help protect Linux's kernel code against tampering (source code not published)

How to Use

- To get source code
    >> git clone https://github.com/intel/vbh.git

- To compile
    >> cd vbh/sources
    >> make

- To clean
    >> make clean

- To install    
    >> sudo insmod vmx-switch.ko switch_vmx_on_load=1

- To uninstall
    >> sudo rmmod vmx_switch

- To use APIs
Please refer to the files under test directory for sample usage of every api function.

How to Contribute

New Use Cases

If you use this project to help your own research or develop your own use cases, we would love to hear your feedback. Or if you have ideas of new use cases and need help, we can help you develop them. Please contact maintainers of the project.

Bugs or New Features

Feel free to contact project's maintaniers to learn next new features to be developed. We also welcome pull request with bug fixes or new feature implementations. Please provide detailed documentation describing proposed changes when sending pull request.

Any Questions or Suggestions

Feel free to contact project's maintainers.

Maintainers

vbh's People

Contributors

bbosinta avatar crisanandreiliviu avatar rliu88 avatar sainath14 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.