mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-05-15 17:51:50 +02:00
Compare commits
24 commits
34f8813075
...
605131eafe
Author | SHA1 | Date | |
---|---|---|---|
![]() |
605131eafe | ||
![]() |
f9dfbe9fe1 | ||
![]() |
49d454693e | ||
![]() |
31b04b6556 | ||
![]() |
0972542ae3 | ||
![]() |
222169d7fe | ||
![]() |
b2ab898843 | ||
![]() |
ee95e86508 | ||
![]() |
542fe93d1f | ||
![]() |
92267c723c | ||
![]() |
b8ef87a7fc | ||
![]() |
79d9ae7ee2 | ||
![]() |
3c90ad9d0b | ||
![]() |
d9f23170cf | ||
![]() |
f33b3851d5 | ||
![]() |
553b0047c6 | ||
![]() |
18ec4758bb | ||
![]() |
038e95b513 | ||
![]() |
d3d04b22ec | ||
![]() |
0042e131f6 | ||
![]() |
a2acbeff53 | ||
![]() |
be8005f72b | ||
![]() |
712b309dbf | ||
![]() |
56663023f5 |
5 changed files with 40 additions and 20 deletions
14
.github/workflows/scan.yml
vendored
14
.github/workflows/scan.yml
vendored
|
@ -10,7 +10,12 @@ on:
|
|||
|
||||
jobs:
|
||||
security-scan-container:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
runs-on:
|
||||
- ubuntu-24.04
|
||||
- ubuntu-24.04-arm
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
@ -51,7 +56,12 @@ jobs:
|
|||
severity-cutoff: critical
|
||||
|
||||
security-scan-app:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
runs-on:
|
||||
- ubuntu-24.04
|
||||
- ubuntu-24.04-arm
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
|
14
.github/workflows/scan_released.yml
vendored
14
.github/workflows/scan_released.yml
vendored
|
@ -9,11 +9,10 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- runs-on: ubuntu-latest
|
||||
- runs-on: ubuntu-24.04
|
||||
arch: i686
|
||||
# Do not scan Silicon mac for now to avoid masking release scan results for other plaforms.
|
||||
# - runs-on: macos-latest
|
||||
# arch: arm64
|
||||
- runs-on: ubuntu-24.04-arm
|
||||
arch: arm64
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -55,7 +54,12 @@ jobs:
|
|||
severity-cutoff: critical
|
||||
|
||||
security-scan-app:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
runs-on:
|
||||
- ubuntu-24.04
|
||||
- ubuntu-24.04-arm
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
|
|
@ -185,7 +185,7 @@ RUN mkdir -p \
|
|||
# Copy the /etc and /var directories under the new root directory. Also,
|
||||
# copy /etc/, /opt, and /usr to the Dangerzone image rootfs.
|
||||
#
|
||||
# XXX: We also have to remove the resolv.conf file, in order to not leak any DNS
|
||||
# NOTE: We also have to remove the resolv.conf file, in order to not leak any DNS
|
||||
# servers added there during image build time.
|
||||
RUN cp -r /etc /var /new_root/ \
|
||||
&& rm /new_root/etc/resolv.conf
|
||||
|
|
|
@ -185,8 +185,8 @@ RUN mkdir -p \
|
|||
# Copy the /etc and /var directories under the new root directory. Also,
|
||||
# copy /etc/, /opt, and /usr to the Dangerzone image rootfs.
|
||||
#
|
||||
# XXX: We also have to remove the resolv.conf file, in order to not leak any DNS
|
||||
# servers added there during image build time.
|
||||
# NOTE: We also have to remove the resolv.conf file, in order to not leak any
|
||||
# DNS servers added there during image build time.
|
||||
RUN cp -r /etc /var /new_root/ \
|
||||
&& rm /new_root/etc/resolv.conf
|
||||
RUN cp -r /etc /opt /usr /new_root/home/dangerzone/dangerzone-image/rootfs \
|
||||
|
|
|
@ -8,6 +8,7 @@ from pytest_subprocess import FakeProcess
|
|||
from dangerzone import container_utils, errors
|
||||
from dangerzone.isolation_provider.container import Container
|
||||
from dangerzone.isolation_provider.qubes import is_qubes_native_conversion
|
||||
from dangerzone.util import get_resource_path
|
||||
|
||||
from .base import IsolationProviderTermination, IsolationProviderTest
|
||||
|
||||
|
@ -47,7 +48,7 @@ class TestContainer(IsolationProviderTest):
|
|||
provider.is_available()
|
||||
|
||||
def test_install_raise_if_image_cant_be_installed(
|
||||
self, mocker: MockerFixture, provider: Container, fp: FakeProcess
|
||||
self, provider: Container, fp: FakeProcess
|
||||
) -> None:
|
||||
"""When an image installation fails, an exception should be raised"""
|
||||
|
||||
|
@ -68,11 +69,13 @@ class TestContainer(IsolationProviderTest):
|
|||
occurrences=2,
|
||||
)
|
||||
|
||||
# Make podman load fail
|
||||
mocker.patch("builtins.open", mocker.mock_open(read_data=""))
|
||||
|
||||
fp.register_subprocess(
|
||||
[container_utils.get_runtime(), "load"],
|
||||
[
|
||||
container_utils.get_runtime(),
|
||||
"load",
|
||||
"-i",
|
||||
get_resource_path("container.tar"),
|
||||
],
|
||||
returncode=-1,
|
||||
)
|
||||
|
||||
|
@ -80,7 +83,7 @@ class TestContainer(IsolationProviderTest):
|
|||
provider.install()
|
||||
|
||||
def test_install_raises_if_still_not_installed(
|
||||
self, mocker: MockerFixture, provider: Container, fp: FakeProcess
|
||||
self, provider: Container, fp: FakeProcess
|
||||
) -> None:
|
||||
"""When an image keep being not installed, it should return False"""
|
||||
fp.register_subprocess(
|
||||
|
@ -105,10 +108,13 @@ class TestContainer(IsolationProviderTest):
|
|||
occurrences=2,
|
||||
)
|
||||
|
||||
# Patch open and podman load so that it works
|
||||
mocker.patch("builtins.open", mocker.mock_open(read_data=""))
|
||||
fp.register_subprocess(
|
||||
[container_utils.get_runtime(), "load"],
|
||||
[
|
||||
container_utils.get_runtime(),
|
||||
"load",
|
||||
"-i",
|
||||
get_resource_path("container.tar"),
|
||||
],
|
||||
)
|
||||
with pytest.raises(errors.ImageNotPresentException):
|
||||
provider.install()
|
||||
|
@ -195,7 +201,7 @@ class TestContainer(IsolationProviderTest):
|
|||
reason="Linux specific",
|
||||
)
|
||||
def test_linux_skips_desktop_version_check_returns_true(
|
||||
self, mocker: MockerFixture, provider: Container
|
||||
self, provider: Container
|
||||
) -> None:
|
||||
assert (True, "") == provider.check_docker_desktop_version()
|
||||
|
||||
|
|
Loading…
Reference in a new issue