connectors
connectors copied to clipboard
[Import Connectors (likely more)] Define a Volume for any r/w filesystem locations
Description
In the import document connector the location used by _download_import_file()
needs to be defined as a volume.
This poses a security issue if users decide to just not run with the root filesystem of a container due to having no context of this and turning it off.
More broadly k8s covers security contexts on runtime really well, I would recommend all containers be able to run non-root with a read only filesystem
Per Docker best practice is to make anyplace files are created at run time a volume.
You should use the VOLUME instruction to expose any database storage area, configuration storage, or files and folders created by your Docker container. You are strongly encouraged to use VOLUME for any combination of mutable or user-serviceable parts of your image.
Environment
- OS (where OpenCTI server runs): N/A
- OpenCTI version: All so far
- OpenCTI client: N/A
- Other environment details: N/A
Reproducible Steps
Steps to create the smallest reproducible scenario:
- deploy import connector with a readonly root filesystem
Expected Output
Proper volume definitions
Actual Output
Runtime errors if no volume is mounted
Additional information
https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod https://docs.docker.com/build/building/best-practices/#volume