System Integrator (SI) ToolkitSystem Integrator (SI) Toolkit
Introduction
Management
Business Operations
Technical Integration Guide
Deployment
Technical Reference
Scheme Designs
Introduction
Management
Business Operations
Technical Integration Guide
Deployment
Technical Reference
Scheme Designs
  • Introduction

    • System Integrator (SI) Toolkit
    • DFSP Onboarding Guide and Roadmap
    • Customer Journey
  • Management
  • Business Operations
  • Technical Integration Guide

    • Technical Integration
    • Inclusive Instant Payment System (IIPS) Integration
    • Development guide for building core-connectors
    • Core Connector Testing Harness
    • Core Connector Template
    • ISO20022 and Merchant Payments.
  • Deployment

    • Overview
    • Docker Compose

      • Payment Manager Deployment Guide
      • Core Connector Guide
      • Deploying Payment Manager
      • Configuring the core connectors
      • Connecting to a Hub
      • Securing the Docker Daemon
      • Firewall Configuration in Ubuntu and AWS EC2 (t2.large)
      • Test Transfer Process
  • Technical Reference

    • API Service
    • Routing and API Specifications
    • Networking
    • Core Banking Solution (CBS) Client
    • Mojaloop Connector Client (SDK Client)
    • Configuration.
    • Core Connector Aggregate (Business Logic)
    • Error Handling
    • Integration Accounts
    • Request Handling Lifecycle
  • Scheme Designs

    • Foreign Exchange - Currency Conversion
    • Interscheme

Securing the Docker Daemon

Securing the Docker Daemon is crucial to protect containerized applications from unauthorized access and potential security threats. This guide will walk you through the necessary steps to harden Docker Daemon.

1. Restrict Docker API Access

Open Docker Configuration File

Modify the Docker configuration file to restrict the API to only be accessible via Unix socket, preventing external access over TCP.

sudo nano /etc/docker/daemon.json

Ensure Docker is Only Accessible via Unix Socket

Update daemon.json to ensure Docker listens only on the Unix socket.

{
  "hosts": ["unix:///var/run/docker.sock"]
}

Restart Docker Service

Restart Docker to apply the changes.

sudo systemctl restart docker

2. Implement User Access Control

Create a Docker Group

Create a Docker group to manage access to Docker commands securely.

sudo groupadd docker

Add a User to the Docker Group

Grant a user access to Docker without needing sudo.

sudo usermod -aG docker username

Restart the Session for Changes to Take Effect

After adding the user to the Docker group, restart the session.

newgrp docker

3. Limit Container Privileges

Run a Container with Dropped Capabilities

Limit the container's capabilities to minimize the risk of privilege escalation.

docker run --cap-drop=ALL --cap-add=NET_BIND_SERVICE my_container

Prevent Privilege Escalation

Ensure that containers cannot escalate their privileges.

docker run --security-opt=no-new-privileges my_container

4. Configure Seccomp and AppArmor Profiles

Use the Default Seccomp Profile

Ensure Docker containers use the default Seccomp profile to limit the available system calls.

docker run --security-opt seccomp=default my_container

Apply AppArmor Profiles

Apply the default AppArmor profile to containers for additional security.

docker run --security-opt apparmor=docker-default my_container

5. Enable Logging and Monitoring

Configure Docker Logging Driver

Set up logging for Docker containers by configuring the Docker logging driver and enabling log rotation.

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}

Restart Docker Service

Restart Docker to apply logging configurations.

sudo systemctl restart docker

6. Keep Docker Updated

Update Docker to the Latest Stable Version

Keep Docker up to date to ensure all security patches and bug fixes are applied.

sudo apt-get update

Verify the Installed Version

After updating Docker, check the version to confirm the update was successful.

docker --version
Last Updated:
Contributors: Paul Baker
Prev
Connecting to a Hub
Next
Firewall Configuration in Ubuntu and AWS EC2 (t2.large)