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

Scan file that were previously on the whitelist #90

Open
Clevero opened this issue Jul 26, 2019 · 3 comments
Open

Scan file that were previously on the whitelist #90

Clevero opened this issue Jul 26, 2019 · 3 comments
Assignees
Labels

Comments

@Clevero
Copy link
Contributor

Clevero commented Jul 26, 2019

It would be cool if files that were (not anymore) on the whitelist and re-incoming as mail are actually scanned

Expected Behavior

  1. Attachment of an incoming mail is not scanned since it's mime type is on the whitelist
  2. Mimy type is removed from the whitelist
  3. Exact same attachment from step one is incoming and is scanned since it's no longer on the whitelist

Current Behavior

  1. Attachment of an incoming mail is not scanned since it's on the whitelist
  2. Mimy type is removed from the whitelist
  3. Exact same attachment from step one is incoming and is not scanned since peekaboo already has an DB entry that says "File type is not on the list of types to analyse (set(['application/hta', 'text/html']))"

Steps to Reproduce

  1. Send an attachment ABC with a mime type that is on the whitelist
  2. Remove that mime type from the whitelist
  3. Re-Send the attachment ABC

Context (Environment)

I tried to enable scanning of .hta files and tested it with the file that was previously ignored
#89

After editing, my current ruleset.conf looks like this:

[file_type_on_whitelist]
#whitelist.1 : text/plain
whitelist.1 : message/rfc822
whitelist.2 : inode/x-empty
whitelist.3 : application/pkcs7-signature
whitelist.4 : application/x-pkcs7-signature
whitelist.5 : application/pkcs7-mime
whitelist.6 : application/x-pkcs7-mime
#whitelist.8 : text/html

[file_type_on_greylist]
greylist.1  : application/octet-stream
...
greylist.35 : application/vnd.ms-excel
greylist.36 : application/msword
greylist.37 : application/hta
greylist.38 : text/html
@Clevero Clevero changed the title Rescan file that were previously on the whitelist Scan file that were previously on the whitelist Jul 26, 2019
@Jack28
Copy link
Member

Jack28 commented Jul 26, 2019

Any change in the configuration or setup that can change the result of a scan should always result in a reset or cleanup of the database (given the "known" rule is enabled).

This is for config changes and also for example if you update the software of pdf reader there are vulnerabilites fixed and new vulnerabilities introduced. All previous results can be wrong.

It can be discussed to keep malicious results.

HTA files are in my experience never legitimate and are blocked by amavis.

The database cleanup functionality could be useful and could be included in the (future) peekaboo-util tool.

@Clevero
Copy link
Contributor Author

Clevero commented Jul 29, 2019

I understand and agree that changing the configuration is also changing the significance of "unknown" results.

In my opinion, "bad" should be kept. I do not want to pass a malicious file when it was rated as malicious in the past even if the file cannot damage my current environment since its targeting an old CVE that was patched on our systems.

I think for "ignored" results, it would solve my use case if there would be a tool where I can easily purge those results. But in the meantime I delete those via an SQl query.

Thanks for your answer!

@Jack28
Copy link
Member

Jack28 commented Aug 6, 2019

Our draft of peekaboo-util:

peekaboo-util
--scan-file <file>
--prune-reports <seconds> - clear reports older than <seconds>
--reload - config reload
--restart - graceful restart
--shutdown - graceful shutdown
--status - report running status and service health
--stats - report some stats such as samples scanned and outcomes achieved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants