All Projects β†’ adrianlshaw β†’ LightVerifier

adrianlshaw / LightVerifier

Licence: GPL-2.0 License
Simple and scalable Linux tools for verifying TPM-based remote attestations πŸ”¬βš–οΈπŸ”β›“πŸ“πŸ“œ

Programming Languages

shell
77523 projects
python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to LightVerifier

meta-secure-core
OpenEmbedded layer for the use cases on secure boot, integrity and encryption
Stars: ✭ 80 (+344.44%)
Mutual labels:  tpm, ima
cnitch
Container Snitch checks running processes under the Docker Engine and alerts if any are found to be running as root
Stars: ✭ 68 (+277.78%)
Mutual labels:  security-audit
vsaudit
VOIP Security Audit Framework
Stars: ✭ 104 (+477.78%)
Mutual labels:  security-audit
clair-cicd
Making CoreOS' Clair easily work in CI/CD pipelines
Stars: ✭ 27 (+50%)
Mutual labels:  security-audit
MailRipV3
SMTP and IMAP checker / cracker for mailpass combolists with a user-friendly GUI, automated inbox test and many more features.
Stars: ✭ 28 (+55.56%)
Mutual labels:  security-audit
kcare-uchecker
A simple tool to detect outdated shared libraries
Stars: ✭ 174 (+866.67%)
Mutual labels:  security-audit
sec-scannode
SECεˆ†εΈƒεΌθ΅„δΊ§ζ‰«ζη³»η»Ÿ
Stars: ✭ 8 (-55.56%)
Mutual labels:  security-audit
ITP-IMA-Code-of-Conduct
The ITP/IMA Code of Conduct is an evolving work-in-progress document that establishes and communicates the commitment of the ITP/IMA community to uphold a key set of standards and obligations that aim to make ITP/IMA an inclusive and welcoming environment.
Stars: ✭ 26 (+44.44%)
Mutual labels:  ima
Detect-CVE-2017-15361-TPM
Detects Windows and Linux systems with enabled Trusted Platform Modules (TPM) vulnerable to CVE-2017-15361. #nsacyber
Stars: ✭ 34 (+88.89%)
Mutual labels:  tpm
tell-me-your-secrets
Find secrets on any machine from over 120 Different Signatures.
Stars: ✭ 31 (+72.22%)
Mutual labels:  security-audit
ehids
A Linux Host-based Intrusion Detection System based on eBPF.
Stars: ✭ 210 (+1066.67%)
Mutual labels:  security-audit
Spydan
A web spider for shodan.io without using the Developer API.
Stars: ✭ 30 (+66.67%)
Mutual labels:  security-audit
Pentesting
Misc. Public Reports of Penetration Testing and Security Audits.
Stars: ✭ 24 (+33.33%)
Mutual labels:  security-audit
docker-wallarm-node
⚑️ Docker official image for Wallarm Node. API security platform agent.
Stars: ✭ 18 (+0%)
Mutual labels:  security-audit
cpan-audit
Check CPAN modules for known security vulnerabilities
Stars: ✭ 27 (+50%)
Mutual labels:  security-audit
phan-taint-check-plugin
Github mirror of "mediawiki/tools/phan/SecurityCheckPlugin" - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing)
Stars: ✭ 21 (+16.67%)
Mutual labels:  security-audit
RockYou2021.txt
RockYou2021.txt is a MASSIVE WORDLIST compiled of various other wordlists. RockYou2021.txt DOES NOT CONTAIN USER:PASS logins!
Stars: ✭ 288 (+1500%)
Mutual labels:  security-audit
CIS-Ubuntu-20.04-Ansible
Ansible Role to Automate CIS v1.1.0 Ubuntu Linux 18.04 LTS, 20.04 LTS Remediation
Stars: ✭ 150 (+733.33%)
Mutual labels:  security-audit
dependency-check-py
πŸ” Shim to easily install OWASP dependency-check-cli into Python projects
Stars: ✭ 44 (+144.44%)
Mutual labels:  security-audit
pentesting-multitool
Different utility scripts for pentesting and hacking.
Stars: ✭ 39 (+116.67%)
Mutual labels:  security-audit

LightVerifier Build Status

LightVerifier is a small set of tools to remotely verify the integrity of Linux systems. In essence, it uses a computer’s Trusted Platform Module (TPM) and some Linux kernel features to track what programs execute, in such a way that the software on the machine cannot lie about what’s running. Through cryptography, a measurement list is signed by the TPM and checked against a database of known good software measurements. This is known as a hardware-based remote attestation. Therefore, unauthorised software modifications or execution can be detected.

