Docker Swarm : Stack OpenVAS

Docker Swarm : Stack OpenVAS

Table of Contents

Informations importantes

Fichier stack.yml

version: '3.3'

services:

  app:
    image: immauss/openvas
    environment:
      # Indiquer un mot de passe pour le compte admin de l'application
      PASSWORD: MotDePasseTresSecure
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/localtime:/etc/localtime:ro
      # Indiquer les volumes à monter. Si le volume est inexistant, il sera créé automatiquement. Attention si contexte de cluster (swarm), penser à placer une contrainte de label.
      - data:/data
    networks:
      # Indispensable pour communiquer avec traefik
      - traefik-public
    deploy:
      #resources:
        #limits:
          #cpus: '0.50'
          #memory: 1024M
        #reservations:
          #cpus: '0.25'
          #memory: 512M
      placement:
        constraints:
          - node.labels.openvas_data == true
      labels:
        # Activation de traefik
        - traefik.enable=true
        - traefik.docker.network=traefik-public
        - traefik.constraint-label=traefik-public
        # Indiquer l'URL de l'application (openvas.example.com)
        - traefik.http.routers.openvas-http.rule=Host(`openvas.example.com`)
        - traefik.http.routers.openvas-http.entrypoints=http
        - traefik.http.routers.openvas-http.middlewares=https-redirect
        # Indiquer l'URL de l'application (openvas.example.com)
        - traefik.http.routers.openvas-https.rule=Host(`openvas.example.com`)
        - traefik.http.routers.openvas-https.entrypoints=https
        - traefik.http.routers.openvas-https.tls=true
        - traefik.http.routers.openvas-https.tls.certresolver=le
        # Indiquer le nomagentapplication pour les headers à travers traefik
        - traefik.http.middlewares.hsts-headers.headers.stsSeconds=315360000
        - traefik.http.middlewares.hsts-headers.headers.stsPreload=true
        - traefik.http.middlewares.hsts-headers.headers.stsIncludeSubdomains=true
        - traefik.http.middlewares.hsts-headers.headers.customFrameOptionsValue=SAMEORIGIN
        - traefik.http.middlewares.hsts-headers.headers.sslRedirect=true
        - traefik.http.middlewares.hsts-headers.headers.forceSTSHeader=true
        - traefik.http.middlewares.hsts-headers.headers.referrerPolicy=same-origin
        - traefik.http.routers.openvas-https.middlewares=hsts-headers
        - traefik.http.services.openvas.loadbalancer.server.port=9392

networks:
  traefik-public:
    external: true

volumes:
  data:
    driver: local

Déploiement

docker stack deploy -c stack.yml openvas
Les commentaires sont fermés.