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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摉 Improve rationale for Binary-Artifacts #1016

Merged
merged 3 commits into from
Sep 14, 2021

Conversation

david-a-wheeler
Copy link
Contributor

I'm fine with prohibiting binary executables, but
the rationale for doing this was completely unclear.

This commit rewrites the rationale to explain, in hopefully
a better way, why they can be a problem.

I prefer "executable" over "binary".
On digital computers, all data (including source code) are binaries :-).
In addition, some executables are simultaneously executables
and source code, e.g., shell scripts.
So I think what is meant here is a "generated binary".

I don't really think this merits a "High" level, but that's
a different dicussion.

Signed-off-by: David A. Wheeler dwheeler@dwheeler.com

  • Please check if the PR fulfills these requirements
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

  • Other information:

I'm fine with prohibiting binary executables, but
the *rationale* for doing this was completely unclear.

This commit rewrites the rationale to explain, in hopefully
a better way, why they can be a problem.

I prefer "executable" over "binary".
On digital computers, all data (including source code) are binaries :-).
In addition, some executables are simultaneously executables
and source code, e.g., shell scripts.
So I think what is meant here is a "generated binary".

I don't really think this merits a "High" level, but that's
a different dicussion.

Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Copy link
Member

@naveensrinivasan naveensrinivasan left a comment

Choose a reason for hiding this comment

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

Few suggestions on typo's and not on the content :)

docs/checks.md Outdated
This check tries to determine if the project has binary artifacts in the source repository.
Binaries are a threat to auditability and vulnerability management. In addition, a binary could be compromised or malicious. A low score is therefore considered `High` risk.
This check tries to determine if the project has generated executable (binary) artifacts in the source repository.
Including generated executables in a source repository increases user risks. Many programming language systems can generate executables from source code (e.g., C/C++ generated machine code, Java `.class` files, Python `.pyc` files, and minified JavaScript). Users will often directly use executables if they are included in the source repository, leading to many dangerous behaviors. One problem is that reviews becomes ineffective and thus enable the use of obsolete or maliciously-subverted executables. Reviews generally review source code, not executables, since it's difficult to audit executables to ensure that they correspond. Since it's hard to audit this, over time the included executables might not correspond to the source code. Another problem is that it allows the executable generation process to atrophy, which can lead to an inability to create working executables. These problems can be countered with verified reproducible builds, but it's easier to implement verified reproducible builds when executables are not included in the source repository (since the executable generation process is less likely to have atrophied).
Copy link
Member

Choose a reason for hiding this comment

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

Including generated executables in a source should be Including generated executables in a source,

Copy link
Member

Choose a reason for hiding this comment

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

One problem is that reviews becomes should be One problem is that reviews become

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Including generated executables in a source should be Including generated executables in a source,

I don't think so. The next word is repository. That would produce Including generated executables in a source, repository increases user risks. The first sentence uses the phrase the source repository`, so let's use this:

Including generated executables in the source repository increases user risks.

One problem is that reviews becomes should be One problem is that reviews become

Agreed!

docs/checks.md Outdated
Binaries are a threat to auditability and vulnerability management. In addition, a binary could be compromised or malicious. A low score is therefore considered `High` risk.
This check tries to determine if the project has generated executable (binary) artifacts in the source repository.
Including generated executables in a source repository increases user risks. Many programming language systems can generate executables from source code (e.g., C/C++ generated machine code, Java `.class` files, Python `.pyc` files, and minified JavaScript). Users will often directly use executables if they are included in the source repository, leading to many dangerous behaviors. One problem is that reviews becomes ineffective and thus enable the use of obsolete or maliciously-subverted executables. Reviews generally review source code, not executables, since it's difficult to audit executables to ensure that they correspond. Since it's hard to audit this, over time the included executables might not correspond to the source code. Another problem is that it allows the executable generation process to atrophy, which can lead to an inability to create working executables. These problems can be countered with verified reproducible builds, but it's easier to implement verified reproducible builds when executables are not included in the source repository (since the executable generation process is less likely to have atrophied).
It's fine to include, in the source repository, files that are simultaneously reviewable source code and executables, since these are reviewable. (Some interpretive systems, such as many operating system shells, don't have a format for separate generated executables.) Similarly, we allow including in the source repository source code generated by other tools (e.g., by bison, yacc, flex, and lex). There are potential downsides to generated source code, but generated source code tends to be much easier to review and thus presents a lower risk. Generated source code is also often difficult for external tools to detect.
Copy link
Member

Choose a reason for hiding this comment

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

separate should be separately

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. separately generated focuses on generation, but we're not focused on generating source code files through some different process. The focus here is that the source files are separate from the executable files, so I think separate is correct. I'll reword the sentence to emphasize the point: in some cases there is no executable file that lives independently from the source file.

@naveensrinivasan naveensrinivasan changed the title Improve rationale for Binary-Artifacts 馃摉 Improve rationale for Binary-Artifacts Sep 14, 2021
Tweak Binary-Artifacts text based on comments from
@naveensrinivasan.

Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
@inferno-chromium inferno-chromium enabled auto-merge (squash) September 14, 2021 23:40
@inferno-chromium inferno-chromium merged commit 8b7da7c into ossf:main Sep 14, 2021
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.

None yet

3 participants