apiVersion: apps/v1
kind: Deployment
metadata:
  name: appdiscovery-tool
  labels:
    app: appdiscovery
    type: security-tool
spec:
  replicas: 1
  selector:
    matchLabels:
      app: appdiscovery
  template:
    metadata:
      labels:
        app: appdiscovery
        type: security-tool
    spec:
      containers:
      - name: appdiscovery-ctr
        imagePullPolicy: Always
        image: abh1sek/appsec-workflow-appdiscovery
        command: ["/usr/bin/workflow-tool-adapter"]
        env:
          - name: MINIO_ENDPOINT
            valueFrom:
              secretKeyRef:
                  name: common-secrets
                  key: MINIO_ENDPOINT
          - name: MINIO_ACCESS_KEY
            valueFrom:
              secretKeyRef:
                  name: minio-secret
                  key: accesskey
          - name: MINIO_SECRET_KEY
            valueFrom:
              secretKeyRef:
                  name: minio-secret
                  key: secretkey
          - name: MINIO_OUTPUT_BUCKET
            value: tools-output
          - name: NATS_URL
            valueFrom:
              secretKeyRef:
                  name: common-secrets
                  key: NATS_URL
          - name: MINIO_OUTPUT_FILE
            value: scans/{{SCAN_ID}}/tool-appdiscovery-{{TIMESTAMP}}.json
          - name: TOOL_NAME
            value: appdiscovery
          - name: NATS_CONSUMER_TOPIC
            value: input.host
          - name: NATS_QUEUE_GROUP_NAME
            value: appdiscovery-tool
          - name: TOOL_COMPLETION_EVENT_TOPIC
            value: output.tool.appdiscovery
          - name: TOOL_EXEC_PATTERN
            value: "/app/ep.sh {{TARGET}}"
          - name: TOOL_EXEC_TIMEOUT
            value: "900"
          - name: TOOL_CAPTURE_STDOUT
            value: "yes"
