Giter VIP home page Giter VIP logo

in-toto's Introduction

in-toto Build CII Best Practices Documentation Status

in-toto provides a framework to protect the integrity of the software supply chain. It does so by verifying that each task in the chain is carried out as planned, by authorized personnel only, and that the product is not tampered with in transit.

in-toto requires a project owner to create a layout. A layout lists the sequence of steps of the software supply chain, and the functionaries authorized to perform these steps. When a functionary performs a step in-toto gathers information about the used command and the related files and stores it in a link metadata file. As a consequence link files provide the required evidence to establish a continuous chain that can be validated against the steps defined in the layout.

The layout, signed by the project owners, together with the links, signed by the designated functionaries, are released as part of the final product, and can be validated manually or via automated tooling in, e.g. a package manager.

Getting Started

Installation

in-toto is available on PyPI and can be installed via pip. See in-toto.readthedocs.io to learn about system dependencies and installation alternatives and recommendations.

pip install in-toto

Create layout, run supply chain steps and verify final product

Layout

The in-toto software supply chain layout consists of the following parts:

  • expiration date
  • readme (an optional description of the supply chain)
  • functionary keys (public keys, used to verify link metadata signatures)
  • signatures (one or more layout signatures created with the project owner key(s))
  • software supply chain steps correspond to steps carried out by a functionary as part of the software supply chain. The steps defined in the layout list the functionaries who are authorized to carry out the step (by key id). Steps require a unique name to associate them (upon verification) with link metadata that is created when a functionary carries out the step using the in-toto tools. Additionally, steps must have material and product rules which define the files a step is supposed to operate on. Material and product rules are described in the section below.
  • inspections define commands to be run during the verification process and can also list material and product rules.

Take a look at the demo layout creation example for further information on how to create an in-toto layout.

Artifact Rules

A software supply chain usually operates on a set of files, such as source code, executables, packages, or the like. in-toto calls these files artifacts. A material is an artifact that will be used when a step or inspection is carried out. Likewise, a product is an artifact that results from carrying out a step.

The in-toto layout provides a simple rule language to authorize or enforce the artifacts of a step and to chain them together. This adds the following guarantees for any given step or inspection:

  • Only artifacts authorized by the project owner are created, modified or deleted,
  • each defined creation, modification or deletion is enforced, and also
  • restricted to the scope of its definition, which chains subsequent steps and inspections together.

Note that it is up to you to properly secure your supply chain, by authorizing, enforcing and chaining materials and products using any and usually multiple of the following rules:

  • CREATE <pattern>
  • DELETE <pattern>
  • MODIFY <pattern>
  • ALLOW <pattern>
  • DISALLOW <pattern>
  • REQUIRE <file>
  • MATCH <pattern> [IN <source-path-prefix>] WITH (MATERIALS|PRODUCTS) [IN <destination-path-prefix>] FROM <step>

Rule arguments specified as <pattern> allow for Unix shell-style wildcards as implemented by Python's fnmatch.

in-toto's Artifact Rules, by default, allow artifacts to exist if they are not explicitly disallowed. As such, a DISALLOW * invocation is recommended as the final rule for most step definitions. To learn more about the different rule types, their guarantees and how they are applied, take a look at the Artifact Rules section of the in-toto specification.

Carrying out software supply chain steps

in-toto-run

in-toto-run is used to execute a step in the software supply chain. This can be anything relevant to the project such as tagging a release with git, running a test, or building a binary. The relevant step name and command are passed as arguments, along with materials, which are files required for that step's command to execute, and products which are files expected as a result of the execution of that command. These, and other relevant details pertaining to the step are stored in a link file, which is signed using the functionary's key.

If materials are not passed to the command, the link file generated just doesn't record them. Similarly, if the execution of a command via in-toto-run doesn't result in any products, they're not recorded in the link file. Any files that are modified or used in any way during the execution of the command are not recorded in the link file unless explicitly passed as artifacts. Conversely, any materials or products passed to the command are recorded in the link file even if they're not part of the execution of the command.