This project consists of a client (ra-agent) and server (verifier). Important note: This project currently only works with TPM 1.2, but 2.0 should be easy to incorporate.

$ apt-get install tpm-quote-tools netcat-traditional tpm-tools redis-tools \
		libtspi-dev autoconf make gcc

Once this depedency is installed on both client and server, you can start to install the LightVerifier tools.

## Setting up the verifier database

Choose a trusted and secure server for deploying the verifier. Install the dependencies for Debian:

$ apt-get install redis-server redis-tools debmirror parallel rpm2cpio

The measurementDB currently supports the creation of reference measurements for a few Linux distributions, including:

  • Debian
  • Ubuntu
  • CentOS 7

It would be nice to support a few LTS distributions, including RH-like distributions like CentOS. Pull requests are welcome.

You can then run the builder for the reference database (note: it could take a day to download packages from scratch):

$ cd measurementDB && ./buildStore.sh

CVE reports for Debian are supported by LightVerifier. You can make the CVE updater run frequently (e.g. every hour):

$ cp cve/* /etc/cron.hourly/

Optional: you can replicate an existing measurementDB database to another verifier's Redis instance by performing the following instructions.

In /etc/redis/redis.conf on the main server add the following line to allow replication on all interfaces:

bind 0.0.0.0

In /etc/redis/redis.conf on the new slave add the hostname and port of the master database, e.g.:

slaveof <your_master_ip_or_hostname> 6379

Important note: the database can only be set to one distro at a time. The current default is Debian. To change this to another distro, change the "DISTRO" variable in downloadDeb.sh and rerun the buildstore.sh script.

Installing the remote attestation client

If you haven't already, then enable the TPM in the BIOS of the device and then take ownership using tpm_takeownership. Then proceed to make the Attestation Identity Key (AIK) using the following commands from the included tpm-quote-tools package:

$ tpm_mkuuid aik.uuid
$ tpm_mkaik aik.blob aik.pub
$ tpm_loadkey aik.blob aik.uuid

Make sure the verifier database has been deployed (see README in measurementDB directory) and then run the "register.sh" script on each machine that needs to be registered:

$ ./register.sh <aik.pub> <aik.uuid> <verifier_db_host_ip>

This will connect to the verifier database and record the necessary machine information (DNS hostname, AIK public cert, the corresponding hash, and the boot aggregate digest). Importantly, you must register before installing the IMA policy. Note, that when you run the verify script in the next section, you should use the hostname rather than the IP address.

Finally, we can set up the required integrity measurement policy. The policy checks loaded executable files (programs, shared libraries and executable files). This should typically be written to /etc/ima/ima-policy, but it depends on your platform. The systemd init system should load it automatically if it exists.

measure func=BPRM_CHECK
measure func=FILE_MMAP mask=MAY_EXEC

This example policy is known as a binary attestation policy, but other types of policy are possible to some degree.

Remote Attestation Scripts

  • verify.sh is the requester; its job is to fetch and analyse quotes and logs to attest that a platform is trustworthy. You can run it with:
$ ./verify.sh <hostname> <port>

If successful, it will generate a file called report.log.

  • ra-agent.sh is run on the machine to be monitored; it waits for a request from the verifier and sends both the log and TPM quote. You can run it with:
$ ./ra-agent.sh <aik.pub> <aik.uuid> <port> 10

How does it work

The aim of the project is to use both binary attestation and CVE databases to evaluate trust for a given machine.

There are two parties:

  • The verifier - this machine runs verify.sh and contains the database
  • The attestor - this machine runs ra-agent.sh and logs activity with IMA

First, the verifier should build the database from the measurementDB. This will store the SHA-1 hash of every ELF file in the packages in a Redis database. We are working to add support for newer hash algorithms.

Secondly, the machine to verify should have IMA running and launch ra-agent.sh. This script will then wait for a request from the verifier and a new instance will be created for each request.

When the machine needs to be verified, the verifier sends a nonce/challenge for freshness. The sender will then create a quote (with the nonce used to prevent replay attacks) and sends it along with the IMA log (unencrypted)

The verifier, using the IMA log, will recompute the value of the PCR for each entry, and will check if the quote contains that same value. Once the right line has been reached, the verifier stops and returns that the distant server is the right one (verified by the AIK) and that the log provided is correct up to that line.

We can then use the database to check if the binaries that run on the machine are genuine, and we can also check their potential vulnerabilities with the CVE database.

In the event of the verifier never reaching the line confirming the quote, the requester would deem the machine as untrustworthy, and simply stop the process.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].