Skip to content

Examples

segmented

Three networks and a router: the user lands on access, may reach the web server on front, and nothing on back; only front may reach the cache, and only on 6379. The web server's port 4444 is an admin console started only on demand: dormant, so nothing waits for it or expects it to answer, but reach still applies to it.

The example's folder, with the files its spec names: examples/segmented.

version: 1
name: segmented

networks:
  front:  { cidr: 10.61.10.0/24 }
  back:   { cidr: 10.61.20.0/24, internet: false }
  access: { cidr: 10.61.99.0/24 }

reach:
  - { from: access, to: front }
  - { from: front, to: back, ports: [6379] }

machines:
  cache:
    os: debian@12
    networks: { back: 20 }
    ports: { redis: 6379 }
    resources: { cpus: 1, memory_mb: 1024, disk_gb: 10 }
    volumes: { data: /data }
    app:
      image: "redis:7-alpine"
      steps: [{ run: provision/cache.sh }]

  web:
    os: debian@12
    networks: { front: 10 }
    ports:
      web: { port: 80, protocol: http }
      shell: { port: 4444, dormant: true }
    depends_on: [cache]
    app:
      build: build/web
      steps: [{ run: provision/web.sh }]

  user:
    os: debian@12
    access: true
    networks: { access: 10 }

checks:
  - name: the web page answers through the router
    from: user
    http: http://web/
    expect: 200
    wait: 60
  - name: the cache is sealed off from the user
    from: user
    tcp: cache:6379
    expect: blocked

Targets

docker, hosted, docker-vm, cloud-docker, kubernetes, vagrant, proxmox, esxi, cloud-vm. See targets for what each means.

Checks

The spec's own:

  • the web page answers through the router (http)
  • the cache is sealed off from the user (tcp)

Plus the checks Isoloom derives from the machines' ports and the reach rules. See checks.