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

pattern matching syntax for artifact rules is undefined #71

Closed
lukpueh opened this issue Mar 22, 2023 · 3 comments
Closed

pattern matching syntax for artifact rules is undefined #71

lukpueh opened this issue Mar 22, 2023 · 3 comments
Labels
X41 Informational findings from X41 source code audit

Comments

@lukpueh
Copy link
Member

lukpueh commented Mar 22, 2023

[from the X41 specification and source code audit]

Section 4.3.3 of the in-toto specification specifies a "pattern" for the artifact rules, but only describes them as "bash-style wildcards" and does not further define the pattern matching syntax.

The Python implementation of in-toto uses the fnmatch module for pattern matching, while the Go implementation uses a customized version of the filepath.Match function.

The Python and Go functions differ in the way patterns are applied, for example regarding escaping and negated sequence matching.

Solution Advice
X41 recommends to describe the pattern syntax in the specification, or to refer to a specific version of a third-party pattern syntax definition, such as IEEE Std 1003.1-2017, 2.13.1.

The Python and Go implementations should implement the same pattern matching syntax.

@lukpueh lukpueh added the X41 Informational findings from X41 source code audit label Mar 30, 2023
@joshuagl
Copy link

joshuagl commented Apr 6, 2023

IEEE/Open Group 1003.1-2017 is the POSIX base specification, i.e.; "IEEE Standard for Information Technology--Portable Operating System Interface (POSIX(TM)) Base Specifications, Issue 7"

AFAIK, and I don't have access to the published spec because it's behind a paywall, the referenced XCU section is the shell pattern matching notation as used in fnmatch(3), that is glob(7) pattern matching rules.

We standardised on glob-style pattern matching for PATHPATTERN in TUF in theupdateframework/specification#174.

@adityasaky
Copy link
Member

We use the same in the reference implementation. I'm open to clarifying in spec before or as part of #75 (and bring other implementations in line separately).

@adityasaky
Copy link
Member

Closed by #75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
X41 Informational findings from X41 source code audit
Projects
None yet
Development

No branches or pull requests

3 participants