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

Deny access to uploaded files #170

Merged
merged 1 commit into from
Jun 14, 2021
Merged

Deny access to uploaded files #170

merged 1 commit into from
Jun 14, 2021

Conversation

jadams
Copy link
Contributor

@jadams jadams commented Jun 14, 2021

🗣 Description

Added deny section to nginx configuration for pcap-upload docker container to deny access to uploaded files.

💭 Motivation and context

This PR fixes a possible RCE where an authenticated user can upload a php webshell (or many to beat the file processor) where they could gain access to the entire Malcolm docker network and all files.

🧪 Testing

  1. Used docker exec to connect to a bash shell within the malcolm_upload_1 container
  2. Used vi to edit /etc/nginx/sites-enabled/default
  3. Added lines from PR
  4. Issued nginx -s reload
  5. Used web browser to check with url: https://<Malcolm_IP>/server/php/files/.gitignore

📷 Screenshots (if appropriate)

Before:
Screenshot 2021-06-14 104652
After:
Screenshot 2021-06-14 104301

✅ Checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

@mmguero mmguero merged commit 26c3a9f into cisagov:master Jun 14, 2021
@mmguero
Copy link
Collaborator

mmguero commented Jun 14, 2021

Thanks much!

mmguero referenced this pull request in mmguero-dev/Malcolm Jun 14, 2021
@mmguero mmguero mentioned this pull request Jul 9, 2021
mmguero added a commit that referenced this pull request Jul 9, 2021
v3.1.1 development

