feat: bump Mirage Firewall version

This commit is contained in:
Ben Grande 2024-10-17 18:01:49 +02:00
parent 475b81a67f
commit 5370aeaacd
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56

View File

@ -8,10 +8,10 @@ SPDX-License-Identifier: MIT
{%- from "qvm/template.jinja" import load -%} {%- from "qvm/template.jinja" import load -%}
{% set mirage_version = 'v0.9.1' -%} {% set mirage_version = 'v0.9.2' -%}
{% set mirage_file_archive = 'mirage-firewall.tar.bz2' -%} {% set mirage_sha256sum = '78a1ee52574b9a4fc5eda265922bcbcface90f7c43ed7a68dc8e201a2ac0a7dc' %}
{% set mirage_url_archive = 'https://github.com/mirage/qubes-mirage-firewall/releases/download/' ~ mirage_version ~ '/' ~ mirage_file_archive -%} {% set mirage_file_kernel = 'qubes-firewall.xen' -%}
{% set mirage_sha256sum = 'ea876bc7525811a16b0dfebe7ee1e91661eeecf67d240298d4ffd31b6ee41843' %} {% set mirage_url_kernel = 'https://github.com/mirage/qubes-mirage-firewall/releases/download/' ~ mirage_version ~ '/' ~ mirage_file_kernel -%}
{# Use the netvm of the default_netvm. #} {# Use the netvm of the default_netvm. #}
{% set default_netvm = salt['cmd.shell']('qubes-prefs default_netvm') -%} {% set default_netvm = salt['cmd.shell']('qubes-prefs default_netvm') -%}
@ -31,7 +31,7 @@ the chain (sys-net).
qvm.start: qvm.start:
- name: {{ updatevm }} - name: {{ updatevm }}
"sys-mirage-firewall-fetch-tarball": "sys-mirage-firewall-fetch-kernel":
cmd.run: cmd.run:
- require: - require:
- qvm: "sys-mirage-firewall-start-updatevm-{{ updatevm }}" - qvm: "sys-mirage-firewall-start-updatevm-{{ updatevm }}"
@ -44,46 +44,49 @@ the chain (sys-net).
--tlsv1.3 --proto =https \ --tlsv1.3 --proto =https \
--fail --fail-early \ --fail --fail-early \
--no-progress-meter --silent --show-error \ --no-progress-meter --silent --show-error \
--remote-name {{ mirage_url_archive }}" --remote-name {{ mirage_url_kernel }}"
- timeout: 30 - timeout: 30
- runas: user
{# Tarball is brought to dom0 instead of just 'vmlinuz' because: "sys-mirage-firewall-create-temporary-kernel-directory":
- checksum on releases is only of the tarball, not of individual files; file.directory:
- updatevm may not have 'bzip2' and 'tar'; - require:
- if we don't trust the provided tarball, we shouldn't even download it. - cmd: "sys-mirage-firewall-fetch-kernel"
#} - name: /tmp/mirage-firewall-download
"sys-mirage-firewall-bring-tarball-to-dom0": - user: root
- group: root
- mode: '0700'
- makedirs: True
"sys-mirage-firewall-bring-kernel-to-dom0":
cmd.run: cmd.run:
- require: - require:
- cmd: "sys-mirage-firewall-fetch-tarball" - file: "sys-mirage-firewall-create-temporary-kernel-directory"
- name: - name: qvm-run --pass-io {{ updatevm }} -- "cat /tmp/mirage-firewall-download/qubes-firewall.xen" | tee -- /tmp/mirage-firewall-download/vmlinuz >/dev/null
qvm-run --pass-io {{ updatevm }} -- "cat /tmp/mirage-firewall-download/mirage-firewall.tar.bz2" | tee -- /tmp/mirage-firewall.tar.bz2 >/dev/null
- runas: user
- timeout: 10 - timeout: 10
"{{ slsdotpath }}-remove-tarball-from-updatevm": "sys-mirage-firewall-remove-kernel-from-updatevm":
cmd.run: cmd.run:
- name: qvm-run {{ updatevm }} -- "rm -rf /tmp/mirage-firewall-download" - name: qvm-run {{ updatevm }} -- "rm -rf /tmp/mirage-firewall-download"
"sys-mirage-firewall-extract-to-vm-kernels": "sys-mirage-firewall-move-kernel-to-usable-directory":
archive.extracted: file.managed:
- require: - require:
- cmd: "sys-mirage-firewall-bring-tarball-to-dom0" - cmd: "sys-mirage-firewall-bring-kernel-to-dom0"
- name: /var/lib/qubes/vm-kernels/ - name: /var/lib/qubes/vm-kernels/mirage-firewall/vmlinuz
- source: /tmp/mirage-firewall.tar.bz2 - source: /tmp/mirage-firewall-download/vmlinuz
- source_hash: sha256={{ mirage_sha256sum }} - source_hash: sha256={{ mirage_sha256sum }}
- archive_format: tar - user: root
- options: -j - group: root
- mode: '0644'
"{{ slsdotpath }}-dom0-archive": "sys-mirage-firewall-remove-temporary-kernel":
file.absent: file.absent:
- name: /tmp/mirage-firewall.tar.bz2 - name: /tmp/mirage-firewall-download
"sys-mirage-firewall-save-version": "sys-mirage-firewall-save-version":
file.managed: file.managed:
- require: - require:
- archive: "sys-mirage-firewall-extract-to-vm-kernels" - file: "sys-mirage-firewall-move-kernel-to-usable-directory"
- name: /var/lib/qubes/vm-kernels/mirage-firewall/version.txt - name: /var/lib/qubes/vm-kernels/mirage-firewall/version.txt
- contents: {{ mirage_version }} - contents: {{ mirage_version }}
- mode: '0644' - mode: '0644'