Skip to main content

Container Security

Keep your containers secure with SailOps security features.

Container Security

Security Overview​

SailOps provides multiple layers of security for your containers:

  • Strong container isolation - Each container runs in a fully isolated environment
  • Network isolation between projects
  • Encrypted communication (TLS everywhere)
  • Secure secrets management
  • Optional security context for additional hardening
  • Read-only file systems option
  • Resource limits to prevent abuse

Container Isolation​

All containers on SailOps benefit from strong isolation by default. Each container runs in a fully isolated environment, meaning:

  • Containers cannot access other containers or the host system
  • Root inside the container is safe and does not compromise security
  • No additional configuration needed for secure operation
Strong Isolation by Default

SailOps isolation ensures that even if an attacker compromises your application, they cannot escape to affect other containers or the infrastructure.

Security Context (Optional)​

Thanks to our strong isolation, security context settings are optional. You only need to configure them for compliance requirements or additional hardening.

ScenarioSecurity Context Needed?
Standard workloadsNo - isolation is sufficient
Compliance requirementsYes - enables audit controls
Defense in depthYes - adds application-level restrictions
Legacy apps needing rootNo - root is safe with our isolation

Network Security​

Project Isolation​

Each project runs in an isolated network namespace:

  • Containers can only communicate within their project
  • Cross-project communication requires explicit gateways
  • External traffic must go through gateways

Internal DNS​

Containers communicate using internal DNS within the same project:

{service-name}.{namespace}

For example, if your container is named backend in the namespace my-project-abc123:

backend.my-project-abc123

This DNS is only resolvable within the same project namespace.

Ingress Protection​

All external traffic passes through gateways:

  • Automatic TLS termination
  • DDoS protection
  • Rate limiting (configurable)

Secrets Management​

Environment Variables​

Store secrets as environment variables:

  1. Go to container Configuration
  2. Add variable with Secret toggle enabled
  3. Value is encrypted at rest
  4. Hidden in UI and logs

Best Practices​

DoDon't
Use environment variablesHardcode secrets in images
Rotate secrets regularlyShare secrets across projects
Use different secrets per envLog secrets accidentally
Encrypt secrets at restCommit secrets to git

Secret Rotation​

To rotate a secret:

  1. Update the environment variable
  2. Container restarts automatically
  3. New value takes effect immediately

Container Hardening​

Security Context (Optional)​

SailOps provides strong container isolation by default. You can optionally configure a security context for additional hardening.

To configure:

  1. Go to your container configuration
  2. Navigate to Advanced Settings > Security Context
  3. Set Run As User ID (e.g., 1000)
  4. Set Run As Group ID (e.g., 1000)
  5. Save changes

When configured, SailOps automatically applies additional security restrictions including non-root enforcement and read-only filesystem.

Default Behavior

Without security context configuration, containers run with strong isolation. This is sufficient for most workloads and allows containers to run as root if needed.

Running as Non-Root (Optional)​

If you configure a security context, ensure your Dockerfile specifies a matching non-root user:

# In your Dockerfile
USER 1000:1000

Running as Root (Default)​

Without security context configuration, containers can run as root. This is safe because:

  • Strong isolation protects the host and other containers
  • Root inside the container ≠ root on the host
  • Perfect for legacy applications requiring root
# No USER instruction needed
# Container runs as root (safe with SailOps isolation)
FROM nginx:alpine

Read-Only Filesystem​

When security context is enabled, the root filesystem becomes read-only. SailOps automatically mounts a writable /tmp directory (1GB limit) for temporary files.

Automatic /tmp Volume

You don't need to configure anything for temporary files. SailOps provides a writable /tmp directory automatically, regardless of security context settings.

Resource Limits​

Resource limits prevent runaway processes:

ResourceLimitPurpose
CPUPer compute classPrevent CPU starvation
MemoryPer compute classPrevent OOM
File Descriptors65535Prevent resource exhaustion
Processes1000Prevent fork bombs

Image Security​

Use Official Images​

Prefer official images from trusted sources:

# Good
FROM node:20-alpine
FROM python:3.12-slim

# Avoid
FROM random-user/node:latest

Keep Images Updated​

Regularly update base images to get security patches:

docker pull node:20-alpine
docker build --no-cache .

Scan Images​

Scan images for vulnerabilities before deployment:

  • Docker Scout
  • Trivy
  • Snyk

Minimal Images​

Use minimal base images:

Base ImageSizeSecurity
Alpine~5MBMinimal attack surface
Distroless~20MBNo shell, no package manager
Debian-slim~80MBBalance of size and utilities

Secure Dockerfile Practices​

Example Secure Dockerfile​

# Use specific version, not 'latest'
FROM node:20-alpine

# Create non-root user
RUN addgroup -g 1001 app && \
adduser -u 1001 -G app -s /bin/sh -D app

# Set working directory
WORKDIR /app

# Copy package files first (layer caching)
COPY package*.json ./

# Install dependencies
RUN npm ci --only=production

# Copy application code
COPY --chown=app:app . .

# Switch to non-root user
USER app

# Expose port
EXPOSE 3000

# Define health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1

# Start application
CMD ["node", "server.js"]

Security Checklist​

  • Use specific image tags, not latest
  • Consider security context for compliance requirements
  • Use multi-stage builds
  • Don't copy unnecessary files
  • Remove development dependencies
  • Don't store secrets in image

Network Policies​

Default Behavior​

  • All containers in a project can communicate
  • External access only via gateways
  • No access between projects

Restricting Access​

Contact support for custom network policies:

  • Restrict container-to-container traffic
  • Limit egress destinations
  • IP whitelisting for ingress

Compliance​

Data Protection​

  • Data encrypted in transit (TLS)
  • Data encrypted at rest by the hosting infrastructure
  • Data hosted in Paris, France (European Union)
  • GDPR compliance

Access Control​

  • Role-based access control (RBAC)
  • API key management
  • Sign-in with Google or GitHub
  • Two-factor authentication (TOTP)

Security Monitoring​

Alerts​

Set up security alerts for:

  • Container crashes (potential attacks)
  • Unusual resource usage
  • Failed health checks
  • Image pull failures

Configure alerts →

Incident Response​

If You Suspect a Breach​

  1. Isolate - Stop affected containers
  2. Investigate - Review logs and events
  3. Notify - Contact [email protected]
  4. Remediate - Rotate secrets, update images
  5. Document - Record findings

Support Contact​

For security issues:

Best Practices Summary​

CategoryRecommendation
IsolationStrong isolation is automatic - no configuration needed
ImagesUse minimal, official, updated images
SecretsUse environment variables, never in code
Security ContextOptional - enable for compliance or defense in depth
NetworkUse internal DNS, gateway for external
MonitoringSet up alerts for anomalies
UpdatesKeep dependencies current