image:
  distribution: "kali"
  release: kali-rolling

source:
  downloader: debootstrap
  url: https://kali.download/kali/
  same_as: sid
  keys:
  - |-
    -----BEGIN PGP PUBLIC KEY BLOCK-----

    mQINBGgBJJUBEADlMTZVDCjrSXIAuYfL3VZt8OoplUdw3mSPlhIjZQmIo2sdzvAF
    EMSCQ+vWeD4VqV9tBtiVx6j8VSfyW18YHHAkvajWDRg5hPLf80wGxrtXYu+vj3Ri
    5dOMhrl9fHKIifPOoV3pFTtOk0dB9lkcmtNzjWgwOJduLbjjraE1BBKqc0uaXDCa
    RJnPYkQuJQcZxmZVFAo9NP7KSAL1zMvutAd0R3WeMaWpT22nGa3rJj4kj25zV6Kn
    qGnv5kQaY2cTlQHnp6EbiLe5sCE7zIOp5CjwIJhyCyn4zT8KqGB8Sw8PEi9mYlSY
    wbGzzfAAbBk7Y8xbmvRrkrHzU74jH0iMK566QVu2yl3Dz0hrlliV6vGn2ZWu7qmh
    lwXSb+q4u46tDbFjdUjYJG2upx5vOm5SewD9snLB4YN2e2qDeQgY16AfpkJa51+u
    PwTeDCbfuQu3irLWcGRZgpOBgsxqCtpZBmF6ED7L8tntoyjZ9WeB8FnTcv7hx5J1
    IPCO4K5TvW0SX6ZKp1Jusbkn5hrrFTjOJHhIDVdioM/wYDKkqJ9e25oGAqPkJYRY
    euonU1teK+EOLM7ZIbalhukrw0bgYl9UJRxQMLEhZzoiiCLLiv3oWHAQGFclP+1E
    zXgbLBviFAU4+DMXfhA6vy8BmS9oTpleS1p3/EOwf2rX/yt4qF7IW9ZXuQARAQAB
    tEBLYWxpIExpbnV4IEFyY2hpdmUgQXV0b21hdGljIFNpZ25pbmcgS2V5ICgyMDI1
    KSA8ZGV2ZWxAa2FsaS5vcmc+iQJUBBMBCgA+FiEEgnyFafJRjMZ3/soa7WVGLsjV
    5MUFAmgF7tkCGwMFCQWkfeUFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ7WVG
    LsjV5MXcjw//XeI6OXY7VcH+hXRcT7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ZGW
    4lBoYCiVFmco2spHw0Jy5sjC93j1AG6pGFFVhtstkPgSuztcRkYFxkEWHk8HBIXA
    Bib0nqFO92m0nPFNzhvw5nvwySPaWCt4hQmZrSN7i6mPSXSf5Cn8eybeEqXkIA7P
    auEORPAgDpU4PVNOB9cA608FAU4Cqah1COrunpR7hp+Zc+zAxeIDkW71vagxaMQB
    t4E9G76uWhA/1rqBKxU9ZWvWhEaMuZm6gZm5/sNvBdy8nEhnnEcaBeJ+LV1fzbdp
    zsNxk23y/GzmV/PWUFi7s77Q2iDVTDyrklG9lmirpuUKEKuv4hVW3gbwjc2Ay+sb
    +48Aq2P/9YbzVyjP8trIho3KO3RkS6n2ZkeZBEFQPLOODhLObBLe2hR0pKp11Kgc
    jU0PRuDTfhUBLcnCr+vwdQuboBZy0AcurVmjAH568tNXdaP3WYH+ZsWkhRHop5ax
    NaBQJ2FDl6rNPYjaPTp09Fig4gbE4cuz8M29i0TlQs/bixuIGyz+6fsY2jhmQqTs
    M7ywm9RRjEfiRPgMXoJx2xxX28nzZ+uer6DZ8EnTMNoYp1Yx8kNgJGtmKv7uKn9n
    5L4BmZ/oTEg=
    =EJtZ
    -----END PGP PUBLIC KEY BLOCK-----
  variant: minbase

targets:
  lxc:
    create_message: |-
      You just created a {{ image.description }} container.

      To enable SSH, run: apt install openssh-server
      No default root or user password are set by LXC.

    config:
    - type: all
      before: 5
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/debian.common.conf

    - type: all
      after: 4
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/common.conf

    - type: user
      after: 4
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/userns.conf

    - type: all
      content: |-
        lxc.arch = {{ image.architecture_personality }}

files:
- path: /etc/hostname
  generator: hostname

- path: /etc/hosts
  generator: hosts

- path: /etc/resolvconf/resolv.conf.d/original
  generator: remove

- path: /etc/resolvconf/resolv.conf.d/tail
  generator: remove

- path: /etc/machine-id
  generator: dump
  content: uninitialized

- path: /var/lib/dbus/machine-id
  generator: remove

- path: /etc/network/interfaces
  generator: dump
  content: |-
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet dhcp

    source /etc/network/interfaces.d/*.cfg
  variants:
  - default

- name: meta-data
  generator: cloud-init
  variants:
  - cloud

- name: network-config
  generator: cloud-init
  variants:
  - cloud

- name: user-data
  generator: cloud-init
  variants:
  - cloud

- name: vendor-data
  generator: cloud-init
  variants:
  - cloud

packages:
  manager: apt
  update: true
  cleanup: true
  sets:
  - packages:
    - kali-archive-keyring
    action: install
    early: true

  - packages:
    - dialog
    - init
    - iproute2
    - locales
    - netbase
    - net-tools
    - openssh-client
    - vim
    - sudo
    - systemd
    action: install

  - packages:
    - cloud-init
    - systemd-resolved
    action: install
    variants:
    - cloud

  - packages:
    - ifupdown
    - isc-dhcp-client
    action: install
    variants:
    - default

  repositories:
  - name: sources.list
    url: |-
      deb http://kali.download/kali {{ image.release }} main contrib non-free non-free-firmware

actions:
- trigger: post-packages
  action: |-
    #!/bin/sh
    set -eux

    # Make sure the locale is built and functional
    echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
    locale-gen en_US.UTF-8 UTF-8
    update-locale LANG=en_US.UTF-8

    # Cleanup underlying /run
    mount -o bind / /mnt
    rm -rf /mnt/run/*
    umount /mnt

    # Cleanup temporary shadow paths
    rm /etc/*-

- trigger: post-packages
  action: |-
    #!/bin/sh
    set -eux

    # Enable cloud-init units
    systemctl enable cloud-init-main.service cloud-init-local.service
  variants:
  - cloud

mappings:
  architecture_map: debian
