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

NF: Add GZIP_HEADER_DATA issue, following gh-1349 #1360

Merged
merged 1 commit into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/schema/meta/context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,19 @@ context:
json:
description: 'Contents of the current JSON file'
type: object
gzip:
description: 'Parsed contents of gzip header'
type: object
properties:
timestamp:
description: 'Modification time, unix timestamp'
type: number
filename:
description: 'File name'
type: string
comment:
description: 'Comment'
type: string
nifti_header:
name: 'NIfTI Header'
description: 'Parsed contents of NIfTI header referenced elsewhere in schema.'
Expand Down
15 changes: 15 additions & 0 deletions src/schema/rules/checks/privacy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
GzipHeaderFields:
issue:
code: GZIP_HEADER_DATA
message: |
The gzip header contains a non-zero timestamp or a non-empty filename
and/or comment field. These may leak sensitive information or indicate
a non-reproducible conversion process.
level: warning
selectors:
- match(extension, ".gz$")
checks:
- gzip.timestamp == 0
- gzip.filename == ""
- gzip.comment == ""