Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add file system environment and other clarifiacations #2

Merged
merged 9 commits into from
Oct 11, 2017

Conversation

SantiagoTorres
Copy link
Member

  • fixes minor issues with the code style in the algorithm descriptions
  • Adds a section for the environment opaque field.
  • Adds more thorough clarification on how verification is done on section 5
  • Adds mention of ecdsa as a signature algorithm.

in-toto-spec.md Outdated
@@ -760,6 +769,12 @@ match any materials.
other words, this path must appear as a material and a product within this
step and their hashes must not match.

The artifact rules contained in the `"expected_materials"` and
`"expected_products"` fields operate in a similar fashion as a firewal. This
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo 'firewal'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up. I ran a spell checker on the patch to correct this and other typos.

Copy link

@reza-curtmola reza-curtmola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a bunch of comments for this PR.

I tried to open an issue for specific lines of the spec (that are not included in the PR), based on these steps, but it didn't seem to work:
https://help.github.com/articles/opening-an-issue-from-code/

Maybe it's because the text in the spec wasn't code?

Anyways, here is an issue that is not directly part of what the lines you changed:

"The current reference implementation of in-toto defines two signing methods"

Right below this, there are 3 signing methods defined, so two should be three?

in-toto-spec.md Outdated
@@ -760,6 +769,12 @@ match any materials.
other words, this path must appear as a material and a product within this
step and their hashes must not match.

The artifact rules contained in the `"expected_materials"` and
`"expected_products"` fields operate in a similar fashion as a firewall. This

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change "as a firewall" to "as firewall rules do".

