ComplianceAsCode / auditree-framework

The Auditree framework tool to run compliance control checks as unit tests.
https://auditree.github.io/
Apache License 2.0
59 stars 23 forks source link

Enable universal newlines when executing local commands. #156

Closed smithsz closed 1 year ago

smithsz commented 1 year ago

What

This change enables universal newline mode during the evidence fetch. The subprocess output will be opened as text streams in universal newlines mode. All line endings will be converted to '\n' ensuring the evidence can be later verified.

Why

Universal newline support is enabled by default in all calls that read data. This means that any non-binary evidence with a foreign newline convention cannot be verified. When the evidence is read, all line endings are converted to '\n' which changes the expected digest.

How

Set universal_newlines=True.

Test

Tested locally.

Context