Code Monkey home page Code Monkey logo

paccor's People

Contributors

iadgovadmin avatar iadgovuser1 avatar iadgovuser29 avatar thomasgruebl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

paccor's Issues

update description of signer's -e option in the user guide for v1.1

v1.1 introduces delta certificates. paccor can generate both base and delta certificates.

Base certificates require an EK certificate referenced in their holder attribute. Delta certificates require a platform certificate to be referenced as their holder. The user guide wasn't updated to describe this enhancement to the command line argument.

Update the EKC gathering script to handle extra data in NVRAM index

Problem:

get_ek.sh gathers the EK certificate with the assumption that the NVRAM index contains only the certificate. We recently encountered a case where the index contained pad bytes after the certificate. Querying the size of the NVRAM index area showed the EC was 1600 bytes. The EC itself was only 1169 bytes. An attempt to give the 1600 byte file as the EC to the paccor signer resulted in Bouncycastle returning an IOException due to the extra data in the stream.

The fix:

get_ek.sh can detect the ASN1 length sequence in the data returned from NVRAM. The script can then truncate anything after the specific number of bytes from the data.

NVMe SSDs

On Linux, lshw does not list NVMe SSDs in the same way as other disks. paccor will need to be updated to gather details on those components.

On Windows, NVMe disks appear to have an incorrect serial number. The serial number reported by Windows is actually the eui, with some special formatting, recorded in the EEPROM on the physical component. An NVMe utility can reveal the correct serial number, which is also stored in the EEPROM. The NVMe SSD being loaded with SCSI drivers dated in 2006 might have something to do with the problem.

TPM 1.2 nvread buffer limit

Problem

TPM tools for 1.2 can have the same problem as 2.0 when reading large blocks of data from NVRAM.

Fix

Similar to functionality for TPM 2.0 get_ek.sh must support reading small amounts of data from NVRAM at once.

Add Package Including XXD to Package Dependencies

In the course of setting up Docker for HIRS testing, I've run into an issue wherein the CentOS Docker Image doesn't include xxd by default, and since this makes use of it, it should be added as a dependency when packaging this project. A cursory glimpse as to packages that provide the xxd binary suggests that vim-common is the recommended one. Any other packages that supply it would also be acceptable.

Table lookups

dmidecode in Linux appears to perform an automatic conversion of SMBIOS data if the field has an enumerated list of values. Windows will output the numerical value.

MAC addresses

The OS commands the allcomponents script uses on Linux retrieves the MAC address of a NIC with each octet separated by dashes. On Windows, the separators are colons. Comparison of these values shouldn't depend on separators. Paccor can ensure a standard representation for the MAC address.

Inject into the TPM

Paccor should provide a function to inject a certificate into the TPM NVRAM.

Base Certificate

Ensure requirements are met for the base platform certificate

Component Class value incorrect size

Issue:

The component class value field is an octet string of fixed size: 4 bytes. Currently, while trying to set the component class value of a component identifier, the created octet string will only be as large as the value requires.

Fix:

The component class value field must have a maximum and minimum size of 4 bytes. Fill in with leading zeros.

v1.1 CLI changes

Command line might need to be updated to support the creation of base or delta platform certificates.

Handle case where NVMe nguid is empty

Encountered a case where the nguid field is empty when looking at details for a NVMe component. The eui64 field also contains the data needed for comparison.

smbios.sh trouble handling empty strings in SMBIOS tables

An issue was discovered with the way strings are gathered from the SMBIOS table. Those strings are referenced in order from the body each individual table. My parser does not properly account for the case that an empty string is included in that list of strings.

HIRS System Tests failing.

Prior to PACCOR 1.1.3r3, the components serial number was being populated. Some of the system tests are now failing, since the HIRS ACA is expecting a serial number for the components to keep track of. Looks like we can update the allcomponents.sh script to put in some default serial numbers.

allscripts.sh is centos-specific

Even though PACCOR has a debian distribution, it contains a line in allscripts.sh that reads a file called /etc/centos-release that is not available on debian systems.

Better handling of EK certificate processing errors

Problem:

Paccor does not provide a reasonable message when it cannot read the EC.

The stack trace below shows the error returned for the problem described in Issue #6. The fix proposed in that issue would handle situations similar to the case we saw for that issue. It could still not represent a valid EC.

Fix:

Better errors will help when paccor is not able to process the EC. pc_certgen.sh should not reach the validation step if a platform certificate is not created.

Stack trace:

Generating a signed Platform Credential
Exception in thread "main" org.bouncycastle.openssl.PEMException: problem parsing cert: java.io.IOException: Extra data detected in stream
        at org.bouncycastle.openssl.PEMParser$X509CertificateParser.parseObject(Unknown Source)
        at org.bouncycastle.openssl.PEMParser.readObject(Unknown Source)
        at cli.DeviceObserverCli.handleCommandLine(DeviceObserverCli.java:66)
        at cli.SigningCli.handleCommandLine(SigningCli.java:100)
        at cli.SigningCli.main(SigningCli.java:192)
Caused by: java.io.IOException: Extra data detected in stream
        at org.bouncycastle.asn1.ASN1Primitive.fromByteArray(Unknown Source)
        at org.bouncycastle.cert.CertUtils.parseNonEmptyASN1(Unknown Source)
        at org.bouncycastle.cert.X509CertificateHolder.parseBytes(Unknown Source)
        at org.bouncycastle.cert.X509CertificateHolder.<init>(Unknown Source)
        ... 5 more
Validating the signature
File "/opt/paccor/scripts/pc_testgen/platform_cert.20181005074720.crt" does not exist.
PC Credential Creation Complete.
Platform Credential has been placed in /opt/paccor/scripts/pc_testgen/platform_cert.20181005074720.crt

Platform Configuration attribute

This platform configuration attribute received the many changes in the updated spec.

All fields one level into the attribute are still optional.

Permanent MAC address for NICs

Linux will randomize the MAC address of NICs when they are either disabled or not in use. Hardware verification relies on finding the consistent, permanent, MAC address of the NIC.

get_ek.sh ubuntu support

get_ek.sh specifically calls out yum to determine version of tpm2-tools. The script could be updated to check apt instead. The rest of the script might work the same.

Powershell scripts save json files with extra bytes that break parsing

Powershell can echo data and pipe it to a file just like on Linux. The difference is that pipe function in Powershell will place two bytes at the beginning of the file (0xFFFE). These two bytes have unknown functionality in Windows. They are not valid in a JSON file and break non-Windows JSON parsers.

The component gathering script was updated a while ago to print the component json file without those extra bytes. The policy and extension scripts were not updated at that time. Until it is fixed, pc_certgen.ps1 will produce a non-functional platform certificate because the policy and extension JSON files are not valid.

Empty fields can break paccor's SMBIOS parsing on Windows

OEM changed their SMBIOS value for CPU from
Serial number = "To Be Filled By O.E.M."
to
Serial number = " "

This causes the localhost-componentlist.json file to be corrupt when read in by pc_certgen.ps1.

Potential problem on line 495 of allcomponents.ps1

localhost-componentlist.json and platform_cert.date.crt do not match

While investigating an issue related to the ACA, there as a mismatch for the platform information in the supply chain validator matching test. Upon further investigation I noticed that the localhost-compenentlist.json and the platform_cert associated didn't have the same information for platform. The platform information is missing from the certificate and just has "Not Specified".

However this is on in the emulator and not on the host machine in the same scenario.

Clean TCGObjectIdentifier

The class provides constant references for ASN1 OIDs related to this project.

The constants should make use of ASN1ObjectIdentifier branching to reduce chance of mistyping a number. The same variable names should be maintained.

Verify correct credential type setting when using -o and -e

Received report of a potential bug where the credential type may always be set to "base certificate" when both an observer file and a holder are specified in the command line arguments to the signer program.

Verify/fix behavior as needed.

v1.1 new attributes and extensions

Certificate Type is a new attribute

Targeting Information is a new extension

Holder is an existing attribute but changes based on the Certificate Type

Allow use of pkcs12 keystore for CA cert and key

The paccor signer program accepts the CA cert and the CA private key each in DER or PEM format as separate command line arguments. This requires the private key to be stored unencrypted on the file system.

OpenSSL makes it easy to format the private key into DER/PEM. Most other tools require the private key to be exported into a PKCS12 file- protected by a password. Powershell is one of those other tools.

The issue in front of me is that Powershell only allows the key to be exported into PKCS12. I don't want to expect Windows users will have installed OpenSSL. The signer should also be able to accept a key store instead.

TPM Emulator and dmesg

Problem

get_ek.sh uses dmesg to detect version of TPM. dmesg will contain that information for hardware TPMs. We've noticed that TPM emulator(s) will not make that information available through dmesg.

Fix:

I will need to find another way to detect the version of TPM running. /sys/class/tpm/tpm0/ does have the information available in separate files. The differing file structures for 1.2 and 2.0 has made me think this method would be inconsistent. At this point, it would be more reliable than dmesg.

Rebuild RPMs for v1.1.0r1

The distribution packages for v1.1.0r1 contain Linux script files which were checked out on Windows. Git for Windows will place carriage return and new line characters at the end of every line.

The distribution packages need to be built again and replace the old ones.

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.