See this simple usage example from the demo application for more details. For a detailed list of all the command line arguments, run in-toto-run --help or look at the online documentation.

in-toto-record

in-toto-record works similar to in-toto-run but can be used for multi-part software supply chain steps, i.e. steps that are not carried out by a single command. Use in-toto-record start ... to create a preliminary link file that only records the materials, then run the commands of that step or edit files manually and finally use in-toto-record stop ... to record the products and generate the actual link metadata file. For a detailed list of all command line arguments and their usage, run in-toto-record start --help or in-toto-record stop --help, or look at the online documentation.

Release final product

In order to verify the final product with in-toto, the verifier must have access to the layout, the *.link files, and the project owner's public key(s).

Verification

Use in-toto-verify on the final product to verify that

  • the layout was signed with the project owner's private key(s),
  • has not expired,
  • each step was performed and signed by the authorized functionary,
  • the functionaries used the commands, they were supposed to use,
  • materials and products of each step were in place as defined by the rules, and
  • run the defined inspections

For a detailed list of all command line arguments and their usage, run in-toto-verify --help or look at the online documentation.

Signatures

in-toto-sign is a metadata signature helper tool to add, replace, and verify signatures within in-toto Link or Layout metadata, with options to:

  • replace (default) or add signature(s), with layout metadata able to be signed by multiple keys at once while link metadata can only be signed by one key at a time
  • write signed metadata to a specified path (if no output path is specified, layout metadata is written to the path of the input file while link metadata is written to <name>.<keyid prefix>.link)
  • verify signatures

This tool serves well to re-sign test and demo data. For example, it can be used if metadata formats or signing routines change.

For a detailed list of all command line arguments and their usage, run in-toto-sign --help or look at the online documentation.

in-toto demo

You can try in-toto by running the demo application. The demo basically outlines three users viz., Alice (project owner), Bob (functionary) and Carl (functionary) and how in-toto helps to specify a project layout and verify that the layout has been followed in a correct manner.

Specification

You can read more about how in-toto works by taking a look at the specification.

Security Issues and Bugs

See SECURITY.md.

Governance and Contributing

For information about in-toto's governance and contributing guidelines, see GOVERNANCE.md and CONTRIBUTING.md.

Acknowledgments

This project is managed by Prof. Santiago Torres-Arias at Purdue University. It is worked on by many folks in academia and industry, including members of the Secure Systems Lab at NYU and the NJIT Cybersecurity Research Center.

This research was supported by the Defense Advanced Research Projects Agency (DARPA), the Air Force Research Laboratory (AFRL), and the US National Science Foundation (NSF). Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of DARPA, AFRL, and NSF. The United States Government is authorized to reproduce and distribute reprints notwithstanding any copyright notice herein.

in-toto's People

Contributors

adityasaky avatar alexsmith15 avatar awwad avatar benwunyc avatar darikshaansari avatar dependabot-preview[bot] avatar dependabot[bot] avatar didier-durand avatar inglor avatar isachit avatar joshuagl avatar justincappos avatar kristelfung avatar lukpueh avatar michizhou avatar minchinweb avatar naveensrinivasan avatar ofek avatar pradyumnakrishna avatar reza-curtmola avatar rohanbhirangi avatar rubyliu206 avatar santiagotorres avatar shekhar-chauhan avatar shikherverma avatar skinny-b avatar solidifiedray avatar spencerklem avatar trishankatdatadog avatar vladimir-v-diaz 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  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  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

in-toto's Issues

Revisit verbosity (stdout/stderr)

In #6 we discussed and fixed many initial user feedback issues.
In the course of a layout tool user testing session, it was noted that when looking at stdout/stderr of the used tool (in-toto-mock) it was unclear if the command was executed properly or not.

Here are some general user feedback related items open for discussion and fixing:

  • Make better use of verbosity levels
  • Reduce the output if -v flag is not specified
  • Make clear if a command failed or not
  • Colorize output
  • Do something about subprocess32 warning (seems to confuse users)

Metadata pretty print

Layout metadata and link metadata is stored in canonical json format. It would be nice to have a way of showing metadata in a logically structured and human friendly way as well.

  • order fields logically instead of alphabetically
  • strip keys and signatures

Add `in-toto-mock` command line utility

in-toto steps are usually executed using the in-toto-run command line utility, whose functionality is implemented in the according library function runlib.in_toto_run.

Since this command requires a signing key and a bunch of command line arguments, it would be helpful to have a stripped down variant of that command that can be used to easily mock in-toto-run's metadata generation aspect, without the need to specify a key and knowing all the command line arguments.

This is particularly interesting for in-toto's layout tool, where we ask un-experienced in-toto users to (mock) run their supply chain, so that we can create a layout using the (mock) link metadata.

Here is an example usage of the envisioned command:

in-toto-mock -n <step name> -- <step command>

The resulting link metadata <step name>.link-mock is not signed and records materials and products at the current working directory where the command is executed.

I think in-toto-run's --verbose and --record-byproducts flags should be on by default.

UPDATE:
As mentioned above in-toto-mock most likely will be used to reverse generate in-toto layouts with an initial set of custom artifact rules. Therefor it might be helpful to store the full path of the current working directory in resulting mock link files.
I think for now we should only store it when running in-toto-mock but make it so that we can easily opt in later to also store it when using in-toto-run.

User input, output, exceptions and return values

Meaningful exceptions are preferred over zero vs. non-zero return values in verifylib and runlib (this is the pythonic way).
The command line tools toto-run and toto-verify on the other hand could catch those exceptions, print meaningful output to stderr and return zero or non-zero values.

Step and Inspection generalization

Steps and Inspection are both items of the software supply supply chain defined in the layout.
Steps are performed by functionaries and correspond to one or more link metadata files, whereas Inspections are performed during toto-verification, which also produces link metadata.
Both item's link metadata is verified against the defined matchrules in a similar fashion. This bears potential for generalization.

I'm inclined to call the generic type Item or LayoutItem. Any suggestions would be appreciated.

Note:
@JustinCappos requested a name change fortoto-run's --name flag which sets the name field of a link metadata file and has to correspond to a Step or Inspection name defined in the Layout. He suggested --step or --step-name. I'd like to keep it abstract for Steps and Inspection, e.g. --item-name.

Provide easy installation and workflow instructions

People will want to use and try toto without downloading a multi-gig virtual machine (with old code).

  • Provide README.md with easy installation and instructions for a simple workflow
  • Update pip requirements file

Store matchrules as Matchrule objects and not as lists

Currently we store the list representation of Matchrule objects in the according Step and Inspection fields. This is a workaround that allows us to use attr's convenient asdict function when dumping the layout to a file.

I suggest to implement our own asdict function allowing us to store Matchrules as objects but returning their list representation instead of their dict representation when dumping the container layout.

Accept matchrule string instead of lists

I think we should allow the rule to be written as strings. A .split() when parsing the rule is not very expensive, whereas a split when writing the rule somehow feels stupid. I for instance script my rules like so:

material_matchrules = ["MATCH PRODUCT yadda yadda".split(), ...]

Add `in-toto-sign` command line utility

in-toto Layouts and Links are both signable.

Let's add a command line utility to handle in-toto metadata signatures. Here are some functions I consider helpful:

  • add signature, while keeping existing signature(s)
  • replace existing signature(s) with new signature
  • verify signature(s)

Feel free to add your own ideas.

Adopt sublayout link metadata namespacing

According to recent specification changes in-toto sublayout verification expects link metadata files pertaining to a sublayout to reside in a fileystem directory with the following naming scheme:

<SUBLAYOUT NAME>.<SUBLAYOUT OWNER KEYID PREFIX>

SUBLAYOUT NAME: Name of step in superlayout that is carried out as sublayout
SUBLAYOUT OWNER: Functionary authorized to perform the step of superlayout that is carried out as sublayout
KEYID PREFIX: Left-most 8 characters of keyid

See 4.5.2 Namespacing link metadata for more details

Readme could use a bit more explanation about in-toto workflow

The readme explains in-toto's general purpose briefly, then starts explaining what a layout contains, without providing the few sentences that I think would help a reader understand the in-toto workflow.

In particular, I think that the last paragraph of the first section of the readme (sorry, can't link line numbers in .md in github) would be better with a little bit more detail. For example, I might change it to something like this:

In-Toto Workflow

in-toto requires a project layout that specifies the functionaries and the tasks they are supposed to perform. The project designer (((or whatever term is preferred))) creates this project layout as a sequence of individual steps, referred to as links, designating functionaries to be trusted for each step. The functionaries in charge of each link produce link metadata once they've completed the work in their link, and provide this metadata to (etc.....). The chain of link metadata travels with the final product, and can be validated manually by the final client or via automated tooling in, for example, a package manager.

Adopt storing environment information in link metadata

The specification recommends storing information about the environment, in which an in-toto step is executed, to the resulting link metadata.

See section 4.4.1 Environment Information of the specification for more details about what should be stored.

Some preliminary questions are:

  • Should storing be parameterizable, e.g. via command line options to in-toto-run/in-toto-record?
  • If so, what should be the default?
  • What do we want to store under the filesystem key?
  • How do we infer which files/directories/filesystem layers are relevant?
  • Do we already have use cases for this information?

Note:
Storing the working directory as suggested would eliminate the need for
the MockLink class, a Link subclass with an additional working_directory property
added in #95 to create a Layout based on Link metadata

Fix MATCH rule ambiguities

The current rule type MATCH uses the following language:

MATCH (MATERIAL|PRODUCT) <path pattern> [AS <target path pattern>] FROM <step name>

Currently this reads (my interpretation of the specification):

MATERIALS or PRODUCTS, depending on the rule's second element, of a step with <step name> and matched by <target path pattern> (if specified) or <path pattern> (else), must have a hash that matches the hash of a MATERIAL or PRODUCT, depending on whether the rule is in the material_matchrules or product_matchrules, of a step that matches <path pattern> and has not been matched by a previous rule. The rule also fails if the target path pattern does not find any artifacts.

When I and @SantiagoTorres, who came up with the language and implemented it, tried to apply these rules in real world software supply chains, we both had difficulties to express what we wanted, which IMHO indicates that the language should be clarified and freed from ambiguities.
The following (or at least most of it) should be unmistakingly clear by just reading the rule:

  • What is the match source and what is the match target?
    rule in one of step's rule lists VS. ... FROM <step name>

  • What is the source artifact type and what is the target artifact type?
    rule in material_matchrules or product_matchrules VS. MATCH (MATERIAL|PRODUCT)...

  • Should there be a target artifact for every source artifact? (currently no)
    material_matchrule (source): MATCH PRODUCT * FROM target-step
    source materials : hash(foo) = x, hash(bar) = y
    target products: hash(foo) = x
    Pass?

  • Should there be a source artifact for every target artifact? (currently yes)
    material_matchrule (source): MATCH PRODUCT * FROM target-step
    source materials : hash(baz) = x
    target products: hash(baz) = x , hash(zap) = y
    Fail?

  • Should the rule fail if the path pattern does not find any artifacts?
    MATCH PRODUCT foo ... should probably fail if there is no product foo?
    MATCH PRODUCT * ... should probably not fail if there is no product?

  • Do we solely match by hash in case of wildcard patterns?
    material_matchrule (source): MATCH PRODUCT * FROM target-step
    source materials : hash(new/path/foo) = x, hash(bar) = y
    target products: hash(foo) = x, hash(baz) = y

  • Can artifacts be matched more than once by different MATCH rules? Would AND, OR operators to concatenate MATCHRULES help here?


Below is a super explicit language to start the discussion. This might be exaggerated but at the same time still does not express everything. I don't say, maximum explicitness is a must, nonetheless implicit behavior should be defined somewhere, e.g. in the specs.

MATCH [ALL] (MATERIAL|PRODUCT) <source path pattern> FROM <source step name> WITH [ALL] (MATERIAL|PRODUCT) <target path pattern>  FROM <target step name>

Properly duplicate standard streams

Currently we provide a command line flag to toto-run to either don't touch stdout and stderr, which is required if toto-run wraps interactive commands like e.g. vi, or to redirect and store them as byproducts to the link metadata.
Ideally we would like to duplicate the streams to allow both.

  • Using a pipe won't work because processes like vi will complain
  • Wrapping stdout/sterr in Python won't work because the suprocess will only take the filedescriptor and then uses it natively
  • Reading from /dev/(stdout|stderr), /dev/tty is *NIX specific

Fix metadata signatures mismatch between specs and implementation

We have been silently accepting a minor metadata format mismatch between specs and implementation. I think it is time to fix that by choosing one or the other.

Reason for the format as specified: Adopted from TUF
Reason for the format as implemented: is-a relationship seemed (from an OO perspective) more intuitive and easier to handle than has-a realtionship.

Implementation

{
  "_type": "layout" or "link",
  ... # rest of the respective properties,
  "signatures" : [
    { "keyid" : KEYID, "method" : METHOD, "sig" : SIGNATURE },
  , ... ]
}

Specification

{
  "signed" : ROLE, # layout or link metadata object [**]
  "signatures" : [
    { "keyid" : KEYID, "method" : METHOD, "sig" : SIGNATURE },
  , ... ]
}

# [**] Btw. I find the term `ROLE` for the metadata type really confusing. 
# While it makes sense for TUF, # where each role corresponds to 
# an individual metadata format, it does not for in-toto, which does 
# not have the some notion of roles.

Enable delegation

Delegation is provided by defining a step in the root layout that will be represented by a toto link metadata file of type layout in verification.
This needs to be enabled in toto-verify/verifylib.

Cannot find link to project's website

The README should link to the project's website. There is also an option of adding a website to the repo by clicking on "Edit" in the repo's description.

Use "{}".format instead of "%s" % ()

@SantiagoTorres made a valid point in preferring "{}".format over "%s" % () for string formatting.

See more info in the Python docs:

Note: The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly). Using the newer str.format() interface helps avoid these errors, and also provides a generally more powerful, flexible and extensible approach to formatting text.

Raise exception on non-zero return of Inspection command

Inspection commands defined in the layout provide the possibility to execute arbitrary commands at verification time.
Inspections, like Steps, must have rules to authorize/enforce materials and products that are recorded before and after an Inspection command is run. Currently a failing rule is the only way to make an Inspection fail the verification.
Additionally, it might be desired to simply fail verification when the inspection command returns a non-zero value.

libraryfy runlib and verifylib

  • verifylib.py :Currently the verifylib is implemented as one long function. We should separate the single verification steps into function units that are called from the commandline tool toto-verify.py.
    Also, functions in verifylib should not contain log/debug/info statements but rather raise meaningful exceptions that might be caught in toto-verify.py
  • runlib.py
    Runlib is already split into separate functions but there is one "call-them-all" function in runlib which should be moved to toto-run.py. Same as above applies for log statements here.

Use parentheses in multi-line imports

I've noticed that we are doing imports as follows:

from x import y, z, \
           i

While this is a correct way of doing it, I'd suggest we move to the parentheses construction instead:

from x import (y, z,
         i)

The rationale behind is that our code style (which is based on pep8) strongly hints of using parentheses for line continuation*. PEP8 also makes the same suggestion:

The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping expressions in parentheses. These should be used in preference to using a backslash for line continuation.

If I recall correctly, tools such as flake or pep8 mark this as a style error....


*Should we also consider updating the example in our style guideline?

Use validators for models and format/schema for crypto

We share crypto specific libraries with the update framework and started off toto using TUF's format/schema validation. As we are more on the OO side than TUF, we will want to replace format/schema validation with model validators, e.g. using attr's validator module.

  • implement validators (the downside of attr.validate is that it seems to be hooked to the __init__, which is not ideal if we want to set attributes post-instantiation and then validate)
  • remove toto/formats.py
  • keep using and toto/ssl_crypto/formats.py for crypto specific data structures, and add where appropriate

Clean up unit-test code.

Some of the unit test code needs to be refactored and cleaned up.

This issue is left up ambiguous intentionally, as it will be discussed in an upcoming hackathon.

Integrate metadata cleanly into distributed software...

We need a better plan for how to integrate link files, the layout, delegated layouts, etc. into software we distribute. Asking the user to copy a bunch of things really doesn't cut it.

Should there be an in-toto-bundle step which automates this (somehow)? Should we do something different?

Deal with (relative) artifacts path recordings

It can occur that the directory in which toto-run is executed and the base of the directory to record materials and products are not the same.
Consider below directory layout and a toto-run to be executed in b and record materials in a:

├─/path/to/project
          ├── a
          │   ├── bar
          │   └── foo
          └── b
# in /path/to/project/b
toto-run.py --materials ../a

this results in a materials list:

materials = [
   "../a/bar" : <hash>
   "../a/foo" : <hash>
]

Currently matchrules would need to add dots or double-dots in the path pattern to match the recorded artifacts. This can be circumvented by using wildcard patterns, which does not seem ideal.

Two possible solutions:

  • Ignore leading dots/double dots at verification time
  • Add a base-path command line option to toto-run, record absolute artifact paths, leftstrip base path from absolute artifact path before writing link metadata.

Miscellaneous material/product (artifact) enhancements

  • Support file path wildcards for artifact flags in toto-run and consequently in toto-verify
  • Re-think "./" left-stripping of paths when recording artifacts (maybe this could be done in verification instead?)
  • revise record_artifacts_as_dict function

Later:

  • think of a more sophisticated way of recording artifacts than by passing file paths as command line arguments (this might deserve a separate ticket)

PKI helper instead of throw-away util

Currently we provide a throw-away create_and_persist_or_load_key function which served its purpose during development.
In future we definitely want something a little more sophisticated, although PKI is not part of the toto specification.

  • Add pki helper interface to create and store public/private keypairs (offer standardized format, eg. PEM)
  • Change key loading calls throughout the codebase to load keys in various formats or die
  • Disable the possibility of adding the private portion of a key to the toto layout

Factor out in_toto.util to securesystemslib + general revision

The in_toto.util module serves as convenience interface for securesystemslib.keys. We could probably move the whole module over to securesystemslib and revise the code while we are at it.

For instance:
@SantiagoTorres pointed out that there should be a better way to determine if a key is password encrypted, than by simply loading it without pw first and then with pw if a generic CryptoError is raised. I agree with him.

Layout keys dict instead of list

The docstring of in-toto's Layout as well as the default value suggest that the keys property should be a list. This does not conform with the in-toto specification and the demo implementation.
The correct format is ssl_crypto.formats.KEYDICT_SCHEMA.

Please change docstring default value, and while you are at it, add model validators and unit tests!

Add intelligent constructors for metadata classes

Currently we use default constructors for all in-toto classes. There is a "factory-like" read method which has been used in the demo so far.

It would be useful to have intelligent constructors or factories for objects that will be created manually by the project owner, i.e. Layout, Step and Inspection, with the following capabilities.

  • Take key dictionary or key list and create key dictionary from it (Layout) (wontfix)
  • Take expected command in list or string format (Layout)
  • Add default expiration if not specified (Layout)
  • Take matchrules in list or string format (Step, Inspection) (wontfix, would require escaping)
  • Validate passed data

Refactor artifact rules field name

The names of the artifact rule properties of in-toto steps and inspections have been updated in the specification to expected_materials and expected_products whereas in the implementation they are still called material_matchrules and product_matchrules.

These names have to be refactored in the codebase and documentation.

Expected command pattern instead of strict and relaxed alignment

Currently we pass command verification upon strict (must be equal) and relaxed (must have an equal prefix) alignment of recorded command and expected command. The following examples show in what cases the alignment passes or fails.

# Left command is the command recorded by toto-run.py
# Right command is the expected command defined in the layout

# Passes:
["vi", "file1", "file2"] ~ ["vi", "file1", "file2"]

# Passes with warning:
["vi", "file1", "file2"] ~  ["vi"]
["make", "install"] ~  ["make"]

# Fails:
["vi", "file1", "file2"] ~ ["make", "install"]
["/usr/bin/vi", "file1"] ~ []
["vi", "file1", "file2"] ~ ["vi", "file2", "file1"]
["/usr/bin/vi", "file1"] ~ ["vi", "file1"]

As one can see in above examples that semantically equal commands sometimes fail whereas syntactically (relaxed) equal commands can pass although they have very different semantics.

@vladimir-v-diaz brought up the idea of using match patterns. We could use regex or a subset of regex like implemented by fnmatch. This would allow either fail or pass and get rid of the relaxed pass.

In any case command alignment does not provide strong security guarantees, since recorded commands can be easily faked using alias, symlinks or the like.

Integrate/require inspection commands

in-toto inspection commands that are executed upon verification need to be on the verifier's PATH. How do we want to integrate custom inspections?

I see two options:

  • Integrate them with in-toto (feasible if it's only a few)
  • Maintain them as a separate project and list them as dependency for in-toto

Coalesce signature verification in-toto verify

As it is now, there are two places that perform signature verification. Following review #77, we decided that both routines could be placed in the same place, and have the second place just verify that the signature matches the keyid prefix in the filename.

Replace ssl_crypto and ssl_commons submodules with securesystemslib

Make in-toto use the tip of secure-systems-lab/ssl_crypto and secure-systems-lab/ssl_commons as submodules.

The tip of in-toto currently uses vladimir-v-diaz/ssl_crypto@542caed as crypto submodule. The common package has not been sub-modularized yet at all.

This issue can be broken down into:

Enable partial verification

Currently in-toto-verify calls verifylib.in_toto_verify and fails immediately if any of the verification sub-routines fails.

It would be useful to allowin-toto-verify and verifylib to call verification routines individually and independently, e.g. only

  • a section of the supply chain
  • artifact rules
  • signatures
    ...

Add connman debianization demo

We need more real world in-toto examples! This time it's Debian.

The idea is to show how in-toto can be used to guarantee the integrity of a software project from upstream development to installation using a Debian package management tool.

Let's use our great in-toto Connman OpenSUSE demo as a basis.

Here are some relevant pointers:

Additionally, this might be helpful:

"Relaxed" command alignment

Command alignment verification passes if the step command as defined in the layout and the related command as recorded by the link metadata are completely equal. If only the first x parameters are equal (where x is the minimum count of both commands) toto-verify should output a warning.

Add key threshold

The layout model must support an additional threshold field which contains an integer indicating how many pieces of link metadata must be provided to verify this step. This field is intended to be used for steps that require a higher degree of trust, so multiple functionaries must perform the operation and report the same results.

  • add field to model and model validation
  • change naming scheme for link metadata files: [name].[KEYID-PREFIX].link
  • add in toto-verify/verifylib

In order to verify a layout file that was signed by multiple keys we simply need allow passing multiple keys to toto-verify

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.