* New features
  * ["Best Guess" Fingerprinting for ICS Protocols](idaholab#49) - In an effort to help identify more ICS traffic, Malcolm can use "buest guess" method based on transport protocol (e.g., TCP or UDP) and port(s) to categorize potential traffic communicating over some ICS protocols without full parser support. This feature involves a [mapping table](https://github.com/idaholab/Malcolm/blob/master/zeek/config/guess_ics_map.txt) and a [Zeek script](https://github.com/idaholab/Malcolm/blob/master/zeek/config/guess.zeek) to look up the transport protocol and destination and/or source port to make a best guess at whether a connection belongs to one of those protocols. These potential ICS communications are categorized by vendor where possible. The list of ICS protocols' ports was adapted from various public sources, including, but not limited to, [Grassmarlin](https://github.com/nsacyber/GRASSMARLIN/tree/master/GM3/data/fingerprint)'s fingerprints and [ITI/ICS-Security-Tools](https://github.com/ITI/ICS-Security-Tools/blob/master/protocols/PORTS.md)' list of Control Systems Ports.

* Improvements and bug fixes
  * Allow configuring the number of concurrent requests for ClamAV scanning, Yara and Capa via environment variables (`CLAMD_MAX_REQUESTS`, `YARA_MAX_REQUESTS` and `CAPA_MAX_REQUESTS`)
  * Zeek plugins to detect [CVE-2021-31166](https://github.com/corelight/CVE-2021-31166) and [pingback](https://github.com/corelight/pingback) vulnerabilities
  * Move creation of custom fields and views to [Arkime's config.ini](https://arkime.com/settings#custom-fields)
  * LDAP bind credentials world readable in docker (idaholab#47 and #171)
  * Deny access to uploaded files (#170)

* Version bumps
  * Yara to 4.1.1
  * Zeek to 4.0.3
  * Spicy to 1.1.0
  * Alpine to 3.14
  * NGINX to 1.20.1
  * Linux kernel to 5.10 (for ISO installs)
  * urllib3 to 1.26.5 (#169)
mmguero added a commit to idaholab/Malcolm that referenced this pull request Jul 9, 2021
Merge remote-tracking branch 'cisa/master'

* New features
  * ["Best Guess" Fingerprinting for ICS Protocols](#49) - In an effort to help identify more ICS traffic, Malcolm can use "buest guess" method based on transport protocol (e.g., TCP or UDP) and port(s) to categorize potential traffic communicating over some ICS protocols without full parser support. This feature involves a [mapping table](https://github.com/idaholab/Malcolm/blob/master/zeek/config/guess_ics_map.txt) and a [Zeek script](https://github.com/idaholab/Malcolm/blob/master/zeek/config/guess.zeek) to look up the transport protocol and destination and/or source port to make a best guess at whether a connection belongs to one of those protocols. These potential ICS communications are categorized by vendor where possible. The list of ICS protocols' ports was adapted from various public sources, including, but not limited to, [Grassmarlin](https://github.com/nsacyber/GRASSMARLIN/tree/master/GM3/data/fingerprint)'s fingerprints and [ITI/ICS-Security-Tools](https://github.com/ITI/ICS-Security-Tools/blob/master/protocols/PORTS.md)' list of Control Systems Ports.

* Improvements and bug fixes
  * Allow configuring the number of concurrent requests for ClamAV scanning, Yara and Capa via environment variables (`CLAMD_MAX_REQUESTS`, `YARA_MAX_REQUESTS` and `CAPA_MAX_REQUESTS`)
  * Zeek plugins to detect [CVE-2021-31166](https://github.com/corelight/CVE-2021-31166) and [pingback](https://github.com/corelight/pingback) vulnerabilities
  * Move creation of custom fields and views to [Arkime's config.ini](https://arkime.com/settings#custom-fields)
  * LDAP bind credentials world readable in docker (#47 and cisagov#171)
  * Deny access to uploaded files (cisagov#170)

* Version bumps
  * Yara to 4.1.1
  * Zeek to 4.0.3
  * Spicy to 1.1.0
  * Alpine to 3.14
  * NGINX to 1.20.1
  * Linux kernel to 5.10 (for ISO installs)
  * urllib3 to 1.26.5 (cisagov#169)
mmguero added a commit to mmguero-dev/Malcolm that referenced this pull request Jul 9, 2021
v3.1.1 development

* New features
  * ["Best Guess" Fingerprinting for ICS Protocols](idaholab#49) - In an effort to help identify more ICS traffic, Malcolm can use "buest guess" method based on transport protocol (e.g., TCP or UDP) and port(s) to categorize potential traffic communicating over some ICS protocols without full parser support. This feature involves a [mapping table](https://github.com/idaholab/Malcolm/blob/master/zeek/config/guess_ics_map.txt) and a [Zeek script](https://github.com/idaholab/Malcolm/blob/master/zeek/config/guess.zeek) to look up the transport protocol and destination and/or source port to make a best guess at whether a connection belongs to one of those protocols. These potential ICS communications are categorized by vendor where possible. The list of ICS protocols' ports was adapted from various public sources, including, but not limited to, [Grassmarlin](https://github.com/nsacyber/GRASSMARLIN/tree/master/GM3/data/fingerprint)'s fingerprints and [ITI/ICS-Security-Tools](https://github.com/ITI/ICS-Security-Tools/blob/master/protocols/PORTS.md)' list of Control Systems Ports.

* Improvements and bug fixes
  * Allow configuring the number of concurrent requests for ClamAV scanning, Yara and Capa via environment variables (`CLAMD_MAX_REQUESTS`, `YARA_MAX_REQUESTS` and `CAPA_MAX_REQUESTS`)
  * Zeek plugins to detect [CVE-2021-31166](https://github.com/corelight/CVE-2021-31166) and [pingback](https://github.com/corelight/pingback) vulnerabilities
  * Move creation of custom fields and views to [Arkime's config.ini](https://arkime.com/settings#custom-fields)
  * LDAP bind credentials world readable in docker (idaholab#47 and cisagov#171)
  * Deny access to uploaded files (cisagov#170)

* Version bumps
  * Yara to 4.1.1
  * Zeek to 4.0.3
  * Spicy to 1.1.0
  * Alpine to 3.14
  * NGINX to 1.20.1
  * Linux kernel to 5.10 (for ISO installs)
  * urllib3 to 1.26.5 (cisagov#169)
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.

2 participants