in-toto-spec.md Outdated
The artifact rules contained in the `"expected_materials"` and
`"expected_products"` fields operate in a similar fashion as a firewall. This
means that the first rule that matches a specific artifact in the link metadata
will be used to match that artifact. Likewise, there is an implicit `ALLOW *`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be "implicit DENY *"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We opted for an implicit ALLOW based on the feedback on people (it's mostly a bet for usability), although I understand the security concern.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly that we should use one over the other between ALLOW * or DENY *.
It's ok to choose one over the other if you have a good reason.

However, if you choose ALLOW *, we should not say "Likewise, ...", because this implies that firewalls also work like that. Instead, I suggest to say "In addition, there is an implicit ALLOW * at the end of such fields."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the wording for this

in-toto-spec.md Outdated
* **variables**: a list of environment variables set in the host system.
* **filesystem**: a list of filepath/hash values of the relevant files in
the filesystem. Another alternative could be to store an MTREE of the
relevant directories. A third alternative would be to use the hashes of the

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are some formatting issues in the resulting in-toto-spec.md file.

in-toto-spec.md Outdated
`build.BOBS_KEYID.link`, and the corresponding pieces of link metadata will be
stored on a folder named `build.BOBS_KEYID`.
`build.BOBS-KEYID-PREFIX.link`, and the corresponding pieces of link metadata
will be stored on a folder named `build.BOBS-KEYID-PREFIX`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to say "stored in a folder" rather than "stored on a folder". Same applies to the previous paragraph.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think about it, probably the better name is directory

in-toto-spec.md Outdated
layout, one or more pieces of link or layout metadata is loaded.
1. If the file loaded metadata is a link metadata file, a data structure
layout, one or more pieces of link or layout metadata is loaded.
1. If the file loaded metadata is a link metadata file, a data structure

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to say "If the loaded metadata file is a ..."

in-toto-spec.md Outdated
functionaries made a sublayout while others didn’t), then verification
should fail. The reason as to why this happens is to avoid ambiguities between
both versions of the supply chain.
1. If the file is a layout file instead, the algorithm will recurse into that

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the previous item in this list, we should say:
"If the loaded metadata file is a layout file instead, ..."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. WIll do

}
},
"environment": {
"variables": [""],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why variables has an empty list-like description [""], whereas filesystem and workdir have empty non-list-like description "" ?
(Same comment applies in other places in this document)

@@ -1158,13 +1245,18 @@ metadata:
"stdin": "",
"stdout": "foo.py",
"return-value": "0"
},
"environment": {
"variables": [""],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why variables has an empty list-like description [""], whereas filesystem and workdir have empty non-list-like description "" ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of variables I know that it's going to be a list of them, on the other case, given that it's an opaque field, it could contain just a string (with e.g., the hash of the filesystem tree). I also think it makes sense to have the CWD just as a string.

Do you think I should work on clarifying this on the spec or was this more of a general question?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the general description of the environment information (Section 4.4.1) already provides clarity that "variables" is a list, "filesystem" is a list or an item, and "workdir" is just one string (one path).

(BTW, in Sec. 4.4.1, change "Variables" to "variables" -- uppercase V to lowercase v).

However, the examples in Sections 5.3.1, 5.3.2, 5.3.3 contain specific instantiations of the above general rule. As such, in these examples the "variables" field is just an empty list.
It looks strange to denote 3 fields which are empty using different notation (even if one field is a list in this case).

But, if you think this is fine, I don't feel strongly about this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. I'll check the examples and make sure they are compliant with the specification.

in-toto-spec.md Outdated
}
},
"signatures" : [
{ "keyid" : "<BOBS_KEYID>",
"method" : "ed25519",
"sig" :
"ae3aee92ea33a8f461f736a698e082e12c300dfe5022a06c7a6c2a6a93a9f5771eb2e5ce0c93dd580bebc2080d10894623cfd6eaedf1d5aa394df84890d7ace3"
"ae3aee92ea33a8f461f736a698e082e12c300dfe5022a06c7a6c2a6a"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason you removed part of the signature?
(In Alice's link above you left the signature as it was)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly did this for readability. I don't know if having a 30-char length hex string adds more information than a shorter one. On the examples outside of the spec I ellipsized it, would this help here?

in-toto-spec.md Outdated
1. The root.layout file exists and is signed with a trusted key (in this case,
Alice's).
1. The code that Alice wrote was tested by two people, in this case, Caroline
and Alfred.
1. Every step in the layout has a corresponding [name].link metadata file
1. Every step in the layout has a corresponding [name].[keyid-prefix].link metadata file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should put [name].[keyid-prefix].link between quotes to obtain the grayed text effect.
(Same for later in this paragraph)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Will do.

@SantiagoTorres
Copy link
Member Author

SantiagoTorres commented Oct 3, 2017

@reza-curtmola I did a round of fixes. I'm left with these two issues:

  • Should we change the implicit ALLOW to a deny?
  • Should we change the string for filesystem and cwd to a list too (or clarify why this is)

I wanted to have your feedback on this. Thanks!

@reza-curtmola
Copy link

I provided feedback for each individual issue above.

BTW, have you seen my initial comment about this:
"The current reference implementation of in-toto defines two signing methods"
However, right below this, there are 3 signing methods defined.
So, should we change the sentence to:
"The current reference implementation of in-toto defines three signing methods" ?

@reza-curtmola
Copy link

Since the spec document has become quite long, it would be useful to have in the beginning a table of contents to help the reader quickly assess its contents and be able to reach faster certain sections in the spec.

@SantiagoTorres
Copy link
Member Author

SantiagoTorres commented Oct 6, 2017

Since the spec document has become quite long, it would be useful to have in the beginning a table of contents to help the reader quickly assess its contents and be able to reach faster certain sections in the spec.

edit: ticket is #3

@SantiagoTorres
Copy link
Member Author

"The current reference implementation of in-toto defines three signing methods" ?

I changed this now.

@SantiagoTorres
Copy link
Member Author

I think all the issues are addressed and this is ready to merge unless you have any other comments.

@reza-curtmola
Copy link

Good to go from my pov

`"expected_products"` fields operate in a similar fashion as firewall rules do.
This means that the first rule that matches a specific artifact in the link
metadata will be used to match that artifact. In addition, there is an implicit
`ALLOW *` at the end of such fields.
Copy link
Member

@lukpueh lukpueh Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since when do we have an implicit ALLOW *?
The pseudo code below as well as the implementation require all artifacts to be consumed by a rule.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the pseudocode, and I was thinking to start documenting a rationale for this on the wiki. Can you make a ticket for this please?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There you go... #4

in-toto-spec.md Outdated
clashes between step names on layouts and sublayouts, as the creator of a
layout may not be aware of the names used by the creators of sublayouts.

Link metadata that pertains to a sublayout must be placed in a file system
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the rest of the document you always use "filesystem"...

in-toto-spec.md Outdated
layout may not be aware of the names used by the creators of sublayouts.

Link metadata that pertains to a sublayout must be placed in a file system
directory for such layout. The name of the directory will be have the same
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-be

@@ -457,24 +457,25 @@ how it is laid out within link and layout metadata.
### 4.1 Metaformat

To provide descriptive examples, we will adopt "canonical JSON," as described
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"canonical JSON," --> "canonical JSON",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally agree with this, but this is an american thing afaik.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intriguing... Disregard my comment, then!

in-toto-spec.md Outdated
@@ -516,7 +518,7 @@ The 'rsa' format is:
where PUBLIC and PRIVATE are in PEM format and are strings. All RSA keys must
be at least 2048 bits.

The 'ed25519' format is:
The elliptic-curve variants ('ed25519' and ecdsa) format are:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ecdsa --> 'ecdsa'

in-toto-spec.md Outdated
The following algorithm contains an in-depth description of the verification
procedure.

1. Toto inspects the final product to find a root.layout file that describes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toto --> in-toto

@lukpueh
Copy link
Member

lukpueh commented Oct 6, 2017

There are still a couple of inconsistencies regarding the use of backticks "`". IMHO that's not a blocker, but it should be taken care of at some point. Worth a ticket?

@SantiagoTorres
Copy link
Member Author

Worth a ticket, I guess. I'll address the others right away

Copy link
Member

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix remaining tiny comment and we are good to merge.

in-toto-spec.md Outdated

```json
{ "environment": {
"Variables": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variables is lower case everywhere else.

@SantiagoTorres
Copy link
Member Author

@lukpueh pushed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants