Docker
Use Docker engines with Cortex XSOAR On-prem 8.7 (EoL).
Docker is a software framework for building, running, and managing containers.
Cortex XSOAR maintains a repository of Docker images, available in the Docker hub under the Cortex organization.
Each Python/PowerShell script or integration has a specific Docker image listed in the YAML file. When the script or integration runs, if the specified Docker image is not available locally, it is downloaded from the Docker hub or the Cortex Container Registry. The script or integration then runs inside the Docker container. For more information on Docker, see the Docker documentation and Using Docker.
Note
Docker images can be downloaded together with their relevant content packs, for offline installation.
Install Docker
Docker is required for engines to run Python/Powershell scripts and integrations in a controlled environment.
If you use the Shell installer to install an engine, Docker is automatically installed. If using DEB and RPM installations, you need to install Docker or Podman before installing an engine. The engine uses Docker to run Python scripts, PowerShell scripts, and integrations in a controlled environment. By packaging libraries and dependencies together, the environment remains the same and scripts and integrations are not affected by different server configurations.
Cortex XSOAR supports the latest Docker Engine release from Docker and the following corresponding supported Linux distributions:
5.3.15 and later
5.4.2 and later
5.5 and later
These Linux distributions include their own Docker Engine package. In addition, older versions of Docker Engine released within the last 12 months are supported unless there is a known compatibility issue with a specific Docker Engine version. In case of a compatibility issue, Cortex XSOAR will publish an advisory notifying customers to upgrade their Docker Engine version.
You can use a version that is not supported. However, when encountering an issue that requires Customer Support involvement, you may be asked to upgrade to a supported version before assistance can be provided.
Docker installation by operating system
If you need to install Docker before installing an engine, use the following procedures:
Note
For Red Hat's Docker distribution, you need Mirantis Container Runtime (formerly Docker Engine - Enterprise) to run specific Docker-dependent integrations and scripts. For more information, see Install Docker distribution for Red Hat on an engine server.
To use the Mirantis Container Runtime (formerly Docker Engine - Enterprise) follow the deployment guide for your operating system distribution.
Verify Docker user and permissions
Verify Docker user
If you installed an engine before installing Docker, verify the demisto operating system user is part of the docker operating system group.
Run
id demistoverify. For example:If needed, add the demisto user to the operating system group:
Remove these keys from the engine configuration file.
Verify user permissions
To verify that the operating system user (demisto) has necessary permissions and can run Docker containers, run the following command from the OS command line.
sudo -u demisto docker run --rm -it demisto/python:1.3-alpine python --version
If everything is configured properly you will receive the following output. Python 2.7.14.
Install Docker distribution for Red Hat on an engine server
Red Hat maintains its own package of Docker, which is the version used in OpenShift Container Platform environments, and is available in the RHEL Extras repository.
Note
If running RHEL v8 or higher, the engine installs Podman packages and configures the operating system to enable Podman in rootless mode.
For more information about the different packages available to install on Red Hat, see the Red Hat Knowledge Base Article (requires a Red Hat subscription to access).
Install Red Hat’s Docker package.
Run the following commands.
systemctl enable docker.servicesystemctl restart docker.serviceChange ownership of the Docker daemon socket so members of the
dockerrootuser group have access.Edit or create the file
/etc/docker/daemon.json.Enable OS group
dockerrootaccess to Docker by adding the following entry to the/etc/docker/daemon.json: "group": "dockerroot"file. For example:{ "group": "dockerroot" }Restart the Docker service by running the following command.
systemctl restart docker.serviceAfter the engine is installed, run the following command to add the
demistoos user to thedockerrootos group (Red Hat uses dockerroot group instead of docker).usermod -aG dockerroot demistoRestart the engine.
Set the required SELinux permissions.
The Cortex XSOAR engine uses the
/var/lib/demisto/tempdirectory (with subdirs) to copy files and receive files from running Docker containers. By default, when SELinux is in enforcing mode directories under/var/lib/it cannot be accessed by Docker containers.To allow containers access to the
/var/lib/demisto/tempdirectory, you need to set the correct SELinux policy type, by typing the following command.chcon -Rt svirt_sandbox_file_t /var/lib/demisto/temp( Optional) Verify that the directory has the
container_file_tSELinux type attached by running the following command.ls -d -Z /var/lib/demisto/tempConfigure label confinement to allow Python and PowerShell containers to access other script folders.
In the d1.conf file, set the following parameters:
KeyValueFor Python containers
python.pass.extra.keys
--security-opt=label=level:s0:c100,c200
For PowerShell containers
powershell.pass.extra.keys
--security-opt=label=level:s0:c100,c200
Open any incident and in the incident War Room CLI, run the
/reset_containerscommand.
Docker image security
The project that contains the source Dockerfiles used to build the images and the accompanying files is fully open source and available for review. Cortex XSOAR uses the secure Docker Hub registry for its Docker images. However, in an Engine environment, you can also use the PANW registry . You can view the Docker trust information for each image at the image info branch.

We automatically update our open source Docker images and their accompanying dependencies (OS and Python). Examples of automatic updates can be viewed on GitHub.
We maintain Docker image information which includes information on Python packages, OS packages and image metadata for all our Docker images. Data image information is updated nightly.
All of our images are continuously scanned using Prisma Cloud for known and newly published vulnerabilities, in two scenarios:
Every new image, and every new version of an image, are scanned before publishing to our public registries, as part of our CI/CD process.
All existing images are continuously scanned to check whether new vulnerabilities were published and now exist in those images.
We evaluate all critical/high findings and actively work to prevent and mitigate security vulnerabilities.
Cortex XSOAR ensures container images are fully patched and do not contain unnecessary packages. Patches and dependencies are applied automatically via our open source docker files build project.
Response Prioritization
We remediate any critical and high level vulnerabilities, irrespective of who found them. Issues may be discovered by external researchers, found during internal testing, encountered by customers or reported by other organizations and vendors.
Any vulnerability with a possible exploitation against our images would be responded to with utmost urgency. If we conclude that there is a risk for our customers we will issue an advisory with recommended actions and mitigations. Advisories are published at: https://security.paloaltonetworks.com/.
In each version release (every 3 months,) we publish a new version of our content, that will use the latest and secure versions of our images.
Troubleshooting
Purge old and unused images periodically.
If you scanned the Docker images locally, and found some critical CVE’s - Make sure you use the latest version of the pack, as it should have the latest version of the image. In addition, purge the old and unused image with vulnerabilities.
Use the Cortex XSOAR Container Registry
By default, Cortex XSOAR uses Docker Hub's public container registry. As an alternative to using Docker Hub, you can use the Cortex XSOAR private container registry (XSOAR Registry), which contains all Docker images that Cortex XSOAR uses in integrations and automations. When you use the XSOAR Container Registry, you can avoid limitations that Docker imposes on Docker Hub, for example rate limits. The registry is available at: xsoar-registry.pan.dev.
The XSOAR Registry requires authentication using the following credentials:
Username: Use the license Customer Name, by going to Settings → About → License.
Password: Use the License ID. To obtain the License ID, go to the License file and copy the ID from the
idproperty, or run the!GetLicenseIDcommand, included in the Common Scripts content pack.The License ID starts and ends with the CUID string.
To pull Docker images from the XSOAR Registry, verify the following base URLs are allowed in your firewall/proxy:
https://xsoar-registry.pan.devhttps://gcr.io
When using a custom Docker registry, including the Cortex XSOAR Container Registry, you must include localhost when you create a custom Docker image. Examples:
localhost.local/directory/container_namelocalhost/directory/container_name
Authenticate to the XSOAR Registry.
For Docker:
sudo -u demisto docker login -u`` ``<license customer name>-p<license id>xsoar-registry.pan.devFor Podman (Red Hat 8.x):
sudo su -s /bin/bash - demisto -c 'podman login -u "<license customer name>" -p "<license id>" xsoar-registry.pan.dev'
If you see an error such as
Error saving credentials: mkdir /home/demisto: permission denied, the demisto user is either missing the home directory or the permissions on the directory are not valid.To verify the home directory assigned to the demisto user, run
echo ~demistoto display the home directory, such as:/home/demisto.To ensure the directory exists and has the correct permissions, run the following commands, using the directory from
echo ~demisto:sudo mkdir -p`` ``/home/demistosudo chown -R demisto:demisto`` ``/home/demisto
Test that the XSOAR Registry is properly authenticated.
For Docker:
sudo -u demisto docker pull xsoar-registry.pan.dev/demisto/python3:3.10.4.27798For Podman (Red Hat 8.x):
sudo su -s /bin/bash - demisto -c 'podman pull xsoar-registry.pan.dev/demisto/python3:3.10.4.27798'
Apply the following configuration to the engine machine by adding to the JSON file:
Test a Docker based automation or integration.
If you need to use external Docker images (images not available in the XSOAR Registry and not part of the demisto org) in custom content, specify the full image name with the registry prefix in the automation or integration configuration. For example:
docker.io/frolvlad/alpine-python2:latest
registry.access.redhat.com/ubi8/python-38:latest
myregistryhost:5000/myorg/myimage:version1.0
Docker FAQs
Does Cortex XSOAR use COPY or ADD for building images?
Cortex XSOAR uses COPY for building images. The COPY instruction copies files from the local host machine to the container file system. Cortex XSOAR does not use the ADD instruction, which could potentially retrieve files from remote URLs and perform operations such as unpacking, introducing potential security vulnerabilities.
Should the
--restart flagbe used?The --restart flag should not be used. Cortex XSOAR manages the lifecycle of Docker images and restarts images as needed.
Can we restrict containers from acquiring additional privileges by setting the no-new-privileges option?
Cortex XSOAR does not support the no-new-privileges option. Some integrations and scripts may need to change privileges when running as a non-root user (such as Ping).
Can we apply a daemon-wide custom seccomp profile?
The default seccomp profile from Docker is strongly recommended. The default seccomp profile provides protection as well as wide application compatibility. While you can apply a custom seccomp profile, Cortex XSOAR cannot guarantee that it won't block system calls used by an integration or script. If you apply a custom seccomp profile, you need to verify and test the profile with any integrations or scripts you plan to use.
Can we use TLS authentication for docker daemon configuration?
TLS authentication is not used, because Cortex XSOAR does not use Docker remote connections. All communication is done via the local Docker IPC socket.
How do we set the logging level to
info?Set the log level in the Docker daemon configuration file.
Can we restrict Linux kernel capabilities within containers?
The default Docker settings (recommended) include 14 kernel capabilities and exclude 23 kernel capabilities. Refer to Docker’s full list of runtime privileges and Linux capabilities.
You can further exclude capabilities via advanced configuration, but will first need to verify that you are not using a script that requires the capability. For example, Ping requires
NET_RAWcapability.Is the Docker health check option implemented at runtime?
The Cortex XSOAR tenant monitors the health of the containers and restarts/terminates containers as needed. The Docker health check option is not needed.
Can we enable live restore?
Live restore is not used. Cortex XSOAR uses ephemeral Docker containers. Every running container is stateless by design.
Can we restrict network traffic between containers?
Cortex XSOAR does not disable inter-container communication by default, as there are use cases where this might be needed. For example, a script communicating with a long running integration which listens on a port, may require inter-container communication. If inter-container communication is not required, it can be disabled by modifying the Docker daemon configuration.
Can we enable user namespace remapping?
Cortex XSOAR does not support user namespace remapping.
How do we configure auditing for Docker files and directories?
Auditing is an operating system configuration, and can be enabled in the operating system settings. Cortex XSOAR does not change the audit settings of the operating system.
Does Cortex XSOAR map privileged ports?
Cortex XSOAR does not map privileged ports (TCP/IP port numbers below 1024).
Does Cortex XSOAR allow privileged execution?
Cortex XSOAR does not allow privileged execution of Docker commands.
Does Cortex XSOAR run SSH within containers?
Cortex XSOAR does not run SSH within containers.
Does Cortex XSOAR change the ownership of the socket?
Cortex XSOAR does not change the ownership of the socket.
Can we disable the userland proxy?
If the kernel supports hairpin NAT, you can disable docker userland proxy settings by modifying the Docker daemon configuration.
Does Cortex XSOAR support the AppArmor profile?
Cortex XSOAR supports the default AppArmor profile (only relevant for Ubuntu with AppArmor enabled).
Does Cortex XSOAR support the SELinux profile?
Cortex XSOAR supports the default SELinux profile (only relevant for RedHat with SELinux enabled).
How does Cortex XSOAR handle secrets management?
For Docker swarm services, a secret is a blob of data, such as password, SSH private keys, SSL certificates, or other piece of data that should not be transmitted over a network or stored unencrypted in a Docker file or in your application’s source code. Cortex XSOAR manages integration credentials internally. It also supports using an external credentials service such as CyberArk.
Troubleshoot Docker issues
The following provides troubleshooting solutions for Docker networking and performance issues.
Troubleshoot Docker networking issues
In Cortex XSOAR, integrations and scripts run either on the tenant, or on an engine.
If you have Docker networking issues when using an engine, you need to modify the d1.conf file.
On the machine where the Engine is installed, open the
d1.conffile.Add the following to the
d1.conffile:Save the file.
Restart the engine using
systemctl restart d1orservice d1 restart.
Troubleshoot Docker performance issues
This information is intended to help resolve the following Docker performance issues.
Containers are getting stuck.
The Docker process consumes a lot of resources.
Time synchronization issues between the container and the operating system.
Cause
The installed Docker package and its dependencies are not up to date.
Workaround
Update the package manager cache.
Linux DistributionCommandDebian
apt-get update(Optional) Check for a newer version of the Docker package.
Linux DistributionCommandDebian
apt-cache policy dockerUpdate the Docker package.
Linux DistributionCommandDebian
apt-get update docker
Configure Docker pull rate limit
Docker enforces a pull rate limit on public images. The limit is based on an IP address or as a logged-in Docker hub user. The default limit (100 pulls per 6 hours) is usually high enough for Cortex XSOAR's use of Docker images, but the rate limit may be reached if using a single IP address for a large organization (behind a NAT). If the rate limit is reached, the following error message is issued:
Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit.
To increase the limit:
Sign up a free user in the Docker hub.
The pull limit is higher for a registered user (200 pulls per 6 hours).
Authenticate the user on the engine machine by running the following command.
sudo -u demisto docker login(Optional) Instead of manually logging in to Docker to pull images, you can edit the Docker config file to use credentials from the file or from a credential store.
Change the Docker installation folder
The /var/lib/docker/ folder is the default Docker folder for Ubuntu, Fedora, and Deblan in a standard engine installation.
To change the Docker folder:
Stop the Docker daemon.
sudo service docker stopCreate a file called
daemon.jsonunder the/etc/dockerdirectory with the following content:Copy the current data directory to the new one.
sudo rsync -aP /var/lib/docker/ <path to your Docker folder>Rename the old docker directory.
sudo mv /var/lib/docker /var/lib/docker.bkpAfter confirming that the change was successful, you can remove the backup file.
sudo rm -rf /var/lib/docker.bkpStart the Docker daemon.
sudo service docker start
Configure Docker integrations to trust custom certificates
Python, Javascript, and native integrations running in Docker use an engine's built-in set of CA-signed certificates to validate TLS communication. If you need to change the certificate bundle of the operating system you are working on, for Javascript and native integrations you need to add custom trusted certificates to the engine built-in set, and for Python Docker integrations you need to create a certificate file that includes the custom certificates and add it to the engine. This is relevant for example if you work with a proxy that performs SSL traffic inspection or use a service that has a self-signed certificate.
Configure Javascript and Native integrations to trust custom certificates
Add the certificate to the machine’s trusted root CA bundle. The location of the CA bundle depends on the operating system version and the operating configuration.
Examples of bundle paths:
"/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc.
"/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL 6
"/etc/ssl/ca-bundle.pem", // OpenSUSE
"/etc/pki/tls/cacert.pem", // OpenELEC
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", //RHEL 7
"/etc/ssl/cert.pem", // Alpine Linux
Examples of certificate bundle directories:
"/etc/ssl/certs", // SLES10/SLES11, https://golang.org/issue/12139
"/etc/pki/tls/certs", // Fedora/RHEL
Restart the engine.
Configure Python Docker integrations to trust custom certificates
This procedure assumes that the Cortex XSOAR lib dir is configured to the default location /var/lib/demisto.
Note
Only PEM format for certificates is supported.
/var/lib/demistorequires root access. This is relevant for Docker and Podman.
Configure the custom certificates for the engine.
Create a certificate PEM file that includes all of the required custom certificates.
To examine the certificate chain used by a specific endpoint, run the following command on the engine machine (requires openssl client):
openssl s_client -servername <host_name> -host <host_name> -port 443 -showcerts < /dev/nullFor example,
openssl s_client -servername api.github.com -host api.github.com -port 443 -showcerts < /dev/nullThis prints certificate information including the PEM representation of the certificates. After examining the output, if you see
Verification error: unable to get issuer certificate, one or more certificates in the certificate chain is not available and you need to obtain these certificates from your IT administrator.To save the certificates to a
certs.pemfile run the following command:openssl s_client -servername api.github.com -host api.github.com -port 443 -showcerts < /dev/null 2>/dev/null | sed -n '/^-----BEGIN CERT/,/^-----END CERT/p' > certs.pemTo verify that the
certs.pemhas all needed certificates as part of the certificate chain, runopenssl verify -CAfile certs.pem site.pem, wheresite.pemcontains the certificate of a specific site you want to trust. To get the cert of a site, runopenssl s_client -servername <site_host> -host <site_host> -port 443and copy the base content including-----BEGIN CERTIFICATE-----and-----END CERTIFICATE-----.After saving the
certs.pemfile, add its content to/var/lib/demisto/python-ssl-certs.pem, by running the following command:cat certs.pem >> /var/lib/demisto/python-ssl-certs.pem
(RedHat only) Set the required SELinux permissions.
By default, when SELinux is in enforcing mode, directories under
/var/lib/cannot be accessed by Docker containers. To allow container access to the/var/lib/demisto/python-ssl-certs.pemfile, you need to set the correct SELinux policy type, by typing the following command:chcon -t svirt_sandbox_file_t /var/lib/demisto/python-ssl-certs.pem(Optional) Verify that the file has the
container_file_t SELinuxtype attached by running the following command:ls -d -Z /var/lib/demisto/python-ssl-certs.pem
(Optional) If you require the standard set of certificates trusted by browsers, you can append the CA certificates provided by your operating system. For example, on Ubuntu, these certificates are located at the following path:
/etc/ssl/certs/ca-certificates.crt. Alternatively, you can download the PEM certificates file provided by the Certifi Project and add your custom certificates to the file that contains the standard set of certificates. For more details, see the cacert.pem file.This example adds the
proxy-ca.pemfile (custom certificate) to thecacert.pemfile (standard certificates):cat proxy-ca.pem >> cacert.pemCopy the certificates PEM file to the following path.
/var/lib/demisto/python-ssl-certs.pem(Multi-tenant) In a multi-tenant deployment, the certificate is copied to the following path on the host machine:
/var/lib/demisto/tenants/acc_TENANT/python-ssl-certs.pem
Add the certificate file to your engines.
Configure each engine to use the
/var/lib/demisto/python-ssl-certs.pemfile.Verify you have the following directory on the engine host.
/var/lib/demistoSet the demisto user as the directory owner with 0700 permissions.
Copy the
python-ssl-certs.pemfile to the/var/lib/demisto directory.Add the following configuration to either the engine configuration file (in the UI) or to the
d1.conffile."python.docker.use_custom_certs": true
Restart the engine.
After saving the
python.docker.use_custom_certsconfiguration on your engine, Docker images that are launched by the engine will contain the certificates file mounted in the following path:/etc/custom-python-ssl/certs.pemAdditionally, the following environment variables will be set with the value of the certificates file path, which enables standard Python HTTP libraries to automatically trust the certificates (without code modifications):
REQUESTS_CA_BUNDLESSL_CERT_FILEThe Python SSL library checks the
SSL_CERT_FILEenvironment variable only when using OpenSSL. If you use a Docker image that usesLibreSSL, theSSL_CERT_FILEenvironment variable will be ignored. For more details, see LibreSSL support.
Note
If you are developing your own integration (BYOI) and using non-standard HTTP libraries, you might need to include specific code that will trust the passed certificates file when the environment variable SSL_CERT_FILE is set. In this case, always use the value in the environment variable as the path for the certificates file, and do not hard code the mounted path specified above. For example:
Check the integration runs correctly on your engine.
For more information about troubleshooting, see TLS/SSL troubleshooting.
Docker hardening guide
The following describes the engine settings we recommend for securely running Docker containers on Ubuntu, using iptables to restrict IP access.
When editing the configuration file, you can limit container resources, open file descriptors, limit available CPU, and more. For example, add the following keys to the configuration file:
{"docker.run.internal.asuser": true,"limit.docker.cpu": true,"limit.docker.memory": true,"python.pass.extra.keys": "--pids-limit=256##--ulimit=nofile=1024:8192"}
Tip
We recommend reviewing Docker network hardening below, before changing any parameters in the configuration file.
To securely run Docker containers, we recommend to use the latest Docker version.
You can Check Docker Hardening Configurations to verify that the Docker container has been hardened according to the settings we recommend.
Note
The settings below can also be applied to Podman, with the exception of limiting available memory, limiting available CPU, and limiting PIDS.
Last updated
Was this helpful?
