Skip to content

[Fall 2021] Step 3: Add a pyre validate-taint-config command and make errors in taintConfiguration.ml typed #82

@onionymous

Description

@onionymous

Outdated, please read later comment.

Pysa rules, sources, sinks and other taint information are specified in taint.config files. Multiple taint.config files can be specified in one project. When Pysa is run, it looks at all the taint.config files specified in the "taint_models_path" of the .pyre_configuration file for that project, and reads the rules, source/sink names, etc. from all of these files.

The goal of this project is to have some method to validate these taint.config files. This can be in the form of a Python script that we can run standalone, or something that is run at the start of invoking the Python client.

Some validation ideas to get started (feel free to think of more!):

  1. Make sure there are no duplicate warning codes. All Pysa rules should have a unique warning code. When there are multiple taint.config files, it can be confusing to keep track of the codes across different files, so we want to make sure no codes are repeated.
  2. Make sure the source/sink names used in rules exist.
  3. A regex validator for implicit string sources/sinks. Pyre/Pysa is written in OCaml and the regex engine used is re2. This is a non-backtracking engine which doesn't support a lot of features in other regex flavors like lookaheads, etc. (see https://github.com/google/re2/wiki/Syntax) so we want to make sure the regexes are valid re2 syntax. In addition, we want to make sure backslashes are escaped properly in these regexes, etc.

Metadata

Metadata

Assignees

Labels

Fall 2021Issues related to the Pysa project for MLH Fellowship cohort of Fall 2021step 3

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions