diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index fc74640d4..ec1b4a10f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -22,7 +22,7 @@ _Describe the bug_ _Steps to reproduce the behavior_ -1. Run in bash `LC_ALL=C firejail PROGRAM` (`LC_ALL=C` to get a consistent +1. Run in bash `LC_ALL=C firejail /path/to/program` (`LC_ALL=C` to get a consistent output in English that can be understood by everybody) 2. Click on '....' 3. Scroll down to '....' @@ -47,10 +47,11 @@ _Any other detail that may help to understand/debug the problem_ ### Environment -- Linux distribution and version (e.g. "Ubuntu 20.04" or "Arch Linux") -- Firejail version (`firejail --version`). +- Name/version/arch of the Linux kernel (`uname -srm`): +- Name/version of the Linux distribution (e.g. "Ubuntu 20.04" or "Arch Linux"): +- Version of Firejail (`firejail --version`): - If you use a development version of firejail, also the commit from which it - was compiled (`git rev-parse HEAD`). + was compiled (`git rev-parse HEAD`): ### Checklist diff --git a/.github/ISSUE_TEMPLATE/build_issue.md b/.github/ISSUE_TEMPLATE/build_issue.md new file mode 100644 index 000000000..e9a0b2410 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/build_issue.md @@ -0,0 +1,73 @@ +--- +name: Build issue +about: There is an issue when trying to build the project from source +title: 'build: ' +labels: '' +assignees: '' + +--- + + + +### Description + +_Describe the bug_ + +### Steps to Reproduce + + + +_Post the commands used to reproduce the issue and their output_ + +Example: + +```console +$ ./configure --prefix=/usr --enable-apparmor +checking for gcc... gcc +checking whether the C compiler works... yes +[...] +$ make +make -C src/lib +gcc [...] +[...] +``` + +_If ./configure fails, include the output of config.log_ + +Example: + +```console +$ cat config.log +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +[...] +``` + +### Additional context + +_(Optional) Any other detail that may help to understand/debug the problem_ + +### Environment + +- Name/version/arch of the Linux kernel (`uname -srm`): +- Name/version of the Linux distribution (e.g. "Ubuntu 20.04" or "Arch Linux"): +- Name/version of the C compiler (e.g. "gcc 14.1.1-1"): +- Name/version of the libc (e.g. "glibc 2.40-1"): +- Name/version of the Linux API headers (e.g. "linux-api-headers 6.10-1" on + Arch Linux): +- Version of the source code being built (`git rev-parse HEAD`): diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index ce1b70e39..08a5678e2 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -22,3 +22,11 @@ _A clear and concise description of any alternative solutions or features you've ### Additional context _Add any other context or screenshots about the feature request here._ + +### Environment + +- Name/version/arch of the Linux kernel (`uname -srm`): +- Name/version of the Linux distribution (e.g. "Ubuntu 20.04" or "Arch Linux"): +- Version of Firejail (`firejail --version`): +- If you use a development version of firejail, also the commit from which it: + was compiled (`git rev-parse HEAD`): diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 30242923d..7335f1eb2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,5 +3,5 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" - open-pull-requests-limit: 2 + interval: "monthly" + open-pull-requests-limit: 4 diff --git a/.github/workflows/build-extra.yml b/.github/workflows/build-extra.yml index 8754e7eff..17cb2f2cc 100644 --- a/.github/workflows/build-extra.yml +++ b/.github/workflows/build-extra.yml @@ -1,50 +1,39 @@ -name: Build-extra CI +# Builds the project with alternative tools. + +name: Build-extra on: + workflow_dispatch: push: - paths-ignore: - - '.github/ISSUE_TEMPLATE/*' - - 'contrib/syntax/**' - - 'contrib/vim/**' - - 'etc/**' - - 'src/man/*.txt' - - .git-blame-ignore-revs - - .github/dependabot.yml - - .github/pull_request_template.md - - .github/workflows/build.yml - - .github/workflows/codeql-analysis.yml - - .github/workflows/profile-checks.yml - - .gitignore - - .gitlab-ci.yml - - CONTRIBUTING.md - - COPYING - - README - - README.md - - RELNOTES - - SECURITY.md - - src/firecfg/firecfg.config + branches-ignore: + - 'dependabot/**' + paths: + - 'm4/**' + - 'src/**.c' + - 'src/**.h' + - 'src/**.mk' + - 'src/**Makefile' + - .github/workflows/build-extra.yml + - Makefile + - ci/printenv.sh + - config.mk.in + - config.sh.in + - configure + - configure.ac pull_request: - paths-ignore: - - '.github/ISSUE_TEMPLATE/*' - - 'contrib/syntax/**' - - 'contrib/vim/**' - - 'etc/**' - - 'src/man/*.txt' - - .git-blame-ignore-revs - - .github/dependabot.yml - - .github/pull_request_template.md - - .github/workflows/build.yml - - .github/workflows/codeql-analysis.yml - - .github/workflows/profile-checks.yml - - .gitignore - - .gitlab-ci.yml - - CONTRIBUTING.md - - COPYING - - README - - README.md - - RELNOTES - - SECURITY.md - - src/firecfg/firecfg.config + paths: + - 'm4/**' + - 'src/**.c' + - 'src/**.h' + - 'src/**.mk' + - 'src/**Makefile' + - .github/workflows/build-extra.yml + - Makefile + - ci/printenv.sh + - config.mk.in + - config.sh.in + - configure + - configure.ac permissions: # added using https://github.com/step-security/secure-workflows contents: read @@ -52,15 +41,18 @@ permissions: # added using https://github.com/step-security/secure-workflows jobs: build-clang: runs-on: ubuntu-22.04 + timeout-minutes: 10 steps: - name: Harden Runner - uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f with: egress-policy: block allowed-endpoints: > azure.archive.ubuntu.com:80 github.com:443 - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + packages.microsoft.com:443 + ppa.launchpadcontent.net:443 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - name: update package information run: sudo apt-get update -qy - name: install dependencies @@ -71,96 +63,13 @@ jobs: run: ./ci/printenv.sh - name: configure run: > - CC=clang-14 ./configure --enable-fatal-warnings --enable-apparmor - --enable-selinux + ./configure CC=clang-14 + --prefix=/usr --enable-fatal-warnings + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: make run: make - name: make install run: sudo make install - name: print version - run: command -V firejail && firejail --version - scan-build: - runs-on: ubuntu-22.04 - steps: - - name: Harden Runner - uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 - with: - egress-policy: block - allowed-endpoints: > - azure.archive.ubuntu.com:80 - github.com:443 - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - name: update package information - run: sudo apt-get update -qy - - name: install clang-tools-14 and dependencies - run: > - sudo apt-get install -qy - clang-tools-14 libapparmor-dev libselinux1-dev - - name: print env - run: ./ci/printenv.sh - - name: configure - run: > - CC=clang-14 ./configure --enable-fatal-warnings --enable-apparmor - --enable-selinux - || (cat config.log; exit 1) - - name: scan-build - run: scan-build-14 --status-bugs make - cppcheck: - runs-on: ubuntu-22.04 - steps: - - name: Harden Runner - uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 - with: - egress-policy: block - allowed-endpoints: > - azure.archive.ubuntu.com:80 - github.com:443 - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - name: update package information - run: sudo apt-get update -qy - - name: install cppcheck - run: sudo apt-get install -qy cppcheck - - run: cppcheck --version - - name: cppcheck - run: > - cppcheck -q --force --error-exitcode=1 --enable=warning,performance - -i src/firejail/checkcfg.c -i src/firejail/main.c . - # new cppcheck version currently chokes on checkcfg.c and main.c, therefore - # scan all files also with older cppcheck version from ubuntu 20.04. - cppcheck_old: - runs-on: ubuntu-20.04 - steps: - - name: Harden Runner - uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 - with: - egress-policy: block - allowed-endpoints: > - azure.archive.ubuntu.com:80 - github.com:443 - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - name: update package information - run: sudo apt-get update -qy - - name: install cppcheck - run: sudo apt-get install -qy cppcheck - - run: cppcheck --version - - name: cppcheck - run: cppcheck -q --force --error-exitcode=1 --enable=warning,performance . - codespell: - runs-on: ubuntu-22.04 - steps: - - name: Harden Runner - uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 - with: - egress-policy: block - allowed-endpoints: > - azure.archive.ubuntu.com:80 - github.com:443 - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - name: update package information - run: sudo apt-get update -qy - - name: install dependencies - run: sudo apt-get install -qy codespell - - run: codespell --version - - name: codespell - run: make codespell + run: make print-version diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32dbaf8cc..070a14c94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,100 +1,91 @@ -name: Build CI +# Checks that `make dist` works and builds the project with the default +# configuration. +name: Build + +# Note: Keep this list in sync with DISTFILES in ../../Makefile. on: + workflow_dispatch: push: - paths-ignore: - - '.github/ISSUE_TEMPLATE/*' - - .git-blame-ignore-revs - - .github/dependabot.yml - - .github/pull_request_template.md - - .github/workflows/build-extra.yml - - .github/workflows/codeql-analysis.yml - - .github/workflows/profile-checks.yml - - .gitignore - - .gitlab-ci.yml - - CONTRIBUTING.md + branches-ignore: + - 'dependabot/**' + paths: + - 'contrib/**' + - 'etc/**' + - 'm4/**' + - 'platform/**' + - 'src/**' + - 'test/**' + - .github/workflows/build.yml - COPYING + - Makefile - README - - README.md - RELNOTES - - SECURITY.md + - ci/printenv.sh + - config.mk.in + - config.sh.in + - configure + - configure.ac + - install.sh + - mkdeb.sh + - mketc.sh pull_request: - paths-ignore: - - '.github/ISSUE_TEMPLATE/*' - - .git-blame-ignore-revs - - .github/dependabot.yml - - .github/pull_request_template.md - - .github/workflows/build-extra.yml - - .github/workflows/codeql-analysis.yml - - .github/workflows/profile-checks.yml - - .gitignore - - .gitlab-ci.yml - - CONTRIBUTING.md + paths: + - 'contrib/**' + - 'etc/**' + - 'm4/**' + - 'platform/**' + - 'src/**' + - 'test/**' + - .github/workflows/build.yml - COPYING + - Makefile - README - - README.md - RELNOTES - - SECURITY.md + - ci/printenv.sh + - config.mk.in + - config.sh.in + - configure + - configure.ac + - install.sh + - mkdeb.sh + - mketc.sh permissions: # added using https://github.com/step-security/secure-workflows contents: read jobs: - build_and_test: + build: runs-on: ubuntu-22.04 - env: - SHELL: /bin/bash + timeout-minutes: 10 steps: - name: Harden Runner - uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f with: egress-policy: block allowed-endpoints: > - 1.1.1.1:1025 azure.archive.ubuntu.com:80 - debian.org:80 - dns.quad9.net:53 github.com:443 packages.microsoft.com:443 ppa.launchpadcontent.net:443 - whois.pir.org:43 - www.debian.org:443 - www.debian.org:80 - yahoo.com:1025 - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - name: update package information run: sudo apt-get update -qy - name: install dependencies run: > sudo apt-get install -qy - gcc-12 libapparmor-dev libselinux1-dev expect xzdec whois - bridge-utils + gcc-12 libapparmor-dev libselinux1-dev - name: print env run: ./ci/printenv.sh - name: configure run: > - CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings - --enable-analyzer --enable-apparmor --enable-selinux + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: make run: make - name: make install run: sudo make install - - name: print firejail version - run: command -V firejail && firejail --version - - run: make lab-setup - - run: make test-seccomp-extra - - run: make test-firecfg - - run: make test-capabilities - - run: make test-apparmor - - run: make test-appimage - - run: make test-chroot - - run: make test-sysutils - - run: make test-private-etc - - run: make test-profiles - - run: make test-fcopy - - run: make test-fnetfilter - - run: make test-fs - - run: make test-utils - - run: make test-environment - - run: make test-network + - name: print version + run: make print-version diff --git a/.github/workflows/check-c.yml b/.github/workflows/check-c.yml new file mode 100644 index 000000000..3a991cd78 --- /dev/null +++ b/.github/workflows/check-c.yml @@ -0,0 +1,175 @@ +# Checks for potential issues in the source code. + +name: Check-C + +on: + workflow_dispatch: + push: + branches-ignore: + - 'dependabot/**' + paths: + - '**.c' + - '**.h' + - 'm4/**' + - 'src/**.mk' + - 'src/**Makefile' + - .github/workflows/check-c.yml + - Makefile + - ci/printenv.sh + - config.mk.in + - config.sh.in + - configure + - configure.ac + pull_request: + paths: + - '**.c' + - '**.h' + - 'm4/**' + - 'src/**.mk' + - 'src/**Makefile' + - .github/workflows/check-c.yml + - Makefile + - ci/printenv.sh + - config.mk.in + - config.sh.in + - configure + - configure.ac + schedule: + - cron: '0 7 * * 2' + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + scan-build: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + egress-policy: block + allowed-endpoints: > + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + github.com:443 + packages.microsoft.com:443 + ppa.launchpadcontent.net:443 + security.ubuntu.com:80 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: update package information + run: sudo apt-get update -qy + - name: install clang-tools-14 and dependencies + run: > + sudo apt-get install -qy + clang-tools-14 libapparmor-dev libselinux1-dev + - name: print env + run: ./ci/printenv.sh + - name: configure + run: > + ./configure CC=clang-14 SCAN_BUILD=scan-build-14 + --prefix=/usr --enable-fatal-warnings + --enable-apparmor --enable-selinux + || (cat config.log; exit 1) + - name: scan-build + run: make scan-build + + cppcheck: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + egress-policy: block + allowed-endpoints: > + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + github.com:443 + packages.microsoft.com:443 + ppa.launchpadcontent.net:443 + security.ubuntu.com:80 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: update package information + run: sudo apt-get update -qy + - name: install cppcheck + run: sudo apt-get install -qy cppcheck + - name: configure + run: > + ./configure CPPCHECK='cppcheck -q' + || (cat config.log; exit 1) + - run: cppcheck --version + - name: cppcheck + run: make cppcheck + + # new cppcheck version currently chokes on checkcfg.c and main.c, therefore + # scan all files also with older cppcheck version from ubuntu 20.04. + cppcheck_old: + runs-on: ubuntu-20.04 + timeout-minutes: 10 + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + egress-policy: block + allowed-endpoints: > + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + github.com:443 + packages.microsoft.com:443 + ppa.launchpad.net:80 + ppa.launchpadcontent.net:443 + security.ubuntu.com:80 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: update package information + run: sudo apt-get update -qy + - name: install cppcheck + run: sudo apt-get install -qy cppcheck + - name: configure + run: > + ./configure CPPCHECK='cppcheck -q' + || (cat config.log; exit 1) + - run: cppcheck --version + - name: cppcheck-old + run: make cppcheck-old + + codeql-cpp: + permissions: + actions: read + contents: read + security-events: write + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + disable-sudo: true + egress-policy: block + allowed-endpoints: > + api.github.com:443 + github.com:443 + objects.githubusercontent.com:443 + uploads.github.com:443 + + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - name: print env + run: ./ci/printenv.sh + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 + with: + languages: cpp + + - name: configure + run: ./configure + + - name: make + run: make -j "$(nproc)" + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 diff --git a/.github/workflows/profile-checks.yml b/.github/workflows/check-profiles.yml similarity index 65% rename from .github/workflows/profile-checks.yml rename to .github/workflows/check-profiles.yml index 0e7403508..895be1c2a 100644 --- a/.github/workflows/profile-checks.yml +++ b/.github/workflows/check-profiles.yml @@ -1,18 +1,25 @@ -name: Profile Checks +# Lints and checks for potential issues in the profiles. + +name: Check-Profiles on: + workflow_dispatch: push: + branches-ignore: + - 'dependabot/**' paths: - 'ci/check/profiles/**' - 'etc/**' - - .github/workflows/profile-checks.yml + - .github/workflows/check-profiles.yml + - ci/printenv.sh - contrib/sort.py - src/firecfg/firecfg.config pull_request: paths: - 'ci/check/profiles/**' - 'etc/**' - - .github/workflows/profile-checks.yml + - .github/workflows/check-profiles.yml + - ci/printenv.sh - contrib/sort.py - src/firecfg/firecfg.config @@ -22,24 +29,26 @@ permissions: # added using https://github.com/step-security/secure-workflows jobs: profile-checks: runs-on: ubuntu-latest + timeout-minutes: 5 + steps: - name: Harden Runner - uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f with: disable-sudo: true egress-policy: block allowed-endpoints: > github.com:443 - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - name: print env run: ./ci/printenv.sh - run: python3 --version -# - name: sort.py -# run: > -# ./ci/check/profiles/sort.py -# etc/inc/*.inc etc/{profile-a-l,profile-m-z}/*.profile + - name: sort.py + run: > + ./ci/check/profiles/sort.py + etc/inc/*.inc etc/{profile-a-l,profile-m-z}/*.profile # Currently broken (see #5610) # - name: private-etc-always-required.sh # run: > diff --git a/.github/workflows/check-python.yml b/.github/workflows/check-python.yml new file mode 100644 index 000000000..92564983c --- /dev/null +++ b/.github/workflows/check-python.yml @@ -0,0 +1,59 @@ +# Lints and checks for potential issues in Python files. + +name: Check-Python + +on: + workflow_dispatch: + push: + branches-ignore: + - 'dependabot/**' + paths: + - '**.py' + - .github/workflows/check-python.yml + pull_request: + paths: + - '**.py' + - .github/workflows/check-python.yml + schedule: + - cron: '0 7 * * 2' + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + codeql-python: + permissions: + actions: read + contents: read + security-events: write + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + disable-sudo: true + egress-policy: block + allowed-endpoints: > + api.github.com:443 + files.pythonhosted.org:443 + github.com:443 + objects.githubusercontent.com:443 + pypi.org:443 + uploads.github.com:443 + + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - name: print env + run: ./ci/printenv.sh + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 + with: + languages: python + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 19d1d3c28..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,121 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -name: "CodeQL" - -on: - push: - paths-ignore: - - '.github/ISSUE_TEMPLATE/*' - - 'contrib/syntax/**' - - 'contrib/vim/**' - - 'etc/**' - - 'src/man/*.txt' - - .git-blame-ignore-revs - - .github/dependabot.yml - - .github/pull_request_template.md - - .github/workflows/build-extra.yml - - .github/workflows/build.yml - - .github/workflows/profile-checks.yml - - .gitignore - - .gitlab-ci.yml - - CONTRIBUTING.md - - COPYING - - README - - README.md - - RELNOTES - - SECURITY.md - - src/firecfg/firecfg.config - pull_request: - paths-ignore: - - '.github/ISSUE_TEMPLATE/*' - - 'contrib/syntax/**' - - 'contrib/vim/**' - - 'etc/**' - - 'src/man/*.txt' - - .git-blame-ignore-revs - - .github/dependabot.yml - - .github/pull_request_template.md - - .github/workflows/build-extra.yml - - .github/workflows/build.yml - - .github/workflows/profile-checks.yml - - .gitignore - - .gitlab-ci.yml - - CONTRIBUTING.md - - COPYING - - README - - README.md - - RELNOTES - - SECURITY.md - - src/firecfg/firecfg.config - schedule: - - cron: '0 7 * * 2' - -permissions: # added using https://github.com/step-security/secure-workflows - contents: read - -jobs: - analyze: - permissions: - actions: read # for github/codeql-action/init to get workflow details - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/autobuild to send a status report - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'cpp', 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Harden Runner - uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 - with: - disable-sudo: true - egress-policy: block - allowed-endpoints: > - api.github.com:443 - github.com:443 - objects.githubusercontent.com:443 - uploads.github.com:443 - - - name: Checkout repository - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - - name: print env - run: ./ci/printenv.sh - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@489225d82a57396c6f426a40e66d461b16b3461d - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@489225d82a57396c6f426a40e66d461b16b3461d - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@489225d82a57396c6f426a40e66d461b16b3461d diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 000000000..ec1547d57 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,48 @@ +# Checks the spelling on all non-third-party files. + +name: Codespell + +on: + workflow_dispatch: + push: + branches-ignore: + - 'dependabot/**' + paths-ignore: + - 'm4/**' + - COPYING + pull_request: + paths-ignore: + - 'm4/**' + - COPYING + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + codespell: + runs-on: ubuntu-22.04 + timeout-minutes: 5 + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + egress-policy: block + allowed-endpoints: > + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + github.com:443 + packages.microsoft.com:443 + ppa.launchpadcontent.net:443 + security.ubuntu.com:80 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: update package information + run: sudo apt-get update -qy + - name: install dependencies + run: sudo apt-get install -qy codespell + - name: print env + run: ./ci/printenv.sh + - name: configure + run: ./configure || (cat config.log; exit 1) + - run: codespell --version + - name: codespell + run: make codespell diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..1cf3b4cac --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,268 @@ +# Checks that the tests are passing. + +name: Test + +on: + workflow_dispatch: + push: + branches-ignore: + - 'dependabot/**' + paths: + - 'm4/**' + - 'src/**.c' + - 'src/**.h' + - 'src/**.mk' + - 'src/**Makefile' + - 'test/**' + - .github/workflows/test.yml + - Makefile + - config.mk.in + - config.sh.in + - configure + - configure.ac + - etc/profile-a-l/default.profile + - src/firecfg/firecfg.config + pull_request: + paths: + - 'm4/**' + - 'src/**.c' + - 'src/**.h' + - 'src/**.mk' + - 'src/**Makefile' + - 'test/**' + - .github/workflows/test.yml + - Makefile + - config.mk.in + - config.sh.in + - configure + - configure.ac + - etc/profile-a-l/default.profile + - src/firecfg/firecfg.config + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +# +# Faster tests +# + +jobs: + test-main: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + env: + SHELL: /bin/bash + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + egress-policy: block + allowed-endpoints: > + azure.archive.ubuntu.com:80 + github.com:443 + packages.microsoft.com:443 + ppa.launchpadcontent.net:443 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: update package information + run: sudo apt-get update -qy + - name: install dependencies + run: > + sudo apt-get install -qy + gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils + - name: print env + run: ./ci/printenv.sh + - name: configure + run: > + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux + || (cat config.log; exit 1) + - name: make + run: make -j "$(nproc)" + - name: make install + run: sudo make install + - name: print version + run: make print-version + - run: make lab-setup + - run: make test-seccomp-extra + - run: make test-firecfg + - run: make test-capabilities + - run: make test-apparmor + - run: make test-appimage + - run: make test-chroot + - run: make test-fcopy + +# +# Slower tests +# + + test-fs: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + env: + SHELL: /bin/bash + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + egress-policy: block + allowed-endpoints: > + azure.archive.ubuntu.com:80 + github.com:443 + packages.microsoft.com:443 + ppa.launchpadcontent.net:443 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: update package information + run: sudo apt-get update -qy + - name: install dependencies + run: > + sudo apt-get install -qy + gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils + - name: print env + run: ./ci/printenv.sh + - name: configure + run: > + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux + || (cat config.log; exit 1) + - name: make + run: make -j "$(nproc)" + - name: make install + run: sudo make install + - name: print version + run: make print-version + - run: make lab-setup + - run: make test-private-etc + - run: make test-fs + + test-environment: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + env: + SHELL: /bin/bash + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + egress-policy: block + allowed-endpoints: > + azure.archive.ubuntu.com:80 + github.com:443 + packages.microsoft.com:443 + ppa.launchpadcontent.net:443 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: update package information + run: sudo apt-get update -qy + - name: install dependencies + run: > + sudo apt-get install -qy + gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils + - name: print env + run: ./ci/printenv.sh + - name: configure + run: > + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux + || (cat config.log; exit 1) + - name: make + run: make -j "$(nproc)" + - name: make install + run: sudo make install + - name: print version + run: make print-version + - run: make lab-setup + - run: make test-environment + - run: make test-profiles + + test-utils: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + env: + SHELL: /bin/bash + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + egress-policy: block + allowed-endpoints: > + azure.archive.ubuntu.com:80 + debian.org:80 + github.com:443 + packages.microsoft.com:443 + ppa.launchpadcontent.net:443 + www.debian.org:443 + www.debian.org:80 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: update package information + run: sudo apt-get update -qy + - name: install dependencies + run: > + sudo apt-get install -qy + gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils + - name: print env + run: ./ci/printenv.sh + - name: configure + run: > + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux + || (cat config.log; exit 1) + - name: make + run: make -j "$(nproc)" + - name: make install + run: sudo make install + - name: print version + run: make print-version + - run: make lab-setup + - run: make test-utils + + test-network: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + env: + SHELL: /bin/bash + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f + with: + egress-policy: block + allowed-endpoints: > + 1.1.1.1:1025 + azure.archive.ubuntu.com:80 + debian.org:80 + dns.quad9.net:53 + github.com:443 + packages.microsoft.com:443 + ppa.launchpadcontent.net:443 + whois.pir.org:43 + www.debian.org:443 + www.debian.org:80 + yahoo.com:1025 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: update package information + run: sudo apt-get update -qy + - name: install dependencies + run: > + sudo apt-get install -qy + gcc-12 libapparmor-dev libselinux1-dev expect xzdec whois + bridge-utils + - name: print env + run: ./ci/printenv.sh + - name: configure + run: > + ./configure CC=gcc-12 + --prefix=/usr --enable-fatal-warnings --enable-analyzer + --enable-apparmor --enable-selinux + || (cat config.log; exit 1) + - name: make + run: make -j "$(nproc)" + - name: make install + run: sudo make install + - name: print version + run: make print-version + - run: make lab-setup + - run: make test-fnetfilter + - run: make test-sysutils + - run: make test-network diff --git a/.gitignore b/.gitignore index 2285c3e5d..5e126990f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ +*.d *.o *.so *~ *.swp *.deb *.rpm +*.tar.xz *.gcda *.gcno *.gz @@ -19,7 +21,6 @@ config.status contrib/syntax/files/example contrib/syntax/files/firejail-profile.lang contrib/syntax/files/firejail.vim -firejail-*.tar.xz src/fnettrace-dns/fnettrace-dns src/fnettrace-sni/fnettrace-sni src/fnettrace-icmp/fnettrace-icmp @@ -44,6 +45,7 @@ src/bash_completion/firejail.bash_completion src/zsh_completion/_firejail src/jailcheck/jailcheck src/fnettrace/fnettrace +src/fnetlock/fnetlock src/fzenity/fzenity uids.h seccomp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb88c0263..71bb70b82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,17 @@ -# Basic notes: builds firejail on 5 different systems for 2 package systems: -# 1. Debian-based systems. Use debian:jessie to ensure reasonable backwards -# compat and ubuntu:rolling for new setups -# 2. Redhat-based systems. Use centos:latest for reasonable backwards compat -# and fedora:latest for new setups -# 3. Alpine for installing directly from source -# Also builds apparmor package for Ubuntu LTS +# Builds on multiple systems using different package managers: +# +# - Debian-based systems: Use oldest working/supported debian image for +# reasonable backwards compatibility and ubuntu:rolling for new setups. +# Additionally, ensure that the package works without apparmor. +# +# - Redhat-based systems: Use a centos-like distribution for reasonable +# backwards compatibility and fedora:latest for new setups. +# +# - Alpine: Use it for installing directly from source. build_ubuntu_package: image: ubuntu:rolling + timeout: 10 minutes variables: DEBIAN_FRONTEND: noninteractive script: @@ -18,12 +22,14 @@ build_ubuntu_package: | grep -Ev '^(Selecting|Preparing to unpack|Unpacking)' - ./ci/printenv.sh - ./configure || (cat config.log; exit 1) - - make deb - - dpkg -i firejail*.deb - - command -V firejail && firejail --version + - make dist + - ./mkdeb.sh --enable-fatal-warnings + - dpkg -i ./*.deb + - make print-version build_debian_package: image: debian:buster + timeout: 10 minutes variables: DEBIAN_FRONTEND: noninteractive script: @@ -34,46 +40,14 @@ build_debian_package: | grep -Ev '^(Selecting|Preparing to unpack|Unpacking)' - ./ci/printenv.sh - ./configure || (cat config.log; exit 1) - - make deb - - dpkg -i firejail*.deb - - command -V firejail && firejail --version - -build_redhat_package: - image: almalinux:latest - script: - - dnf update -y - - dnf install -y rpm-build gcc make - - ./ci/printenv.sh - - ./configure --prefix=/usr || (cat config.log; exit 1) - - make rpms - - rpm -i firejail*.rpm - - command -V firejail && firejail --version - -build_fedora_package: - image: fedora:latest - script: - - dnf update -y - - dnf install -y rpm-build gcc make - - ./ci/printenv.sh - - ./configure --prefix=/usr || (cat config.log; exit 1) - - make rpms - - rpm -i firejail*.rpm - - command -V firejail && firejail --version - -build_src_package: - image: alpine:latest - script: - - apk update - - apk upgrade - - apk add build-base linux-headers gawk - - ./ci/printenv.sh - - ./configure --prefix=/usr || (cat config.log; exit 1) - - make - - make install-strip - - command -V firejail && firejail --version + - make dist + - ./mkdeb.sh --enable-fatal-warnings + - dpkg -i ./*.deb + - make print-version build_no_apparmor: image: ubuntu:latest + timeout: 10 minutes variables: DEBIAN_FRONTEND: noninteractive script: @@ -85,17 +59,64 @@ build_no_apparmor: - ./ci/printenv.sh - ./configure || (cat config.log; exit 1) - make dist - - ./mkdeb.sh --disable-apparmor - - dpkg -i firejail*.deb - - command -V firejail && firejail --version - - firejail --version | grep -F 'AppArmor support is disabled' + - > + ./mkdeb.sh --enable-fatal-warnings + --disable-apparmor + - dpkg -i ./*.deb + - make print-version + - make print-version | grep -F 'AppArmor support is disabled' + +build_redhat_package: + image: almalinux:latest + timeout: 10 minutes + script: + - dnf update -y + - dnf install -y rpm-build gcc make + - ./ci/printenv.sh + - ./configure || (cat config.log; exit 1) + - make dist + - ./platform/rpm/mkrpm.sh --enable-fatal-warnings + - rpm -i ./*.rpm + - make print-version + +build_fedora_package: + image: fedora:latest + timeout: 10 minutes + script: + - dnf update -y + - dnf install -y rpm-build gcc make + - ./ci/printenv.sh + - ./configure || (cat config.log; exit 1) + - make dist + - ./platform/rpm/mkrpm.sh --enable-fatal-warnings + - rpm -i ./*.rpm + - make print-version + +build_src_package: + image: alpine:latest + timeout: 10 minutes + script: + - apk update + - apk upgrade + - apk add build-base linux-headers gawk + - ./ci/printenv.sh + # Note: Do not use ` --enable-fatal-warnings` because the build + # currently produces warnings on Alpine (see #6224). + - > + ./configure --prefix=/usr + || (cat config.log; exit 1) + - make + - make install-strip + - make print-version debian_ci: image: registry.salsa.debian.org/salsa-ci-team/ci-image-git-buildpackage:latest + timeout: 10 minutes variables: DEBFULLNAME: "$GITLAB_USER_NAME" DEBEMAIL: "$GITLAB_USER_EMAIL" DEBIAN_FRONTEND: noninteractive + PKGNAME: firejail before_script: - git checkout -B ci_build "$CI_COMMIT_SHA" - gitlab-ci-enable-sid @@ -110,17 +131,17 @@ debian_ci: - git config user.email "$DEBEMAIL" - | cd "$CI_PROJECT_DIR/.." - apt-get source --download-only -t experimental firejail || - apt-get source --download-only firejail + apt-get source --download-only -t experimental "$PKGNAME" || + apt-get source --download-only "$PKGNAME" - | cd "$CI_PROJECT_DIR" - tar xf ../firejail_*.debian.tar.* + tar xf "../${PKGNAME}"_*.debian.tar.* - rm -rf debian/patches/ - | VERSION="$(grep ^PACKAGE_VERSION= configure | cut -d "'" -f 2)" dch -v "${VERSION}-0.1~ci" 'Non-maintainer upload.' - git archive -o "../firejail_${VERSION}.orig.tar.gz" HEAD - pristine-tar commit "../firejail_${VERSION}.orig.tar.gz" ci_build + git archive -o "../${PKGNAME}_${VERSION}.orig.tar.gz" HEAD + pristine-tar commit "../${PKGNAME}_${VERSION}.orig.tar.gz" ci_build git branch -m pristine-tar origin/pristine-tar - git add debian - git commit -m 'add debian/' diff --git a/Makefile b/Makefile index fdf83beb4..d93f28b22 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,20 @@ ROOT = . -include config.mk +# Default programs (in configure.ac). +CC ?= cc +CODESPELL ?= codespell +CPPCHECK ?= cppcheck +GAWK ?= gawk +GZIP ?= gzip +SCAN_BUILD ?= scan-build +STRIP ?= strip +TAR ?= tar + +# Default programs (not in configure.ac). +INSTALL ?= install +RM ?= rm -f + ifneq ($(HAVE_MAN),no) MAN_TARGET = man endif @@ -17,7 +31,7 @@ SBOX_APPS = src/fbuilder/fbuilder src/ftee/ftee src/fids/fids SBOX_APPS_NON_DUMPABLE = src/fcopy/fcopy src/fldd/fldd src/fnet/fnet src/fnetfilter/fnetfilter src/fzenity/fzenity SBOX_APPS_NON_DUMPABLE += src/fsec-optimize/fsec-optimize src/fsec-print/fsec-print src/fseccomp/fseccomp SBOX_APPS_NON_DUMPABLE += src/fnettrace/fnettrace src/fnettrace-dns/fnettrace-dns src/fnettrace-sni/fnettrace-sni -SBOX_APPS_NON_DUMPABLE += src/fnettrace-icmp/fnettrace-icmp +SBOX_APPS_NON_DUMPABLE += src/fnettrace-icmp/fnettrace-icmp src/fnetlock/fnetlock MYDIRS = src/lib $(COMPLETIONDIRS) MYLIBS = src/libpostexecseccomp/libpostexecseccomp.so src/libtrace/libtrace.so src/libtracelog/libtracelog.so COMPLETIONS = src/zsh_completion/_firejail src/bash_completion/firejail.bash_completion @@ -62,33 +76,37 @@ mydirs: $(MYDIRS) $(MYDIRS): $(MAKE) -C $@ +.PHONY: strip +strip: all + $(STRIP) $(ALL_ITEMS) + .PHONY: filters filters: $(SECCOMP_FILTERS) -seccomp: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize +seccomp: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize Makefile src/fseccomp/fseccomp default seccomp src/fsec-optimize/fsec-optimize seccomp -seccomp.debug: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize +seccomp.debug: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize Makefile src/fseccomp/fseccomp default seccomp.debug allow-debuggers src/fsec-optimize/fsec-optimize seccomp.debug -seccomp.32: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize +seccomp.32: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize Makefile src/fseccomp/fseccomp secondary 32 seccomp.32 src/fsec-optimize/fsec-optimize seccomp.32 -seccomp.block_secondary: src/fseccomp/fseccomp +seccomp.block_secondary: src/fseccomp/fseccomp Makefile src/fseccomp/fseccomp secondary block seccomp.block_secondary -seccomp.mdwx: src/fseccomp/fseccomp +seccomp.mdwx: src/fseccomp/fseccomp Makefile src/fseccomp/fseccomp memory-deny-write-execute seccomp.mdwx -seccomp.mdwx.32: src/fseccomp/fseccomp +seccomp.mdwx.32: src/fseccomp/fseccomp Makefile src/fseccomp/fseccomp memory-deny-write-execute.32 seccomp.mdwx.32 -seccomp.namespaces: src/fseccomp/fseccomp +seccomp.namespaces: src/fseccomp/fseccomp Makefile src/fseccomp/fseccomp restrict-namespaces seccomp.namespaces cgroup,ipc,net,mnt,pid,time,user,uts -seccomp.namespaces.32: src/fseccomp/fseccomp +seccomp.namespaces.32: src/fseccomp/fseccomp Makefile src/fseccomp/fseccomp restrict-namespaces seccomp.namespaces.32 cgroup,ipc,net,mnt,pid,time,user,uts .PHONY: man @@ -103,58 +121,65 @@ contrib: syntax syntax: $(SYNTAX_FILES) # TODO: include/rlimit are false positives -contrib/syntax/lists/profile_commands_arg0.list: src/firejail/profile.c +contrib/syntax/lists/profile_commands_arg0.list: src/firejail/profile.c Makefile + @printf 'Generating %s from %s\n' $@ $< @sed -En 's/.*strn?cmp\(ptr, "([^ "]*[^ ])".*/\1/p' $< | \ - grep -Ev '^(include|rlimit)$$' | sed 's/\./\\./' | LC_ALL=C sort -u >$@ + grep -Ev '^(include|rlimit)$$' | LC_ALL=C sort -u >$@ # TODO: private-lib is special-cased in the code and doesn't match the regex -contrib/syntax/lists/profile_commands_arg1.list: src/firejail/profile.c - @{ sed -En 's/.*strn?cmp\(ptr, "([^"]+) ".*/\1/p' $<; echo private-lib; } | \ - LC_ALL=C sort -u >$@ +contrib/syntax/lists/profile_commands_arg1.list: src/firejail/profile.c Makefile + @printf 'Generating %s from %s\n' $@ $< + @{ sed -En 's/.*strn?cmp\(ptr, "([^"]+) .*/\1/p' $<; \ + echo private-lib; } | LC_ALL=C sort -u >$@ -contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c +contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c Makefile + @printf 'Generating %s from %s\n' $@ $< @awk -- 'BEGIN {process=0;} /^Cond conditionals\[\] = \{$$/ {process=1;} \ /\t*\{"[^"]+".*/ \ { if (process) {print gensub(/^\t*\{"([^"]+)".*$$/, "\\1", 1);} } \ /^\t\{ NULL, NULL \}$$/ {process=0;}' \ $< | LC_ALL=C sort -u >$@ -contrib/syntax/lists/profile_macros.list: src/firejail/macros.c +contrib/syntax/lists/profile_macros.list: src/firejail/macros.c Makefile + @printf 'Generating %s from %s\n' $@ $< @sed -En 's/.*\$$\{([^}]+)\}.*/\1/p' $< | LC_ALL=C sort -u >$@ -contrib/syntax/lists/syscall_groups.list: src/lib/syscall.c +contrib/syntax/lists/syscall_groups.list: src/lib/syscall.c Makefile + @printf 'Generating %s from %s\n' $@ $< @sed -En 's/.*"@([^",]+).*/\1/p' $< | LC_ALL=C sort -u >$@ -contrib/syntax/lists/syscalls.list: $(SYSCALL_HEADERS) +contrib/syntax/lists/syscalls.list: $(SYSCALL_HEADERS) Makefile + @printf 'Generating %s\n' $@ @sed -n 's/{\s\+"\([^"]\+\)",.*},/\1/p' $(SYSCALL_HEADERS) | \ LC_ALL=C sort -u >$@ -contrib/syntax/lists/system_errnos.list: src/lib/errno.c +contrib/syntax/lists/system_errnos.list: src/lib/errno.c Makefile + @printf 'Generating %s from %s\n' $@ $< @sed -En 's/.*"(E[^"]+).*/\1/p' $< | LC_ALL=C sort -u >$@ -pipe_fromlf = { tr '\n' '|' | sed 's/|$$//'; } -space_fromlf = { tr '\n' ' ' | sed 's/ $$//'; } +regex_fromlf = { tr '\n' '|' | sed -e 's/|$$//' -e 's/\./\\\\./g'; } +space_fromlf = { tr '\n' ' ' | sed -e 's/ $$//'; } edit_syntax_file = sed \ -e "s/@make_input@/$$(basename $@). Generated from $$(basename $<) by make./" \ - -e "s/@FJ_PROFILE_COMMANDS_ARG0@/$$($(pipe_fromlf) $@ # gtksourceview language-specs -contrib/syntax/files/%.lang: contrib/syntax/files/%.lang.in $(SYNTAX_LISTS) +contrib/syntax/files/%.lang: contrib/syntax/files/%.lang.in $(SYNTAX_LISTS) Makefile @printf 'Generating %s from %s\n' $@ $< @$(edit_syntax_file) $< >$@ # vim syntax files -contrib/syntax/files/%.vim: contrib/syntax/files/%.vim.in $(SYNTAX_LISTS) +contrib/syntax/files/%.vim: contrib/syntax/files/%.vim.in $(SYNTAX_LISTS) Makefile @printf 'Generating %s from %s\n' $@ $< @$(edit_syntax_file) $< >$@ @@ -165,209 +190,220 @@ clean: done $(MAKE) -C src/man clean $(MAKE) -C test clean - rm -f $(SECCOMP_FILTERS) - rm -f firejail*.rpm - rm -f $(SYNTAX_FILES) - rm -f src/fnettrace/static-ip-map - rm -f test/utils/index.html* - rm -f test/utils/wget-log - rm -f test/utils/firejail-test-file* - rm -f test/utils/lstesting - rm -f test/environment/index.html* - rm -f test/environment/wget-log* - rm -fr test/environment/-testdir - rm -f test/environment/logfile* - rm -f test/environment/index.html - rm -f test/environment/wget-log - rm -f test/sysutils/firejail_t* - cd test/compile; ./compile.sh --clean; cd ../.. + $(RM) $(SECCOMP_FILTERS) + $(RM) $(SYNTAX_FILES) + $(RM) -r ./$(TARNAME)-$(VERSION) ./$(TARNAME)-$(VERSION).tar.xz + $(RM) ./$(TARNAME)*.deb + $(RM) ./$(TARNAME)*.rpm .PHONY: distclean distclean: clean - for dir in $$(dirname $(ALL_ITEMS)) $(MYDIRS); do \ - $(MAKE) -C $$dir distclean; \ - done - $(MAKE) -C test distclean - rm -fr autom4te.cache config.log config.mk config.sh config.status + $(RM) -r autom4te.cache config.log config.mk config.sh config.status -.PHONY: realinstall -realinstall: config.mk +.PHONY: install +install: all config.mk # firejail executable - install -m 0755 -d $(DESTDIR)$(bindir) - install -m 0755 src/firejail/firejail $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 -d $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 -t $(DESTDIR)$(bindir) src/firejail/firejail ifeq ($(HAVE_SUID),-DHAVE_SUID) chmod u+s $(DESTDIR)$(bindir)/firejail endif # firemon executable - install -m 0755 src/firemon/firemon $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 -t $(DESTDIR)$(bindir) src/firemon/firemon # firecfg executable - install -m 0755 src/firecfg/firecfg $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 -t $(DESTDIR)$(bindir) src/firecfg/firecfg # jailcheck executable - install -m 0755 src/jailcheck/jailcheck $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 -t $(DESTDIR)$(bindir) src/jailcheck/jailcheck # libraries and plugins - install -m 0755 -d $(DESTDIR)$(libdir)/firejail - install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/firecfg/firejail-welcome.sh - install -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) $(SECCOMP_FILTERS) - install -m 0755 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS) - install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/profstats/profstats - install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/etc-cleanup/etc-cleanup + $(INSTALL) -m 0755 -d $(DESTDIR)$(libdir)/firejail + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail src/firecfg/firejail-welcome.sh + $(INSTALL) -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) $(SECCOMP_FILTERS) + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS) + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail src/profstats/profstats + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail src/etc-cleanup/etc-cleanup # plugins w/o read permission (non-dumpable) - install -m 0711 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS_NON_DUMPABLE) - install -m 0711 -t $(DESTDIR)$(libdir)/firejail src/fshaper/fshaper.sh - install -m 0644 -t $(DESTDIR)$(libdir)/firejail src/fnettrace/static-ip-map + $(INSTALL) -m 0711 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS_NON_DUMPABLE) + $(INSTALL) -m 0711 -t $(DESTDIR)$(libdir)/firejail src/fshaper/fshaper.sh + $(INSTALL) -m 0644 -t $(DESTDIR)$(libdir)/firejail src/fnettrace/static-ip-map ifeq ($(HAVE_CONTRIB_INSTALL),yes) # contrib scripts - install -m 0755 -t $(DESTDIR)$(libdir)/firejail contrib/*.py contrib/*.sh + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail contrib/*.py contrib/*.sh # vim syntax - install -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect - install -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax - install -m 0644 contrib/vim/ftdetect/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect - install -m 0644 contrib/syntax/files/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect + $(INSTALL) -m 0644 -t $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect contrib/vim/ftdetect/firejail.vim + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax + $(INSTALL) -m 0644 -t $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax contrib/syntax/files/firejail.vim # gtksourceview language-specs - install -m 0755 -d $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs - install -m 0644 contrib/syntax/files/firejail-profile.lang $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs + $(INSTALL) -m 0644 -t $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs contrib/syntax/files/firejail-profile.lang endif # documents - install -m 0755 -d $(DESTDIR)$(docdir) - install -m 0644 -t $(DESTDIR)$(docdir) COPYING README RELNOTES etc/templates/* + $(INSTALL) -m 0755 -d $(DESTDIR)$(docdir) + $(INSTALL) -m 0644 -t $(DESTDIR)$(docdir) COPYING README RELNOTES etc/templates/* # profiles and settings - install -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail - install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail src/firecfg/firecfg.config - install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/profile-a-l/*.profile etc/profile-m-z/*.profile etc/inc/*.inc etc/net/*.net etc/firejail.config - sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/firejail/login.users ]; then install -c -m 0644 etc/login.users $(DESTDIR)/$(sysconfdir)/firejail/.; fi;" + $(INSTALL) -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail + $(INSTALL) -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail/firecfg.d + $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail src/firecfg/firecfg.config + $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/profile-a-l/*.profile etc/profile-m-z/*.profile etc/inc/*.inc etc/net/*.net etc/firejail.config + sh -c "if [ ! -f $(DESTDIR)$(sysconfdir)/firejail/login.users ]; then \ + $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/login.users; \ + fi" ifeq ($(HAVE_IDS),-DHAVE_IDS) - install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/ids.config + $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/ids.config endif ifeq ($(BUSYBOX_WORKAROUND),yes) ./mketc.sh $(DESTDIR)$(sysconfdir)/firejail/disable-common.inc endif ifeq ($(HAVE_APPARMOR),-DHAVE_APPARMOR) # install apparmor profile - sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d; fi;" - install -m 0644 etc/apparmor/firejail-default $(DESTDIR)$(sysconfdir)/apparmor.d + $(INSTALL) -m 0755 -d $(DESTDIR)$(sysconfdir)/apparmor.d + $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/apparmor.d etc/apparmor/firejail-default # install apparmor profile customization file - sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/local ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/local; fi;" - sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default ]; then install -c -m 0644 etc/apparmor/firejail-local $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default; fi;" + $(INSTALL) -m 0755 -d $(DESTDIR)$(sysconfdir)/apparmor.d/local + sh -c "if [ ! -f $(DESTDIR)$(sysconfdir)/apparmor.d/local/firejail-default ]; then \ + $(INSTALL) -m 0644 etc/apparmor/firejail-local $(DESTDIR)$(sysconfdir)/apparmor.d/local/firejail-default; \ + fi" # install apparmor base abstraction drop-in - sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions; fi;" - sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d; fi;" - install -m 0644 etc/apparmor/firejail-base $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/base.d + $(INSTALL) -m 0755 -d $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/base.d + $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/base.d etc/apparmor/firejail-base endif ifneq ($(HAVE_MAN),no) # man pages - install -m 0755 -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 - install -m 0644 $(MANPAGES1_GZ) $(DESTDIR)$(mandir)/man1/ - install -m 0644 $(MANPAGES5_GZ) $(DESTDIR)$(mandir)/man5/ + $(INSTALL) -m 0755 -d $(DESTDIR)$(mandir)/man1 + $(INSTALL) -m 0644 -t $(DESTDIR)$(mandir)/man1 $(MANPAGES1_GZ) + $(INSTALL) -m 0755 -d $(DESTDIR)$(mandir)/man5 + $(INSTALL) -m 0644 -t $(DESTDIR)$(mandir)/man5 $(MANPAGES5_GZ) endif # bash completion - install -m 0755 -d $(DESTDIR)$(datarootdir)/bash-completion/completions - install -m 0644 src/bash_completion/firejail.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail - install -m 0644 src/bash_completion/firemon.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon - install -m 0644 src/bash_completion/firecfg.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/bash-completion/completions + $(INSTALL) -m 0644 src/bash_completion/firejail.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail + $(INSTALL) -m 0644 src/bash_completion/firemon.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon + $(INSTALL) -m 0644 src/bash_completion/firecfg.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg # zsh completion - install -m 0755 -d $(DESTDIR)$(datarootdir)/zsh/site-functions - install -m 0644 src/zsh_completion/_firejail $(DESTDIR)$(datarootdir)/zsh/site-functions/ - -.PHONY: install -install: all - $(MAKE) realinstall + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/zsh/site-functions + $(INSTALL) -m 0644 -t $(DESTDIR)$(datarootdir)/zsh/site-functions src/zsh_completion/_firejail .PHONY: install-strip -install-strip: all - strip $(ALL_ITEMS) - $(MAKE) realinstall +install-strip: strip install .PHONY: uninstall uninstall: config.mk - rm -f $(DESTDIR)$(bindir)/firejail - rm -f $(DESTDIR)$(bindir)/firemon - rm -f $(DESTDIR)$(bindir)/firecfg - rm -f $(DESTDIR)$(bindir)/jailcheck - rm -fr $(DESTDIR)$(libdir)/firejail - rm -fr $(DESTDIR)$(datarootdir)/doc/firejail - rm -f $(addprefix $(DESTDIR)$(mandir)/man1/,$(notdir $(MANPAGES1_GZ))) - rm -f $(addprefix $(DESTDIR)$(mandir)/man5/,$(notdir $(MANPAGES5_GZ))) - rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail - rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon - rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg - rm -f $(DESTDIR)$(datarootdir)/zsh/site-functions/_firejail - rm -f $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect/firejail.vim - rm -f $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax/firejail.vim - rm -f $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs/firejail-profile.lang + $(RM) $(DESTDIR)$(bindir)/firejail + $(RM) $(DESTDIR)$(bindir)/firemon + $(RM) $(DESTDIR)$(bindir)/firecfg + $(RM) $(DESTDIR)$(bindir)/jailcheck + $(RM) -r $(DESTDIR)$(libdir)/firejail + $(RM) -r $(DESTDIR)$(datarootdir)/doc/firejail + $(RM) $(addprefix $(DESTDIR)$(mandir)/man1/,$(notdir $(MANPAGES1_GZ))) + $(RM) $(addprefix $(DESTDIR)$(mandir)/man5/,$(notdir $(MANPAGES5_GZ))) + $(RM) $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail + $(RM) $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon + $(RM) $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg + $(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_firejail + $(RM) $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect/firejail.vim + $(RM) $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax/firejail.vim + $(RM) $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs/firejail-profile.lang @echo "If you want to install a different version of firejail, you might also need to run 'rm -fr $(DESTDIR)$(sysconfdir)/firejail', see #2038." +# Note: Keep this list in sync with `paths` in .github/workflows/build.yml. DISTFILES = \ -COPYING \ -Makefile \ -README \ -RELNOTES \ -config.mk.in \ -config.sh.in \ -configure \ -configure.ac \ -contrib \ -etc \ -install.sh \ -m4 \ -mkdeb.sh \ -mketc.sh \ -platform \ -src + COPYING \ + Makefile \ + README \ + RELNOTES \ + config.mk.in \ + config.sh.in \ + configure \ + configure.ac \ + contrib \ + etc \ + install.sh \ + m4 \ + mkdeb.sh \ + mketc.sh \ + platform \ + src -DISTFILES_TEST = test/Makefile test/apps test/apps-x11 test/apps-x11-xorg test/capabilities test/private-lib test/fnetfilter test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/fs test/sysutils +DISTFILES_TEST = \ + test/Makefile \ + test/apps \ + test/apps-x11 \ + test/apps-x11-xorg \ + test/capabilities \ + test/compile \ + test/environment \ + test/fcopy \ + test/filters \ + test/fnetfilter \ + test/fs \ + test/network \ + test/private-lib \ + test/profiles \ + test/sysutils \ + test/utils .PHONY: dist -dist: config.mk - mv config.sh config.sh.old - mv config.status config.status.old - make distclean - mv config.status.old config.status - mv config.sh.old config.sh - rm -fr $(TARNAME)-$(VERSION) $(TARNAME)-$(VERSION).tar.xz +dist: clean config.mk mkdir -p $(TARNAME)-$(VERSION)/test cp -a $(DISTFILES) $(TARNAME)-$(VERSION) cp -a $(DISTFILES_TEST) $(TARNAME)-$(VERSION)/test - rm -rf $(TARNAME)-$(VERSION)/src/tools - find $(TARNAME)-$(VERSION) -name .svn -delete - tar -cJvf $(TARNAME)-$(VERSION).tar.xz $(TARNAME)-$(VERSION) - rm -fr $(TARNAME)-$(VERSION) + $(RM) -r $(TARNAME)-$(VERSION)/src/tools + $(TAR) -cJvf $(TARNAME)-$(VERSION).tar.xz $(TARNAME)-$(VERSION) + $(RM) -r $(TARNAME)-$(VERSION) .PHONY: asc -asc: config.mk - ./mkasc.sh $(VERSION) +asc: config.sh + ./mkasc.sh .PHONY: deb deb: dist config.sh ./mkdeb.sh .PHONY: test-compile -test-compile: dist config.mk - cd test/compile; ./compile.sh $(TARNAME)-$(VERSION) +test-compile: dist config.sh + cd test/compile; ./compile.sh .PHONY: rpms -rpms: src/man config.mk - ./platform/rpm/mkrpm.sh $(TARNAME) $(VERSION) +rpms: src/man config.sh + ./platform/rpm/mkrpm.sh .PHONY: extras extras: all $(MAKE) -C extras/firetools .PHONY: cppcheck -cppcheck: clean - cppcheck --force --error-exitcode=1 --enable=warning,performance . +cppcheck: + $(CPPCHECK) --force --error-exitcode=1 --enable=warning,performance \ + -i src/firejail/checkcfg.c -i src/firejail/main.c . + +# For cppcheck 1.x; see .github/workflows/check-c.yml +.PHONY: cppcheck-old +cppcheck-old: + $(CPPCHECK) --force --error-exitcode=1 --enable=warning,performance . .PHONY: scan-build scan-build: clean - scan-build make + $(SCAN_BUILD) --status-bugs $(MAKE) +# TODO: Old codespell versions (such as v2.1.0 in CI) have issues with +# contrib/syscalls.sh .PHONY: codespell -codespell: clean - codespell --ignore-regex "UE|creat|doas|shotcut|ether" src test +codespell: + @printf 'Running %s...\n' $@ + @$(CODESPELL) --ignore-regex 'Manuel|UE|als|chage|creat|doas|ether|isplay|readby|[Ss]hotcut' \ + -S *.d,*.gz,*.o,*.so \ + -S COPYING,m4 \ + -S ./contrib/syscalls.sh \ + . .PHONY: print-env print-env: ./ci/printenv.sh +.PHONY: print-version +print-version: config.mk + command -V $(TARNAME) && $(TARNAME) --version + # # make test # diff --git a/README b/README index 174530cc6..67bcfd82a 100644 --- a/README +++ b/README @@ -28,13 +28,17 @@ Compile and install the mainline version from GitHub: cd firejail ./configure && make && sudo make install-strip -On Debian/Ubuntu you will need to install git and gcc. AppArmor development -libraries and pkg-config are required when using the --enable-apparmor -./configure option: +On Debian/Ubuntu you will need to install git and gcc. + +To build with AppArmor support (which is usually used on Debian, Ubuntu, +openSUSE and derivatives), install the AppArmor development libraries and +pkg-config and use the `--enable-apparmor` ./configure option: sudo apt-get install git build-essential libapparmor-dev pkg-config gawk -For --selinux option, add libselinux1-dev (libselinux-devel for Fedora). +To build with SELinux support (which is usually used on Fedora, RHEL and +derivatives), install libselinux1-dev (libselinux-devel on Fedora) and use the +`--enable-selinux` ./configure option. We build our release firejail.tar.xz and firejail.deb packages using the following commands: @@ -59,7 +63,7 @@ Committers: - rusty-snake (https://github.com/rusty-snake) - smitsohu (https://github.com/smitsohu) - SkewedZeppelin (https://github.com/SkewedZeppelin) -- startx2017 (https://github.com/startx2017) - LTS and *bugfixes branches +- startx2017 (https://github.com/startx2017) maintainer) - Topi Miettinen (https://github.com/topimiettinen) - veloute (https://github.com/veloute) @@ -125,6 +129,7 @@ Aleksey Manevich (https://github.com/manevich) Alexander Gerasiov (https://github.com/gerasiov) - read-only ~/.ssh/authorized_keys - profile updates + - fcopy: Use lstat when copy directory Alexander Stein (https://github.com/ajstein) - added profile for qutebrowser alkim0 (https://github.com/alkim0) @@ -169,6 +174,8 @@ aoand (https://github.com/aoand) - seccomp fix: allow numeric syscalls Arne Welzel (https://github.com/awelzel) - ignore SIGTTOU during flush_stdin() +archaon616 (https://github.com/archaon616) + - steam.profile: allow Factorio, Zomboid Atrate (https://github.com/Atrate) - BetterDiscord support Austin Morton (https://github.com/apmorton) @@ -196,8 +203,11 @@ avoidr (https://github.com/avoidr) - added mcabber profile - fixed mpv profile - various other fixes +ayham (https://github.com/ayham-1) + - allow custom homedir support for gpgagent АСаĐģĐ¸Ņ ĐĄĐŧĐ°Ņ€Đ°ĐŗĐ´ĐžĐ˛Đ°/ChrysoliteAzalea (https://github.com/ChrysoliteAzalea) - - add support for custom AppArmor profiles (--apparmor=) + - add support for custom AppArmor profiles (--apparmor=) + - add Landlock support backspac (https://github.com/backspac) - firecfg fixes - add steam-runtime alias @@ -253,6 +263,8 @@ bymoz089 (https://github.com/bymoz089) - add timezone access to make libical functional BytesTuner (https://github.com/BytesTuner) - provided keepassxc profile +Caleb McCombs (https://github.com/squatched) + - Zoom profile fixes caoliver (https://github.com/caoliver) - network system fixes Carlo Abelli (https://github.com/carloabelli) @@ -266,6 +278,9 @@ Cat (https://github.com/ecat3) cayday (https://github.com/caydey) - added ~/Private blacklist in disable-common.inc - added quiet to some CLI profiles +celenityy (https://github.com/celenityy) + - Thunderbird profile fix + - wget profile fix Christian Pinedo (https://github.com/chrpinedo) - added nicotine profile - allow python3 in totem profile @@ -283,6 +298,8 @@ Christian Stadelmann (https://github.com/genodeftest) - evolution profile fix Clayton Williams (https://github.com/gosre) - addition of RLIMIT_AS +CodeWithMa (https://github.com/CodeWithMa) + - mpv.profile: add new XDG_STATE_HOME path corecontingency (https://https://github.com/corecontingency) - tighten private-bin and etc for torbrowser-launcher.profile - added i2prouter profile @@ -320,6 +337,8 @@ curiosityseeker (https://github.com/curiosityseeker - new) - fixed conky profile - thunderbird.profile: harden and enable the rules necessary to make Firefox open links +D357R0Y3R (https://github.com/D357R0Y3R) + - added floorp to firejail.config da2x (https://github.com/da2x) - matched RPM license tag Daan Bakker (https://github.com/dbakker) @@ -349,6 +368,10 @@ David Hyrule (https://github.com/Svaag) - remove nou2f in ssh profile Deelvesh Bunjun (https://github.com/DeelveshBunjun) - added xpdf profile +DefaultUser (https://github.com/DefaultUser) + - neochat: Allow netlink +Denis Subbotin (https://github.com/mr-tron) + - telegram.profile: allow ~/.local/share/telegram-desktop Denys Havrysh (https://github.com/vutny) - update SkypeForLinux profile for latest version - removed outdated Skype profile @@ -361,6 +384,8 @@ DiGitHubCap (https://github.com/DiGitHubCap) - fix qt5ct colour schemes and QSS Dieter Plaetinck (https://github.com/Dieterbe) - qutebrowser: update MPRIS name for qutebrowser-qt6 + - fix email-common.profile + - fix claws-mail profile Disconnect3d (https://github.com/disconnect3d) - code cleanup dm9pZCAq (https://github.com/dm9pZCAq) @@ -371,6 +396,7 @@ dmfreemon (https://github.com/dmfreemon) - handle malloc() failures; use gnu_basename() instead of basenaem() Dmitriy Chestnykh (https://github.com/chestnykh) - add ability to disable user profiles at compile time + - lookup xauth in PATH Dpeta (https://github.com/Dpeta) - add Chatterino profile dshmgh (https://github.com/dshmgh) @@ -397,11 +423,19 @@ Fabian WÃŧrfl (https://github.com/BafDyce) - Liferea profile Felipe Barriga Richards (https://github.com/fbarriga) - --private-etc fix +Felix Pehla (https://github.com/FelixPehla) + - fix fractal profile + - blacklist sway IPC socket globally fenuks (https://github.com/fenuks) - fix sound in games using FMOD - allow /opt/tor-browser for Tor Browser profile fkrone (https://github.com/fkrone) - fix Zoom profile +Fidel Ramos (https://github.com/haplo) + - added Ledger Live profile + - fixed geeqie profile + - added rawtherapee profile + - added electron-cache profile Florian Begusch (https://github.com/florianbegusch) - (la)tex profiles - fixed transmission-common.profile @@ -411,6 +445,8 @@ floxo (https://github.com/floxo) - fixed qml disk cache issue Foemass (https://github.com/Foemass) - documentation +Foxreef (https://github.com/Foxreef) + - steam profile fixes Franco (nextime) Lanza (https://github.com/nextime) - added --private-template/--private-home FrantiÅĄek PolÃĄÅĄek (https://github.com/fandaa) @@ -465,6 +501,9 @@ Fred-Barclay (https://github.com/Fred-Barclay) - added Catfish profile Frederik Olesen (https://github.com/Freso) - added many vim profiles +Frostbyte4664 (https://github.com/Frostbyte4664) + - steam.profile: Allow Baba Is You + - blender-3.6 redirect g3ngr33n (https://github.com/g3ngr33n) - fix musl compilation G4JC (https://sourceforge.net/u/gaming4jc/profile/) @@ -472,6 +511,10 @@ G4JC (https://sourceforge.net/u/gaming4jc/profile/) - profile fixes Gaman Gabriel (https://github.com/stelariusinfinitek) - inox profile +Gabriel (https://github.com/gcb) + - okular profile fix + - irssi profile + - syncthing profile geg2048 (https://github.com/geg2048) - kwallet profile fixes glitsj16 (https://github.com/glitsj16) @@ -497,6 +540,8 @@ glitsj16 (https://github.com/glitsj16) - new profiles: lzip, artha, nitroshare, nitroshare-cli, nitroshare-nmh - new profiles: nirtoshare-send, nitroshare-ui, mencoder, gnome-pie - new profiles: masterpdfeditor +glu8716 (https://github.com/glu8716) + - nicotine: support Fcitx and dconf via dbus-user filter gm10 (https://github.com/gm10) - get_user() do not use the unreliable getlogin() GovanifY (https://github.com/GovanifY) @@ -514,6 +559,7 @@ GSI (https://github.com/GSI) - added Uzbl browser profile haarp (https://github.com/haarp) - Allow sound for hexchat + - discord-common.profile: harden & allow notifications hamzadis (https://github.com/hamzadis) - added --overlay-named=name and --overlay-path=path Hans-Christoph Steiner (https://github.com/eighthave) @@ -548,6 +594,9 @@ Haowei Yu (https://github.com/sfc-gh-hyu) Icaro Perseo (https://github.com/icaroperseo) - Icecat profile - several profile fixes +Ilya Pankratov (https://github.com/i-pankrat) + - profstats fix + - fix various memory resource leaks Igor Bukanov (https://github.com/ibukanov) - found/fiixed privilege escalation in --hosts-file option iiotx (https://github.com/iiotx) @@ -642,6 +691,8 @@ jrabe (https://github.com/jrabe) - Polari profile - qTox profile - X11 fixes +jtrv (https://github.com/jtrv) + - tidal-hifi profile juan (https://github.com/nyancat18) - fixed Kdenlive, Shotcut profiles - new profiles for Cinelerra, Cliqz, Bluefish @@ -690,6 +741,8 @@ kuesji koesnu (https://github.com/kuesji) - better parser for size strings Kunal Mehta (https://github.com/legoktm) - converted all links to https in manpages +kzsa (https://github.com/kzsa) + - wusc: add /usr/share/locale-langpack (LC_MESSAGES) laniakea64 (https://github.com/laniakea64) - added fj-mkdeb.py script to build deb packages Lari Rauno (https://github.com/tuutti) @@ -705,6 +758,8 @@ layderv (https://github.com/layderv) lecso7 (https://github.com/lecso7) - added goldendict profile - allow evince to read .cbz file format +leukimi (https://github.com/leukimi) + - 0ad.profile: fix libmozjs error on OpenSUSE Tumbleweed Loïc Damien (https://github.com/dzamlo) - small fixes Liorst4 (https://github.com/Liorst4) @@ -714,6 +769,8 @@ Liorst4 (https://github.com/Liorst4) - minetest fixes Lockdis (https://github.com/Lockdis) - Added crow, nyx, and google-earth-pro profiles +luca0N (https://github.com/luca0N) + - fixed crawl profile LukÃĄÅĄ Krejčí (https://github.com/lskrejci) - fixed parsing of --keep-var-tmp luzpaz (https://github.com/luzpaz) @@ -729,12 +786,15 @@ Madura A (https://github.com/manushanga) mahdi1234 (https://github.com/mahdi1234) - cherrytree profile - Seamonkey profiles +mammo0 (https://github.com/mammo0) + - remove 'text/plain' from firejail-profile.lang.in Manuel Dipolt (https://github.com/xeniter) - stack alignment for the ARM Architecture Marek KÃŧthe (https://github.com/marek22k) - allow loading plugins in gajim - allow bsfilter in email-common.profile - email-common.profile: allow clamav plugin for claws-mail + - VSCodium: Fix developing Arduino Martin Carpenter (https://github.com/mcarpenter) - security audit and bug fixes - Centos 6.x support @@ -766,6 +826,8 @@ Michael Haas (https://github.com/mhaas) - bugfixes Michael Hoffmann (https://github.com/brisad) - added support for subdirs in private-etc +Michele Sorcinelli (https://github.com/michelesr) + - fix ssh profile Mike Frysinger (vapier@gentoo.org) - Gentoo compile patch minus7 (https://github.com/minus7) @@ -803,6 +865,8 @@ NetSysFire (https://github.com/NetSysFire) - update weechat profile - update megaglest profile - added parsecd profile + - fix minecraft-launcher.profile + - singularity profile Nick Fox (https://github.com/njfox) - add a profile alias for code-oss - add code-oss config directory @@ -823,6 +887,11 @@ Nikos Chantziaras (https://github.com/realnc) - fix audio support for Discord nolanl (https://github.com/nolanl) - added localtime to signal-desktop's profile +nutta-git (https://github.com/nutta-git) + - steam.profile: allow process_vm_readv syscall + - lutris.profile: allow more syscalls + - steam.profile: update novideo comment for webcam motion trackers + - more lutris.profile problems nyancat18 (https://github.com/nyancat18) - added ardour4, dooble, karbon, krita profiles nya1 (https://github.com/nya1) @@ -905,6 +974,8 @@ PizzaDude (https://github.com/pizzadude) - fix welcome.sh polyzen (https://github.com/polyzen) - fixed wusc issue with mpv/Vulkan +powerjungle (https://github.com/powerjungle) + - fixed multimc probonopd (https://github.com/probonopd) - automatic build on Travis CI pshpsh (https://github.com/pshpsh) @@ -915,6 +986,9 @@ pszxzsd (https://github.com/pszxzsd) -uGet profile pwnage-pineapple (https://github.com/pwnage-pineapple) - update Okular profile +qdii (https://github.com/qdii) + - added notpm command & keep tpm devices in private-dev + - keepassxc: add new socket location Quentin Retornaz (https://github.com/qretornaz-adapei42) - microsoft-edge profiles fixes Quentin Minster (https://github.com/laomaiweng) @@ -969,6 +1043,8 @@ rootalc (https://github.com/rootalc) - add nolocal6.net filter Ruan (https://github.com/ruany) - fixed hexchat profile +RundownRhino (https://github.com/RundownRhino) + - firefox profile fix rusty-snake (https://github.com/rusty-snake) - added profiles: thunderbird-wayland, supertuxkart, ghostwriter - added profiles: klavaro, mypaint, mypaint-ora-thumbnailer, nano @@ -1006,18 +1082,17 @@ Serphentas (https://github.com/Serphentas) - add Paradox Launcher to Steam profile Slava Monich (https://github.com/monich) - added configure option to disable man pages -Tobias Schmidl (https://github.com/schtobia) - - added profile for webui-aria2 Simon Peter (https://github.com/probonopd) - set $APPIMAGE and $APPDIR environment variables - AppImage version detection - Leafppad type v1 and v2 appimage packages in test/appimage - GitHub/Travis CI integration +Simo Piiroinen (https://github.com/spiiroin) + - Jolla/SailfishOS patches + - fix startup race condition for /run/firejail directory sinkuu (https://github.com/sinkuu) - blacklisting kwalletd - fix symlink invocation for programs placing symlinks in $PATH -Simo Piiroinen (https://github.com/spiiroin) - - Jolla/SailfishOS patches slowpeek (https://github.com/slowpeek) - refine appimage example in docs - allow resolution of .local names with avahi-daemon in the apparmor profile @@ -1025,6 +1100,9 @@ slowpeek (https://github.com/slowpeek) - make appimage examples consistent with --appimage option short description - blacklist google-drive-ocamlfuse config - blacklist sendgmail config +Shahriar Heidrich (https://github.com/smheidrich) + - fix manpages + - fix i3 profile and disable-programs.profile smitsohu (https://github.com/smitsohu) - read-only kde4 services directory - enhanced mediathekview profile @@ -1119,6 +1197,8 @@ startx2017 (https://github.com/startx2017) - kwrite and geary profiles StelFux (https://github.com/StelFux) - Fix youtube video in totem +Syed Muhammad Shuja Haider (https://github.com/xplanthris) + - prismlauncher profile the-antz (https://github.com/the-antz) - Fix libx265 encoding in ffmpeg profile - Fix Firefox profile @@ -1153,6 +1233,8 @@ Tomasz Jan GÃŗralczyk (https://github.com/tjg) - fixed Steam profile Tomi Leppänen (https://github.com/Tomin1) - Jolla/SailfishOS patches +Tobias Schmidl (https://github.com/schtobia) + - added profile for webui-aria2 Topi Miettinen (https://github.com/topimiettinen) - improved seccomp printing - improve mount handling, fix /run/user handling @@ -1167,6 +1249,11 @@ Ted Robertson (https://github.com/tredondo) - various documentation fixes - blacklist Exodus wallet - blacklist monero-project directory + - several README file fixes + - use GitHub issues as the bug reporting address + - fix documentation for selinux +tools200ms (https://github.com/tools200ms) + - fixed allow-ssh.inc Tus1688 (https://github.com/Tus1688) - added neovim profile user1024 (user1024@tut.by) @@ -1193,6 +1280,9 @@ Vadim A. Misbakh-Soloviov (https://github.com/msva) ValdikSS (https://github.com/ValdikSS) - Psi+, Corebird, Konversation profiles - various profile fixes +Varun Sharma (https://github.com/varunsh-coder) + - update allowed endpoints + - build(deps): bump step-security/harden-runner from 2.5.0 to 2.5.1 Vasya Novikov (https://github.com/vn971) - Wesnoth profile - Hedegewars profile @@ -1257,6 +1347,9 @@ ydididodat (https://github.com/ydididodat) yumkam (https://github.com/yumkam) - add compile-time option to restrict --net= to root only - man page fixes +Yves-Alexis Perez (https://github.com/corsac-s) + - signal-desktop profile fix + - signal: add access to D-Bus freedesktop.org secret API Zack Weinberg (https://github.com/zackw) - added support for joining a persistent, named network namespace - removed libconnect @@ -1278,4 +1371,4 @@ Zack Weinberg (https://github.com/zackw) zupatisc (https://github.com/zupatisc) - patch-util fix -Copyright (C) 2014-2023 Firejail Authors +Copyright (C) 2014-2024 Firejail Authors diff --git a/README.md b/README.md index 781304451..16cd6bd45 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,25 @@ # Firejail -[![Build CI (GitLab)](https://gitlab.com/Firejail/firejail_ci/badges/master/pipeline.svg)](https://gitlab.com/Firejail/firejail_ci/pipelines) -[![Build CI (GitHub)](https://github.com/netblue30/firejail/workflows/Build%20CI/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3A%22Build+CI%22) -[![CodeQL CI](https://github.com/netblue30/firejail/workflows/CodeQL/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3ACodeQL) +[![Build (GitLab)](https://gitlab.com/Firejail/firejail_ci/badges/master/pipeline.svg)](https://gitlab.com/Firejail/firejail_ci/pipelines) +[![Build (GitHub)](https://github.com/netblue30/firejail/workflows/Build/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3ABuild) +[![Build-extra](https://github.com/netblue30/firejail/workflows/Build-extra/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3ABuild-extra) +[![Test](https://github.com/netblue30/firejail/workflows/Test/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3ATest) +[![Check-C](https://github.com/netblue30/firejail/workflows/Check-C/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3ACheck-C) +[![Check-Profiles](https://github.com/netblue30/firejail/workflows/Check-Profiles/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3ACheck-Profiles) +[![Check-Python](https://github.com/netblue30/firejail/workflows/Check-Python/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3ACheck-Python) +[![Codespell](https://github.com/netblue30/firejail/workflows/Codespell/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3ACodespell) [![Packaging status (Repology)](https://repology.org/badge/tiny-repos/firejail.svg)](https://repology.org/project/firejail/versions) -Firejail is a SUID sandbox program that reduces the risk of security breaches -by restricting the running environment of untrusted applications using Linux -namespaces, seccomp-bpf and Linux capabilities. It allows a process and all -its descendants to have their own private view of the globally shared kernel -resources, such as the network stack, process table, mount table. Firejail can -work in a SELinux or AppArmor environment, and it is integrated with Linux -Control Groups. +Firejail is a lightweight security tool intended to protect a Linux system by +setting up a restricted environment for running (potentially untrusted) +applications. + +More specifically, it is an SUID sandbox program that reduces the risk of +security breaches by using Linux namespaces, seccomp-bpf and Linux +capabilities. It allows a process and all its descendants to have their own +private view of the globally shared kernel resources, such as the network +stack, process table and mount table. Firejail can work in an SELinux or +AppArmor environment, and it is integrated with Linux Control Groups. Written in C with virtually no dependencies, the software runs on any Linux computer with a 3.x kernel version or newer. It can sandbox any type of @@ -30,7 +38,15 @@ and available on any Linux computer. - + + +
Quick Start +
+ + + + Advanced Browser Security
Advanced Browser Security @@ -38,18 +54,10 @@ alt="Advanced Browser Security" width="240" height="142" border="10" /> -
- -
How To Disable Network Access -
- - - - - -
Deep Dive +
+ +
Tor Browser Security
@@ -83,6 +91,10 @@ Debian stable (bullseye): We recommend to use the ### Ubuntu +Note: The PPA recommendation is mainly for firejail itself; it should be fine +to install firetools and firejail-related tools directly from the distribution +if they are not in the PPA as they tend to be updated less frequently. + For Ubuntu 18.04+ and derivatives (such as Linux Mint), users are **strongly advised** to use the [PPA](https://launchpad.net/~deki/+archive/ubuntu/firejail). @@ -143,7 +155,9 @@ The version can be checked with `firejail --version` after installing. You can also install one of the [released packages](https://github.com/netblue30/firejail/releases). -Or clone the source code from our git repository and build manually: +## Building + +You can clone the source code from this git repository and build manually: ```sh git clone https://github.com/netblue30/firejail.git @@ -151,15 +165,19 @@ cd firejail ./configure && make && sudo make install-strip ``` -On Debian/Ubuntu you will need to install git and gcc. AppArmor development -libraries and pkg-config are required when using the `--enable-apparmor` -./configure option: +On Debian/Ubuntu you will need to install git and gcc. + +To build with AppArmor support (which is usually used on Debian, Ubuntu, +openSUSE and derivatives), install the AppArmor development libraries and +pkg-config and use the `--enable-apparmor` ./configure option: ```sh sudo apt-get install git build-essential libapparmor-dev pkg-config gawk ``` -For `--selinux` option, add libselinux1-dev (libselinux-devel for Fedora). +To build with SELinux support (which is usually used on Fedora, RHEL and +derivatives), install libselinux1-dev (libselinux-devel on Fedora) and use the +`--enable-selinux` ./configure option. Detailed information on using firejail from git is available on the [wiki](https://github.com/netblue30/firejail/wiki/Using-firejail-from-git). @@ -306,6 +324,53 @@ Discussion: * [private-etc rework](https://github.com/netblue30/firejail/discussions/5610) +### Landlock support + +* Added on #6078, which is based on #5315 from ChrysoliteAzalea/landlock +* Compile-time detection based on linux/landlock.h - if the header is found, + the feature is compiled in +* Runtime detection based on whether Landlock is supported by the kernel and is + enabled on the system + +```text +LANDLOCK + Landlock is a Linux security module first introduced in version 5.13 of + the Linux kernel. It allows unprivileged processes to restrict their + access to the filesystem. Once imposed, these restrictions can never + be removed, and all child processes created by a Landlock-restricted + processes inherit these restrictions. Firejail supports Landlock as an + additional sandboxing feature. It can be used to ensure that a sand‐ + boxed application can only access files and directories that it was ex‐ + plicitly allowed to access. Firejail supports populating the ruleset + with both a basic set of rules (see --landlock) and with a custom set + of rules. + + Important notes: + + - A process can install a Landlock ruleset only if it has either + CAP_SYS_ADMIN in its effective capability set, or the "No New + Privileges" restriction enabled. Because of this, enabling the + Landlock feature will also cause Firejail to enable the "No New + Privileges" restriction, regardless of the profile or the + --nonewprivs command line option. + + - Access to the /proc directory is managed through the --land‐ + lock.proc command line option. + + - Access to the /etc directory is automatically allowed. To + override this, use the --writable-etc command line option. You + can also use the --private-etc option to restrict access to the + /etc directory. + + To enable Landlock self-restriction on top of your current Firejail se‐ + curity features, pass --landlock flag to Firejail command line. You + can also use --landlock.read, --landlock.write, --landlock.special and + --landlock.execute options together with --landlock or instead of it. + Example: + + $ firejail --landlock --landlock.read=/media --landlock.proc=ro mc +``` + ### Profile Statistics A small tool to print profile statistics. Compile and install as usual. The @@ -316,33 +381,35 @@ Run it over the profiles in /etc/profiles: ```console $ /usr/lib/firejail/profstats /etc/firejail/*.profile No include .local found in /etc/firejail/noprofile.profile +Warning: multiple caps in /etc/firejail/tidal-hifi.profile Warning: multiple caps in /etc/firejail/transmission-daemon.profile Stats: - profiles 1209 - include local profile 1208 (include profile-name.local) - include globals 1181 (include globals.local) - blacklist ~/.ssh 1079 (include disable-common.inc) - seccomp 1096 - capabilities 1202 - noexec 1087 (include disable-exec.inc) - noroot 1003 - memory-deny-write-execute 272 - restrict-namespaces 958 - apparmor 753 - private-bin 704 - private-dev 1058 - private-etc 550 - private-lib 71 - private-tmp 932 - whitelist home directory 585 - whitelist var 870 (include whitelist-var-common.inc) - whitelist run/user 1176 (include whitelist-runuser-common.inc + profiles 1249 + include local profile 1248 (include profile-name.local) + include globals 1217 (include globals.local) + blacklist ~/.ssh 1117 (include disable-common.inc) + seccomp 1127 + capabilities 1242 + noexec 1125 (include disable-exec.inc) + noroot 1030 + memory-deny-write-execute 285 + restrict-namespaces 981 + apparmor 788 + private-bin 750 + private-dev 1090 + private-etc 763 + private-lib 78 + private-tmp 959 + whitelist home directory 609 + whitelist var 907 (include whitelist-var-common.inc) + whitelist run/user 1214 (include whitelist-runuser-common.inc or blacklist ${RUNUSER}) - whitelist usr/share 640 (include whitelist-usr-share-common.inc - net none 410 - dbus-user none 679 - dbus-user filter 141 - dbus-system none 851 - dbus-system filter 12 + whitelist usr/share 690 (include whitelist-usr-share-common.inc + net none 420 + dbus-user none 705 + dbus-user filter 164 + dbus-system none 889 + dbus-system filter 13 + ``` diff --git a/RELNOTES b/RELNOTES index 73d6c6a7e..b11159dd0 100644 --- a/RELNOTES +++ b/RELNOTES @@ -1,40 +1,95 @@ firejail (0.9.73) baseline; urgency=low * work in progress + * security: fix sscanf rv checks (CodeQL) (#6184) + * feature: private-etc rework: improve handling of /etc/resolv.conf and add + private-etc groups (#6400 #5518 #5608 #5609 #5629 #5638 #5641 #5642 #5643 + #5650 #5681 #5737 #5844 #5989 #6016 #6104 #5655 #6435 #6514 #6515) * feature: Add "keep-shell-rc" command and option (#1127 #5634) * feature: Print the argument when failing with "too long arguments" (#5677) * feature: a random hostname is assigned to each sandbox unless overwritten using --hostname command * feature: add IPv6 support for --net.print option * feature: QUIC (HTTP/3) support in --nettrace - * feature: use seccomp filters build at install time for --restrict-namespaces + * feature: add seccomp filters for --restrict-namespaces * feature: stats support for --nettrace - * feature: add doas support in firecfg and jailcheck + * feature: add doas support in firecfg and jailcheck (#5899 #5900) + * feature: firecfg: add firecfg.d & add ignore command (#2097 #5245 #5876 + #6153 #6268) + * feature: expand simple macros in more commands (--chroot= --netfilter= + --netfilter6= --trace=) (#6032 #6109) + * feature: add Landlock support (#5269 #6078 #6115 #6125 #6187 #6195 #6200 + #6228 #6260 #6302 #6305) + * feature: add support for comm, coredump, and prctl procevents in firemon + (#6414 #6415) + * feature: add notpm command & keep tpm devices in private-dev (#6379 #6390) + * feature: fshaper.sh: support tc on NixOS (#6426 #6431) * modif: Stop forwarding own double-dash to the shell (#5599 #5600) * modif: Prevent sandbox name (--name=) and host name (--hostname=) from containing only digits (#5578 #5741) * modif: Escape control characters of the command line (#5613) * modif: Allow mostly only ASCII letters and digits for sandbox name (--name=) and host name (--hostname=) (#5708 #5856) - * modif: remove firemon --interface option (duplicating --net.print option) * modif: make private-lib a configure-time option, disabled by default (see --enable-private-lib) (#5727 #5732) - * modif: Improve --version/--help & print version on startup (#5829) - * bugfix: qutebrowser: links will not open in the existing instance (#5601 - #5618) + * modif: Improve --version/--help & print version on startup (#5829 #6172) + * modif: improve errExit error messages (#5871) + * modif: drop deprecated 'shell' option references (#5894) + * modif: keep pipewire group unless nosound is used (#5992 #5993) + * modif: fcopy: use lstat when copying directory (#5378 #5957) + * modif: private-dev: keep /dev/kfd unless no3d is used (#6380) + * modif: keep /sys/module/nvidia* if prop driver and no no3d (#6372 #6387) + * removal: firemon: remove --interface option (it duplicates the firejail + --net.print= option) (0e48f9933) + * removal: remove support for LTS and firetunnel (db09546f2) * bugfix: fix --hostname and --hosts-file commands + * bugfix: fix examples in firejail-local AppArmor profile (#5717) * bugfix: arp.c: ensure positive timeout on select(2) (#5806) + * bugfix: Wrong syscall names for s390_pci_mmio_read and s390_pci_mmio_write + (#5965 #5976) + * bugfix: firejail --ls reports wrong file sizes for large files (#5982 + #6086) + * bugfix: fix startup race condition for /run/firejail directory (#6307) + * bugfix: fix various resource leaks (#6367) + * bugfix: profstats: fix restrict-namespaces max count (#6369) + * bugfix: remove --noautopulse from --help and zsh comp (#6401) * build: auto-generate syntax files (#5627) * build: mark all phony targets as such (#5637) * build: mkdeb.sh: pass all arguments to ./configure (#5654) * build: deb: enable apparmor by default & remove deb-apparmor (#5668) * build: Fix whitespace and add .editorconfig (#5674) + * build: remove for loop initial declarations to fix building with old + compilers (#5778) * build: enable compiler warnings by default (#5842) * build: remove -mretpoline and NO_EXTRA_CFLAGS (#5859) * build: disable all built-in implicit make rules (#5864) * build: organize and standardize make vars and targets (#5866) * build: fix seccomp filters and man pages always being rebuilt when running - make - * build: simplify code related to man pages (#5898) + make (#5156 #5898) + * build: fix hardcoded make & remove unnecessary distclean targets (#5911) + * build: dist and asc improvements (#5916) + * build: fix some shellcheck issues & use config.sh in more scripts (#5927) + * build: firecfg.config sorting improvements (#5942) + * build: codespell improvements (#5955) + * build: add missing makefile dep & syntax improvements (#5956) + * build: sort.py: use case-sensitive sorting (#6070) + * build: mkrpm.sh: append instead of override configure args (#6126) + * build: use CPPFLAGS instead of INCLUDE in compile targets (#6159) + * build: use full paths on compile/link targets (#6158) + * build: automatically generate header dependencies (#6164) + * build: improve main clean target (#6186) + * build: mkrpm.sh improvements (#6196) + * build: move errExit macro into inline function (#6217) + * build: allow overriding certain tools & sync targets with CI (#6222) + * build: reduce hardcoding and inconsistencies (#6230) + * build: sort.py: filter empty and duplicate items (#6261) + * build: fix "warning: "_FORTIFY_SOURCE" redefined" (#6282 #6283) + * build: sort.py: add -h/-i/-n/-- options (#6290 #6339 #6562) + * build: add strip target and simplify install targets (#6342) + * build: remove clean dependency from cppcheck targets (#6343) + * build: allow overriding common tools (#6354) + * build: standardize install commands (#6366) + * build: improve reliability/portability of date command usage (#6403 #6404) + * build: sort.py: strip whitespace in profiles (#6556) * ci: always update the package db before installing packages (#5742) * ci: fix codeql unable to download its own bundle (#5783) * ci: split configure/build/install commands on gitlab (#5784) @@ -43,6 +98,14 @@ firejail (0.9.73) baseline; urgency=low * ci: run for every branch instead of just master (#5815) * ci: upgrade debian:stretch to debian:buster (#5818) * ci: standardize apt-get update/install & misc improvements (#5857) + * ci: Update step-security/harden-runner and update allowed endpoints (#5953) + * ci: whitelist paths, reorganize workflows & speed-up tests (#5960) + * ci: fix dependabot duplicated workflow runs (#5984) + * ci: allow running workflows manually (#6026) + * ci: add timeout limits (#6178) + * ci: make dependabot updates monthly and bump PR limit (#6338) + * contrib/syntax: remove 'text/plain' from firejail-profile.lang.in (#6057 + #6059) * contrib/vim: match profile files more broadly (#5850) * test: split individual test groups in github workflows * test: add chroot, appimage and network tests in github workflows @@ -51,8 +114,62 @@ firejail (0.9.73) baseline; urgency=low * docs: fix typos (#5693) * docs: markdown formatting and misc improvements (#5757) * docs: add uninstall instructions to README.md (#5812) + * docs: add precedence info to manpage & fix noblacklist example (#6358 + #6359) + * docs: bug_report.md: use absolute path in 'steps to reproduce' (#6382) + * docs: man: format and sort some private- items (#6398) + * docs: man: improve blacklist/whitelist examples with spaces (#6425) + * docs: add build_issue.md issue template (#6423) + * docs: man: sort commands (firejail.1) (#6451) + * docs: man: fix bold in command TPs (#6472) + * docs: man: fix wrong escapes (#6474) + * docs: github: streamline environment in issue templates (#6471) + * docs: fix typos of --enable-selinux configure option (#6526) + * docs: clarify intro and build section in README (#6524) * legal: selinux.c: Split Copyright notice & use same license as upstream (#5667) + * profiles: qutebrowser: fix links not opening in the existing instance + (#5601 #5618) + * profiles: clarify userns comments (#5686) + * profiles: bulk rename electron to electron-common (#5700) + * profiles: streamline seccomp socket comment (#5735) + * profiles: drop hostname option from all profiles (#5702) + * profiles: move read-only config entries to disable-common.inc (#5763) + * profiles: standardize on just "GTK" on comments (#5794) + * profiles: bleachbit: allow erasing Trash contents (#5337 #5902) + * profiles: improvements to profiles using private (#5946) + * profiles: standardize commented code and eol comments (#5987) + * profiles: disable-common: add more suid programs (#6049 #6051 #6052) + * profiles: replace private-opt with whitelist & document private-opt issues + (#6021) + * profiles: drop paths already in wusc (#6218) + * profiles: deny access to ~/.config/autostart (#6257) + * profiles: replace x11 socket blacklist with disable-X11.inc (#6286) + * profiles: sort blacklist sections (#6289) + * profiles: rename disable-X11.inc to disable-x11.inc (#6294) + * profiles: add allow-nodejs.inc to profile.template (#6298) + * profiles: add allow-php.inc to profile.template (#6299) + * profiles: clarify and add opengl-game to profile.template (#6300) + * profiles: allow-ssh: allow /etc/ssh/ssh_revoked_hosts (#6308 #6309) + * profiles: libreoffice: support signing documents with GPG (#6352 #6353) + * profiles: blacklist i3 IPC socket & dir except for i3 itself (#6361) + * profiles: librewolf: add new dbus name (io.gitlab.firefox) (#6413 #6473) + * profiles: nextcloud: fix access to ~/Nextcloud (#5877 #6478) + * profiles: ssh: add ${RUNUSER}/gvfsd-sftp (#5816 #6479) + * profiles: firecfg: disable text editors (#6002 #6477) + * profiles: browsers: centralize/sync/improve comments (#6486) + * profiles: keepassxc: add new socket location (#5447 #6391) + * profiles: signal-desktop: allow org.freedesktop.secrets (#6498) + * profiles: firefox-common: allow org.freedesktop.portal.Documents (#6444 #6499) + * profiles: keepassxc: allow access to ssh-agent socket (#3314 #6531) + * profiles: firecfg.config: disable dnsmasq (#6533) + * profiles: game-launchers: disable nou2f (#6534) + * profiles: anki: fix opening, allow media & add to firecfg (#6544 #6545) + * profiles: wget: allow ~/.local/share/wget (#6542) + * profiles: wget: unify wget2 into wget profile (#6551) + * profiles: tesseract: disable private-tmp to fix ocrmypdf (#6550 #6552) + * profiles: ensure allow-lua where mpv is allowed (#6555) + * profiles: video-players: add missing /usr/share paths (#6557) * new profiles: fix-qdf, qpdf, zlib-flate, standard-notes, url-eater -- netblue30 Mon, 17 Jan 2023 09:00:00 -0500 @@ -233,7 +350,7 @@ firejail (0.9.68) baseline; urgency=low -- netblue30 Sun, 6 Feb 2022 09:00:00 -0500 firejail (0.9.66) baseline; urgency=low - * deprecated --audit options, relpaced by jailcheck utility + * deprecated --audit options, replaced by jailcheck utility * deprecated follow-symlink-as-user from firejail.config * new firejail.config settings: private-bin, private-etc * new firejail.config settings: private-opt, private-srv @@ -358,7 +475,7 @@ firejail (0.9.62) baseline; urgency=low * whitelisting /usr/share in a large number of profiles * new scripts in contrib: gdb-firejail.sh and sort.py * enhancement: whitelist /usr/share in some profiles - * added signal mediation ot apparmor profile + * added signal mediation to apparmor profile * new conditions: HAS_X11, HAS_NET * new profiles: qgis, klatexformula, klatexformula_cmdl, links, xlinks * new profiles: pandoc, teams-for-linux, OpenArena, gnome-sound-recorder @@ -753,7 +870,7 @@ firejail (0.9.44.4) baseline; urgency=low firejail (0.9.44.2) baseline; urgency=low * security: overwrite /etc/resolv.conf found by Martin Carpenter (CVE-2016-10118) - * secuirty: TOCTOU exploit for --get and --put found by Daniel Hodson + * security: TOCTOU exploit for --get and --put found by Daniel Hodson * security: invalid environment exploit found by Martin Carpenter (CVE-2016-10122) * security: several security enhancements * bugfix: crashing VLC by pressing Ctrl-O diff --git a/ci/check/profiles/sort-firecfg.config.sh b/ci/check/profiles/sort-firecfg.config.sh index 17a595350..dbfbf24f5 100755 --- a/ci/check/profiles/sort-firecfg.config.sh +++ b/ci/check/profiles/sort-firecfg.config.sh @@ -1,2 +1,5 @@ #!/bin/sh -tail -n +4 "$1" | sed 's/^# /#/' | LC_ALL=C sort -c -d +# See ../../../src/firecfg/firecfg.config + +sed -E -e '/^#$/d' -e '/^# /d' -e 's/^#([^ ])/\1/' "$1" | +LC_ALL=C sort -c -u diff --git a/config.mk.in b/config.mk.in index c76ca1a98..812573a14 100644 --- a/config.mk.in +++ b/config.mk.in @@ -34,11 +34,10 @@ HAVE_APPARMOR=@HAVE_APPARMOR@ HAVE_CHROOT=@HAVE_CHROOT@ HAVE_DBUSPROXY=@HAVE_DBUSPROXY@ HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@ -HAVE_FIRETUNNEL=@HAVE_FIRETUNNEL@ HAVE_FORCE_NONEWPRIVS=@HAVE_FORCE_NONEWPRIVS@ HAVE_GLOBALCFG=@HAVE_GLOBALCFG@ HAVE_IDS=@HAVE_IDS@ -HAVE_LTS=@HAVE_LTS@ +HAVE_LANDLOCK=@HAVE_LANDLOCK@ HAVE_NETWORK=@HAVE_NETWORK@ HAVE_ONLY_SYSCFG_PROFILES=@HAVE_ONLY_SYSCFG_PROFILES@ HAVE_OUTPUT=@HAVE_OUTPUT@ @@ -56,11 +55,10 @@ MANFLAGS = \ $(HAVE_CHROOT) \ $(HAVE_DBUSPROXY) \ $(HAVE_FILE_TRANSFER) \ - $(HAVE_FIRETUNNEL) \ $(HAVE_FORCE_NONEWPRIVS) \ $(HAVE_GLOBALCFG) \ $(HAVE_IDS) \ - $(HAVE_LTS) \ + $(HAVE_LANDLOCK) \ $(HAVE_NETWORK) \ $(HAVE_ONLY_SYSCFG_PROFILES) \ $(HAVE_OUTPUT) \ @@ -77,28 +75,40 @@ MANFLAGS = \ # the user building the package); see the following for details: # https://www.gnu.org/software/automake/manual/1.16.5/html_node/User-Variables.html CC=@CC@ +CODESPELL=@CODESPELL@ +CPPCHECK=@CPPCHECK@ +GAWK=@GAWK@ +GZIP=@GZIP@ +SCAN_BUILD=@SCAN_BUILD@ +STRIP=@STRIP@ +TAR=@TAR@ + CFLAGS=@CFLAGS@ +CPPFLAGS=@CPPFLAGS@ LDFLAGS=@LDFLAGS@ # Project variables EXTRA_CFLAGS =@EXTRA_CFLAGS@ +DEPS_CFLAGS =@DEPS_CFLAGS@ COMMON_CFLAGS = \ - -ggdb -O2 -DVERSION='"$(VERSION)"' -DMOD_DIR='"$(MOD_DIR)"' \ + -ggdb -O2 -DVERSION='"$(VERSION)"' \ -Wall -Wextra $(HAVE_FATAL_WARNINGS) \ -Wformat -Wformat-security \ - -fstack-protector-all -D_FORTIFY_SOURCE=2 \ + -fstack-protector-all \ -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' \ -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' \ - -DVARDIR='"/var/lib/firejail"' \ + -DVARDIR='"/var/lib/firejail"' PROG_CFLAGS = \ $(COMMON_CFLAGS) \ $(HAVE_GCOV) $(MANFLAGS) \ $(EXTRA_CFLAGS) \ + $(DEPS_CFLAGS) \ -fPIE SO_CFLAGS = \ $(COMMON_CFLAGS) \ + $(DEPS_CFLAGS) \ -fPIC EXTRA_LDFLAGS =@EXTRA_LDFLAGS@ @@ -106,4 +116,4 @@ PROG_LDFLAGS = -Wl,-z,relro -Wl,-z,now -fPIE -pie $(EXTRA_LDFLAGS) SO_LDFLAGS = -Wl,-z,relro -Wl,-z,now -fPIC LIBS =@LIBS@ -CLEANFILES = *.o *.gcov *.gcda *.gcno *.plist +CLEANFILES = *.d *.o *.gcov *.gcda *.gcno *.plist diff --git a/configure b/configure index 54b9d4da3..92f80a30c 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for firejail 0.9.73. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -267,10 +267,10 @@ then : printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and -$0: netblue30@protonmail.com about your system, including -$0: any error possibly output before this message. Then -$0: install a modern shell, or manually run the script -$0: under such a shell if you do have one." +$0: https://github.com/netblue30/firejail/issues about your +$0: system, including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." fi exit 1 fi @@ -612,7 +612,7 @@ PACKAGE_NAME='firejail' PACKAGE_TARNAME='firejail' PACKAGE_VERSION='0.9.73' PACKAGE_STRING='firejail 0.9.73' -PACKAGE_BUGREPORT='netblue30@protonmail.com' +PACKAGE_BUGREPORT='https://github.com/netblue30/firejail/issues' PACKAGE_URL='https://firejail.wordpress.com' ac_unique_file="src/firejail/main.c" @@ -650,7 +650,6 @@ ac_includes_default="\ ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS -HAVE_LTS HAVE_ONLY_SYSCFG_PROFILES HAVE_FORCE_NONEWPRIVS HAVE_CONTRIB_INSTALL @@ -666,8 +665,6 @@ HAVE_GLOBALCFG HAVE_CHROOT HAVE_PRIVATE_LIB HAVE_PRIVATE_HOME -HAVE_FIRETUNNEL -HAVE_GAWK HAVE_MAN HAVE_USERTMPFS HAVE_OUTPUT @@ -675,6 +672,7 @@ HAVE_OVERLAYFS HAVE_DBUSPROXY EXTRA_LDFLAGS EXTRA_CFLAGS +HAVE_LANDLOCK HAVE_SELINUX AA_LIBS AA_CFLAGS @@ -683,6 +681,14 @@ PKG_CONFIG_PATH PKG_CONFIG HAVE_APPARMOR HAVE_IDS +DEPS_CFLAGS +TAR +STRIP +SCAN_BUILD +GZIP +GAWK +CPPCHECK +CODESPELL OBJEXT EXEEXT ac_ct_CC @@ -737,11 +743,11 @@ enable_sanitizer enable_ids enable_apparmor enable_selinux +enable_landlock enable_dbusproxy enable_output enable_usertmpfs enable_man -enable_firetunnel enable_private_home enable_private_lib enable_chroot @@ -757,7 +763,6 @@ enable_gcov enable_contrib_install enable_force_nonewprivs enable_only_syscfg_profiles -enable_lts ' ac_precious_vars='build_alias host_alias @@ -1396,11 +1401,11 @@ Optional Features: --enable-ids enable ids --enable-apparmor enable apparmor --enable-selinux SELinux labeling support + --enable-landlock Landlock self-restriction support --disable-dbusproxy disable dbus proxy --disable-output disable --output logging --disable-usertmpfs disable tmpfs as regular user --disable-man disable man pages - --enable-firetunnel enable firetunnel --disable-private-home disable private home feature --disable-private-lib disable private lib feature --disable-chroot disable chroot @@ -1421,7 +1426,6 @@ Optional Features: enable force nonewprivs --enable-only-syscfg-profiles disable profiles in $HOME/.config/firejail - --enable-lts enable long-term support software version (LTS) Some influential environment variables: CC C compiler command @@ -1442,7 +1446,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . firejail home page: . _ACEOF ac_status=$? @@ -3272,9 +3276,424 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +for ac_prog in codespell +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CODESPELL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CODESPELL"; then + ac_cv_prog_CODESPELL="$CODESPELL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CODESPELL="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CODESPELL=$ac_cv_prog_CODESPELL +if test -n "$CODESPELL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CODESPELL" >&5 +printf "%s\n" "$CODESPELL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CODESPELL" && break +done + +for ac_prog in cppcheck +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CPPCHECK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CPPCHECK"; then + ac_cv_prog_CPPCHECK="$CPPCHECK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CPPCHECK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CPPCHECK=$ac_cv_prog_CPPCHECK +if test -n "$CPPCHECK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPPCHECK" >&5 +printf "%s\n" "$CPPCHECK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CPPCHECK" && break +done + +for ac_prog in gawk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_GAWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$GAWK"; then + ac_cv_prog_GAWK="$GAWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_GAWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GAWK=$ac_cv_prog_GAWK +if test -n "$GAWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GAWK" >&5 +printf "%s\n" "$GAWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$GAWK" && break +done + +for ac_prog in gzip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_GZIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$GZIP"; then + ac_cv_prog_GZIP="$GZIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_GZIP="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GZIP=$ac_cv_prog_GZIP +if test -n "$GZIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5 +printf "%s\n" "$GZIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$GZIP" && break +done + +for ac_prog in scan-build +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_SCAN_BUILD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$SCAN_BUILD"; then + ac_cv_prog_SCAN_BUILD="$SCAN_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_SCAN_BUILD="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +SCAN_BUILD=$ac_cv_prog_SCAN_BUILD +if test -n "$SCAN_BUILD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SCAN_BUILD" >&5 +printf "%s\n" "$SCAN_BUILD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$SCAN_BUILD" && break +done + +for ac_prog in strip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$STRIP" && break +done + +for ac_prog in tar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_TAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$TAR"; then + ac_cv_prog_TAR="$TAR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_TAR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +TAR=$ac_cv_prog_TAR +if test -n "$TAR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 +printf "%s\n" "$TAR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$TAR" && break +done + + +DEPS_CFLAGS="" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -MMD -MP" >&5 +printf %s "checking whether C compiler accepts -MMD -MP... " >&6; } +if test ${ax_cv_check_cflags___MMD__MP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -MMD -MP" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_check_cflags___MMD__MP=yes +else $as_nop + ax_cv_check_cflags___MMD__MP=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___MMD__MP" >&5 +printf "%s\n" "$ax_cv_check_cflags___MMD__MP" >&6; } +if test "x$ax_cv_check_cflags___MMD__MP" = xyes +then : + + DEPS_CFLAGS="$DEPS_CFLAGS -MMD -MP" + +else $as_nop + : +fi + + +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$CFLAGS $CPPFLAGS -Werror_-D_FORTIFY_SOURCE=2" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -D_FORTIFY_SOURCE=2" >&5 +printf %s "checking whether C compiler accepts -D_FORTIFY_SOURCE=2... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $CFLAGS $CPPFLAGS -Werror -D_FORTIFY_SOURCE=2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + + EXTRA_CFLAGS="$EXTRA_CFLAGS -D_FORTIFY_SOURCE=2" + +else $as_nop + : +fi + HAVE_SPECTRE="no" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mindirect-branch=thunk" >&5 printf %s "checking whether C compiler accepts -mindirect-branch=thunk... " >&6; } if test ${ax_cv_check_cflags___mindirect_branch_thunk+y} @@ -3739,6 +4158,58 @@ then : fi +HAVE_LANDLOCK="" + +# Check whether --enable-landlock was given. +if test ${enable_landlock+y} +then : + enableval=$enable_landlock; +fi + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi +if test "x$enable_landlock" != "xno" +then : + + ac_fn_c_check_header_compile "$LINENO" "linux/landlock.h" "ac_cv_header_linux_landlock_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_landlock_h" = xyes +then : + HAVE_LANDLOCK="-DHAVE_LANDLOCK" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: header not found: linux/landlock.h, building without Landlock support" >&5 +printf "%s\n" "$as_me: WARNING: header not found: linux/landlock.h, building without Landlock support" >&2;} +fi + + +fi + @@ -3808,71 +4279,13 @@ if test "x$enable_man" != "xno" then : HAVE_MAN="-DHAVE_MAN" - # Extract the first word of "gawk", so it can be a program name with args. -set dummy gawk; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_HAVE_GAWK+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$HAVE_GAWK"; then - ac_cv_prog_HAVE_GAWK="$HAVE_GAWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_HAVE_GAWK="yes" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_HAVE_GAWK" && ac_cv_prog_HAVE_GAWK="no" -fi -fi -HAVE_GAWK=$ac_cv_prog_HAVE_GAWK -if test -n "$HAVE_GAWK"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HAVE_GAWK" >&5 -printf "%s\n" "$HAVE_GAWK" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - if test "x$HAVE_GAWK" != "xyes" + if test "x$GAWK" = "x" then : as_fn_error $? "*** gawk not found ***" "$LINENO" 5 fi fi -HAVE_FIRETUNNEL="" - -# Check whether --enable-firetunnel was given. -if test ${enable_firetunnel+y} -then : - enableval=$enable_firetunnel; -fi - -if test "x$enable_firetunnel" = "xyes" -then : - - HAVE_FIRETUNNEL="-DHAVE_FIRETUNNEL" - -fi - HAVE_PRIVATE_HOME="" # Check whether --enable-private-home was given. @@ -4100,67 +4513,6 @@ then : fi -HAVE_LTS="" - -# Check whether --enable-lts was given. -if test ${enable_lts+y} -then : - enableval=$enable_lts; -fi - -if test "x$enable_lts" = "xyes" -then : - - HAVE_LTS="-DHAVE_LTS" - HAVE_IDS="" - HAVE_DBUSPROXY="" - HAVE_OVERLAYFS="" - HAVE_OUTPUT="" - HAVE_USERTMPFS="" - HAVE_MAN="-DHAVE_MAN" - HAVE_FIRETUNNEL="" - HAVE_PRIVATE_HOME="" - HAVE_PRIVATE_LIB="" - HAVE_CHROOT="" - HAVE_GLOBALCFG="" - HAVE_USERNS="" - HAVE_X11="" - HAVE_FILE_TRANSFER="" - HAVE_SUID="-DHAVE_SUID" - BUSYBOX_WORKAROUND="no" - HAVE_CONTRIB_INSTALL="no" - -fi - -ac_header= ac_cache= -for ac_item in $ac_header_c_list -do - if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h - fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item - else - ac_header=$ac_item - fi -done - - - - - - - - -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes -then : - -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h - -fi ac_fn_c_check_header_compile "$LINENO" "linux/seccomp.h" "ac_cv_header_linux_seccomp_h" "$ac_includes_default" if test "x$ac_cv_header_linux_seccomp_h" = xyes then : @@ -4759,7 +5111,7 @@ Usage: $0 [OPTION]... [TAG]... Configuration files: $config_files -Report bugs to . +Report bugs to . firejail home page: ." _ACEOF @@ -5335,8 +5687,10 @@ cat < 0: + if args[0] == "-h": + print(__doc__) + return 0 + elif args[0] == "-i": + overwrite = True + args.pop(0) + elif args[0] == "-n": + overwrite = False + args.pop(0) + elif args[0] == "--": + args.pop(0) + break + elif args[0][0] == "-": + print(f"[ Error ] Unknown option: {args[0]}", file=stderr) + return 2 + else: + break + if len(args) < 1: print(__doc__, file=stderr) return 2 @@ -107,9 +141,9 @@ def main(args): for filename in args: try: if exit_code not in (1, 101): - exit_code = fix_profile(filename) + exit_code = check_profile(filename, overwrite) else: - fix_profile(filename) + check_profile(filename, overwrite) except FileNotFoundError as err: print(f"[ Error ] {err}", file=stderr) exit_code = 1 diff --git a/contrib/syntax/files/firejail-profile.lang.in b/contrib/syntax/files/firejail-profile.lang.in index acd5c86ce..a5deceb2c 100644 --- a/contrib/syntax/files/firejail-profile.lang.in +++ b/contrib/syntax/files/firejail-profile.lang.in @@ -7,7 +7,7 @@ --> - text/plain;text/x-firejail-profile + text/x-firejail-profile *.profile;*.local;*.inc # diff --git a/contrib/syntax/lists/profile_commands_arg0.list b/contrib/syntax/lists/profile_commands_arg0.list index fd1bdb401..13adfeddc 100644 --- a/contrib/syntax/lists/profile_commands_arg0.list +++ b/contrib/syntax/lists/profile_commands_arg0.list @@ -12,6 +12,7 @@ keep-config-pulse keep-dev-shm keep-shell-rc keep-var-tmp +landlock.enforce machine-id memory-deny-write-execute netfilter @@ -26,6 +27,7 @@ nonewprivs noprinters noroot nosound +notpm notv nou2f novideo @@ -41,7 +43,7 @@ private-tmp quiet restrict-namespaces seccomp -seccomp\.block-secondary +seccomp.block-secondary tab tracelog writable-etc diff --git a/contrib/syntax/lists/profile_commands_arg1.list b/contrib/syntax/lists/profile_commands_arg1.list index c703f2257..6fd943e57 100644 --- a/contrib/syntax/lists/profile_commands_arg1.list +++ b/contrib/syntax/lists/profile_commands_arg1.list @@ -5,11 +5,13 @@ blacklist-nolog caps.drop caps.keep cpu +dbus-system dbus-system.broadcast dbus-system.call dbus-system.own dbus-system.see dbus-system.talk +dbus-user dbus-user.broadcast dbus-user.call dbus-user.own @@ -27,6 +29,11 @@ ip6 iprange join-or-start keep-fd +landlock.fs.execute +landlock.fs.makedev +landlock.fs.makeipc +landlock.fs.read +landlock.fs.write mac mkdir mkfile @@ -68,9 +75,11 @@ seccomp.32.drop seccomp.32.keep seccomp.drop seccomp.keep +shell timeout tmpfs veth-name whitelist whitelist-ro +x11 xephyr-screen diff --git a/contrib/syscalls.sh b/contrib/syscalls.sh index aece84e72..80a53c4ac 100755 --- a/contrib/syscalls.sh +++ b/contrib/syscalls.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 STRACE_OUTPUT_FILE="$(pwd)/strace_output.txt" diff --git a/contrib/update_deb.sh b/contrib/update_deb.sh index aaefc38a8..c5947d996 100755 --- a/contrib/update_deb.sh +++ b/contrib/update_deb.sh @@ -1,6 +1,6 @@ #!/bin/sh # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # Purpose: Fetch, compile, and install firejail from GitHub source. For @@ -16,7 +16,7 @@ sed -i "s/# restricted-network .*/restricted-network yes/" \ etc/firejail.config make deb -sudo dpkg -i firejail*.deb +sudo dpkg -i ./*.deb echo "Firejail updated." cd .. rm -rf firejail diff --git a/etc-fixes/0.9.38/firefox.profile b/etc-fixes/0.9.38/firefox.profile index 00244aaa4..3b8264e75 100644 --- a/etc-fixes/0.9.38/firefox.profile +++ b/etc-fixes/0.9.38/firefox.profile @@ -7,7 +7,7 @@ include /etc/firejail/disable-devel.inc caps.drop all #seccomp.drop @clock,@cpu-emulation,@debug,@module,@obsolete,@raw-io,@reboot,@resources,@swap,acct,add_key,bpf,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioprio_set,kcmp,keyctl,mount,name_to_handle_at,nfsservctl,ni_syscall,open_by_handle_at,personality,pivot_root,process_vm_readv,ptrace,remap_file_pages,request_key,setdomainname,sethostname,syslog,umount,umount2,userfaultfd,vhangup,vmsplice -seccomp.drop adjtimex,clock_adjtime,clock_settime,settimeofday,stime,modify_ldt,subpage_prot,switch_endian,vm86,vm86old,lookup_dcookie,perf_event_open,process_vm_writev,rtas,s390_runtime_instr,sys_debug_setcontext,delete_module,finit_module,init_module,_sysctl,afs_syscall,bdflush,break,create_module,ftime,get_kernel_syms,getpmsg,gtty,lock,mpx,prof,profil,putpmsg,query_module,security,sgetmask,ssetmask,stty,sysfs,tuxcall,ulimit,uselib,ustat,vserver,ioperm,iopl,pciconfig_iobase,pciconfig_read,pciconfig_write,s390_mmio_read,s390_mmio_write,kexec_load,kexec_file_load,reboot,set_mempolicy,migrate_pages,move_pages,mbind,swapon,swapoff,acct,add_key,bpf,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioprio_set,kcmp,keyctl,mount,name_to_handle_at,nfsservctl,ni_syscall,open_by_handle_at,personality,pivot_root,process_vm_readv,ptrace,remap_file_pages,request_key,setdomainname,sethostname,syslog,umount,umount2,userfaultfd,vhangup,vmsplice +seccomp.drop adjtimex,clock_adjtime,clock_settime,settimeofday,stime,modify_ldt,subpage_prot,switch_endian,vm86,vm86old,lookup_dcookie,perf_event_open,process_vm_writev,rtas,s390_runtime_instr,sys_debug_setcontext,delete_module,finit_module,init_module,_sysctl,afs_syscall,bdflush,break,create_module,ftime,get_kernel_syms,getpmsg,gtty,lock,mpx,prof,profil,putpmsg,query_module,security,sgetmask,ssetmask,stty,sysfs,tuxcall,ulimit,uselib,ustat,vserver,ioperm,iopl,pciconfig_iobase,pciconfig_read,pciconfig_write,s390_pci_mmio_read,s390_pci_mmio_write,kexec_load,kexec_file_load,reboot,set_mempolicy,migrate_pages,move_pages,mbind,swapon,swapoff,acct,add_key,bpf,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioprio_set,kcmp,keyctl,mount,name_to_handle_at,nfsservctl,ni_syscall,open_by_handle_at,personality,pivot_root,process_vm_readv,ptrace,remap_file_pages,request_key,setdomainname,sethostname,syslog,umount,umount2,userfaultfd,vhangup,vmsplice protocol unix,inet,inet6,netlink netfilter diff --git a/etc/apparmor/firejail-local b/etc/apparmor/firejail-local index 557204d75..876ec5b67 100644 --- a/etc/apparmor/firejail-local +++ b/etc/apparmor/firejail-local @@ -20,5 +20,8 @@ # Uncomment to opt-in to apparmor for firefox native-messaging-hosts under ${HOME} #owner @{HOME}/.mozilla/native-messaging-hosts/** ix, +# Uncomment to opt-in to apparmor for mullvad-browser under ${HOME} +#owner @{HOME}/.local/share/mullvad-browser/** ix, + # Uncomment to opt-in to apparmor for torbrowser-launcher -#owner @{HOME}/.local/share/torbrowser/tbb/{i686,x86_64}/tor-browser_*/Browser/** ix, +#owner @{HOME}/.local/share/torbrowser/tbb/{i686,x86_64}/tor-browser*/** ix, diff --git a/etc/firejail.config b/etc/firejail.config index e8bf45751..c3c355e3d 100644 --- a/etc/firejail.config +++ b/etc/firejail.config @@ -163,12 +163,12 @@ # Xpra server command extra parameters. None by default; this is an example. # xpra-extra-params --dpi 96 -# Screen size for --x11=xvfb, default 800x600x24. The third dimension is +# Screen size for --x11=xvfb, default 800x600x24. The third dimension is # color depth; use 24 unless you know exactly what you're doing. # xvfb-screen 640x480x24 # xvfb-screen 800x600x24 # xvfb-screen 1024x768x24 # xvfb-screen 1280x1024x24 -# Xvfb command extra parameters. None by default; this is an example. +# Xvfb command extra parameters. None by default; this is an example. # xvfb-extra-params -pixdepths 8 24 32 diff --git a/etc/inc/allow-common-devel.inc b/etc/inc/allow-common-devel.inc index 9576239f3..8083ef1a8 100644 --- a/etc/inc/allow-common-devel.inc +++ b/etc/inc/allow-common-devel.inc @@ -2,6 +2,10 @@ # Persistent customizations should go in a .local file. include allow-common-devel.local +# Arduino +noblacklist ${HOME}/.arduino15 +noblacklist ${HOME}/Arduino + # Git noblacklist ${HOME}/.config/git noblacklist ${HOME}/.gitconfig @@ -26,6 +30,9 @@ noblacklist ${HOME}/.yarn-config noblacklist ${HOME}/.yarncache noblacklist ${HOME}/.yarnrc +# PlatformIO +noblacklist ${HOME}/.platformio + # Python noblacklist ${HOME}/.pylint.d noblacklist ${HOME}/.python-history @@ -37,3 +44,4 @@ noblacklist ${HOME}/.bundle # Rust noblacklist ${HOME}/.cargo +noblacklist ${HOME}/.rustup diff --git a/etc/inc/allow-lua.inc b/etc/inc/allow-lua.inc index 9c47e7a3b..4b6dd8a53 100644 --- a/etc/inc/allow-lua.inc +++ b/etc/inc/allow-lua.inc @@ -8,5 +8,4 @@ noblacklist /usr/lib/liblua* noblacklist /usr/lib/lua noblacklist /usr/lib64/liblua* noblacklist /usr/lib64/lua -noblacklist /usr/share/lua noblacklist /usr/share/lua* diff --git a/etc/inc/allow-opengl-game.inc b/etc/inc/allow-opengl-game.inc index 5d2d6c5c1..5ec227348 100644 --- a/etc/inc/allow-opengl-game.inc +++ b/etc/inc/allow-opengl-game.inc @@ -2,6 +2,12 @@ # Persistent customizations should go in a .local file. include allow-opengl-game.local +# Explanation: Fedora (and maybe others) install a .desktop file that uses +# `Exec=foo-wrapper` instead of `Exec=foo`. Each /usr/bin/foo-wrapper is a +# symlink to /usr/bin/opengl-game-wrapper.sh, which checks hardware +# acceleration and then starts the game or notifies the user that there is a +# problem. + noblacklist ${PATH}/bash whitelist /usr/share/opengl-games-utils/opengl-game-functions.sh private-bin basename,bash,cut,glxinfo,grep,head,sed,zenity diff --git a/etc/inc/allow-ssh.inc b/etc/inc/allow-ssh.inc index 024d87be7..d4895b82e 100644 --- a/etc/inc/allow-ssh.inc +++ b/etc/inc/allow-ssh.inc @@ -6,7 +6,8 @@ noblacklist ${HOME}/.ssh noblacklist /etc/ssh noblacklist /etc/ssh/ssh_config noblacklist /etc/ssh/ssh_config.d -noblacklist ${PATH}/ssh +noblacklist /etc/ssh/ssh_revoked_hosts # RevokedHostKeys on Gentoo +noblacklist ${PATH}/ssh* noblacklist /tmp/ssh-* # Arch Linux and derivatives noblacklist /usr/lib/ssh diff --git a/etc/inc/disable-X11.inc b/etc/inc/disable-X11.inc index d227c7a0b..9f2bb47ae 100644 --- a/etc/inc/disable-X11.inc +++ b/etc/inc/disable-X11.inc @@ -2,14 +2,7 @@ # Persistent customizations should go in a .local file. include disable-X11.local -blacklist /tmp/.X11-unix -blacklist ${HOME}/.Xauthority -blacklist ${RUNUSER}/gdm/Xauthority -blacklist ${RUNUSER}/.mutter-Xwaylandauth* -blacklist ${RUNUSER}/xauth_* -#blacklist ${RUNUSER}/[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]] -blacklist /tmp/xauth* -blacklist /tmp/.ICE-unix -blacklist ${RUNUSER}/ICEauthority -rmenv DISPLAY -rmenv XAUTHORITY +# Warning: This file is deprecated; use disable-x11.inc (lowercase) instead. + +# Redirect +include disable-x11.inc diff --git a/etc/inc/disable-common.inc b/etc/inc/disable-common.inc index ce4f08958..9568bbe6f 100644 --- a/etc/inc/disable-common.inc +++ b/etc/inc/disable-common.inc @@ -33,7 +33,8 @@ blacklist-nolog ${HOME}/.viminfo blacklist-nolog /tmp/clipmenu* # X11 session autostart -# blacklist ${HOME}/.xpra - this will kill --x11=xpra cmdline option for all programs +# this will kill --x11=xpra cmdline option for all programs +#blacklist ${HOME}/.xpra blacklist ${HOME}/.Xsession blacklist ${HOME}/.blackbox blacklist ${HOME}/.config/autostart @@ -166,11 +167,19 @@ blacklist ${RUNUSER}/gnome-session-leader-fifo blacklist ${RUNUSER}/gnome-shell blacklist ${RUNUSER}/gsconnect +# i3 IPC socket (allows arbitrary shell script execution) +blacklist ${RUNUSER}/i3/ipc-socket.* +blacklist /tmp/i3-*/ipc-socket.* + +# sway IPC socket (allows arbitrary shell script execution) +blacklist ${RUNUSER}/sway-ipc.* +blacklist /tmp/sway-ipc.* + # systemd blacklist ${HOME}/.config/systemd blacklist ${HOME}/.local/share/systemd blacklist ${PATH}/systemctl -blacklist ${PATH}/systemd-run +blacklist ${PATH}/systemd* blacklist ${RUNUSER}/systemd blacklist /etc/credstore* blacklist /etc/systemd/network @@ -191,6 +200,7 @@ blacklist ${HOME}/.VirtualBox blacklist ${HOME}/VirtualBox VMs # GNOME Boxes +blacklist ${HOME}/.cache/gnome-boxes blacklist ${HOME}/.config/gnome-boxes blacklist ${HOME}/.local/share/gnome-boxes @@ -241,8 +251,9 @@ blacklist /var/lib/mysql/mysql.sock blacklist /var/lib/mysqld/mysql.sock blacklist /var/lib/pacman blacklist /var/lib/upower -# blacklist /var/log - a virtual /var/log directory (mostly empty) is build up by default for -# every sandbox, unless --writable-var-log switch is activated +# a virtual /var/log directory (mostly empty) is build up by default for every +# sandbox, unless --writable-var-log switch is activated +#blacklist /var/log blacklist /var/mail blacklist /var/opt blacklist /var/run/acpid.socket @@ -319,7 +330,7 @@ read-only ${HOME}/.zshenv read-only ${HOME}/.zshrc read-only ${HOME}/.zshrc.local -# Remote access +# Remote access (used only by sshd; should always be blacklisted) blacklist ${HOME}/.rhosts blacklist ${HOME}/.shosts blacklist ${HOME}/.ssh/authorized_keys @@ -327,13 +338,12 @@ blacklist ${HOME}/.ssh/authorized_keys2 blacklist ${HOME}/.ssh/environment blacklist ${HOME}/.ssh/rc blacklist /etc/hosts.equiv -read-only ${HOME}/.ssh/config -read-only ${HOME}/.ssh/config.d # Initialization files that allow arbitrary command execution read-only ${HOME}/.caffrc read-only ${HOME}/.cargo/env read-only ${HOME}/.config/mpv +read-only ${HOME}/.config/msmtp read-only ${HOME}/.config/nano read-only ${HOME}/.config/nvim read-only ${HOME}/.config/pkcs11 @@ -360,6 +370,8 @@ read-only ${HOME}/.nanorc read-only ${HOME}/.npmrc read-only ${HOME}/.pythonrc.py read-only ${HOME}/.reportbugrc +read-only ${HOME}/.ssh/config +read-only ${HOME}/.ssh/config.d read-only ${HOME}/.tmux.conf read-only ${HOME}/.vim read-only ${HOME}/.viminfo @@ -422,6 +434,7 @@ blacklist /etc/group- blacklist /etc/gshadow blacklist /etc/gshadow+ blacklist /etc/gshadow- +blacklist /etc/msmtprc blacklist /etc/passwd+ blacklist /etc/passwd- blacklist /etc/shadow @@ -444,6 +457,7 @@ blacklist ${HOME}/.cargo/credentials.toml blacklist ${HOME}/.cert blacklist ${HOME}/.config/hub blacklist ${HOME}/.config/keybase +blacklist ${HOME}/.config/msmtp blacklist ${HOME}/.davfs2/secrets blacklist ${HOME}/.ecryptfs blacklist ${HOME}/.fetchmailrc @@ -502,6 +516,7 @@ blacklist /usr/sbin # system management and various SUID executables blacklist ${PATH}/at +blacklist ${PATH}/bmon blacklist ${PATH}/busybox blacklist ${PATH}/chage blacklist ${PATH}/chfn @@ -510,69 +525,96 @@ blacklist ${PATH}/crontab blacklist ${PATH}/doas blacklist ${PATH}/evtest blacklist ${PATH}/expiry -blacklist ${PATH}/fusermount +blacklist ${PATH}/fping +blacklist ${PATH}/fping6 +blacklist ${PATH}/fusermount* blacklist ${PATH}/gksu blacklist ${PATH}/gksudo blacklist ${PATH}/gpasswd +blacklist ${PATH}/groupmems +blacklist ${PATH}/hostname +#blacklist ${PATH}/ip # breaks --ip=dhcp blacklist ${PATH}/kdesudo blacklist ${PATH}/ksu blacklist ${PATH}/mount -blacklist ${PATH}/mount.ecryptfs_private +blacklist ${PATH}/mount.* +blacklist ${PATH}/mountpoint +blacklist ${PATH}/mtr +blacklist ${PATH}/mtr-packet blacklist ${PATH}/nc +blacklist ${PATH}/nc.openbsd +blacklist ${PATH}/nc.traditional blacklist ${PATH}/ncat -blacklist ${PATH}/nmap +blacklist ${PATH}/netstat +blacklist ${PATH}/networkctl blacklist ${PATH}/newgidmap blacklist ${PATH}/newgrp blacklist ${PATH}/newuidmap -blacklist ${PATH}/ntfs-3g -blacklist ${PATH}/pkexec -blacklist ${PATH}/procmail -blacklist ${PATH}/sg -blacklist ${PATH}/strace -blacklist ${PATH}/su -blacklist ${PATH}/sudo -blacklist ${PATH}/tcpdump -blacklist ${PATH}/umount -blacklist ${PATH}/unix_chkpwd -blacklist ${PATH}/xev -blacklist ${PATH}/xinput -# from 0.9.67 -blacklist /usr/lib/openssh -blacklist /usr/lib/ssh -blacklist /usr/libexec/openssh -blacklist ${PATH}/passwd -blacklist /usr/lib/xorg/Xorg.wrap -blacklist /usr/lib/policykit-1/polkit-agent-helper-1 -blacklist /usr/lib/dbus-1.0/dbus-daemon-launch-helper -blacklist /usr/lib/eject/dmcrypt-get-device -blacklist /usr/lib/chromium/chrome-sandbox -blacklist /usr/lib/opera/opera_sandbox -blacklist /usr/lib/vmware -blacklist ${PATH}/suexec -blacklist /usr/lib/squid/basic_pam_auth -blacklist ${PATH}/slock -blacklist ${PATH}/physlock -blacklist ${PATH}/schroot -blacklist ${PATH}/wshowkeys -blacklist ${PATH}/pmount -blacklist ${PATH}/pumount -blacklist ${PATH}/bmon -blacklist ${PATH}/fping -blacklist ${PATH}/fping6 -blacklist ${PATH}/hostname -# blacklist ${PATH}/ip - breaks --ip=dhcp -blacklist ${PATH}/mtr -blacklist ${PATH}/mtr-packet -blacklist ${PATH}/netstat blacklist ${PATH}/nm-online +blacklist ${PATH}/nmap blacklist ${PATH}/nmcli blacklist ${PATH}/nmtui blacklist ${PATH}/nmtui-connect blacklist ${PATH}/nmtui-edit blacklist ${PATH}/nmtui-hostname -blacklist ${PATH}/networkctl +blacklist ${PATH}/ntfs-3g +blacklist ${PATH}/passwd +blacklist ${PATH}/physlock +blacklist ${PATH}/pkexec +blacklist ${PATH}/plocate +blacklist ${PATH}/pmount +blacklist ${PATH}/procmail +blacklist ${PATH}/pumount +blacklist ${PATH}/schroot +blacklist ${PATH}/sg +blacklist ${PATH}/slock blacklist ${PATH}/ss +blacklist ${PATH}/ssmtp +blacklist ${PATH}/strace +blacklist ${PATH}/su +blacklist ${PATH}/sudo +blacklist ${PATH}/suexec +blacklist ${PATH}/tcpdump blacklist ${PATH}/traceroute +blacklist ${PATH}/umount +blacklist ${PATH}/unix_chkpwd +blacklist ${PATH}/wall +blacklist ${PATH}/write +blacklist ${PATH}/wshowkeys +blacklist ${PATH}/xev +blacklist ${PATH}/xinput +blacklist /usr/lib/chromium/chrome-sandbox +blacklist /usr/lib/dbus-1.0/dbus-daemon-launch-helper +blacklist /usr/lib/eject/dmcrypt-get-device +blacklist /usr/lib/openssh +blacklist /usr/lib/opera/opera_sandbox +blacklist /usr/lib/policykit-1/polkit-agent-helper-1 +blacklist /usr/lib/squid/basic_pam_auth +blacklist /usr/lib/ssh +blacklist /usr/lib/vmware +blacklist /usr/lib/xorg/Xorg.wrap +blacklist /usr/libexec/openssh +# since firejail version 0.9.73 +blacklist ${PATH}/dpkg* +blacklist ${PATH}/apt* +blacklist ${PATH}/dumpcap +blacklist ${PATH}/efibootdump +blacklist ${PATH}/efibootmgr +blacklist ${PATH}/passmass +blacklist ${PATH}/proxy +blacklist ${PATH}/aa-* +blacklist ${PATH}/airscan-discover +blacklist ${PATH}/avahi* +blacklist ${PATH}/dbus-* +blacklist ${PATH}/debconf* +blacklist ${PATH}/grub-* +blacklist ${PATH}/kernel-install # from systemd package + +# binaries installed by firejail +blacklist ${PATH}/firemon +blacklist ${PATH}/firecfg +blacklist ${PATH}/jailcheck +blacklist ${PATH}/firetools # other SUID binaries blacklist /opt/microsoft/msedge*/msedge-sandbox @@ -585,11 +627,13 @@ blacklist /tmp/.lxterminal-socket* blacklist /tmp/tmux-* # disable terminals running as server resulting in sandbox escape +blacklist ${PATH}/foot +blacklist ${PATH}/footserver blacklist ${PATH}/gnome-terminal blacklist ${PATH}/gnome-terminal.wrapper blacklist ${PATH}/kgx -# blacklist ${PATH}/konsole # konsole doesn't seem to have this problem - last tested on Ubuntu 16.04 +#blacklist ${PATH}/konsole blacklist ${PATH}/lilyterm blacklist ${PATH}/lxterminal blacklist ${PATH}/mate-terminal @@ -640,6 +684,10 @@ blacklist /usr/lib/snapd blacklist /var/lib/snapd blacklist /var/snap +# bubblejail +blacklist ${HOME}/.config/bubblejail +blacklist ${HOME}/.local/share/bubblejail + # mail directories used by mutt blacklist ${HOME}/.Mail blacklist ${HOME}/.mail @@ -653,10 +701,13 @@ blacklist ${HOME}/sent blacklist /proc/config.gz # prevent DNS malware attempting to communicate with the server using regular DNS tools +blacklist ${PATH}/delv blacklist ${PATH}/dig blacklist ${PATH}/dlint blacklist ${PATH}/dns2tcp blacklist ${PATH}/dnssec-* +blacklist ${PATH}/dnstap-read +blacklist ${PATH}/mdig blacklist ${PATH}/dnswalk blacklist ${PATH}/drill blacklist ${PATH}/host @@ -667,12 +718,14 @@ blacklist ${PATH}/knsupdate blacklist ${PATH}/ldns-* blacklist ${PATH}/ldnsd blacklist ${PATH}/nslookup +blacklist ${PATH}/nsupdate +blacklist ${PATH}/nstat blacklist ${PATH}/resolvectl blacklist ${PATH}/unbound-host # prevent an intruder to guess passwords using regular network tools blacklist ${PATH}/ftp -blacklist ${PATH}/ssh +blacklist ${PATH}/ssh* blacklist ${PATH}/telnet # rest of ${RUNUSER} diff --git a/etc/inc/disable-devel.inc b/etc/inc/disable-devel.inc index 360077936..ae8140974 100644 --- a/etc/inc/disable-devel.inc +++ b/etc/inc/disable-devel.inc @@ -4,32 +4,70 @@ include disable-devel.local # development tools +# autoconf/automake +blacklist ${PATH}/aclocal* +blacklist ${PATH}/autoconf +blacklist ${PATH}/autoheader +blacklist ${PATH}/autom4te +blacklist ${PATH}/automake* +blacklist ${PATH}/autoreconf +blacklist ${PATH}/autoscan +blacklist ${PATH}/autoupdate +blacklist ${PATH}/ifnames +blacklist ${PATH}/m4 + +# patch +blacklist ${PATH}/elfedit +blacklist ${PATH}/espdiff +blacklist ${PATH}/patch +blacklist ${PATH}/patchview + +# packaging +blacklist ${PATH}/dh_* +blacklist ${PATH}/fakeroot* +blacklist ${PATH}/lintian + +# expect +blacklist ${PATH}/autoexpect +blacklist ${PATH}/expect* + # clang/llvm +blacklist ${PATH}/analyze-build* +blacklist ${PATH}/asan_symbolize* +blacklist ${PATH}/bugpoint* +blacklist ${PATH}/c-index-test* blacklist ${PATH}/clang* +blacklist ${PATH}/llc* blacklist ${PATH}/lldb* +blacklist ${PATH}/lli* blacklist ${PATH}/llvm* +blacklist ${PATH}/scan-build # see issue #2106 - it disables hardware acceleration in Firefox on Radeon GPU -# blacklist /usr/lib/llvm* +#blacklist /usr/lib/llvm* # GCC +blacklist ${PATH}/*-g++* +blacklist ${PATH}/*-gcc* blacklist ${PATH}/as -blacklist ${PATH}/cc blacklist ${PATH}/c++* blacklist ${PATH}/c8* blacklist ${PATH}/c9* +blacklist ${PATH}/cc blacklist ${PATH}/cpp* +blacklist ${PATH}/elfedit blacklist ${PATH}/g++* blacklist ${PATH}/gcc* +blacklist ${PATH}/gcov* blacklist ${PATH}/gdb +blacklist ${PATH}/gmake blacklist ${PATH}/ld -blacklist ${PATH}/*-gcc* -blacklist ${PATH}/*-g++* -blacklist ${PATH}/*-gcc* -blacklist ${PATH}/*-g++* +blacklist ${PATH}/make +blacklist ${PATH}/make-first-existing-target +blacklist ${PATH}/x86_64-linux-gnu-* # seems to create problems on Gentoo #blacklist /usr/lib/gcc -#Go +# Go blacklist ${PATH}/gccgo blacklist ${PATH}/go blacklist ${PATH}/gofmt @@ -48,15 +86,14 @@ blacklist ${PATH}/scala3-compiler blacklist ${PATH}/scala3-repl blacklist ${PATH}/scalac -#OpenSSL +# OpenSSL blacklist ${PATH}/openssl blacklist ${PATH}/openssl-1.0 -#Rust +# Rust blacklist ${PATH}/rust-gdb blacklist ${PATH}/rust-lldb blacklist ${PATH}/rustc -blacklist ${HOME}/.rustup # tcc - Tiny C Compiler blacklist ${PATH}/tcc @@ -68,7 +105,7 @@ blacklist ${PATH}/valgrind* blacklist /usr/lib/valgrind # Source-Code -blacklist /usr/src -blacklist /usr/local/src blacklist /usr/include blacklist /usr/local/include +blacklist /usr/local/src +blacklist /usr/src diff --git a/etc/inc/disable-interpreters.inc b/etc/inc/disable-interpreters.inc index 4e3590fed..e4497f832 100644 --- a/etc/inc/disable-interpreters.inc +++ b/etc/inc/disable-interpreters.inc @@ -44,8 +44,7 @@ blacklist /usr/share/perl* # it is needed so that Firefox can run applications with Terminal=true in # their .desktop file (depending on what is installed). The reason is that # this is done via glib, which currently uses a hardcoded list of terminal -# emulators: -# https://gitlab.gnome.org/GNOME/glib/-/issues/338 +# emulators: https://gitlab.gnome.org/GNOME/glib/-/issues/338. # And in this list, rxvt comes before xterm. blacklist ${PATH}/rxvt diff --git a/etc/inc/disable-programs.inc b/etc/inc/disable-programs.inc index f95ddf2fa..c7c1797bf 100644 --- a/etc/inc/disable-programs.inc +++ b/etc/inc/disable-programs.inc @@ -22,13 +22,14 @@ blacklist ${HOME}/.Steampid blacklist ${HOME}/.TelegramDesktop blacklist ${HOME}/.VSCodium blacklist ${HOME}/.ViberPC -blacklist ${HOME}/.VirtualBox blacklist ${HOME}/.WebStorm* blacklist ${HOME}/.Wolfram Research blacklist ${HOME}/.ZAP blacklist ${HOME}/.aMule blacklist ${HOME}/.abook blacklist ${HOME}/.addressbook +blacklist ${HOME}/.alienblaster +blacklist ${HOME}/.alienblaster_highscore blacklist ${HOME}/.alpine-smime blacklist ${HOME}/.ammonite blacklist ${HOME}/.android @@ -44,6 +45,7 @@ blacklist ${HOME}/.attic blacklist ${HOME}/.audacity-data blacklist ${HOME}/.avidemux3 blacklist ${HOME}/.avidemux6 +blacklist ${HOME}/.axelrc blacklist ${HOME}/.ballbuster.hs blacklist ${HOME}/.balsa blacklist ${HOME}/.bcast5 @@ -79,6 +81,7 @@ blacklist ${HOME}/.cache/PawelStolowski blacklist ${HOME}/.cache/Psi blacklist ${HOME}/.cache/QuiteRss blacklist ${HOME}/.cache/Quotient/quaternion +blacklist ${HOME}/.cache/RawTherapee blacklist ${HOME}/.cache/Shortwave blacklist ${HOME}/.cache/Tox blacklist ${HOME}/.cache/Zeal @@ -97,6 +100,7 @@ blacklist ${HOME}/.cache/cantata blacklist ${HOME}/.cache/champlain blacklist ${HOME}/.cache/chromium blacklist ${HOME}/.cache/chromium-dev +blacklist ${HOME}/.cache/claws-mail blacklist ${HOME}/.cache/cliqz blacklist ${HOME}/.cache/com.github.johnfactotum.Foliate blacklist ${HOME}/.cache/darktable @@ -112,6 +116,7 @@ blacklist ${HOME}/.cache/falkon blacklist ${HOME}/.cache/feedreader blacklist ${HOME}/.cache/firedragon blacklist ${HOME}/.cache/flaska.net/trojita +blacklist ${HOME}/.cache/floorp blacklist ${HOME}/.cache/folks blacklist ${HOME}/.cache/font-manager blacklist ${HOME}/.cache/fossamail @@ -124,7 +129,6 @@ blacklist ${HOME}/.cache/geeqie blacklist ${HOME}/.cache/gegl-0.4 blacklist ${HOME}/.cache/gfeeds blacklist ${HOME}/.cache/gimp -blacklist ${HOME}/.cache/gnome-boxes blacklist ${HOME}/.cache/gnome-builder blacklist ${HOME}/.cache/gnome-control-center blacklist ${HOME}/.cache/gnome-recipes @@ -137,11 +141,13 @@ blacklist ${HOME}/.cache/google-chrome-beta blacklist ${HOME}/.cache/google-chrome-unstable blacklist ${HOME}/.cache/gradio blacklist ${HOME}/.cache/gummi +blacklist ${HOME}/.cache/hashcat blacklist ${HOME}/.cache/icedove blacklist ${HOME}/.cache/inkscape blacklist ${HOME}/.cache/inox blacklist ${HOME}/.cache/io.github.lainsce.Notejot blacklist ${HOME}/.cache/iridium +blacklist ${HOME}/.cache/journal-viewer blacklist ${HOME}/.cache/kcmshell5 blacklist ${HOME}/.cache/kdenlive blacklist ${HOME}/.cache/keepassxc @@ -156,6 +162,7 @@ blacklist ${HOME}/.cache/ksplashqml blacklist ${HOME}/.cache/kube blacklist ${HOME}/.cache/kwin blacklist ${HOME}/.cache/lbry-viewer +blacklist ${HOME}/.cache/lettura blacklist ${HOME}/.cache/libgweather blacklist ${HOME}/.cache/librewolf blacklist ${HOME}/.cache/liferea @@ -171,6 +178,7 @@ blacklist ${HOME}/.cache/mirage blacklist ${HOME}/.cache/moonchild productions/basilisk blacklist ${HOME}/.cache/moonchild productions/pale moon blacklist ${HOME}/.cache/mozilla +blacklist ${HOME}/.cache/mpv blacklist ${HOME}/.cache/ms-excel-online blacklist ${HOME}/.cache/ms-office-online blacklist ${HOME}/.cache/ms-onenote-online @@ -178,10 +186,12 @@ blacklist ${HOME}/.cache/ms-outlook-online blacklist ${HOME}/.cache/ms-powerpoint-online blacklist ${HOME}/.cache/ms-skype-online blacklist ${HOME}/.cache/ms-word-online +blacklist ${HOME}/.cache/mullvad/mullvadbrowser blacklist ${HOME}/.cache/mutt blacklist ${HOME}/.cache/mypaint blacklist ${HOME}/.cache/netsurf blacklist ${HOME}/.cache/nheko +blacklist ${HOME}/.cache/nhex blacklist ${HOME}/.cache/nvim blacklist ${HOME}/.cache/ocenaudio blacklist ${HOME}/.cache/okular @@ -218,10 +228,12 @@ blacklist ${HOME}/.cache/supertuxkart blacklist ${HOME}/.cache/systemsettings blacklist ${HOME}/.cache/telepathy blacklist ${HOME}/.cache/thunderbird +blacklist ${HOME}/.cache/tiny-rdm blacklist ${HOME}/.cache/torbrowser blacklist ${HOME}/.cache/transmission blacklist ${HOME}/.cache/ueberzugpp blacklist ${HOME}/.cache/ungoogled-chromium +blacklist ${HOME}/.cache/virt-manager blacklist ${HOME}/.cache/vivaldi blacklist ${HOME}/.cache/vivaldi-snapshot blacklist ${HOME}/.cache/vlc @@ -249,6 +261,7 @@ blacklist ${HOME}/.clonk blacklist ${HOME}/.config/0ad blacklist ${HOME}/.config/1Password blacklist ${HOME}/.config/2048-qt +blacklist ${HOME}/.config/ArmCord blacklist ${HOME}/.config/Atom blacklist ${HOME}/.config/Audaciousrc blacklist ${HOME}/.config/Authenticator @@ -331,21 +344,24 @@ blacklist ${HOME}/.config/QuiteRssrc blacklist ${HOME}/.config/Quotient blacklist ${HOME}/.config/RSS Guard 4 blacklist ${HOME}/.config/Rambox +blacklist ${HOME}/.config/RawTherapee blacklist ${HOME}/.config/Riot blacklist ${HOME}/.config/Rocket.Chat blacklist ${HOME}/.config/RogueLegacy blacklist ${HOME}/.config/RogueLegacyStorageContainer blacklist ${HOME}/.config/Seafile +blacklist ${HOME}/.config/Session blacklist ${HOME}/.config/Signal blacklist ${HOME}/.config/Sinew Software Systems blacklist ${HOME}/.config/Slack blacklist ${HOME}/.config/Standard Notes blacklist ${HOME}/.config/SubDownloader blacklist ${HOME}/.config/Thunar +blacklist ${HOME}/.config/TinyRDM blacklist ${HOME}/.config/Twitch +blacklist ${HOME}/.config/UNDERTALE blacklist ${HOME}/.config/Unknown Organization blacklist ${HOME}/.config/VSCodium -blacklist ${HOME}/.config/VirtualBox blacklist ${HOME}/.config/Whalebird blacklist ${HOME}/.config/Wire blacklist ${HOME}/.config/Youtube @@ -382,6 +398,7 @@ blacklist ${HOME}/.config/borg blacklist ${HOME}/.config/brasero blacklist ${HOME}/.config/brave blacklist ${HOME}/.config/brave-flags.conf +blacklist ${HOME}/.config/breezy blacklist ${HOME}/.config/caja blacklist ${HOME}/.config/calibre blacklist ${HOME}/.config/cantata @@ -403,11 +420,14 @@ blacklist ${HOME}/.config/cliqz blacklist ${HOME}/.config/cmus blacklist ${HOME}/.config/cointop blacklist ${HOME}/.config/com.github.bleakgrey.tootle +blacklist ${HOME}/.config/com.lettura.dev blacklist ${HOME}/.config/corebird blacklist ${HOME}/.config/coyim +blacklist ${HOME}/.config/curlrc blacklist ${HOME}/.config/d-feet blacklist ${HOME}/.config/darktable blacklist ${HOME}/.config/deadbeef +blacklist ${HOME}/.config/deadlink blacklist ${HOME}/.config/deluge blacklist ${HOME}/.config/devilspie2 blacklist ${HOME}/.config/digikam @@ -440,6 +460,7 @@ blacklist ${HOME}/.config/flaska.net blacklist ${HOME}/.config/flowblade blacklist ${HOME}/.config/font-manager blacklist ${HOME}/.config/freecol +blacklist ${HOME}/.config/fyne blacklist ${HOME}/.config/gajim blacklist ${HOME}/.config/galculator blacklist ${HOME}/.config/gallery-dl @@ -449,6 +470,7 @@ blacklist ${HOME}/.config/geany blacklist ${HOME}/.config/geary blacklist ${HOME}/.config/gedit blacklist ${HOME}/.config/geeqie +blacklist ${HOME}/.config/gh blacklist ${HOME}/.config/ghb blacklist ${HOME}/.config/ghostwriter blacklist ${HOME}/.config/git @@ -471,6 +493,8 @@ blacklist ${HOME}/.config/google-chrome blacklist ${HOME}/.config/google-chrome-beta blacklist ${HOME}/.config/google-chrome-unstable blacklist ${HOME}/.config/gpicview +blacklist ${HOME}/.config/gramps +blacklist ${HOME}/.config/green-recorder blacklist ${HOME}/.config/gthumb blacklist ${HOME}/.config/gummi blacklist ${HOME}/.config/guvcview2 @@ -514,6 +538,7 @@ blacklist ${HOME}/.config/kmplayerrc blacklist ${HOME}/.config/knotesrc blacklist ${HOME}/.config/konversation.notifyrc blacklist ${HOME}/.config/konversationrc +blacklist ${HOME}/.config/koreader blacklist ${HOME}/.config/kritarc blacklist ${HOME}/.config/ktorrentrc blacklist ${HOME}/.config/ktouch2rc @@ -546,10 +571,12 @@ blacklist ${HOME}/.config/midori blacklist ${HOME}/.config/mirage blacklist ${HOME}/.config/monero-project blacklist ${HOME}/.config/mono +blacklist ${HOME}/.config/mov-cli blacklist ${HOME}/.config/mpDris2 blacklist ${HOME}/.config/mpd blacklist ${HOME}/.config/mps-youtube blacklist ${HOME}/.config/mpv +blacklist ${HOME}/.config/mullvad-browser-flags.conf blacklist ${HOME}/.config/mupen64plus blacklist ${HOME}/.config/mutt blacklist ${HOME}/.config/mutter @@ -569,6 +596,7 @@ blacklist ${HOME}/.config/nomacs blacklist ${HOME}/.config/nuclear blacklist ${HOME}/.config/nvim blacklist ${HOME}/.config/obs-studio +blacklist ${HOME}/.config/obsidian blacklist ${HOME}/.config/okularpartrc blacklist ${HOME}/.config/okularrc blacklist ${HOME}/.config/onboard @@ -615,12 +643,14 @@ blacklist ${HOME}/.config/scribus blacklist ${HOME}/.config/scribusrc blacklist ${HOME}/.config/sendgmail blacklist ${HOME}/.config/sinew.in +blacklist ${HOME}/.config/singularity blacklist ${HOME}/.config/sink blacklist ${HOME}/.config/skypeforlinux blacklist ${HOME}/.config/slimjet blacklist ${HOME}/.config/smplayer blacklist ${HOME}/.config/smtube blacklist ${HOME}/.config/smuxi +blacklist ${HOME}/.config/sniffnet blacklist ${HOME}/.config/snox blacklist ${HOME}/.config/sound-juicer blacklist ${HOME}/.config/specialmailcollectionsrc @@ -636,6 +666,7 @@ blacklist ${HOME}/.config/synfig blacklist ${HOME}/.config/teams blacklist ${HOME}/.config/teams-for-linux blacklist ${HOME}/.config/telepathy-account-widgets +blacklist ${HOME}/.config/textroom blacklist ${HOME}/.config/torbrowser blacklist ${HOME}/.config/totem blacklist ${HOME}/.config/tox @@ -646,6 +677,7 @@ blacklist ${HOME}/.config/tuir blacklist ${HOME}/.config/tuta_integration blacklist ${HOME}/.config/tutanota-desktop blacklist ${HOME}/.config/tvbrowser +blacklist ${HOME}/.config/tvnamer blacklist ${HOME}/.config/uGet blacklist ${HOME}/.config/ueberzugpp blacklist ${HOME}/.config/ungoogled-chromium @@ -699,8 +731,10 @@ blacklist ${HOME}/.dillo blacklist ${HOME}/.dooble blacklist ${HOME}/.dosbox blacklist ${HOME}/.dropbox* +blacklist ${HOME}/.dvdcss blacklist ${HOME}/.easystroke blacklist ${HOME}/.electron-cache +blacklist ${HOME}/.electron-cash blacklist ${HOME}/.electrum* blacklist ${HOME}/.elinks blacklist ${HOME}/.emacs @@ -708,8 +742,10 @@ blacklist ${HOME}/.emacs.d blacklist ${HOME}/.equalx blacklist ${HOME}/.ethereum blacklist ${HOME}/.etr +blacklist ${HOME}/.factorio blacklist ${HOME}/.filezilla blacklist ${HOME}/.firedragon +blacklist ${HOME}/.floorp blacklist ${HOME}/.flowblade blacklist ${HOME}/.fltk blacklist ${HOME}/.fossamail @@ -743,6 +779,7 @@ blacklist ${HOME}/.i2p blacklist ${HOME}/.icedove blacklist ${HOME}/.imagej blacklist ${HOME}/.inkscape +blacklist ${HOME}/.irssi blacklist ${HOME}/.itch blacklist ${HOME}/.ivy2 blacklist ${HOME}/.jack-server @@ -825,6 +862,8 @@ blacklist ${HOME}/.klatexformula blacklist ${HOME}/.klei blacklist ${HOME}/.kodi blacklist ${HOME}/.lastpass +blacklist ${HOME}/.lbreakouthd +blacklist ${HOME}/.lettura blacklist ${HOME}/.librewolf blacklist ${HOME}/.lincity-ng blacklist ${HOME}/.links @@ -836,6 +875,7 @@ blacklist ${HOME}/.local/lib/vivaldi blacklist ${HOME}/.local/share/0ad blacklist ${HOME}/.local/share/3909/PapersPlease blacklist ${HOME}/.local/share/Anki2 +blacklist ${HOME}/.local/share/Baba_Is_You blacklist ${HOME}/.local/share/Colossal Order blacklist ${HOME}/.local/share/Dredmor blacklist ${HOME}/.local/share/Empathy @@ -895,6 +935,8 @@ blacklist ${HOME}/.local/share/cdprojektred blacklist ${HOME}/.local/share/chatterino blacklist ${HOME}/.local/share/clipit blacklist ${HOME}/.local/share/com.github.johnfactotum.Foliate +blacklist ${HOME}/.local/share/com.lettura.dev +blacklist ${HOME}/.local/share/com.vmingueza.journal-viewer blacklist ${HOME}/.local/share/contacts blacklist ${HOME}/.local/share/cor-games blacklist ${HOME}/.local/share/data/Mendeley Ltd. @@ -903,6 +945,7 @@ blacklist ${HOME}/.local/share/data/MusE blacklist ${HOME}/.local/share/data/MuseScore blacklist ${HOME}/.local/share/data/nomacs blacklist ${HOME}/.local/share/data/qBittorrent +blacklist ${HOME}/.local/share/dev.nhex blacklist ${HOME}/.local/share/dino blacklist ${HOME}/.local/share/dolphin blacklist ${HOME}/.local/share/dolphin-emu @@ -912,6 +955,8 @@ blacklist ${HOME}/.local/share/evolution blacklist ${HOME}/.local/share/feedreader blacklist ${HOME}/.local/share/feral-interactive blacklist ${HOME}/.local/share/five-or-more +blacklist ${HOME}/.local/share/fluffychat +blacklist ${HOME}/.local/share/fractal blacklist ${HOME}/.local/share/freecol blacklist ${HOME}/.local/share/gajim blacklist ${HOME}/.local/share/gdfuse @@ -920,7 +965,6 @@ blacklist ${HOME}/.local/share/geeqie blacklist ${HOME}/.local/share/ghostwriter blacklist ${HOME}/.local/share/gitg blacklist ${HOME}/.local/share/gnome-2048 -blacklist ${HOME}/.local/share/gnome-boxes blacklist ${HOME}/.local/share/gnome-builder blacklist ${HOME}/.local/share/gnome-chess blacklist ${HOME}/.local/share/gnome-klotski @@ -938,6 +982,7 @@ blacklist ${HOME}/.local/share/gnote blacklist ${HOME}/.local/share/godot blacklist ${HOME}/.local/share/gradio blacklist ${HOME}/.local/share/gwenview +blacklist ${HOME}/.local/share/hashcat blacklist ${HOME}/.local/share/i2p blacklist ${HOME}/.local/share/io.github.lainsce.Notejot blacklist ${HOME}/.local/share/jami @@ -964,6 +1009,7 @@ blacklist ${HOME}/.local/share/liferea blacklist ${HOME}/.local/share/linphone blacklist ${HOME}/.local/share/lobster blacklist ${HOME}/.local/share/local-mail +blacklist ${HOME}/.local/share/localsend_app blacklist ${HOME}/.local/share/lollypop blacklist ${HOME}/.local/share/love blacklist ${HOME}/.local/share/lugaru @@ -977,6 +1023,7 @@ blacklist ${HOME}/.local/share/meld blacklist ${HOME}/.local/share/midori blacklist ${HOME}/.local/share/minder blacklist ${HOME}/.local/share/mirage +blacklist ${HOME}/.local/share/mullvad-browser blacklist ${HOME}/.local/share/multimc blacklist ${HOME}/.local/share/multimc5 blacklist ${HOME}/.local/share/mupen64plus @@ -999,6 +1046,7 @@ blacklist ${HOME}/.local/share/orage blacklist ${HOME}/.local/share/org.kde.gwenview blacklist ${HOME}/.local/share/pix blacklist ${HOME}/.local/share/plasma_notes +blacklist ${HOME}/.local/share/pnpm blacklist ${HOME}/.local/share/profanity blacklist ${HOME}/.local/share/psi blacklist ${HOME}/.local/share/psi+ @@ -1012,14 +1060,17 @@ blacklist ${HOME}/.local/share/rtv blacklist ${HOME}/.local/share/scribus blacklist ${HOME}/.local/share/shotwell blacklist ${HOME}/.local/share/signal-cli +blacklist ${HOME}/.local/share/singularity blacklist ${HOME}/.local/share/sink blacklist ${HOME}/.local/share/smuxi blacklist ${HOME}/.local/share/spotify +blacklist ${HOME}/.local/share/sqlitebrowser blacklist ${HOME}/.local/share/steam blacklist ${HOME}/.local/share/strawberry blacklist ${HOME}/.local/share/supertux2 blacklist ${HOME}/.local/share/supertuxkart blacklist ${HOME}/.local/share/swell-foop +blacklist ${HOME}/.local/share/telegram-desktop blacklist ${HOME}/.local/share/telepathy blacklist ${HOME}/.local/share/terasology blacklist ${HOME}/.local/share/torbrowser @@ -1040,6 +1091,7 @@ blacklist ${HOME}/.local/share/xreader blacklist ${HOME}/.local/share/zathura blacklist ${HOME}/.local/state/ani-cli blacklist ${HOME}/.local/state/audacity +blacklist ${HOME}/.local/state/mpv blacklist ${HOME}/.local/state/pipewire blacklist ${HOME}/.lv2 blacklist ${HOME}/.lyx @@ -1061,7 +1113,7 @@ blacklist ${HOME}/.mp3splt-gtk blacklist ${HOME}/.mpd blacklist ${HOME}/.mpdconf blacklist ${HOME}/.mplayer -blacklist ${HOME}/.msmtprc +blacklist ${HOME}/.mullvad/mullvadbrowser blacklist ${HOME}/.multimc5 blacklist ${HOME}/.nanorc blacklist ${HOME}/.netactview @@ -1103,6 +1155,7 @@ blacklist ${HOME}/.pinerc blacklist ${HOME}/.pinercex blacklist ${HOME}/.pingus blacklist ${HOME}/.pioneer +blacklist ${HOME}/.platformio blacklist ${HOME}/.prey blacklist ${HOME}/.purple blacklist ${HOME}/.pylint.d @@ -1117,6 +1170,7 @@ blacklist ${HOME}/.repo_.gitconfig.json blacklist ${HOME}/.repoconfig blacklist ${HOME}/.retroshare blacklist ${HOME}/.ripperXrc +blacklist ${HOME}/.rustup blacklist ${HOME}/.sbt blacklist ${HOME}/.scorched3d blacklist ${HOME}/.scribus @@ -1149,6 +1203,7 @@ blacklist ${HOME}/.torcs blacklist ${HOME}/.tremulous blacklist ${HOME}/.ts3client blacklist ${HOME}/.tuxguitar* +blacklist ${HOME}/.tuxtype blacklist ${HOME}/.tvbrowser blacklist ${HOME}/.unknown-horizons blacklist ${HOME}/.viking @@ -1195,6 +1250,8 @@ blacklist ${HOME}/SoftMaker blacklist ${HOME}/Standard Notes Backups blacklist ${HOME}/TeamSpeak3-Client-linux_amd64 blacklist ${HOME}/TeamSpeak3-Client-linux_x86 +blacklist ${HOME}/UpdateInfo +blacklist ${HOME}/Zomboid blacklist ${HOME}/hyperrogue.ini blacklist ${HOME}/i2p blacklist ${HOME}/mps @@ -1204,11 +1261,16 @@ blacklist ${HOME}/yt-dlp.conf blacklist ${HOME}/yt-dlp.conf.txt blacklist ${RUNUSER}/*firefox* blacklist ${RUNUSER}/akonadi +blacklist ${RUNUSER}/i3 blacklist ${RUNUSER}/psd/*firefox* blacklist ${RUNUSER}/qutebrowser +blacklist /etc/clamav blacklist /etc/ssmtp blacklist /tmp/.wine-* blacklist /tmp/akonadi-* +blacklist /tmp/evolution-* +blacklist /tmp/i3-* +blacklist /tmp/lwjgl_* blacklist /var/games/nethack blacklist /var/games/slashem blacklist /var/games/vulturesclaw diff --git a/etc/inc/disable-x11.inc b/etc/inc/disable-x11.inc new file mode 100644 index 000000000..d78329046 --- /dev/null +++ b/etc/inc/disable-x11.inc @@ -0,0 +1,15 @@ +# This file is overwritten during software install. +# Persistent customizations should go in a .local file. +include disable-x11.local + +blacklist /tmp/.X11-unix +blacklist ${HOME}/.Xauthority +blacklist ${RUNUSER}/gdm/Xauthority +blacklist ${RUNUSER}/.mutter-Xwaylandauth* +blacklist ${RUNUSER}/xauth_* +#blacklist ${RUNUSER}/[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]] +blacklist /tmp/xauth* +blacklist /tmp/.ICE-unix +blacklist ${RUNUSER}/ICEauthority +rmenv DISPLAY +rmenv XAUTHORITY diff --git a/etc/inc/landlock-common.inc b/etc/inc/landlock-common.inc new file mode 100644 index 000000000..7ff6448e2 --- /dev/null +++ b/etc/inc/landlock-common.inc @@ -0,0 +1,31 @@ +# This file is overwritten during software install. +# Persistent customizations should go in a .local file. +include landlock-common.local + +landlock.fs.read / # whole system read +landlock.fs.read /proc +landlock.fs.makeipc / # sockets etc. + +# write access +landlock.fs.write ${HOME} +landlock.fs.write ${RUNUSER} +landlock.fs.write /dev +landlock.fs.write /proc +landlock.fs.write /run/shm +landlock.fs.write /tmp + +# exec access +## misc +landlock.fs.execute ${PATH} +landlock.fs.execute /opt +landlock.fs.execute /run/firejail # appimage and various firejail features +## lib +landlock.fs.execute /lib +landlock.fs.execute /lib32 +landlock.fs.execute /libx32 +landlock.fs.execute /lib64 +landlock.fs.execute /usr/lib +landlock.fs.execute /usr/lib32 +landlock.fs.execute /usr/libx32 +landlock.fs.execute /usr/lib64 +landlock.fs.execute /usr/local/lib diff --git a/etc/inc/whitelist-usr-share-common.inc b/etc/inc/whitelist-usr-share-common.inc index dcf941004..03653cc16 100644 --- a/etc/inc/whitelist-usr-share-common.inc +++ b/etc/inc/whitelist-usr-share-common.inc @@ -40,6 +40,7 @@ whitelist /usr/share/kxmlgui5 whitelist /usr/share/libdrm whitelist /usr/share/libthai whitelist /usr/share/locale +whitelist /usr/share/locale-langpack whitelist /usr/share/mime whitelist /usr/share/misc whitelist /usr/share/Modules diff --git a/etc/inc/whitelist-var-common.inc b/etc/inc/whitelist-var-common.inc index d8ba84ad0..080f16b6e 100644 --- a/etc/inc/whitelist-var-common.inc +++ b/etc/inc/whitelist-var-common.inc @@ -13,3 +13,4 @@ whitelist /var/cache/fontconfig whitelist /var/tmp whitelist /var/run whitelist /var/lock +whitelist /var/games diff --git a/etc/profile-a-l/0ad.profile b/etc/profile-a-l/0ad.profile index 48a2afdf2..9ec2f2ad1 100644 --- a/etc/profile-a-l/0ad.profile +++ b/etc/profile-a-l/0ad.profile @@ -10,6 +10,9 @@ noblacklist ${HOME}/.cache/0ad noblacklist ${HOME}/.config/0ad noblacklist ${HOME}/.local/share/0ad +# Allow gjs (blacklisted by disable-interpreters.inc) +include allow-gjs.inc + blacklist /usr/libexec include disable-common.inc diff --git a/etc/profile-a-l/1password.profile b/etc/profile-a-l/1password.profile index 690086099..63a04330b 100644 --- a/etc/profile-a-l/1password.profile +++ b/etc/profile-a-l/1password.profile @@ -13,7 +13,7 @@ whitelist ${HOME}/.config/1Password private-etc @tls-ca -# Needed for keychain things, talking to Firefox, possibly other things? Not sure how to narrow down +# Needed for keychain things, talking to Firefox, possibly other things? ignore dbus-user none # Redirect diff --git a/etc/profile-a-l/abiword.profile b/etc/profile-a-l/abiword.profile index a0eed24ca..dcd1259cf 100644 --- a/etc/profile-a-l/abiword.profile +++ b/etc/profile-a-l/abiword.profile @@ -44,7 +44,7 @@ private-dev private-etc @x11 private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/abrowser.profile b/etc/profile-a-l/abrowser.profile index 2e6e8f1af..6217af780 100644 --- a/etc/profile-a-l/abrowser.profile +++ b/etc/profile-a-l/abrowser.profile @@ -12,9 +12,9 @@ mkdir ${HOME}/.cache/mozilla/abrowser mkdir ${HOME}/.mozilla whitelist ${HOME}/.cache/mozilla/abrowser whitelist ${HOME}/.mozilla +whitelist /usr/share/abrowser -# private-etc must first be enabled in firefox-common.profile -#private-etc abrowser +private-etc abrowser # Redirect include firefox-common.profile diff --git a/etc/profile-a-l/agetpkg.profile b/etc/profile-a-l/agetpkg.profile index 9ebbf1cb0..1bf954e3a 100644 --- a/etc/profile-a-l/agetpkg.profile +++ b/etc/profile-a-l/agetpkg.profile @@ -7,7 +7,6 @@ include agetpkg.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* # Allow python (blacklisted by disable-interpreters.inc) @@ -20,6 +19,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include disable-xdg.inc whitelist ${DOWNLOADS} diff --git a/etc/profile-a-l/akonadi_control.profile b/etc/profile-a-l/akonadi_control.profile index 184036f24..275ff41ef 100644 --- a/etc/profile-a-l/akonadi_control.profile +++ b/etc/profile-a-l/akonadi_control.profile @@ -34,7 +34,7 @@ include whitelist-var-common.inc # disabled options below are not compatible with the apparmor profile for mysqld-akonadi. # this affects ubuntu and debian currently -# apparmor +#apparmor caps.drop all ipc-namespace netfilter @@ -42,17 +42,17 @@ no3d nodvd nogroups noinput -# nonewprivs +#nonewprivs noroot nosound notv nou2f novideo -# protocol unix,inet,inet6,netlink -# seccomp !io_destroy,!io_getevents,!io_setup,!io_submit,!ioprio_set +#protocol unix,inet,inet6,netlink +#seccomp !io_destroy,!io_getevents,!io_setup,!io_submit,!ioprio_set tracelog private-dev -# private-tmp - breaks programs that depend on akonadi +#private-tmp # breaks programs that depend on akonadi -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/akregator.profile b/etc/profile-a-l/akregator.profile index d88a1fcad..9de992a76 100644 --- a/etc/profile-a-l/akregator.profile +++ b/etc/profile-a-l/akregator.profile @@ -49,4 +49,4 @@ private-dev private-tmp deterministic-shutdown -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/alacarte.profile b/etc/profile-a-l/alacarte.profile index 22a303cdd..318e169d7 100644 --- a/etc/profile-a-l/alacarte.profile +++ b/etc/profile-a-l/alacarte.profile @@ -21,7 +21,6 @@ include disable-xdg.inc whitelist /usr/share/alacarte whitelist /usr/share/app-info whitelist /usr/share/desktop-directories -whitelist /usr/share/icons whitelist /var/lib/app-info/icons whitelist /var/lib/flatpak/exports/share/applications whitelist /var/lib/flatpak/exports/share/icons @@ -49,7 +48,7 @@ seccomp.block-secondary tracelog disable-mnt -# private-bin alacarte,bash,python*,sh +#private-bin alacarte,bash,python*,sh private-cache private-dev private-etc @tls-ca,@x11,mime.types diff --git a/etc/profile-a-l/alienarena-wrapper.profile b/etc/profile-a-l/alienarena-wrapper.profile index b31996cd2..b05a6968d 100644 --- a/etc/profile-a-l/alienarena-wrapper.profile +++ b/etc/profile-a-l/alienarena-wrapper.profile @@ -6,6 +6,7 @@ include alienarena-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin alienarena-wrapper diff --git a/etc/profile-a-l/alienblaster.profile b/etc/profile-a-l/alienblaster.profile new file mode 100644 index 000000000..2de296f53 --- /dev/null +++ b/etc/profile-a-l/alienblaster.profile @@ -0,0 +1,55 @@ +# Firejail profile for alienblaster +# Persistent local customizations +include alienblaster.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.alienblaster +noblacklist ${HOME}/.alienblaster_highscore + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-xdg.inc + +mkdir ${HOME}/.alienblaster +mkfile ${HOME}/.alienblaster_highscore +whitelist ${HOME}/.alienblaster +whitelist ${HOME}/.alienblaster_highscore +whitelist ${RUNUSER}/pulse +whitelist /usr/share/games/alienblaster +whitelist /usr/share/timidity +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +netfilter +net none +nodvd +noinput +nonewprivs +noroot +notv +nou2f +novideo +protocol unix +seccomp +tracelog + +disable-mnt +private-dev +private-etc @games,@sound,@x11 +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-a-l/alpine.profile b/etc/profile-a-l/alpine.profile index 5ccb9896f..7ff2058a5 100644 --- a/etc/profile-a-l/alpine.profile +++ b/etc/profile-a-l/alpine.profile @@ -30,7 +30,6 @@ noblacklist ${HOME}/.pinercex noblacklist ${HOME}/.signature noblacklist ${HOME}/mail -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc @@ -39,6 +38,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include disable-xdg.inc #whitelist ${DOCUMENTS} diff --git a/etc/profile-a-l/amarok.profile b/etc/profile-a-l/amarok.profile index 389aae602..0c78ab20d 100644 --- a/etc/profile-a-l/amarok.profile +++ b/etc/profile-a-l/amarok.profile @@ -26,11 +26,11 @@ notv nou2f novideo protocol unix,inet,inet6 -# seccomp +#seccomp -# private-bin amarok +#private-bin amarok private-dev -# private-etc alternatives,asound.conf,ca-certificates,crypto-policies,machine-id,pki,pulse,resolv.conf,ssl +#private-etc alternatives,asound.conf,ca-certificates,crypto-policies,machine-id,pki,pulse,resolv.conf,ssl private-tmp dbus-user filter @@ -45,4 +45,4 @@ dbus-user.talk org.freedesktop.Notifications #dbus-user.talk org.kde.knotify dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/android-studio.profile b/etc/profile-a-l/android-studio.profile index 3dfa0f95a..09289ace1 100644 --- a/etc/profile-a-l/android-studio.profile +++ b/etc/profile-a-l/android-studio.profile @@ -36,7 +36,7 @@ protocol unix,inet,inet6 seccomp private-cache -# private-tmp +#private-tmp # noexec /tmp breaks 'Android Profiler' #noexec /tmp diff --git a/etc/profile-a-l/ani-cli.profile b/etc/profile-a-l/ani-cli.profile index 613f74ce5..76db2986d 100644 --- a/etc/profile-a-l/ani-cli.profile +++ b/etc/profile-a-l/ani-cli.profile @@ -10,6 +10,7 @@ include ani-cli.local noblacklist ${HOME}/.cache/ani-cli noblacklist ${HOME}/.local/state/ani-cli +noblacklist ${PATH}/patch # Allow /bin/sh (blacklisted by disable-shell.inc) include allow-bin-sh.inc @@ -30,9 +31,9 @@ noprinters notv disable-mnt -private-bin ani-cli,aria2c,cat,cp,curl,cut,ffmpeg,fzf,grep,head,mkdir,mv,nl,nohup,patch,printf,rm,rofi,sed,sh,sort,tail,tput,tr,uname,wc +private-bin ani-cli,aria2c,cat,cp,curl,cut,ffmpeg,fzf,grep,head,mkdir,mktemp,mv,nl,nohup,patch,printf,rm,rofi,sed,sh,sort,tail,tput,tr,uname,wc #private-cache -private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg +private-etc X11,alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,xdg private-tmp # Redirect diff --git a/etc/profile-a-l/anki.profile b/etc/profile-a-l/anki.profile index 2d0bfcb6c..99623d612 100644 --- a/etc/profile-a-l/anki.profile +++ b/etc/profile-a-l/anki.profile @@ -6,8 +6,19 @@ include anki.local # Persistent global definitions include globals.local +# Add the following to anki.local if you don't need media playing/recording +# (lua is needed by mpv): +#ignore include allow-lua.inc +#machine-id +#nosound + noblacklist ${DOCUMENTS} +noblacklist ${HOME}/.config/mpv noblacklist ${HOME}/.local/share/Anki2 +noblacklist ${HOME}/.mplayer + +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc # Allow python (blacklisted by disable-interpreters.inc) include allow-python2.inc @@ -23,13 +34,15 @@ include disable-xdg.inc mkdir ${HOME}/.local/share/Anki2 whitelist ${DOCUMENTS} +whitelist ${HOME}/.config/mpv whitelist ${HOME}/.local/share/Anki2 +whitelist ${HOME}/.mplayer include whitelist-common.inc include whitelist-var-common.inc apparmor caps.drop all -machine-id +#machine-id netfilter no3d nodvd @@ -37,7 +50,7 @@ nogroups noinput nonewprivs noroot -nosound +#nosound notv nou2f novideo @@ -46,7 +59,7 @@ protocol unix,inet,inet6 seccomp !chroot disable-mnt -private-bin anki,python* +private-bin anki,mplayer,mpv,python* private-cache private-dev private-etc @tls-ca,@x11 @@ -55,4 +68,4 @@ private-tmp dbus-user none dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/apostrophe.profile b/etc/profile-a-l/apostrophe.profile index cc9c893de..581084ed3 100644 --- a/etc/profile-a-l/apostrophe.profile +++ b/etc/profile-a-l/apostrophe.profile @@ -32,7 +32,6 @@ include disable-xdg.inc whitelist /usr/libexec/webkit2gtk-4.0 whitelist /usr/share/apostrophe -whitelist /usr/share/texlive whitelist /usr/share/texmf whitelist /usr/share/pandoc-* include whitelist-runuser-common.inc diff --git a/etc/profile-a-l/archiver-common.profile b/etc/profile-a-l/archiver-common.profile index 487e0c5f8..deaf5df4c 100644 --- a/etc/profile-a-l/archiver-common.profile +++ b/etc/profile-a-l/archiver-common.profile @@ -43,7 +43,7 @@ x11 none private-cache private-dev -private-etc +private-etc mkinitcpio* dbus-user none dbus-system none diff --git a/etc/profile-a-l/arduino.profile b/etc/profile-a-l/arduino.profile index 85ea76939..a925e223f 100644 --- a/etc/profile-a-l/arduino.profile +++ b/etc/profile-a-l/arduino.profile @@ -21,7 +21,7 @@ caps.drop all netfilter no3d nodvd -# nogroups +#nogroups nonewprivs noroot nosound diff --git a/etc/profile-a-l/aria2c.profile b/etc/profile-a-l/aria2c.profile index 7f9463c4f..a3add6a4d 100644 --- a/etc/profile-a-l/aria2c.profile +++ b/etc/profile-a-l/aria2c.profile @@ -11,7 +11,6 @@ noblacklist ${HOME}/.cache/winetricks # XXX: See #5238 noblacklist ${HOME}/.config/aria2 noblacklist ${HOME}/.netrc -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc @@ -19,6 +18,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc @@ -39,7 +39,7 @@ novideo protocol unix,inet,inet6,netlink seccomp -# disable-mnt +#disable-mnt # Add your custom event hook commands to 'private-bin' in your aria2c.local. private-bin aria2c,gzip # Add 'private-cache' to your aria2c.local if you don't use Lutris/winetricks (see issue #2772). diff --git a/etc/profile-a-l/ark.profile b/etc/profile-a-l/ark.profile index 272e06219..65e965248 100644 --- a/etc/profile-a-l/ark.profile +++ b/etc/profile-a-l/ark.profile @@ -22,7 +22,7 @@ include whitelist-var-common.inc apparmor caps.drop all -# net none +#net none netfilter nodvd nogroups @@ -42,7 +42,7 @@ private-bin 7z,ark,bash,lrzip,lsar,lz4,lzop,p7zip,rar,sh,tclsh,unar,unrar,unzip, private-dev private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/armcord.profile b/etc/profile-a-l/armcord.profile new file mode 100644 index 000000000..470e0dee0 --- /dev/null +++ b/etc/profile-a-l/armcord.profile @@ -0,0 +1,40 @@ +# Firejail profile for armcord +# Description: Standalone Discord client +# This file is overwritten after every install/update +# Persistent local customizations +include armcord.local +# Persistent global definitions +include globals.local + +# Modules might depend on nodejs. +# Add the below lines to your armcord.local if you need this. +# Allow node (disabled by disable-interpreters.inc) +#include allow-nodejs.inc +#private-bin node + +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) +noblacklist ${HOME}/.mozilla +whitelist ${HOME}/.mozilla/firefox/profiles.ini + +noblacklist ${HOME}/.config/ArmCord + +mkdir ${HOME}/.config/ArmCord +whitelist ${HOME}/.config/ArmCord +whitelist /opt/armcord +whitelist /usr/share/armcord + +ignore novideo +private-bin armcord + +dbus-user filter +dbus-user.talk org.freedesktop.Notifications +# Allow D-Bus communication with Firefox for opening links +dbus-user.talk org.mozilla.* +ignore dbus-user none + +join-or-start armcord + +# Redirect +include electron-common.profile diff --git a/etc/profile-a-l/artha.profile b/etc/profile-a-l/artha.profile index 897140857..f6369eb86 100644 --- a/etc/profile-a-l/artha.profile +++ b/etc/profile-a-l/artha.profile @@ -35,7 +35,7 @@ include whitelist-var-common.inc apparmor caps.drop all ipc-namespace -# net none - breaks on Ubuntu +#net none # breaks on Ubuntu no3d nodvd nogroups diff --git a/etc/profile-a-l/asunder.profile b/etc/profile-a-l/asunder.profile index c09ad7936..601ef5c13 100644 --- a/etc/profile-a-l/asunder.profile +++ b/etc/profile-a-l/asunder.profile @@ -26,7 +26,7 @@ apparmor caps.drop all netfilter no3d -# nogroups +#nogroups noinput nonewprivs noroot @@ -44,5 +44,5 @@ dbus-user none dbus-system none # mdwe is disabled due to breaking hardware accelerated decoding -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-a-l/atom.profile b/etc/profile-a-l/atom.profile index 8e8f8515f..f21a8c34a 100644 --- a/etc/profile-a-l/atom.profile +++ b/etc/profile-a-l/atom.profile @@ -26,7 +26,7 @@ noblacklist ${HOME}/.config/Atom # Allows files commonly used by IDEs include allow-common-devel.inc -# net none +#net none nosound # Redirect diff --git a/etc/profile-a-l/atool.profile b/etc/profile-a-l/atool.profile index 672286087..091a2f59f 100644 --- a/etc/profile-a-l/atool.profile +++ b/etc/profile-a-l/atool.profile @@ -12,8 +12,6 @@ include allow-perl.inc noroot -# without login.defs atool complains and uses UID/GID 1000 by default -private-etc private-tmp # Redirect diff --git a/etc/profile-a-l/atril.profile b/etc/profile-a-l/atril.profile index d0513d2a7..26b978158 100644 --- a/etc/profile-a-l/atril.profile +++ b/etc/profile-a-l/atril.profile @@ -22,7 +22,7 @@ include disable-xdg.inc include whitelist-var-common.inc -# apparmor +#apparmor caps.drop all machine-id no3d @@ -44,7 +44,7 @@ private-dev private-etc # atril uses webkit gtk to display epub files # waiting for globbing support in private-lib; for now hardcoding it to webkit2gtk-4.0 -#private-lib webkit2gtk-4.0 - problems on Arch with the new version of WebKit +#private-lib webkit2gtk-4.0 # problems on Arch with the new version of WebKit private-tmp # webkit gtk killed by memory-deny-write-execute diff --git a/etc/profile-a-l/audacious.profile b/etc/profile-a-l/audacious.profile index b31f3f1b2..6d1a07e2d 100644 --- a/etc/profile-a-l/audacious.profile +++ b/etc/profile-a-l/audacious.profile @@ -14,6 +14,7 @@ include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc +include disable-proc.inc include disable-programs.inc include disable-xdg.inc @@ -26,6 +27,7 @@ netfilter nogroups noinput nonewprivs +noprinters noroot notv nou2f @@ -34,13 +36,18 @@ protocol unix,inet,inet6 seccomp tracelog -# private-bin audacious +#private-bin audacious private-cache private-dev private-tmp -# dbus needed for MPRIS -# dbus-user none -# dbus-system none +dbus-user filter +dbus-user.own org.atheme.audacious +dbus-user.own org.mpris.MediaPlayer2.audacious +dbus-user.talk ca.desrt.dconf +dbus-user.talk org.freedesktop.Notifications +dbus-user.talk org.gtk.vfs.UDisks2VolumeMonitor +dbus-user.talk org.mpris.MediaPlayer2.Player +dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/audacity.profile b/etc/profile-a-l/audacity.profile index c2a482b61..2893dda5a 100644 --- a/etc/profile-a-l/audacity.profile +++ b/etc/profile-a-l/audacity.profile @@ -6,10 +6,9 @@ include audacity.local # Persistent global definitions include globals.local -# Add the below lines to your audacity.local if you need online plugins. -#ignore net none -#netfilter -#protocol inet6 +# To disable networking, add the following lines to audacity.local: +#ignore netfilter +#net none noblacklist ${HOME}/.audacity-data noblacklist ${HOME}/.cache/audacity @@ -34,7 +33,7 @@ allow-debuggers ## Enabling App Armor appears to break some Fedora / Arch installs #apparmor caps.drop all -net none +netfilter no3d nodvd nogroups @@ -44,17 +43,17 @@ noroot notv nou2f novideo -protocol unix,inet +protocol unix,inet,inet6 seccomp tracelog private-bin audacity private-dev -private-etc @x11 +private-etc @network,@sound,@tls-ca,@x11 private-tmp # problems on Fedora 27 -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/audio-recorder.profile b/etc/profile-a-l/audio-recorder.profile index deba11a47..816852a71 100644 --- a/etc/profile-a-l/audio-recorder.profile +++ b/etc/profile-a-l/audio-recorder.profile @@ -41,7 +41,7 @@ seccomp tracelog disable-mnt -# private-bin audio-recorder +#private-bin audio-recorder private-cache private-etc private-tmp @@ -50,5 +50,5 @@ dbus-user filter dbus-user.talk ca.desrt.dconf dbus-system none -# memory-deny-write-execute - breaks on Arch +#memory-deny-write-execute # breaks on Arch restrict-namespaces diff --git a/etc/profile-a-l/authenticator.profile b/etc/profile-a-l/authenticator.profile index 96c70a838..cbd97449d 100644 --- a/etc/profile-a-l/authenticator.profile +++ b/etc/profile-a-l/authenticator.profile @@ -19,7 +19,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc -# apparmor +#apparmor caps.drop all netfilter no3d @@ -31,19 +31,19 @@ noroot nosound notv nou2f -# novideo +#novideo protocol unix,inet,inet6 seccomp disable-mnt -# private-bin authenticator,python* +#private-bin authenticator,python* private-dev private-etc @tls-ca private-tmp # makes settings immutable -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-a-l/autokey-common.profile b/etc/profile-a-l/autokey-common.profile index 834eac11a..bc47b26a9 100644 --- a/etc/profile-a-l/autokey-common.profile +++ b/etc/profile-a-l/autokey-common.profile @@ -38,5 +38,5 @@ private-cache private-dev private-tmp -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-a-l/axel.profile b/etc/profile-a-l/axel.profile new file mode 100644 index 000000000..9961477f3 --- /dev/null +++ b/etc/profile-a-l/axel.profile @@ -0,0 +1,61 @@ +# Firejail profile for axel +# Description: Lightweight CLI download accelerator +quiet +# This file is overwritten after every install/update +# Persistent local customizations +include axel.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.axelrc +noblacklist ${HOME}/.netrc + +blacklist ${RUNUSER} + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +#include disable-x11.inc # x11 none +include disable-xdg.inc + +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog +x11 none + +#disable-mnt +private-bin axel +private-cache +private-dev +private-etc @network,@tls-ca,axelrc +private-lib +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-a-l/ballbuster-wrapper.profile b/etc/profile-a-l/ballbuster-wrapper.profile index 419dcaab5..64a78e154 100644 --- a/etc/profile-a-l/ballbuster-wrapper.profile +++ b/etc/profile-a-l/ballbuster-wrapper.profile @@ -6,6 +6,7 @@ include ballbuster-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin ballbuster-wrapper diff --git a/etc/profile-a-l/baloo_file.profile b/etc/profile-a-l/baloo_file.profile index 084b7c702..de4004724 100644 --- a/etc/profile-a-l/baloo_file.profile +++ b/etc/profile-a-l/baloo_file.profile @@ -7,10 +7,10 @@ include globals.local # Make home directory read-only and allow writing only to ${HOME}/.local/share/baloo # Note: Baloo will not be able to update the "first run" key in its configuration files. -# mkdir ${HOME}/.local/share/baloo -# read-only ${HOME} -# read-write ${HOME}/.local/share/baloo -# ignore read-write +#mkdir ${HOME}/.local/share/baloo +#read-only ${HOME} +#read-write ${HOME}/.local/share/baloo +#ignore read-write noblacklist ${HOME}/.config/baloofilerc noblacklist ${HOME}/.kde/share/config/baloofilerc @@ -31,7 +31,7 @@ include whitelist-var-common.inc apparmor caps.drop all machine-id -# net none +#net none netfilter no3d nodvd @@ -46,7 +46,7 @@ novideo protocol unix # blacklisting of ioprio_set system calls breaks baloo_file seccomp !ioprio_set -# x11 xorg +#x11 xorg private-bin baloo_file,baloo_file_extractor,baloo_filemetadata_temp_extractor,kbuildsycoca4 private-cache diff --git a/etc/profile-a-l/baobab.profile b/etc/profile-a-l/baobab.profile index 31ef66a58..942d82941 100644 --- a/etc/profile-a-l/baobab.profile +++ b/etc/profile-a-l/baobab.profile @@ -6,13 +6,13 @@ include baobab.local # Persistent global definitions include globals.local -# include disable-common.inc +#include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc -# include disable-programs.inc +#include disable-programs.inc include disable-shell.inc -# include disable-xdg.inc +#include disable-xdg.inc include whitelist-runuser-common.inc @@ -37,8 +37,8 @@ private-bin baobab private-dev private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none read-only ${HOME} restrict-namespaces diff --git a/etc/profile-a-l/basilisk.profile b/etc/profile-a-l/basilisk.profile index a962bfe02..f5595274e 100644 --- a/etc/profile-a-l/basilisk.profile +++ b/etc/profile-a-l/basilisk.profile @@ -12,14 +12,14 @@ mkdir ${HOME}/.cache/moonchild productions/basilisk mkdir ${HOME}/.moonchild productions whitelist ${HOME}/.cache/moonchild productions/basilisk whitelist ${HOME}/.moonchild productions +whitelist /usr/share/basilisk # Basilisk can use the full firejail seccomp filter (unlike firefox >= 60) seccomp ignore seccomp #private-bin basilisk -# private-etc must first be enabled in firefox-common.profile -#private-etc basilisk +private-etc basilisk #private-opt basilisk restrict-namespaces diff --git a/etc/profile-a-l/bcompare.profile b/etc/profile-a-l/bcompare.profile index d566b94e8..c0e024445 100644 --- a/etc/profile-a-l/bcompare.profile +++ b/etc/profile-a-l/bcompare.profile @@ -19,7 +19,7 @@ include disable-exec.inc include disable-interpreters.inc # Add the next line to your bcompare.local if you don't need to compare files in disable-programs.inc. #include disable-programs.inc -#include disable-shell.inc - breaks launch +#include disable-shell.inc # breaks launch include disable-write-mnt.inc apparmor diff --git a/etc/profile-a-l/beaker.profile b/etc/profile-a-l/beaker.profile index ff21b7ee5..85c1bdec1 100644 --- a/etc/profile-a-l/beaker.profile +++ b/etc/profile-a-l/beaker.profile @@ -13,7 +13,6 @@ ignore include whitelist-usr-share-common.inc ignore include whitelist-var-common.inc ignore nou2f ignore novideo -ignore shell none ignore disable-mnt ignore private-cache ignore private-dev diff --git a/etc/profile-a-l/bibletime.profile b/etc/profile-a-l/bibletime.profile index 3fb2a82c3..dcef2bff1 100644 --- a/etc/profile-a-l/bibletime.profile +++ b/etc/profile-a-l/bibletime.profile @@ -48,7 +48,7 @@ protocol unix,inet,inet6,netlink seccomp !chroot disable-mnt -# private-bin bibletime +#private-bin bibletime private-cache private-dev private-etc @tls-ca,sword,sword.conf @@ -57,4 +57,4 @@ private-tmp dbus-user none dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/bijiben.profile b/etc/profile-a-l/bijiben.profile index 53d212e34..7afccf5cd 100644 --- a/etc/profile-a-l/bijiben.profile +++ b/etc/profile-a-l/bijiben.profile @@ -48,7 +48,7 @@ tracelog disable-mnt private-bin bijiben -# private-cache -- access to .cache/tracker is required +#private-cache # access to .cache/tracker is required private-dev private-etc @x11 private-tmp @@ -59,5 +59,8 @@ dbus-user.talk ca.desrt.dconf dbus-user.talk org.freedesktop.Tracker1 dbus-system none -env WEBKIT_FORCE_SANDBOX=0 +# Warning: Disabling the webkit sandbox may be needed to make firejail work +# with webkit2gtk, but this is not recommended (see #2995). +# Add the following line to bijiben.local at your own risk: +#env WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 restrict-namespaces diff --git a/etc/profile-a-l/bitlbee.profile b/etc/profile-a-l/bitlbee.profile index 988a1479e..0f10c7ce0 100644 --- a/etc/profile-a-l/bitlbee.profile +++ b/etc/profile-a-l/bitlbee.profile @@ -10,7 +10,7 @@ ignore noexec ${HOME} noblacklist /sbin noblacklist /usr/sbin -# noblacklist /var/log +#noblacklist /var/log include disable-common.inc include disable-devel.inc diff --git a/etc/profile-a-l/bitwarden-desktop.profile b/etc/profile-a-l/bitwarden-desktop.profile new file mode 100644 index 000000000..4c1994c50 --- /dev/null +++ b/etc/profile-a-l/bitwarden-desktop.profile @@ -0,0 +1,11 @@ +# Firejail profile for bitwarden-desktop +# Description: A secure and free password manager for all of your devices +# This file is overwritten after every install/update. +# Persistent local customisations +include bitwarden-desktop.local +# Persistent global definitions +# added by included profile +#include globals.local + +# Redirect +include bitwarden.profile diff --git a/etc/profile-a-l/bitwarden.profile b/etc/profile-a-l/bitwarden.profile index 56bb871e7..9ed48b02d 100644 --- a/etc/profile-a-l/bitwarden.profile +++ b/etc/profile-a-l/bitwarden.profile @@ -6,17 +6,18 @@ include bitwarden.local # Persistent global definitions include globals.local -# Disabled until someone reported positive feedback -ignore include whitelist-usr-share-common.inc - ignore noexec /tmp noblacklist ${HOME}/.config/Bitwarden +# Allow /bin/sh (blacklisted by disable-shell.inc) +include allow-bin-sh.inc + include disable-shell.inc mkdir ${HOME}/.config/Bitwarden whitelist ${HOME}/.config/Bitwarden +whitelist /opt/Bitwarden machine-id no3d @@ -24,7 +25,6 @@ nosound ?HAS_APPIMAGE: ignore private-dev private-etc @tls-ca -private-opt Bitwarden # Redirect include electron-common.profile diff --git a/etc/profile-a-l/bleachbit.profile b/etc/profile-a-l/bleachbit.profile index 52d970d89..cd1b059b4 100644 --- a/etc/profile-a-l/bleachbit.profile +++ b/etc/profile-a-l/bleachbit.profile @@ -18,7 +18,7 @@ include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc -# include disable-programs.inc +#include disable-programs.inc caps.drop all net none @@ -36,11 +36,11 @@ protocol unix seccomp private-dev -# private-tmp +#private-tmp dbus-user none dbus-system none # memory-deny-write-execute breaks some systems, see issue #1850 -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-a-l/blender-3.6.profile b/etc/profile-a-l/blender-3.6.profile new file mode 100644 index 000000000..4e32c1f6d --- /dev/null +++ b/etc/profile-a-l/blender-3.6.profile @@ -0,0 +1,10 @@ +# Firejail profile alias for blender +# This file is overwritten after every install/update +# Persistent local customizations +include blender-3.6.local +# Persistent global definitions +# added by included profile +#include globals.local + +# Redirect +include blender.profile diff --git a/etc/profile-a-l/bless.profile b/etc/profile-a-l/bless.profile index 6dd540943..85f232751 100644 --- a/etc/profile-a-l/bless.profile +++ b/etc/profile-a-l/bless.profile @@ -31,7 +31,7 @@ novideo protocol unix seccomp -# private-bin bash,bless,mono,sh +#private-bin bash,bless,mono,sh private-cache private-dev private-etc mono diff --git a/etc/profile-a-l/bpftop.profile b/etc/profile-a-l/bpftop.profile new file mode 100644 index 000000000..d5b723f17 --- /dev/null +++ b/etc/profile-a-l/bpftop.profile @@ -0,0 +1,61 @@ +# Firejail profile for bpftop +# Description: Dynamic real-time view of running eBPF programs +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include bpftop.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} +blacklist /usr/libexec + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-x11.inc +include disable-xdg.inc + +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.keep sys_admin +ipc-namespace +machine-id +net none +no3d +nodvd +nogroups +noinput +noprinters +#noroot +nosound +notv +nou2f +novideo +seccomp.drop socket +seccomp.block-secondary +tracelog +x11 none + +disable-mnt +private-bin bpftop +private-cache +private-dev +private-etc +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces +read-only ${HOME} diff --git a/etc/profile-a-l/brackets.profile b/etc/profile-a-l/brackets.profile index a483c2b0a..684504937 100644 --- a/etc/profile-a-l/brackets.profile +++ b/etc/profile-a-l/brackets.profile @@ -32,4 +32,4 @@ seccomp !chroot,!ioperm private-cache private-dev -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/brasero.profile b/etc/profile-a-l/brasero.profile index 12d7062ab..92184ef18 100644 --- a/etc/profile-a-l/brasero.profile +++ b/etc/profile-a-l/brasero.profile @@ -29,9 +29,9 @@ protocol unix seccomp tracelog -# private-bin brasero +#private-bin brasero private-cache -# private-dev -# private-tmp +#private-dev +#private-tmp restrict-namespaces diff --git a/etc/profile-a-l/brave.profile b/etc/profile-a-l/brave.profile index 071a279b0..b3994c974 100644 --- a/etc/profile-a-l/brave.profile +++ b/etc/profile-a-l/brave.profile @@ -9,8 +9,8 @@ include globals.local # noexec /tmp is included in chromium-common.profile and breaks Brave ignore noexec /tmp # TOR is installed in ${HOME}. -# NOTE: chromium-common.profile enables apparmor. To keep that intact -# you will need to uncomment the 'brave + tor' rule in /etc/apparmor.d/local/firejail-default. +# Note: chromium-common.profile enables apparmor. To keep that intact, +# uncomment the 'brave + tor' rule in /etc/apparmor.d/local/firejail-default. # Alternatively you can add 'ignore apparmor' to your brave.local. ignore noexec ${HOME} # Causes slow starts (#4604) diff --git a/etc/profile-a-l/brz.profile b/etc/profile-a-l/brz.profile new file mode 100644 index 000000000..dcc7af54b --- /dev/null +++ b/etc/profile-a-l/brz.profile @@ -0,0 +1,14 @@ +# Firejail profile for brz +# Description: Distributed VCS with support for Bazaar and Git file formats +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include brz.local +# Persistent global definitions +# added by included profile +#include globals.local + +noblacklist ${HOME}/.config/breezy + +# Redirect +include git.profile diff --git a/etc/profile-a-l/bsdtar.profile b/etc/profile-a-l/bsdtar.profile index c5c2e33eb..f78d4bdff 100644 --- a/etc/profile-a-l/bsdtar.profile +++ b/etc/profile-a-l/bsdtar.profile @@ -6,7 +6,5 @@ include bsdtar.local # Persistent global definitions include globals.local -private-etc - # Redirect include archiver-common.profile diff --git a/etc/profile-a-l/build-systems-common.profile b/etc/profile-a-l/build-systems-common.profile index cf5f462ae..9761efc72 100644 --- a/etc/profile-a-l/build-systems-common.profile +++ b/etc/profile-a-l/build-systems-common.profile @@ -25,7 +25,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc -include disable-X11.inc +include disable-x11.inc include disable-xdg.inc #whitelist ${HOME}/Projects @@ -39,7 +39,7 @@ include whitelist-var-common.inc caps.drop all ipc-namespace machine-id -# net none +#net none netfilter no3d nodvd diff --git a/etc/profile-a-l/bzr.profile b/etc/profile-a-l/bzr.profile new file mode 100644 index 000000000..61c1aae38 --- /dev/null +++ b/etc/profile-a-l/bzr.profile @@ -0,0 +1,10 @@ +# Firejail profile alias for bzr +# This file is overwritten after every install/update +# Persistent local customizations +include bzr.local +# Persistent global definitions +# added by included profile +#include globals.local + +# Redirect +include brz.profile diff --git a/etc/profile-a-l/cachy-browser.profile b/etc/profile-a-l/cachy-browser.profile index 7a14d9464..6bebbf7b0 100644 --- a/etc/profile-a-l/cachy-browser.profile +++ b/etc/profile-a-l/cachy-browser.profile @@ -1,5 +1,5 @@ -# Firejail profile for Cachy-Browser -# Description: Librewolf fork based on enhanced privacy with gentoo patchset +# Firejail profile for cachy-browser +# Description: Librewolf fork based on enhanced privacy with Gentoo patchset # This file is overwritten after every install/update # Persistent local customizations include cachy-browser.local @@ -13,43 +13,14 @@ mkdir ${HOME}/.cache/cachy mkdir ${HOME}/.cachy whitelist ${HOME}/.cache/cachy whitelist ${HOME}/.cachy +whitelist /usr/share/cachy-browser -# Add the next lines to your cachy-browser.local if you want to use the migration wizard. -#noblacklist ${HOME}/.mozilla -#whitelist ${HOME}/.mozilla - -# To enable KeePassXC Plugin add one of the following lines to your cachy-browser.local. -# NOTE: start KeePassXC before CachyBrowser and keep it open to allow communication between them. -#whitelist ${RUNUSER}/kpxc_server -#whitelist ${RUNUSER}/org.keepassxc.KeePassXC.BrowserServer - -whitelist /usr/share/doc -whitelist /usr/share/gtk-doc/html -whitelist /usr/share/mozilla -whitelist /usr/share/webext -include whitelist-usr-share-common.inc - -# Add the next line to your cachy-browser.local to enable private-bin (Arch Linux). +# Add the next line to cachy-browser.local to enable private-bin. #private-bin dbus-launch,dbus-send,cachy-browser,sh -# Add the next line to your cachy-browser.local to enable private-etc. -# NOTE: private-etc must first be enabled in firefox-common.local. -#private-etc cachy-browser +private-etc cachy-browser dbus-user filter dbus-user.own org.mozilla.cachybrowser.* -# Add the next line to your cachy-browser.local to enable native notifications. -#dbus-user.talk org.freedesktop.Notifications -# Add the next line to your cachy-browser.local to allow inhibiting screensavers. -#dbus-user.talk org.freedesktop.ScreenSaver -# Add the next lines to your cachy-browser.local for plasma browser integration. -#dbus-user.own org.mpris.MediaPlayer2.plasma-browser-integration -#dbus-user.talk org.kde.JobViewServer -#dbus-user.talk org.kde.kuiserver -# Add the next line to your cachy-browser.local to allow screensharing under Wayland. -#dbus-user.talk org.freedesktop.portal.Desktop -# Also add the next line to your cachy-browser.local if screensharing does not work with -# the above lines (depends on the portal implementation). -#ignore noroot ignore dbus-user none # Redirect diff --git a/etc/profile-a-l/calibre.profile b/etc/profile-a-l/calibre.profile index b347941d7..cb9c92ffb 100644 --- a/etc/profile-a-l/calibre.profile +++ b/etc/profile-a-l/calibre.profile @@ -36,4 +36,4 @@ seccomp !chroot private-dev private-tmp -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/calligra.profile b/etc/profile-a-l/calligra.profile index c2972f902..ffb83b2ed 100644 --- a/etc/profile-a-l/calligra.profile +++ b/etc/profile-a-l/calligra.profile @@ -15,7 +15,7 @@ include disable-programs.inc caps.drop all ipc-namespace -# net none +#net none netfilter nodvd nogroups @@ -32,9 +32,9 @@ seccomp.block-secondary private-bin calligra,calligraauthor,calligraconverter,calligraflow,calligragemini,calligraplan,calligraplanwork,calligrasheets,calligrastage,calligrawords,dbus-launch,kbuildsycoca4,kdeinit4 private-dev -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -# noexec ${HOME} +#noexec ${HOME} noexec /tmp restrict-namespaces diff --git a/etc/profile-a-l/cameramonitor.profile b/etc/profile-a-l/cameramonitor.profile index df94ac859..4f8fd7187 100644 --- a/etc/profile-a-l/cameramonitor.profile +++ b/etc/profile-a-l/cameramonitor.profile @@ -48,8 +48,8 @@ private-cache private-etc private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -# memory-deny-write-execute - breaks on Arch +#memory-deny-write-execute # breaks on Arch restrict-namespaces diff --git a/etc/profile-a-l/cantata.profile b/etc/profile-a-l/cantata.profile index 7cb56efee..36c7c1091 100644 --- a/etc/profile-a-l/cantata.profile +++ b/etc/profile-a-l/cantata.profile @@ -22,7 +22,7 @@ include disable-programs.inc include disable-shell.inc include disable-xdg.inc -# apparmor +#apparmor caps.drop all ipc-namespace netfilter @@ -34,7 +34,7 @@ novideo protocol unix,inet,inet6,netlink seccomp -# private-etc alternatives,drirc,fonts,gcrypt,hosts,kde5rc,mpd.conf,passwd,samba,ssl,xdg +#private-etc alternatives,drirc,fonts,gcrypt,hosts,kde5rc,mpd.conf,passwd,samba,ssl,xdg private-bin cantata,mpd,perl private-dev diff --git a/etc/profile-a-l/catfish.profile b/etc/profile-a-l/catfish.profile index e2df341e9..037f6ee40 100644 --- a/etc/profile-a-l/catfish.profile +++ b/etc/profile-a-l/catfish.profile @@ -15,10 +15,10 @@ noblacklist ${HOME}/.config/catfish include allow-python2.inc include allow-python3.inc -# include disable-common.inc -# include disable-devel.inc +#include disable-common.inc +#include disable-devel.inc include disable-interpreters.inc -# include disable-programs.inc +#include disable-programs.inc whitelist /var/lib/mlocate include whitelist-var-common.inc @@ -40,9 +40,9 @@ tracelog # These options work but are disabled in case # a users wants to search in these directories. -# private-bin bash,catfish,env,locate,ls,mlocate,python* -# private-dev -# private-tmp +#private-bin bash,catfish,env,locate,ls,mlocate,python* +#private-dev +#private-tmp dbus-user none dbus-system none diff --git a/etc/profile-a-l/cawbird.profile b/etc/profile-a-l/cawbird.profile index 17887b6cc..7fdbc3881 100644 --- a/etc/profile-a-l/cawbird.profile +++ b/etc/profile-a-l/cawbird.profile @@ -41,7 +41,7 @@ private-dev private-etc @tls-ca,@x11,host.conf,mime.types private-tmp -# dbus-user none +#dbus-user none dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/chatterino.profile b/etc/profile-a-l/chatterino.profile index 2df03b10b..907067de7 100644 --- a/etc/profile-a-l/chatterino.profile +++ b/etc/profile-a-l/chatterino.profile @@ -12,16 +12,20 @@ include globals.local #whitelist ${MUSIC} # Also allow access to mpv/vlc, they're usable via streamlink. +noblacklist ${HOME}/.cache/mpv noblacklist ${HOME}/.config/mpv noblacklist ${HOME}/.config/pulse noblacklist ${HOME}/.config/vlc noblacklist ${HOME}/.local/share/chatterino noblacklist ${HOME}/.local/share/vlc +noblacklist ${HOME}/.local/state/mpv -# Allow Lua for mpv (blacklisted by disable-interpreters.inc) +# Lua is required by mpv. +# Allow lua (blacklisted by disable-interpreters.inc) include allow-lua.inc -# Allow Python for Streamlink integration (blacklisted by disable-interpreters.inc) +# Python is required for streamlink integration. +# Allow python (blacklisted by disable-interpreters.inc) include allow-python3.inc include disable-common.inc @@ -40,6 +44,9 @@ whitelist-ro ${HOME}/.config/mpv whitelist-ro ${HOME}/.config/pulse whitelist-ro ${HOME}/.config/vlc whitelist-ro ${HOME}/.local/share/vlc +whitelist-ro /usr/share/lua* +whitelist-ro /usr/share/mpv +whitelist-ro /usr/share/vlc include whitelist-common.inc include whitelist-run-common.inc include whitelist-runuser-common.inc diff --git a/etc/profile-a-l/chromium-browser-privacy.profile b/etc/profile-a-l/chromium-browser-privacy.profile index 8803a4d9d..67a3a43af 100644 --- a/etc/profile-a-l/chromium-browser-privacy.profile +++ b/etc/profile-a-l/chromium-browser-privacy.profile @@ -13,7 +13,7 @@ mkdir ${HOME}/.config/ungoogled-chromium whitelist ${HOME}/.cache/ungoogled-chromium whitelist ${HOME}/.config/ungoogled-chromium -# private-bin basename,bash,cat,chromium-browser-privacy,dirname,mkdir,readlink,sed,touch,which,xdg-settings +#private-bin basename,bash,cat,chromium-browser-privacy,dirname,mkdir,readlink,sed,touch,which,xdg-settings # Redirect include chromium.profile diff --git a/etc/profile-a-l/chromium-common.profile b/etc/profile-a-l/chromium-common.profile index 878e0fe1d..8d4f3fc9a 100644 --- a/etc/profile-a-l/chromium-common.profile +++ b/etc/profile-a-l/chromium-common.profile @@ -9,14 +9,28 @@ include chromium-common.local # noexec ${HOME} breaks DRM binaries. ?BROWSER_ALLOW_DRM: ignore noexec ${HOME} +# To enable support for the KeePassXC extension, add the following lines to +# chromium-common.local. +# Note: Start KeePassXC before the web browser and keep it open to allow +# communication between them. +#noblacklist ${RUNUSER}/app +#whitelist ${RUNUSER}/app/org.keepassxc.KeePassXC +#whitelist ${RUNUSER}/kpxc_server +#whitelist ${RUNUSER}/org.keepassxc.KeePassXC.BrowserServer + noblacklist ${HOME}/.local/share/pki noblacklist ${HOME}/.pki noblacklist /usr/lib/chromium/chrome-sandbox -# Add the next line to your chromium-common.local if you want Google Chrome/Chromium browser -# to have access to Gnome extensions (extensions.gnome.org) via browser connector +# Add the next line to chromium-common.local if you want the web browser to +# have access to Gnome extensions (extensions.gnome.org) via the browser +# connector. #include allow-python3.inc +blacklist ${PATH}/curl +blacklist ${PATH}/wget +blacklist ${PATH}/wget2 + mkdir ${HOME}/.local/share/pki mkdir ${HOME}/.pki whitelist ${HOME}/.local/share/pki @@ -27,19 +41,17 @@ include whitelist-run-common.inc # If your kernel allows the creation of user namespaces by unprivileged users # (for example, if running `unshare -U echo enabled` prints "enabled"), you -# can add the next line to your chromium-common.local. +# can add the next line to chromium-common.local. #include chromium-common-hardened.inc.profile ?BROWSER_DISABLE_U2F: nou2f ?BROWSER_DISABLE_U2F: private-dev -#private-tmp - issues when using multiple browser sessions +#private-tmp # issues when using multiple browser sessions -blacklist ${PATH}/curl -blacklist ${PATH}/wget -blacklist ${PATH}/wget2 - -#dbus-user none - prevents access to passwords saved in GNOME Keyring and KWallet, also breaks Gnome connector. +# Note: This prevents access to passwords saved in GNOME Keyring and KWallet +# and breaks Gnome connector. +#dbus-user none # The file dialog needs to work without d-bus. ?HAS_NODBUS: env NO_CHROME_KDE_FILE_DIALOG=1 diff --git a/etc/profile-a-l/chromium.profile b/etc/profile-a-l/chromium.profile index 14f1bbe64..8c43aac9c 100644 --- a/etc/profile-a-l/chromium.profile +++ b/etc/profile-a-l/chromium.profile @@ -17,7 +17,7 @@ whitelist ${HOME}/.config/chromium whitelist ${HOME}/.config/chromium-flags.conf whitelist /usr/share/chromium -# private-bin chromium,chromium-browser,chromedriver +#private-bin chromium,chromium-browser,chromedriver # Redirect include chromium-common.profile diff --git a/etc/profile-a-l/clac.profile b/etc/profile-a-l/clac.profile new file mode 100644 index 000000000..7a8104b63 --- /dev/null +++ b/etc/profile-a-l/clac.profile @@ -0,0 +1,63 @@ +# Firejail profile for clac +# Description: Simple command-line calculator +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include clac.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +#include disable-x11.inc # x11 none +include disable-xdg.inc + +#include whitelist-common.inc # see #903 +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +net none +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +# block socket syscall to simulate empty protocol option (see #639) +seccomp socket +seccomp.block-secondary +tracelog +x11 none + +disable-mnt +private +private-bin clac +#private-cache +private-dev +private-etc +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +restrict-namespaces diff --git a/etc/profile-a-l/clamav.profile b/etc/profile-a-l/clamav.profile index ddd0eb1f9..8b3257026 100644 --- a/etc/profile-a-l/clamav.profile +++ b/etc/profile-a-l/clamav.profile @@ -7,6 +7,8 @@ include clamav.local # Persistent global definitions include globals.local +noblacklist /etc/clamav + blacklist ${RUNUSER}/wayland-* include disable-exec.inc diff --git a/etc/profile-a-l/clamtk.profile b/etc/profile-a-l/clamtk.profile index 9fc73ee55..7651c5d32 100644 --- a/etc/profile-a-l/clamtk.profile +++ b/etc/profile-a-l/clamtk.profile @@ -1,4 +1,5 @@ # Firejail profile for clamtk +# Description: Easy to use, light-weight, on-demand virus scanner for Linux systems # This file is overwritten after every install/update # Persistent local customizations include clamtk.local @@ -7,15 +8,22 @@ include globals.local include disable-exec.inc +# Add the below lines to your clamtk.local if you update signatures databases per-user: +#ignore net none +#netfilter +#protocol inet,inet6 + caps.drop all ipc-namespace net none no3d nodvd -nogroups +# nogroups breaks scanning +#nogroups noinput nonewprivs -noroot +# noroot breaks scanning +#noroot nosound notv nou2f @@ -25,7 +33,9 @@ seccomp private-dev -dbus-user none +dbus-user filter +dbus-user.talk ca.desrt.dconf +dbus-user.talk org.gtk.vfs.UDisks2VolumeMonitor dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/claws-mail.profile b/etc/profile-a-l/claws-mail.profile index 7fefc68b1..2d2f0e48d 100644 --- a/etc/profile-a-l/claws-mail.profile +++ b/etc/profile-a-l/claws-mail.profile @@ -6,9 +6,17 @@ include claws-mail.local # Persistent global definitions include globals.local +# Note: If you use things like claws-mail's "fancy" (html rendering) plugin and +# the X11 window freezes, 'no3d' is likely the cause. In which case, try +# adding the following line to claws-mail.local: +#ignore no3d + +noblacklist ${HOME}/.cache/claws-mail noblacklist ${HOME}/.claws-mail +mkdir ${HOME}/.cache/claws-mail mkdir ${HOME}/.claws-mail +whitelist ${HOME}/.cache/claws-mail whitelist ${HOME}/.claws-mail # Add the below lines to your claws-mail.local if you use python-based plugins. @@ -18,7 +26,7 @@ whitelist ${HOME}/.claws-mail whitelist /usr/share/doc/claws-mail -# private-bin claws-mail,curl,gpg,gpg2,gpg-agent,gpgsm,gpgme-config,pinentry,pinentry-gtk-2 +#private-bin claws-mail,curl,gpg,gpg2,gpg-agent,gpgsm,gpgme-config,pinentry,pinentry-gtk-2 # Redirect include email-common.profile diff --git a/etc/profile-a-l/clawsker.profile b/etc/profile-a-l/clawsker.profile index 3b8eb7bbd..37d9e9e3a 100644 --- a/etc/profile-a-l/clawsker.profile +++ b/etc/profile-a-l/clawsker.profile @@ -50,5 +50,5 @@ private-tmp dbus-user none dbus-system none -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-a-l/clementine.profile b/etc/profile-a-l/clementine.profile index ee01fa653..3e9363bb4 100644 --- a/etc/profile-a-l/clementine.profile +++ b/etc/profile-a-l/clementine.profile @@ -37,6 +37,6 @@ private-dev private-tmp dbus-system none -# dbus-user none +#dbus-user none restrict-namespaces diff --git a/etc/profile-a-l/clion.profile b/etc/profile-a-l/clion.profile index 652809f1b..0cea1c7d4 100644 --- a/etc/profile-a-l/clion.profile +++ b/etc/profile-a-l/clion.profile @@ -37,7 +37,7 @@ seccomp private-cache private-dev -# private-tmp +#private-tmp noexec /tmp restrict-namespaces diff --git a/etc/profile-a-l/clipgrab.profile b/etc/profile-a-l/clipgrab.profile index 3f3748e1a..2657876b8 100644 --- a/etc/profile-a-l/clipgrab.profile +++ b/etc/profile-a-l/clipgrab.profile @@ -46,7 +46,7 @@ private-dev private-tmp # 'dbus-user none' breaks tray menu - add 'dbus-user none' to your clipgrab.local if you don't need it. -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/cliqz.profile b/etc/profile-a-l/cliqz.profile index d0b8cc0ef..bded735a9 100644 --- a/etc/profile-a-l/cliqz.profile +++ b/etc/profile-a-l/cliqz.profile @@ -15,9 +15,9 @@ mkdir ${HOME}/.config/cliqz whitelist ${HOME}/.cache/cliqz whitelist ${HOME}/.cliqz whitelist ${HOME}/.config/cliqz +whitelist /usr/share/cliqz -# private-etc must first be enabled in firefox-common.profile -#private-etc cliqz +private-etc cliqz # Redirect include firefox-common.profile diff --git a/etc/profile-a-l/cloneit.profile b/etc/profile-a-l/cloneit.profile new file mode 100644 index 000000000..abbeb9d77 --- /dev/null +++ b/etc/profile-a-l/cloneit.profile @@ -0,0 +1,61 @@ +# Firejail profile for cloneit +# Description: A CLI tool to download specific GitHub directories or files +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include cloneit.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} +blacklist /usr/libexec + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-x11.inc +include disable-xdg.inc + +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog +x11 none + +disable-mnt +private-bin cloneit +private-cache +private-dev +private-etc @network,@tls-ca,rpc,services +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-a-l/code.profile b/etc/profile-a-l/code.profile index 19862bc92..1b69effc3 100644 --- a/etc/profile-a-l/code.profile +++ b/etc/profile-a-l/code.profile @@ -35,7 +35,7 @@ nosound # Disabling noexec ${HOME} for now since it will # probably interfere with running some programmes # in VS Code -# noexec ${HOME} +#noexec ${HOME} noexec /tmp # Redirect diff --git a/etc/profile-a-l/cointop.profile b/etc/profile-a-l/cointop.profile index aa053e2f7..fa30331e1 100644 --- a/etc/profile-a-l/cointop.profile +++ b/etc/profile-a-l/cointop.profile @@ -17,7 +17,7 @@ include disable-interpreters.inc include disable-proc.inc include disable-programs.inc include disable-shell.inc -include disable-X11.inc +include disable-x11.inc include disable-xdg.inc mkdir ${HOME}/.config/cointop diff --git a/etc/profile-a-l/colorful-wrapper.profile b/etc/profile-a-l/colorful-wrapper.profile index 4b762047d..ebccffe09 100644 --- a/etc/profile-a-l/colorful-wrapper.profile +++ b/etc/profile-a-l/colorful-wrapper.profile @@ -6,6 +6,7 @@ include colorful-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin colorful-wrapper diff --git a/etc/profile-a-l/com.github.bleakgrey.tootle.profile b/etc/profile-a-l/com.github.bleakgrey.tootle.profile index 180282869..b1275e96b 100644 --- a/etc/profile-a-l/com.github.bleakgrey.tootle.profile +++ b/etc/profile-a-l/com.github.bleakgrey.tootle.profile @@ -48,9 +48,9 @@ private-etc @tls-ca,@x11,host.conf,mime.types private-tmp # Settings are immutable -# dbus-user filter -# dbus-user.own com.github.bleakgrey.tootle -# dbus-user.talk ca.desrt.dconf +#dbus-user filter +#dbus-user.own com.github.bleakgrey.tootle +#dbus-user.talk ca.desrt.dconf dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/cower.profile b/etc/profile-a-l/cower.profile index 9b05b4416..c280cf22a 100644 --- a/etc/profile-a-l/cower.profile +++ b/etc/profile-a-l/cower.profile @@ -19,8 +19,8 @@ include disable-shell.inc include disable-xdg.inc # This profile could be significantly strengthened by adding the following to cower.local -# whitelist ${HOME}/ -# whitelist ${HOME}/.config/cower +#whitelist ${HOME}/ +#whitelist ${HOME}/.config/cower caps.drop all ipc-namespace diff --git a/etc/profile-a-l/crawl.profile b/etc/profile-a-l/crawl.profile index 7df7b4480..9545fb8bc 100644 --- a/etc/profile-a-l/crawl.profile +++ b/etc/profile-a-l/crawl.profile @@ -8,6 +8,9 @@ include globals.local noblacklist ${HOME}/.crawl +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + include disable-common.inc include disable-devel.inc include disable-exec.inc diff --git a/etc/profile-a-l/curl.profile b/etc/profile-a-l/curl.profile index bfe8764d5..9044e9ac0 100644 --- a/etc/profile-a-l/curl.profile +++ b/etc/profile-a-l/curl.profile @@ -7,6 +7,7 @@ include curl.local # Persistent global definitions include globals.local +noblacklist ${HOME}/.config/curlrc # since curl 7.73.0 # curl 7.74.0 introduces experimental support for HSTS cache # https://daniel.haxx.se/blog/2020/11/03/hsts-your-curl/ # Technically this file can be anywhere but let's assume users have it in ${HOME}/.curl-hsts. @@ -15,7 +16,6 @@ include globals.local noblacklist ${HOME}/.curl-hsts noblacklist ${HOME}/.curlrc -blacklist /tmp/.X11-unix blacklist ${RUNUSER} # If you use nvm, add the below lines to your curl.local @@ -25,6 +25,7 @@ blacklist ${RUNUSER} include disable-common.inc include disable-exec.inc include disable-programs.inc +include disable-x11.inc # Depending on workflow you can add 'include disable-xdg.inc' to your curl.local. #include disable-xdg.inc @@ -50,10 +51,10 @@ protocol inet,inet6 seccomp tracelog -# private-bin curl +#private-bin curl private-cache private-dev -# private-etc alternatives,ca-certificates,crypto-policies,pki,resolv.conf,ssl +#private-etc alternatives,ca-certificates,crypto-policies,pki,resolv.conf,ssl private-etc @tls-ca private-tmp diff --git a/etc/profile-a-l/cyberfox.profile b/etc/profile-a-l/cyberfox.profile index d1fff0004..173c5b4a5 100644 --- a/etc/profile-a-l/cyberfox.profile +++ b/etc/profile-a-l/cyberfox.profile @@ -12,10 +12,11 @@ mkdir ${HOME}/.8pecxstudios mkdir ${HOME}/.cache/8pecxstudios whitelist ${HOME}/.8pecxstudios whitelist ${HOME}/.cache/8pecxstudios +whitelist /usr/share/8pecxstudios +whitelist /usr/share/cyberfox -# private-bin cyberfox,dbus-launch,dbus-send,env,sh,which -# private-etc must first be enabled in firefox-common.profile -#private-etc cyberfox +#private-bin cyberfox,dbus-launch,dbus-send,env,sh,which +private-etc cyberfox # Redirect include firefox-common.profile diff --git a/etc/profile-a-l/d-feet.profile b/etc/profile-a-l/d-feet.profile index 7dd5ca260..e11134616 100644 --- a/etc/profile-a-l/d-feet.profile +++ b/etc/profile-a-l/d-feet.profile @@ -12,45 +12,16 @@ noblacklist ${HOME}/.config/d-feet include allow-python2.inc include allow-python3.inc -include disable-common.inc -include disable-devel.inc -include disable-exec.inc -include disable-interpreters.inc -include disable-programs.inc -include disable-shell.inc -include disable-xdg.inc - mkdir ${HOME}/.config/d-feet whitelist ${HOME}/.config/d-feet whitelist /usr/share/d-feet -include whitelist-common.inc -include whitelist-runuser-common.inc -include whitelist-usr-share-common.inc -include whitelist-var-common.inc -apparmor -caps.drop all -ipc-namespace -# net none - breaks on Ubuntu -no3d -nodvd -nogroups -noinput -nonewprivs -noroot -nosound -notv -nou2f -novideo -protocol unix -seccomp +# breaks on Ubuntu +ignore net none -disable-mnt private-bin d-feet,python* -private-cache -private-dev -private-etc dbus-1 -private-tmp -#memory-deny-write-execute - breaks on Arch (see issue #1803) -restrict-namespaces +#memory-deny-write-execute # breaks on Arch (see issue #1803) + +# Redirect +include dbus-debug-common.profile diff --git a/etc/profile-a-l/d-spy.profile b/etc/profile-a-l/d-spy.profile new file mode 100644 index 000000000..2c9ef52cb --- /dev/null +++ b/etc/profile-a-l/d-spy.profile @@ -0,0 +1,12 @@ +# Firejail profile for d-spy +# Description: D-Bus debugger for GNOME +# This file is overwritten after every install/update +# Persistent local customizations +include d-spy.local +# Persistent global definitions +include globals.local + +private-bin d-spy + +# Redirect +include dbus-debug-common.profile diff --git a/etc/profile-a-l/daisy.profile b/etc/profile-a-l/daisy.profile new file mode 100644 index 000000000..c6e616414 --- /dev/null +++ b/etc/profile-a-l/daisy.profile @@ -0,0 +1,63 @@ +# Firejail profile for daisy +# Description: TUI scientific calculator with support for units +# This file is overwritten after every install/update +# Persistent local customizations +include daisy.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +#include disable-x11.inc # x11 none +include disable-xdg.inc + +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +net none +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +# block socket syscall to simulate empty protocol option (see #639) +seccomp socket +seccomp.block-secondary +tracelog +x11 none + +disable-mnt +private-bin daisy +private-cache +private-dev +private-etc +private-lib +private-opt none +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +restrict-namespaces diff --git a/etc/profile-a-l/dbus-debug-common.profile b/etc/profile-a-l/dbus-debug-common.profile new file mode 100644 index 000000000..0ef060f3a --- /dev/null +++ b/etc/profile-a-l/dbus-debug-common.profile @@ -0,0 +1,49 @@ +# Firejail profile for dbus-debug-common +# This file is overwritten after every install/update +# Persistent local customizations +include dbus-debug-common.local +# Persistent global definitions +# added by caller profile +#include globals.local + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +include whitelist-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +net none +no3d +nodvd +nogroups +noinput +nonewprivs +noroot +nosound +notv +nou2f +novideo +protocol unix +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-cache +private-dev +private-etc dbus-1 +private-tmp + +read-only ${HOME} +restrict-namespaces diff --git a/etc/profile-a-l/dbus-send.profile b/etc/profile-a-l/dbus-send.profile index 80790bb0c..b54724aa5 100644 --- a/etc/profile-a-l/dbus-send.profile +++ b/etc/profile-a-l/dbus-send.profile @@ -7,7 +7,6 @@ include dbus-send.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc @@ -17,9 +16,10 @@ include disable-interpreters.inc include disable-programs.inc include disable-shell.inc include disable-write-mnt.inc +include disable-x11.inc include disable-xdg.inc -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc @@ -28,8 +28,7 @@ apparmor caps.drop all ipc-namespace machine-id -# Breaks abstract sockets -#net none +#net none # breaks abstract sockets netfilter no3d nodvd diff --git a/etc/profile-a-l/dconf-editor.profile b/etc/profile-a-l/dconf-editor.profile index e2e2492bc..e8acd60b7 100644 --- a/etc/profile-a-l/dconf-editor.profile +++ b/etc/profile-a-l/dconf-editor.profile @@ -22,7 +22,7 @@ include whitelist-var-common.inc apparmor caps.drop all -# net none - breaks application on older versions +#net none # breaks application on older versions no3d nodvd nogroups diff --git a/etc/profile-a-l/ddgtk.profile b/etc/profile-a-l/ddgtk.profile index 9811c90d6..0fa88f232 100644 --- a/etc/profile-a-l/ddgtk.profile +++ b/etc/profile-a-l/ddgtk.profile @@ -50,5 +50,5 @@ private-tmp dbus-user none dbus-system none -# memory-deny-write-execute - breaks on Arch +#memory-deny-write-execute # breaks on Arch restrict-namespaces diff --git a/etc/profile-a-l/deadlink.profile b/etc/profile-a-l/deadlink.profile new file mode 100644 index 000000000..dd7283ed9 --- /dev/null +++ b/etc/profile-a-l/deadlink.profile @@ -0,0 +1,64 @@ +# Firejail profile for deadlink +# Description: Checks and fixes URLs in code and documentation +# This file is overwritten after every install/update +# Persistent local customizations +include deadlink.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} +blacklist /usr/libexec + +noblacklist ${HOME}/.config/deadlink + +# Allow python (blacklisted by disable-interpreters.inc) +#include allow-python2.inc +include allow-python3.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-x11.inc +include disable-xdg.inc + +include whitelist-run-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,inet +seccomp +seccomp.block-secondary +tracelog +x11 none + +disable-mnt +private-bin deadlink,python* +private-cache +private-dev +private-etc @network,@tls-ca +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-a-l/default.profile b/etc/profile-a-l/default.profile index a10bbab5b..659d9755e 100644 --- a/etc/profile-a-l/default.profile +++ b/etc/profile-a-l/default.profile @@ -9,55 +9,57 @@ include globals.local # depending on your usage, you can enable some of the commands below: include disable-common.inc -# include disable-devel.inc -# include disable-exec.inc -# include disable-interpreters.inc +#include disable-devel.inc +#include disable-exec.inc +#include disable-interpreters.inc include disable-programs.inc -# include disable-shell.inc -# include disable-write-mnt.inc -# include disable-xdg.inc +#include disable-shell.inc +#include disable-write-mnt.inc +#include disable-xdg.inc -# include whitelist-common.inc -# include whitelist-runuser-common.inc -# include whitelist-usr-share-common.inc -# include whitelist-var-common.inc +#include whitelist-common.inc +#include whitelist-runuser-common.inc +#include whitelist-usr-share-common.inc +#include whitelist-var-common.inc -# apparmor +include landlock-common.inc + +#apparmor caps.drop all -# ipc-namespace -# machine-id -# net none +#ipc-namespace +#machine-id +#net none netfilter -# no3d -# nodvd -# nogroups +#no3d +#nodvd +#nogroups noinput nonewprivs noroot -# nosound +#nosound +#notpm notv -# nou2f +#nou2f novideo protocol unix,inet,inet6 seccomp -# shell none -# tracelog +#tracelog -# disable-mnt -# private -# private-bin program -# private-cache -# private-dev +#disable-mnt +#private +#private-bin program +#private-cache +private-dev # see /usr/share/doc/firejail/profile.template for more common private-etc paths. -# private-etc alternatives,fonts,machine-id -# private-lib -# private-opt none -# private-tmp +#private-etc alternatives,fonts,machine-id +#private-lib +#private-opt none +private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -# deterministic-shutdown -# memory-deny-write-execute -# read-only ${HOME} +#deterministic-shutdown +#memory-deny-write-execute +#read-only ${HOME} restrict-namespaces diff --git a/etc/profile-a-l/deluge.profile b/etc/profile-a-l/deluge.profile index ebc751e1a..b257f9a4c 100644 --- a/etc/profile-a-l/deluge.profile +++ b/etc/profile-a-l/deluge.profile @@ -13,7 +13,7 @@ include allow-python2.inc include allow-python3.inc include disable-common.inc -# include disable-devel.inc +#include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc diff --git a/etc/profile-a-l/devhelp.profile b/etc/profile-a-l/devhelp.profile index 066cdc8b0..7b5e692a0 100644 --- a/etc/profile-a-l/devhelp.profile +++ b/etc/profile-a-l/devhelp.profile @@ -23,7 +23,7 @@ include whitelist-usr-share-common.inc apparmor caps.drop all -# net none - makes settings immutable +#net none # makes settings immutable nodvd nogroups noinput @@ -45,9 +45,9 @@ private-etc @tls-ca,@x11 private-tmp # makes settings immutable -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) read-only ${HOME} restrict-namespaces diff --git a/etc/profile-a-l/dexios.profile b/etc/profile-a-l/dexios.profile new file mode 100644 index 000000000..936aa9f05 --- /dev/null +++ b/etc/profile-a-l/dexios.profile @@ -0,0 +1,63 @@ +# Firejail profile for dexios +# Description: CLI encryption tool +quiet +# This file is overwritten after every install/update +# Persistent local customizations +include dexios.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} +blacklist /usr/libexec + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-x11.inc +include disable-xdg.inc + +whitelist ${DOWNLOADS} +include whitelist-run-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +seccomp.drop socket +seccomp.block-secondary +tracelog +x11 none + +disable-mnt +private-bin dexios +private-cache +private-dev +private-etc +private-lib +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +read-write ${DOWNLOADS} +restrict-namespaces diff --git a/etc/profile-a-l/dig.profile b/etc/profile-a-l/dig.profile index 7c0fee9c3..6a00475f9 100644 --- a/etc/profile-a-l/dig.profile +++ b/etc/profile-a-l/dig.profile @@ -10,17 +10,17 @@ include globals.local noblacklist ${HOME}/.digrc noblacklist ${PATH}/dig -blacklist /tmp/.X11-unix blacklist ${RUNUSER} include disable-common.inc -# include disable-devel.inc +#include disable-devel.inc include disable-exec.inc -# include disable-interpreters.inc +#include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc -#mkfile ${HOME}/.digrc - see #903 +#mkfile ${HOME}/.digrc # see #903 whitelist ${HOME}/.digrc include whitelist-common.inc include whitelist-usr-share-common.inc diff --git a/etc/profile-a-l/digikam.profile b/etc/profile-a-l/digikam.profile index 05f0dfba8..34d4081d4 100644 --- a/etc/profile-a-l/digikam.profile +++ b/etc/profile-a-l/digikam.profile @@ -37,11 +37,13 @@ protocol unix,inet,inet6,netlink # QtWebengine needs chroot to set up its own sandbox seccomp !chroot -# private-dev - prevents libdc1394 loading; this lib is used to connect to a camera device -# private-etc alternatives,ca-certificates,crypto-policies,pki,ssl +# private-dev prevents libdc1394 from loading; this lib is used to connect to a +# camera device +#private-dev +#private-etc alternatives,ca-certificates,crypto-policies,pki,ssl private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/dino.profile b/etc/profile-a-l/dino.profile index fe2b59a1e..44a3f0846 100644 --- a/etc/profile-a-l/dino.profile +++ b/etc/profile-a-l/dino.profile @@ -40,7 +40,8 @@ tracelog disable-mnt private-bin dino private-dev -# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl -- breaks server connection +# breaks server connection +#private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl private-tmp dbus-user filter diff --git a/etc/profile-a-l/discord-canary.profile b/etc/profile-a-l/discord-canary.profile index 245b07b8d..acf0281d9 100644 --- a/etc/profile-a-l/discord-canary.profile +++ b/etc/profile-a-l/discord-canary.profile @@ -9,9 +9,10 @@ noblacklist ${HOME}/.config/discordcanary mkdir ${HOME}/.config/discordcanary whitelist ${HOME}/.config/discordcanary +whitelist /opt/DiscordCanary +whitelist /opt/discord-canary -private-bin discord-canary,DiscordCanary -private-opt discord-canary,DiscordCanary +private-bin DiscordCanary,discord-canary # Redirect include discord-common.profile diff --git a/etc/profile-a-l/discord-common.profile b/etc/profile-a-l/discord-common.profile index 83fca8772..b7744a83c 100644 --- a/etc/profile-a-l/discord-common.profile +++ b/etc/profile-a-l/discord-common.profile @@ -7,15 +7,7 @@ include discord-common.local #include globals.local # Disabled until someone reported positive feedback -ignore include disable-interpreters.inc -ignore include disable-xdg.inc -ignore include whitelist-runuser-common.inc -ignore include whitelist-usr-share-common.inc ignore apparmor -ignore disable-mnt -ignore private-cache -ignore dbus-user none -ignore dbus-system none ignore noexec ${HOME} ignore novideo @@ -26,6 +18,11 @@ whitelist ${HOME}/.local/share/betterdiscordctl private-bin awk,bash,cut,echo,egrep,electron,electron[0-9],electron[0-9][0-9],fish,grep,head,sed,sh,tclsh,tr,which,xdg-mime,xdg-open,zsh private-etc @tls-ca +# allow D-Bus notifications +dbus-user filter +dbus-user.talk org.freedesktop.Notifications +ignore dbus-user none + join-or-start discord # Redirect diff --git a/etc/profile-a-l/discord-ptb.profile b/etc/profile-a-l/discord-ptb.profile index c39c0d843..82b33174c 100644 --- a/etc/profile-a-l/discord-ptb.profile +++ b/etc/profile-a-l/discord-ptb.profile @@ -1,17 +1,18 @@ -# Firejail profile for discord-ptb +# Firejail profile for discord-ptb # This file is overwritten after every install/update # Persistent local customizations -include discord-ptb.local +include discord-ptb.local # Persistent global definitions include globals.local -noblacklist ${HOME}/.config/discordptb +noblacklist ${HOME}/.config/discordptb -mkdir ${HOME}/.config/discordptb -whitelist ${HOME}/.config/discordptb +mkdir ${HOME}/.config/discordptb +whitelist ${HOME}/.config/discordptb +whitelist /opt/DiscordPTB +whitelist /opt/discord -private-bin discord-ptb,DiscordPTB -private-opt discord-ptb,DiscordPTB +private-bin DiscordPTB,discord-ptb # Redirect include discord-common.profile diff --git a/etc/profile-a-l/discord.profile b/etc/profile-a-l/discord.profile index 02d1c65cd..9776b41d5 100644 --- a/etc/profile-a-l/discord.profile +++ b/etc/profile-a-l/discord.profile @@ -9,9 +9,11 @@ noblacklist ${HOME}/.config/discord mkdir ${HOME}/.config/discord whitelist ${HOME}/.config/discord +whitelist /opt/Discord +whitelist /opt/discord +whitelist /usr/share/discord -private-bin discord,Discord -private-opt discord,Discord +private-bin Discord,discord # Redirect include discord-common.profile diff --git a/etc/profile-a-l/display.profile b/etc/profile-a-l/display.profile index bf77828be..53ed90e9c 100644 --- a/etc/profile-a-l/display.profile +++ b/etc/profile-a-l/display.profile @@ -34,13 +34,13 @@ notv nou2f protocol unix seccomp -# x11 xorg - problems on kubuntu 17.04 +#x11 xorg # problems on kubuntu 17.04 private-bin display,python* private-dev # On Debian-based systems, display is a symlink in /etc/alternatives private-etc ImageMagick-6,ImageMagick-7 -private-lib gcc/*/*/libgcc_s.so.*,gcc/*/*/libgomp.so.*,ImageMagick*,libfreetype.so.*,libltdl.so.*,libMagickWand-*.so.*,libXext.so.* +private-lib ImageMagick*,gcc/*/*/libgcc_s.so.*,gcc/*/*/libgomp.so.*,libMagickWand-*.so.*,libXext.so.*,libfreetype.so.*,libltdl.so.* private-tmp dbus-user none diff --git a/etc/profile-a-l/dnscrypt-proxy.profile b/etc/profile-a-l/dnscrypt-proxy.profile index 0d52805b7..49d201d76 100644 --- a/etc/profile-a-l/dnscrypt-proxy.profile +++ b/etc/profile-a-l/dnscrypt-proxy.profile @@ -7,7 +7,6 @@ include dnscrypt-proxy.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* noblacklist /sbin @@ -18,6 +17,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc whitelist /usr/share/dnscrypt-proxy @@ -38,7 +38,7 @@ notv nou2f novideo protocol inet,inet6 -seccomp.drop _sysctl,acct,add_key,adjtimex,clock_adjtime,delete_module,fanotify_init,finit_module,get_mempolicy,init_module,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioperm,iopl,kcmp,kexec_file_load,kexec_load,keyctl,lookup_dcookie,mbind,migrate_pages,modify_ldt,mount,move_pages,open_by_handle_at,perf_event_open,perf_event_open,pivot_root,process_vm_readv,process_vm_writev,ptrace,remap_file_pages,request_key,set_mempolicy,swapoff,swapon,sysfs,syslog,umount2,uselib,vmsplice +seccomp.drop _sysctl,acct,add_key,adjtimex,clock_adjtime,delete_module,fanotify_init,finit_module,get_mempolicy,init_module,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioperm,iopl,kcmp,kexec_file_load,kexec_load,keyctl,lookup_dcookie,mbind,migrate_pages,modify_ldt,mount,move_pages,open_by_handle_at,perf_event_open,pivot_root,process_vm_readv,process_vm_writev,ptrace,remap_file_pages,request_key,set_mempolicy,swapoff,swapon,sysfs,syslog,umount2,uselib,vmsplice tracelog disable-mnt diff --git a/etc/profile-a-l/dnsmasq.profile b/etc/profile-a-l/dnsmasq.profile index 40ccab8c7..2ce980cb1 100644 --- a/etc/profile-a-l/dnsmasq.profile +++ b/etc/profile-a-l/dnsmasq.profile @@ -11,13 +11,13 @@ noblacklist /sbin noblacklist /usr/sbin noblacklist /var/lib/libvirt -blacklist /tmp/.X11-unix blacklist ${RUNUSER} include disable-common.inc include disable-devel.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc whitelist /var/lib/libvirt/dnsmasq diff --git a/etc/profile-a-l/dolphin-emu.profile b/etc/profile-a-l/dolphin-emu.profile index 9743ebfbd..0ae09ce7e 100644 --- a/etc/profile-a-l/dolphin-emu.profile +++ b/etc/profile-a-l/dolphin-emu.profile @@ -36,7 +36,7 @@ apparmor caps.drop all ipc-namespace # Add the next line to your dolphin-emu.local if you do not need NetPlay support. -# net none +#net none netfilter # Add the next line to your dolphin-emu.local if you do not need disc support. #nodvd diff --git a/etc/profile-a-l/drawio.profile b/etc/profile-a-l/drawio.profile index 79366b8ee..c9daa939a 100644 --- a/etc/profile-a-l/drawio.profile +++ b/etc/profile-a-l/drawio.profile @@ -39,7 +39,7 @@ nou2f novideo protocol unix seccomp !chroot -# tracelog - breaks on Arch +#tracelog # breaks on Arch private-bin drawio private-cache @@ -50,5 +50,5 @@ private-tmp dbus-user none dbus-system none -# memory-deny-write-execute - breaks on Arch -# restrict-namespaces +#memory-deny-write-execute # breaks on Arch +#restrict-namespaces diff --git a/etc/profile-a-l/drill.profile b/etc/profile-a-l/drill.profile index bd6fb6dcc..2205f52a0 100644 --- a/etc/profile-a-l/drill.profile +++ b/etc/profile-a-l/drill.profile @@ -9,17 +9,17 @@ include globals.local noblacklist ${PATH}/drill -blacklist /tmp/.X11-unix blacklist ${RUNUSER} include disable-common.inc -# include disable-devel.inc +#include disable-devel.inc include disable-exec.inc -# include disable-interpreters.inc +#include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-a-l/dropbox.profile b/etc/profile-a-l/dropbox.profile index 4fdf1bbfe..3094495d6 100644 --- a/etc/profile-a-l/dropbox.profile +++ b/etc/profile-a-l/dropbox.profile @@ -5,7 +5,12 @@ include dropbox.local # Persistent global definitions include globals.local -noblacklist ${HOME}/.config/autostart +# To allow the program to autostart, add the following to dropbox.local: +# Warning: This allows the program to easily escape the sandbox. +#noblacklist ${HOME}/.config/autostart +#mkfile ${HOME}/.config/autostart/dropbox.desktop +#whitelist ${HOME}/.config/autostart/dropbox.desktop + noblacklist ${HOME}/.dropbox noblacklist ${HOME}/.dropbox-dist @@ -20,8 +25,6 @@ include disable-programs.inc mkdir ${HOME}/.dropbox mkdir ${HOME}/.dropbox-dist mkdir ${HOME}/Dropbox -mkfile ${HOME}/.config/autostart/dropbox.desktop -whitelist ${HOME}/.config/autostart/dropbox.desktop whitelist ${HOME}/.dropbox whitelist ${HOME}/.dropbox-dist whitelist ${HOME}/Dropbox diff --git a/etc/profile-a-l/dtui.profile b/etc/profile-a-l/dtui.profile new file mode 100644 index 000000000..b85ae451b --- /dev/null +++ b/etc/profile-a-l/dtui.profile @@ -0,0 +1,15 @@ +# Firejail profile for dtui +# Description: TUI D-Bus debugger +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include dtui.local +# Persistent global definitions +include globals.local + +private-bin dtui + +memory-deny-write-execute + +# Redirect +include dbus-debug-common.profile diff --git a/etc/profile-a-l/easystroke.profile b/etc/profile-a-l/easystroke.profile index 40fd8be7c..3fd5578e6 100644 --- a/etc/profile-a-l/easystroke.profile +++ b/etc/profile-a-l/easystroke.profile @@ -49,8 +49,8 @@ private-etc #private-lib gdk-pixbuf-2.*,gio,gvfs/libgvfscommon.so,libgconf-2.so.*,librsvg-2.so.* private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-a-l/editorconfiger.profile b/etc/profile-a-l/editorconfiger.profile new file mode 100644 index 000000000..654d65ee0 --- /dev/null +++ b/etc/profile-a-l/editorconfiger.profile @@ -0,0 +1,56 @@ +# Firejail profile for editorconfiger +# Description: Plain tool to validate and compare .editorconfig files +# This file is overwritten after every install/update +# Persistent local customizations +include editorconfiger.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} +blacklist /usr/libexec + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-x11.inc +include disable-xdg.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +net none +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +seccomp socket +seccomp.block-secondary +tracelog +x11 none + +#disable-mnt +private-bin editorconfiger +private-cache +private-dev +private-etc .editorconfig +private-lib +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +restrict-namespaces diff --git a/etc/profile-a-l/electron-cash.profile b/etc/profile-a-l/electron-cash.profile new file mode 100644 index 000000000..dc60fcac0 --- /dev/null +++ b/etc/profile-a-l/electron-cash.profile @@ -0,0 +1,54 @@ +# Firejail profile for electron-cash +# Description: Lightweight Bitcoin Cash wallet +# This file is overwritten after every install/update +# Persistent local customizations +include electron-cash.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.electron-cash + +# Allow python (blacklisted by disable-interpreters.inc) +include allow-python3.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.electron-cash +whitelist ${HOME}/.electron-cash +include whitelist-common.inc +include whitelist-var-common.inc + +caps.drop all +ipc-namespace +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noroot +nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp + +disable-mnt +private-bin electron-cash,python* +private-cache +?HAS_APPIMAGE: ignore private-dev +private-dev +private-etc @network,@tls-ca,@x11 +private-tmp + +# dbus-user none +# dbus-system none + +restrict-namespaces diff --git a/etc/profile-a-l/electron-mail.profile b/etc/profile-a-l/electron-mail.profile index 766fe523b..603ea4e2f 100644 --- a/etc/profile-a-l/electron-mail.profile +++ b/etc/profile-a-l/electron-mail.profile @@ -18,6 +18,7 @@ include disable-shell.inc mkdir ${HOME}/.config/electron-mail whitelist ${HOME}/.config/electron-mail +whitelist /opt/ElectronMail # The lines below are needed to find the default Firefox profile name, to allow # opening links in an existing instance of Firefox (note that it still fails if @@ -29,13 +30,12 @@ machine-id nosound private-etc @tls-ca,@x11 -private-opt ElectronMail dbus-user filter dbus-user.talk org.freedesktop.Notifications dbus-user.talk org.freedesktop.secrets dbus-user.talk org.gnome.keyring.SystemPrompter -# allow D-Bus communication with firefox for opening links +# Allow D-Bus communication with Firefox for opening links dbus-user.talk org.mozilla.* # Redirect diff --git a/etc/profile-a-l/electrum.profile b/etc/profile-a-l/electrum.profile index 48ce0aa22..d73ed9092 100644 --- a/etc/profile-a-l/electrum.profile +++ b/etc/profile-a-l/electrum.profile @@ -49,7 +49,7 @@ private-dev private-etc @tls-ca,@x11 private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/element-desktop.profile b/etc/profile-a-l/element-desktop.profile index 7b4994a85..52a439c48 100644 --- a/etc/profile-a-l/element-desktop.profile +++ b/etc/profile-a-l/element-desktop.profile @@ -14,8 +14,7 @@ noblacklist ${HOME}/.config/Element mkdir ${HOME}/.config/Element whitelist ${HOME}/.config/Element whitelist /opt/Element - -private-opt Element +whitelist /usr/share/element dbus-user filter dbus-user.talk org.freedesktop.Notifications diff --git a/etc/profile-a-l/email-common.profile b/etc/profile-a-l/email-common.profile index 8eee662ad..eccd64c95 100644 --- a/etc/profile-a-l/email-common.profile +++ b/etc/profile-a-l/email-common.profile @@ -10,11 +10,11 @@ include email-common.local noblacklist ${HOME}/.bogofilter noblacklist ${HOME}/.bsfilter noblacklist ${HOME}/.gnupg -noblacklist ${HOME}/.mozilla noblacklist ${HOME}/.signature # when storing mail outside the default ${HOME}/Mail path, 'noblacklist' the custom path in your email-common.local # and 'blacklist' it in your disable-common.local too so it is kept hidden from other applications noblacklist ${HOME}/Mail +noblacklist /etc/clamav noblacklist /var/lib/clamav noblacklist /var/mail noblacklist /var/spool/mail @@ -31,6 +31,12 @@ include disable-interpreters.inc include disable-programs.inc include disable-xdg.inc +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) +noblacklist ${HOME}/.mozilla +whitelist ${HOME}/.mozilla/firefox/profiles.ini + mkdir ${HOME}/.gnupg mkfile ${HOME}/.config/mimeapps.list mkfile ${HOME}/.signature @@ -38,7 +44,6 @@ whitelist ${HOME}/.bogofilter whitelist ${HOME}/.bsfilter whitelist ${HOME}/.config/mimeapps.list whitelist ${HOME}/.gnupg -whitelist ${HOME}/.mozilla/firefox/profiles.ini whitelist ${HOME}/.signature whitelist ${DOCUMENTS} whitelist ${DOWNLOADS} @@ -48,7 +53,7 @@ whitelist ${RUNUSER}/gnupg whitelist /usr/share/bogofilter whitelist /usr/share/gnupg whitelist /usr/share/gnupg2 -whitelist /var/lib/clamav +whitelist /var/lib/clamav whitelist /var/mail whitelist /var/spool/mail include whitelist-common.inc @@ -75,10 +80,10 @@ seccomp seccomp.block-secondary tracelog -# disable-mnt +#disable-mnt private-cache private-dev -private-etc @tls-ca,@x11,bogofilter,bogofilter.cf,gnupg,hosts.conf,mailname,timezone +private-etc @tls-ca,@x11,bogofilter,bogofilter.cf,clamav,gnupg,hosts.conf,mailname,timezone private-tmp # encrypting and signing email writable-run-user @@ -90,6 +95,7 @@ dbus-user.talk org.freedesktop.Notifications dbus-user.talk org.freedesktop.secrets dbus-user.talk org.gnome.keyring.* dbus-user.talk org.gnome.seahorse.* +# Allow D-Bus communication with Firefox for opening links dbus-user.talk org.mozilla.* dbus-system none diff --git a/etc/profile-a-l/enchant-2.profile b/etc/profile-a-l/enchant-2.profile index 32cc0e691..c87dbd948 100644 --- a/etc/profile-a-l/enchant-2.profile +++ b/etc/profile-a-l/enchant-2.profile @@ -1,5 +1,6 @@ # Firejail profile for enchant-2 # This file is overwritten after every install/update +quiet # Persistent local customizations include enchant-2.local # Persistent global definitions diff --git a/etc/profile-a-l/enchant-lsmod-2.profile b/etc/profile-a-l/enchant-lsmod-2.profile index a7199955e..3fe9e94c0 100644 --- a/etc/profile-a-l/enchant-lsmod-2.profile +++ b/etc/profile-a-l/enchant-lsmod-2.profile @@ -7,4 +7,4 @@ include enchant-lsmod-2.local #include globals.local # Redirect -include enchant.profile +include enchant-2.profile diff --git a/etc/profile-a-l/engrampa.profile b/etc/profile-a-l/engrampa.profile index e1d107dc7..24e4f8a0e 100644 --- a/etc/profile-a-l/engrampa.profile +++ b/etc/profile-a-l/engrampa.profile @@ -35,9 +35,9 @@ seccomp seccomp.block-secondary tracelog -# private-bin engrampa +#private-bin engrampa private-dev -# private-tmp +#private-tmp dbus-user filter dbus-user.talk ca.desrt.dconf diff --git a/etc/profile-a-l/enpass.profile b/etc/profile-a-l/enpass.profile index 45a1125b4..62e9d42ac 100644 --- a/etc/profile-a-l/enpass.profile +++ b/etc/profile-a-l/enpass.profile @@ -52,11 +52,11 @@ protocol unix,inet,inet6,netlink seccomp tracelog -private-bin dirname,Enpass,importer_enpass,readlink,sh +private-bin Enpass,dirname,importer_enpass,readlink,sh ?HAS_APPIMAGE: ignore private-dev private-dev private-opt Enpass private-tmp -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-a-l/ephemeral.profile b/etc/profile-a-l/ephemeral.profile index 8b32d08b1..795128418 100644 --- a/etc/profile-a-l/ephemeral.profile +++ b/etc/profile-a-l/ephemeral.profile @@ -59,7 +59,7 @@ private-cache private-tmp # breaks preferences -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/equalx.profile b/etc/profile-a-l/equalx.profile index 8cbdccbb5..373a2f4ec 100644 --- a/etc/profile-a-l/equalx.profile +++ b/etc/profile-a-l/equalx.profile @@ -23,7 +23,6 @@ whitelist ${HOME}/.config/equalx whitelist ${HOME}/.equalx whitelist /usr/share/poppler whitelist /usr/share/ghostscript -whitelist /usr/share/texlive whitelist /usr/share/equalx whitelist /var/lib/texmf include whitelist-common.inc diff --git a/etc/profile-a-l/erd.profile b/etc/profile-a-l/erd.profile new file mode 100644 index 000000000..e72b75e75 --- /dev/null +++ b/etc/profile-a-l/erd.profile @@ -0,0 +1,43 @@ +# Firejail profile for erd +# Description: Multi-threaded file-tree visualizer and disk usage analyzer +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include erd.local +# Persistent global definitions +include globals.local + +include disable-exec.inc +#include disable-x11.inc # x11 none + +apparmor +caps.drop all +ipc-namespace +machine-id +net none +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +seccomp socket +seccomp.block-secondary +x11 none + +# private-bin erd does work but defeats the purpose of this app +#private-bin erd +private-dev + +dbus-user none +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +read-only ${RUNUSER} +restrict-namespaces diff --git a/etc/profile-a-l/etr-wrapper.profile b/etc/profile-a-l/etr-wrapper.profile index 98f949918..66dcb3af1 100644 --- a/etc/profile-a-l/etr-wrapper.profile +++ b/etc/profile-a-l/etr-wrapper.profile @@ -6,6 +6,7 @@ include etr-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin etr-wrapper diff --git a/etc/profile-a-l/etr.profile b/etc/profile-a-l/etr.profile index 5b9892af3..4789afee6 100644 --- a/etc/profile-a-l/etr.profile +++ b/etc/profile-a-l/etr.profile @@ -48,7 +48,7 @@ disable-mnt private-bin etr private-cache private-dev -# private-etc alternatives,drirc,machine-id,openal,passwd +#private-etc alternatives,drirc,machine-id,openal,passwd private-etc @games,@x11 private-tmp diff --git a/etc/profile-a-l/evince.profile b/etc/profile-a-l/evince.profile index 75a3958ad..06a4a64b1 100644 --- a/etc/profile-a-l/evince.profile +++ b/etc/profile-a-l/evince.profile @@ -34,7 +34,7 @@ include whitelist-var-common.inc caps.drop all machine-id -# net none - breaks AppArmor on Ubuntu systems +#net none # breaks AppArmor on Ubuntu systems netfilter no3d nodvd diff --git a/etc/profile-a-l/evolution.profile b/etc/profile-a-l/evolution.profile index 517bb6206..e703938eb 100644 --- a/etc/profile-a-l/evolution.profile +++ b/etc/profile-a-l/evolution.profile @@ -6,6 +6,7 @@ include evolution.local # Persistent global definitions include globals.local +noblacklist /tmp/evolution-* noblacklist /var/mail noblacklist /var/spool/mail noblacklist ${HOME}/.bogofilter @@ -41,7 +42,7 @@ protocol unix,inet,inet6 seccomp private-dev -private-tmp +#private-tmp writable-var restrict-namespaces diff --git a/etc/profile-a-l/falkon.profile b/etc/profile-a-l/falkon.profile index d805766eb..2a30d2e23 100644 --- a/etc/profile-a-l/falkon.profile +++ b/etc/profile-a-l/falkon.profile @@ -41,17 +41,17 @@ nou2f protocol unix,inet,inet6,netlink # blacklisting of chroot system calls breaks falkon seccomp !chroot -# tracelog +#tracelog disable-mnt -# private-bin falkon +#private-bin falkon private-cache private-dev private-etc @tls-ca,@x11,adobe,mailcap,mime.types private-tmp -# dbus-user filter -# dbus-user.own org.kde.Falkon +#dbus-user filter +#dbus-user.own org.kde.Falkon dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/fbreader.profile b/etc/profile-a-l/fbreader.profile index 434371aee..5906085de 100644 --- a/etc/profile-a-l/fbreader.profile +++ b/etc/profile-a-l/fbreader.profile @@ -33,7 +33,7 @@ novideo protocol unix,inet,inet6 seccomp -private-bin fbreader,FBReader +private-bin FBReader,fbreader private-dev private-tmp diff --git a/etc/profile-a-l/fdns.profile b/etc/profile-a-l/fdns.profile index 4dbf3c194..2d956f5a4 100644 --- a/etc/profile-a-l/fdns.profile +++ b/etc/profile-a-l/fdns.profile @@ -8,7 +8,6 @@ include globals.local noblacklist /sbin noblacklist /usr/sbin -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc @@ -16,6 +15,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc #include whitelist-usr-share-common.inc @@ -24,7 +24,7 @@ include disable-xdg.inc apparmor /usr/bin/fdns caps.keep kill,net_bind_service,setgid,setuid,sys_admin,sys_chroot ipc-namespace -# netfilter /etc/firejail/webserver.net +#netfilter /etc/firejail/webserver.net no3d nodvd nogroups @@ -36,7 +36,6 @@ nou2f novideo protocol unix,inet,inet6,netlink #seccomp -#shell none disable-mnt private @@ -44,7 +43,7 @@ private-bin bash,fdns,sh private-cache #private-dev private-etc @tls-ca,fdns -# private-lib +#private-lib private-tmp memory-deny-write-execute diff --git a/etc/profile-a-l/feedreader.profile b/etc/profile-a-l/feedreader.profile index 6aa24cc86..7b205a917 100644 --- a/etc/profile-a-l/feedreader.profile +++ b/etc/profile-a-l/feedreader.profile @@ -29,13 +29,13 @@ include whitelist-var-common.inc caps.drop all netfilter -# no3d +#no3d nodvd nogroups noinput nonewprivs noroot -# nosound +#nosound notv nou2f novideo diff --git a/etc/profile-a-l/ferdi.profile b/etc/profile-a-l/ferdi.profile index 3a044542f..27920620a 100644 --- a/etc/profile-a-l/ferdi.profile +++ b/etc/profile-a-l/ferdi.profile @@ -45,4 +45,4 @@ disable-mnt private-dev private-tmp -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/ffmpeg.profile b/etc/profile-a-l/ffmpeg.profile index b7d54f05d..895a7dbfb 100644 --- a/etc/profile-a-l/ffmpeg.profile +++ b/etc/profile-a-l/ffmpeg.profile @@ -9,6 +9,7 @@ include globals.local noblacklist ${MUSIC} noblacklist ${VIDEOS} +noblacklist ${HOME}/.dvdcss include disable-common.inc include disable-devel.inc @@ -53,5 +54,5 @@ private-tmp dbus-user none dbus-system none -# memory-deny-write-execute - it breaks old versions of ffmpeg +#memory-deny-write-execute # it breaks old versions of ffmpeg restrict-namespaces diff --git a/etc/profile-a-l/file-roller.profile b/etc/profile-a-l/file-roller.profile index 78e2751b3..cc1a290ef 100644 --- a/etc/profile-a-l/file-roller.profile +++ b/etc/profile-a-l/file-roller.profile @@ -6,6 +6,8 @@ include file-roller.local # Persistent global definitions include globals.local +noblacklist ${PATH}/dpkg* + include disable-common.inc include disable-devel.inc include disable-exec.inc @@ -22,7 +24,7 @@ include whitelist-var-common.inc apparmor caps.drop all machine-id -# net none - breaks on older Ubuntu versions +#net none # breaks on older Ubuntu versions netfilter no3d nodvd @@ -40,11 +42,11 @@ seccomp seccomp.block-secondary tracelog -private-bin 7z,7za,7zr,ar,arj,atool,bash,brotli,bsdtar,bzip2,compress,cp,cpio,dpkg-deb,file-roller,gtar,gzip,isoinfo,lha,lrzip,lsar,lz4,lzip,lzma,lzop,mv,p7zip,rar,rm,rzip,sh,tar,unace,unalz,unar,uncompress,unrar,unsquashfs,unstuff,unzip,unzstd,xz,xzdec,zip,zoo,zstd +private-bin 7z,7za,7zr,ar,arj,atool,bash,brotli,bsdtar,bzip2,compress,cp,cpio,dpkg*,file-roller,gtar,gzip,isoinfo,lha,lrzip,lsar,lz4,lzip,lzma,lzop,mv,p7zip,rar,rm,rzip,sh,tar,unace,unalz,unar,uncompress,unrar,unsquashfs,unstuff,unzip,unzstd,xz,xzdec,zip,zoo,zstd private-cache private-dev private-etc @x11 -# private-tmp +#private-tmp dbus-user filter dbus-user.own org.gnome.ArchiveManager1 diff --git a/etc/profile-a-l/firedragon.profile b/etc/profile-a-l/firedragon.profile index 77487161e..3177fb989 100644 --- a/etc/profile-a-l/firedragon.profile +++ b/etc/profile-a-l/firedragon.profile @@ -13,6 +13,7 @@ mkdir ${HOME}/.cache/firedragon mkdir ${HOME}/.firedragon whitelist ${HOME}/.cache/firedragon whitelist ${HOME}/.firedragon +whitelist /usr/share/firedragon # Add the next lines to your firedragon.local if you want to use the migration wizard. #noblacklist ${HOME}/.mozilla diff --git a/etc/profile-a-l/firefox-common-addons.profile b/etc/profile-a-l/firefox-common-addons.profile index 6dc1fca8a..2774c12b2 100644 --- a/etc/profile-a-l/firefox-common-addons.profile +++ b/etc/profile-a-l/firefox-common-addons.profile @@ -4,6 +4,7 @@ include firefox-common-addons.local # Prevent whitelisting in ${RUNUSER} ignore whitelist ${RUNUSER}/*firefox* +ignore whitelist ${RUNUSER}/app/org.keepassxc.KeePassXC ignore whitelist ${RUNUSER}/psd/*firefox* ignore whitelist ${RUNUSER}/kpxc_server ignore whitelist ${RUNUSER}/org.keepassxc.KeePassXC.BrowserServer @@ -11,6 +12,7 @@ ignore include whitelist-runuser-common.inc ignore private-cache +noblacklist ${HOME}/.cache/mpv noblacklist ${HOME}/.cache/youtube-dl noblacklist ${HOME}/.config/kgetrc noblacklist ${HOME}/.config/mpv @@ -32,9 +34,14 @@ noblacklist ${HOME}/.local/share/kget noblacklist ${HOME}/.local/share/kxmlgui5/okular noblacklist ${HOME}/.local/share/okular noblacklist ${HOME}/.local/share/qpdfview +noblacklist ${HOME}/.local/state/mpv noblacklist ${HOME}/.netrc +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + whitelist ${HOME}/.cache/gnome-mplayer/plugin +whitelist ${HOME}/.cache/mpv whitelist ${HOME}/.cache/youtube-dl/youtube-sigfuncs whitelist ${HOME}/.config/gnome-mplayer whitelist ${HOME}/.config/kgetrc @@ -62,6 +69,7 @@ whitelist ${HOME}/.local/share/kxmlgui5/okular whitelist ${HOME}/.local/share/okular whitelist ${HOME}/.local/share/qpdfview whitelist ${HOME}/.local/share/tridactyl +whitelist ${HOME}/.local/state/mpv whitelist ${HOME}/.netrc whitelist ${HOME}/.pentadactyl whitelist ${HOME}/.pentadactylrc @@ -72,11 +80,10 @@ whitelist ${HOME}/.wine-pipelight whitelist ${HOME}/.wine-pipelight64 whitelist ${HOME}/.zotero whitelist ${HOME}/dwhelper -whitelist /usr/share/lua whitelist /usr/share/lua* -whitelist /usr/share/vulkan +whitelist /usr/share/mpv -# GNOME Shell integration (chrome-gnome-shell) needs dbus and python +# GNOME Shell integration (chrome-gnome-shell) needs dbus and python. noblacklist ${HOME}/.local/share/gnome-shell whitelist ${HOME}/.local/share/gnome-shell dbus-user.talk ca.desrt.dconf @@ -89,8 +96,7 @@ include allow-python3.inc #private-bin keepassxc-proxy # Flash plugin -# private-etc must first be enabled in firefox-common.profile and in profiles including it. -#private-etc adobe +private-etc adobe # ff2mpv #ignore noexec ${HOME} diff --git a/etc/profile-a-l/firefox-common.profile b/etc/profile-a-l/firefox-common.profile index 42d12c5d9..953012954 100644 --- a/etc/profile-a-l/firefox-common.profile +++ b/etc/profile-a-l/firefox-common.profile @@ -11,12 +11,31 @@ include firefox-common.local # noexec ${RUNUSER} breaks DRM binaries when using profile-sync-daemon. ?BROWSER_ALLOW_DRM: ignore noexec ${RUNUSER} -# Add the next line to your firefox-common.local to allow access to common programs/addons/plugins. +# Add the next lines to firefox-common.local if you want to use the migration +# wizard. +#noblacklist ${HOME}/.mozilla +#whitelist ${HOME}/.mozilla + +# To enable support for the KeePassXC extension, add the following lines to +# firefox-common.local. +# Note: Start KeePassXC before the web browser and keep it open to allow +# communication between them. +#noblacklist ${RUNUSER}/app +#whitelist ${RUNUSER}/app/org.keepassxc.KeePassXC +#whitelist ${RUNUSER}/kpxc_server +#whitelist ${RUNUSER}/org.keepassxc.KeePassXC.BrowserServer + +# Add the next line to firefox-common.local to allow access to common +# programs/addons/plugins. #include firefox-common-addons.profile noblacklist ${HOME}/.local/share/pki noblacklist ${HOME}/.pki +blacklist ${PATH}/curl +blacklist ${PATH}/wget +blacklist ${PATH}/wget2 + include disable-common.inc include disable-devel.inc include disable-exec.inc @@ -29,45 +48,70 @@ mkdir ${HOME}/.pki whitelist ${DOWNLOADS} whitelist ${HOME}/.local/share/pki whitelist ${HOME}/.pki +whitelist /usr/share/doc +whitelist /usr/share/gtk-doc/html +whitelist /usr/share/mozilla +whitelist /usr/share/webext include whitelist-common.inc include whitelist-run-common.inc include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc include whitelist-var-common.inc apparmor # Fixme! apparmor-replace caps.drop all -# machine-id breaks pulse audio; add it to your firefox-common.local if sound is not required. +# Note: machine-id breaks pulseaudio; add it to firefox-common.local if sound +# is not required. #machine-id netfilter nodvd nogroups noinput nonewprivs -# noroot breaks GTK_USE_PORTAL=1 usage, see https://github.com/netblue30/firejail/issues/2506. +# Note: noroot breaks GTK_USE_PORTAL=1 usage; see +# https://github.com/netblue30/firejail/issues/2506. noroot notv ?BROWSER_DISABLE_U2F: nou2f protocol unix,inet,inet6,netlink -# The below seccomp configuration still permits chroot syscall. See https://github.com/netblue30/firejail/issues/2506 for possible workarounds. +# Note: The seccomp line below still permits the chroot syscall; see +# https://github.com/netblue30/firejail/issues/2506 for possible workarounds. seccomp !chroot -# Disable tracelog, it breaks or causes major issues with many firefox based browsers, see https://github.com/netblue30/firejail/issues/1930. +# Note: tracelog may break or cause major issues with many Firefox-based +# browsers; see https://github.com/netblue30/firejail/issues/1930. #tracelog disable-mnt ?BROWSER_DISABLE_U2F: private-dev -# private-etc below works fine on most distributions. There could be some problems on CentOS. +# Note: The private-etc line below works fine on most distributions but it +# could cause problems on CentOS. private-etc @tls-ca,@x11,mailcap,mime.types,os-release private-tmp -blacklist ${PATH}/curl -blacklist ${PATH}/wget -blacklist ${PATH}/wget2 - -# 'dbus-user none' breaks various desktop integration features like global menus, native notifications, -# Gnome connector, KDE connect and power management on KDE Plasma. +# Note: `dbus-user none` breaks various desktop integration features like +# global menus, native notifications, Gnome connector, KDE Connect and power +# management on KDE Plasma. dbus-user none dbus-system none +# Allow drag and drop +dbus-user.talk org.freedesktop.portal.Documents +# Add the next line to firefox-common.local to enable native notifications. +#dbus-user.talk org.freedesktop.Notifications +# Add the next line to firefox-common.local to allow inhibiting screensavers. +#dbus-user.talk org.freedesktop.ScreenSaver +# Add the next lines to firefox-common.local for plasma browser integration. +#dbus-user.own org.mpris.MediaPlayer2.plasma-browser-integration +#dbus-user.talk org.kde.JobViewServer +#dbus-user.talk org.kde.kdeconnect +#dbus-user.talk org.kde.kuiserver +# Add the next line to firefox-common.local to allow screensharing under +# Wayland. +#dbus-user.talk org.freedesktop.portal.Desktop +# Also add the next line to firefox-common.local if screensharing does not work +# with the above lines (depends on the portal implementation). +#ignore noroot + #restrict-namespaces diff --git a/etc/profile-a-l/firefox-esr.profile b/etc/profile-a-l/firefox-esr.profile index 5e69fdb51..05fe0c344 100644 --- a/etc/profile-a-l/firefox-esr.profile +++ b/etc/profile-a-l/firefox-esr.profile @@ -8,5 +8,7 @@ include firefox-esr.local whitelist /usr/share/firefox-esr +private-etc firefox-esr + # Redirect include firefox.profile diff --git a/etc/profile-a-l/firefox.profile b/etc/profile-a-l/firefox.profile index 1fcbf0562..92b7eb1c7 100644 --- a/etc/profile-a-l/firefox.profile +++ b/etc/profile-a-l/firefox.profile @@ -6,10 +6,10 @@ include firefox.local # Persistent global definitions include globals.local -# NOTE: sandboxing web browsers is as important as it is complex. Users might be -# interested in creating custom profiles depending on use case (e.g. one for -# general browsing, another for banking, ...). Consult our FAQ/issue tracker for more -# info. Here are a few links to get you going. +# Note: Sandboxing web browsers is as important as it is complex. Users might +# be interested in creating custom profiles depending on the use case (e.g. one +# for general browsing, another for banking, ...). Consult our FAQ/issue +# tracker for more information. Here are a few links to get you going: # https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions#firefox-doesnt-open-in-a-new-sandbox-instead-it-opens-a-new-tab-in-an-existing-firefox-instance # https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions#how-do-i-run-two-instances-of-firefox # https://github.com/netblue30/firejail/issues/4206#issuecomment-824806968 @@ -29,43 +29,20 @@ mkdir ${HOME}/.mozilla whitelist ${HOME}/.cache/mozilla/firefox whitelist ${HOME}/.mozilla -# Add one of the following whitelist options to your firefox.local to enable KeePassXC Plugin support. -# NOTE: start KeePassXC before Firefox and keep it open to allow communication between them. -#whitelist ${RUNUSER}/kpxc_server -#whitelist ${RUNUSER}/org.keepassxc.KeePassXC.BrowserServer - -whitelist /usr/share/doc whitelist /usr/share/firefox whitelist /usr/share/gnome-shell/search-providers/firefox-search-provider.ini -whitelist /usr/share/gtk-doc/html -whitelist /usr/share/mozilla -whitelist /usr/share/webext whitelist ${RUNUSER}/*firefox* whitelist ${RUNUSER}/psd/*firefox* -include whitelist-usr-share-common.inc -# firefox requires a shell to launch on Arch - add the next line to your firefox.local to enable private-bin. +# Note: Firefox requires a shell to launch on Arch and Fedora. +# Add the next lines to firefox.local to enable private-bin. #private-bin bash,dbus-launch,dbus-send,env,firefox,sh,which -# Fedora uses shell scripts to launch firefox - add the next line to your firefox.local to enable private-bin. #private-bin basename,bash,cat,dirname,expr,false,firefox,firefox-wayland,getenforce,ln,mkdir,pidof,restorecon,rm,rmdir,sed,sh,tclsh,true,uname private-etc firefox dbus-user filter dbus-user.own org.mozilla.* dbus-user.own org.mpris.MediaPlayer2.firefox.* -# Add the next line to your firefox.local to enable native notifications. -#dbus-user.talk org.freedesktop.Notifications -# Add the next line to your firefox.local to allow inhibiting screensavers. -#dbus-user.talk org.freedesktop.ScreenSaver -# Add the next lines to your firefox.local for plasma browser integration. -#dbus-user.own org.mpris.MediaPlayer2.plasma-browser-integration -#dbus-user.talk org.kde.JobViewServer -#dbus-user.talk org.kde.kuiserver -# Add the next line to your firefox.local to allow screen sharing under wayland. -#dbus-user.talk org.freedesktop.portal.Desktop -# Add the next line to your firefox.local if screen sharing sharing still does not work -# with the above lines (might depend on the portal implementation). -#ignore noroot ignore dbus-user none # Redirect diff --git a/etc/profile-a-l/floorp.profile b/etc/profile-a-l/floorp.profile new file mode 100644 index 000000000..8a5932876 --- /dev/null +++ b/etc/profile-a-l/floorp.profile @@ -0,0 +1,23 @@ +# Firejail profile for floorp +# Description: A customisable Firefox fork with excellent privacy protection +# This file is overwritten after every install/update +# Persistent local customizations +include floorp.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.cache/floorp +noblacklist ${HOME}/.floorp + +mkdir ${HOME}/.cache/floorp +mkdir ${HOME}/.floorp +whitelist ${HOME}/.cache/floorp +whitelist ${HOME}/.floorp + +dbus-user filter +dbus-user.own org.mozilla.floorp.* +ignore apparmor +ignore dbus-user none + +# Redirect +include firefox-common.profile diff --git a/etc/profile-a-l/fluffychat.profile b/etc/profile-a-l/fluffychat.profile new file mode 100644 index 000000000..e1b13edad --- /dev/null +++ b/etc/profile-a-l/fluffychat.profile @@ -0,0 +1,72 @@ +# Firejail profile for fluffychat +# Description: Easy to use matrix messenger +# This file is overwritten after every install/update +# Persistent local customizations +include fluffychat.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.local/share/fluffychat + +# Allow /bin/sh (blacklisted by disable-shell.inc) +include allow-bin-sh.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) +noblacklist ${HOME}/.mozilla +whitelist ${HOME}/.mozilla/firefox/profiles.ini + +mkdir ${HOME}/.local/share/fluffychat +whitelist ${DOWNLOADS} +whitelist ${HOME}/.local/share/fluffychat +whitelist /opt/fluffychat +whitelist /usr/share/fluffychat +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-bin firefox,fluffychat,sh,which,zenity +private-cache +private-dev +private-etc X11,alsa,alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,gconf,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,xdg +private-tmp + +dbus-user filter +dbus-user.talk org.freedesktop.secrets +# Allow D-Bus communication with Firefox for opening links +dbus-user.talk org.mozilla.* +dbus-system filter +dbus-system.talk org.freedesktop.NetworkManager + +restrict-namespaces diff --git a/etc/profile-a-l/font-manager.profile b/etc/profile-a-l/font-manager.profile index 88ae56c82..5b9603243 100644 --- a/etc/profile-a-l/font-manager.profile +++ b/etc/profile-a-l/font-manager.profile @@ -33,7 +33,7 @@ include whitelist-var-common.inc apparmor caps.drop all machine-id -# net none - issues on older versions +#net none # issues on older versions no3d nodvd nogroups @@ -53,5 +53,5 @@ private-bin font-manager,python*,yelp private-dev private-tmp -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-a-l/fractal.profile b/etc/profile-a-l/fractal.profile index fe0bc8756..8ec1f3665 100644 --- a/etc/profile-a-l/fractal.profile +++ b/etc/profile-a-l/fractal.profile @@ -7,6 +7,7 @@ include fractal.local include globals.local noblacklist ${HOME}/.cache/fractal +noblacklist ${HOME}/.local/share/fractal # Allow python (blacklisted by disable-interpreters.inc) include allow-python2.inc @@ -21,8 +22,11 @@ include disable-shell.inc include disable-xdg.inc mkdir ${HOME}/.cache/fractal +mkdir ${HOME}/.local/share/fractal whitelist ${HOME}/.cache/fractal +whitelist ${HOME}/.local/share/fractal whitelist ${DOWNLOADS} +whitelist /usr/share/fractal include whitelist-common.inc include whitelist-runuser-common.inc include whitelist-usr-share-common.inc diff --git a/etc/profile-a-l/franz.profile b/etc/profile-a-l/franz.profile index e21789d73..664773b77 100644 --- a/etc/profile-a-l/franz.profile +++ b/etc/profile-a-l/franz.profile @@ -45,4 +45,4 @@ disable-mnt private-dev private-tmp -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/freemind.profile b/etc/profile-a-l/freemind.profile index 9bf5a14be..80958d305 100644 --- a/etc/profile-a-l/freemind.profile +++ b/etc/profile-a-l/freemind.profile @@ -9,6 +9,8 @@ include globals.local noblacklist ${DOCUMENTS} noblacklist ${HOME}/.freemind +noblacklist ${PATH}/dpkg* + # Allow java (blacklisted by disable-devel.inc) include allow-java.inc @@ -40,7 +42,7 @@ seccomp tracelog disable-mnt -private-bin bash,cp,dirname,dpkg,echo,freemind,grep,java,lsb_release,mkdir,readlink,rpm,sed,sh,uname,which +private-bin bash,cp,dirname,dpkg*,echo,freemind,grep,java,lsb_release,mkdir,readlink,rpm,sed,sh,uname,which private-cache private-dev #private-etc alternatives,fonts,java* diff --git a/etc/profile-a-l/freshclam.profile b/etc/profile-a-l/freshclam.profile index 133d66f0d..f59094567 100644 --- a/etc/profile-a-l/freshclam.profile +++ b/etc/profile-a-l/freshclam.profile @@ -2,7 +2,7 @@ # This file is overwritten after every install/update quiet # Persistent local customizations -include clamav.local +include freshclam.local # Persistent global definitions include globals.local diff --git a/etc/profile-a-l/frozen-bubble.profile b/etc/profile-a-l/frozen-bubble.profile index f162a4a31..98f473654 100644 --- a/etc/profile-a-l/frozen-bubble.profile +++ b/etc/profile-a-l/frozen-bubble.profile @@ -41,7 +41,7 @@ seccomp tracelog disable-mnt -# private-bin frozen-bubble +#private-bin frozen-bubble private-dev private-etc @games,@x11 private-tmp diff --git a/etc/profile-a-l/ftp.profile b/etc/profile-a-l/ftp.profile index f448ab932..e133deba2 100644 --- a/etc/profile-a-l/ftp.profile +++ b/etc/profile-a-l/ftp.profile @@ -17,7 +17,7 @@ include disable-proc.inc include disable-programs.inc #include disable-shell.inc include disable-write-mnt.inc -include disable-X11.inc +include disable-x11.inc include disable-xdg.inc apparmor diff --git a/etc/profile-a-l/funnyboat.profile b/etc/profile-a-l/funnyboat.profile index 8ca349d1c..bd790cab4 100644 --- a/etc/profile-a-l/funnyboat.profile +++ b/etc/profile-a-l/funnyboat.profile @@ -16,7 +16,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc -# include disable-shell.inc +#include disable-shell.inc include disable-xdg.inc mkdir ${HOME}/.funnyboat @@ -41,7 +41,7 @@ notv novideo protocol unix,inet,inet6 seccomp -# tracelog +#tracelog disable-mnt private-cache diff --git a/etc/profile-a-l/galculator.profile b/etc/profile-a-l/galculator.profile index 44d62cc86..aa1b96c41 100644 --- a/etc/profile-a-l/galculator.profile +++ b/etc/profile-a-l/galculator.profile @@ -48,5 +48,5 @@ private-tmp dbus-user none dbus-system none -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-a-l/gapplication.profile b/etc/profile-a-l/gapplication.profile index baf8f614e..2d0511cf6 100644 --- a/etc/profile-a-l/gapplication.profile +++ b/etc/profile-a-l/gapplication.profile @@ -17,7 +17,7 @@ include disable-programs.inc include disable-shell.inc include disable-xdg.inc -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-a-l/gconf-editor.profile b/etc/profile-a-l/gconf-editor.profile index 67eddd2e5..fef6ea5d3 100644 --- a/etc/profile-a-l/gconf-editor.profile +++ b/etc/profile-a-l/gconf-editor.profile @@ -7,8 +7,6 @@ include gconf-editor.local # added by included profile #include globals.local -blacklist /tmp/.X11-unix - whitelist /usr/share/gconf-editor ignore x11 none diff --git a/etc/profile-a-l/geary.profile b/etc/profile-a-l/geary.profile index ba0837780..1303922c8 100644 --- a/etc/profile-a-l/geary.profile +++ b/etc/profile-a-l/geary.profile @@ -14,9 +14,9 @@ noblacklist ${HOME}/.config/geary noblacklist ${HOME}/.local/share/evolution noblacklist ${HOME}/.local/share/geary noblacklist ${HOME}/.local/share/pki -noblacklist ${HOME}/.mozilla noblacklist ${HOME}/.pki +# sh is needed to allow Firefox to open links include allow-bin-sh.inc include disable-common.inc @@ -27,6 +27,12 @@ include disable-programs.inc include disable-shell.inc include disable-xdg.inc +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) +noblacklist ${HOME}/.mozilla +whitelist ${HOME}/.mozilla/firefox/profiles.ini + mkdir ${HOME}/.cache/evolution mkdir ${HOME}/.cache/folks mkdir ${HOME}/.cache/geary @@ -43,7 +49,6 @@ whitelist ${HOME}/.config/geary whitelist ${HOME}/.local/share/evolution whitelist ${HOME}/.local/share/geary whitelist ${HOME}/.local/share/pki -whitelist ${HOME}/.mozilla/firefox/profiles.ini whitelist ${HOME}/.pki whitelist /usr/share/geary include whitelist-common.inc @@ -53,7 +58,7 @@ include whitelist-var-common.inc apparmor caps.drop all -#ipc-namespace - may cause issues with X11 +#ipc-namespace # may cause issues with X11 #machine-id netfilter no3d @@ -71,7 +76,7 @@ seccomp seccomp.block-secondary tracelog -# disable-mnt +#disable-mnt #private-bin geary,sh private-cache private-dev @@ -88,6 +93,7 @@ dbus-user.talk org.gnome.OnlineAccounts dbus-user.talk org.gnome.evolution.dataserver.AddressBook10 dbus-user.talk org.gnome.evolution.dataserver.Sources5 ?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher +# Allow D-Bus communication with Firefox for opening links dbus-user.talk org.mozilla.* dbus-system none diff --git a/etc/profile-a-l/gedit.profile b/etc/profile-a-l/gedit.profile index dbb3ab971..bc265a509 100644 --- a/etc/profile-a-l/gedit.profile +++ b/etc/profile-a-l/gedit.profile @@ -13,18 +13,18 @@ noblacklist ${HOME}/.config/gedit include allow-common-devel.inc include disable-common.inc -# include disable-devel.inc +#include disable-devel.inc include disable-exec.inc -# include disable-interpreters.inc +#include disable-interpreters.inc include disable-programs.inc include whitelist-runuser-common.inc include whitelist-var-common.inc -# apparmor - makes settings immutable +#apparmor # makes settings immutable caps.drop all machine-id -# net none - makes settings immutable +#net none # makes settings immutable no3d nodvd nogroups @@ -40,14 +40,14 @@ seccomp seccomp.block-secondary tracelog -# private-bin gedit +#private-bin gedit private-dev # private-lib breaks python plugins - add the next line to your gedit.local if you don't use them. #private-lib aspell,gconv,gedit,libgspell-1.so.*,libgtksourceview-*,libpeas-gtk-1.0.so.*,libreadline.so.*,libtinfo.so.* private-tmp # makes settings immutable -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/geekbench.profile b/etc/profile-a-l/geekbench.profile index e8d4c013f..387ec615f 100644 --- a/etc/profile-a-l/geekbench.profile +++ b/etc/profile-a-l/geekbench.profile @@ -43,7 +43,7 @@ seccomp tracelog disable-mnt -#private-bin bash,geekbench*,sh -- #4576 +#private-bin bash,geekbench*,sh # #4576 private-cache private-dev private-etc lsb-release diff --git a/etc/profile-a-l/geeqie.profile b/etc/profile-a-l/geeqie.profile index f81a49e4f..beffb28e3 100644 --- a/etc/profile-a-l/geeqie.profile +++ b/etc/profile-a-l/geeqie.profile @@ -10,6 +10,9 @@ noblacklist ${HOME}/.cache/geeqie noblacklist ${HOME}/.config/geeqie noblacklist ${HOME}/.local/share/geeqie +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + # Allow perl (blacklisted by disable-interpreters.inc) include allow-perl.inc @@ -32,7 +35,7 @@ novideo protocol unix,inet,inet6 seccomp -# private-bin geeqie +#private-bin geeqie private-dev restrict-namespaces diff --git a/etc/profile-a-l/geki2.profile b/etc/profile-a-l/geki2.profile new file mode 100644 index 000000000..5ebd9b427 --- /dev/null +++ b/etc/profile-a-l/geki2.profile @@ -0,0 +1,49 @@ +# Firejail profile for geki2 +# Persistent local customizations +include geki2.local +# Persistent global definitions +include globals.local + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +whitelist /usr/share/games/geki2 +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +net none +netfilter +nodvd +noinput +nonewprivs +noroot +notv +nou2f +novideo +protocol unix +seccomp +tracelog + +disable-mnt +private +private-bin geki2 +private-dev +private-etc @games,@sound,@x11 +private-tmp +writable-var # game scores are stored under /var/games + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-a-l/geki3.profile b/etc/profile-a-l/geki3.profile new file mode 100644 index 000000000..508c96002 --- /dev/null +++ b/etc/profile-a-l/geki3.profile @@ -0,0 +1,49 @@ +# Firejail profile for geki3 +# Persistent local customizations +include geki3.local +# Persistent global definitions +include globals.local + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +whitelist /usr/share/games/geki3 +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +net none +netfilter +nodvd +noinput +nonewprivs +noroot +notv +nou2f +novideo +protocol unix +seccomp +tracelog + +disable-mnt +private +private-bin geki3 +private-dev +private-etc @games,@sound,@x11 +private-tmp +writable-var # game scores are stored under /var/games + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-a-l/gfeeds.profile b/etc/profile-a-l/gfeeds.profile index 1c97ad21c..007658138 100644 --- a/etc/profile-a-l/gfeeds.profile +++ b/etc/profile-a-l/gfeeds.profile @@ -58,7 +58,7 @@ tracelog disable-mnt private-bin gfeeds,python3* -# private-cache -- feeds are stored in ~/.cache +#private-cache # feeds are stored in ~/.cache private-dev private-etc @tls-ca,@x11,dbus-1,gconf,host.conf,mime.types,rpc,services private-tmp diff --git a/etc/profile-a-l/gget.profile b/etc/profile-a-l/gget.profile index 11d5f620c..eff215381 100644 --- a/etc/profile-a-l/gget.profile +++ b/etc/profile-a-l/gget.profile @@ -7,7 +7,6 @@ include gget.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER} include disable-common.inc @@ -16,6 +15,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include disable-xdg.inc whitelist ${DOWNLOADS} diff --git a/etc/profile-m-z/porn-cli.profile b/etc/profile-a-l/gh.profile similarity index 53% rename from etc/profile-m-z/porn-cli.profile rename to etc/profile-a-l/gh.profile index f33ff439c..3fbe52ac4 100644 --- a/etc/profile-m-z/porn-cli.profile +++ b/etc/profile-a-l/gh.profile @@ -1,14 +1,14 @@ -# Firejail profile for porn-cli -# Description: Python script for watching porn via the terminal +# Firejail profile for gh +# Description: GitHub's official command-line tool # This file is overwritten after every install/update quiet # Persistent local customizations -include porn-cli.local +include gh.local # Persistent global definitions # added by included profile #include globals.local -private-bin porn-cli +noblacklist ${HOME}/.config/gh # Redirect -include mov-cli.profile +include git.profile diff --git a/etc/profile-a-l/ghostwriter.profile b/etc/profile-a-l/ghostwriter.profile index dabf0dd7f..ea4989d9c 100644 --- a/etc/profile-a-l/ghostwriter.profile +++ b/etc/profile-a-l/ghostwriter.profile @@ -23,7 +23,6 @@ include disable-xdg.inc whitelist /usr/share/ghostwriter whitelist /usr/share/mozilla-dicts -whitelist /usr/share/texlive whitelist /usr/share/pandoc* include whitelist-runuser-common.inc include whitelist-usr-share-common.inc @@ -45,7 +44,7 @@ novideo protocol unix,inet,inet6,netlink seccomp !chroot seccomp.block-secondary -#tracelog -- breaks +#tracelog # breaks private-bin context,gettext,ghostwriter,latex,mktexfmt,pandoc,pdflatex,pdfroff,prince,weasyprint,wkhtmltopdf private-cache diff --git a/etc/profile-a-l/gist.profile b/etc/profile-a-l/gist.profile index 6eea076f7..4dff73c54 100644 --- a/etc/profile-a-l/gist.profile +++ b/etc/profile-a-l/gist.profile @@ -7,7 +7,6 @@ include gist.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* noblacklist ${HOME}/.gist @@ -20,6 +19,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc mkdir ${HOME}/.gist diff --git a/etc/profile-a-l/git.profile b/etc/profile-a-l/git.profile index 78d6cb2a1..f2fd63e1b 100644 --- a/etc/profile-a-l/git.profile +++ b/etc/profile-a-l/git.profile @@ -28,12 +28,12 @@ ignore rmenv GITHUB_ENTERPRISE_TOKEN # Allow ssh (blacklisted by disable-common.inc) include allow-ssh.inc -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc include disable-exec.inc include disable-programs.inc +include disable-x11.inc whitelist /usr/share/git whitelist /usr/share/git-core diff --git a/etc/profile-a-l/github-desktop.profile b/etc/profile-a-l/github-desktop.profile index ced1aa190..88134b363 100644 --- a/etc/profile-a-l/github-desktop.profile +++ b/etc/profile-a-l/github-desktop.profile @@ -29,14 +29,14 @@ noblacklist ${HOME}/.config/git noblacklist ${HOME}/.gitconfig noblacklist ${HOME}/.git-credentials -# no3d +#no3d nosound -# private-bin github-desktop +#private-bin github-desktop ?HAS_APPIMAGE: ignore private-dev -# private-lib +#private-lib -# memory-deny-write-execute +#memory-deny-write-execute # Redirect include electron-common.profile diff --git a/etc/profile-a-l/gitter.profile b/etc/profile-a-l/gitter.profile index e3cf87c87..713cb98e9 100644 --- a/etc/profile-a-l/gitter.profile +++ b/etc/profile-a-l/gitter.profile @@ -5,7 +5,11 @@ include gitter.local # Persistent global definitions include globals.local -noblacklist ${HOME}/.config/autostart +# To allow the program to autostart, add the following to gitter.local: +# Warning: This allows the program to easily escape the sandbox. +#noblacklist ${HOME}/.config/autostart +#whitelist ${HOME}/.config/autostart + noblacklist ${HOME}/.config/Gitter include disable-common.inc @@ -16,8 +20,8 @@ include disable-programs.inc mkdir ${HOME}/.config/Gitter whitelist ${DOWNLOADS} -whitelist ${HOME}/.config/autostart whitelist ${HOME}/.config/Gitter +whitelist /opt/Gitter include whitelist-var-common.inc caps.drop all @@ -37,7 +41,6 @@ seccomp disable-mnt private-bin bash,env,gitter private-etc @tls-ca -private-opt Gitter private-dev private-tmp diff --git a/etc/profile-a-l/gjs.profile b/etc/profile-a-l/gjs.profile index bd332a6d5..cad261365 100644 --- a/etc/profile-a-l/gjs.profile +++ b/etc/profile-a-l/gjs.profile @@ -38,9 +38,9 @@ protocol unix,inet,inet6 seccomp tracelog -# private-bin gjs,gnome-books,gnome-documents,gnome-maps,gnome-photos,gnome-weather +#private-bin gjs,gnome-books,gnome-documents,gnome-maps,gnome-photos,gnome-weather private-dev -# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl +#private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl private-tmp restrict-namespaces diff --git a/etc/profile-a-l/gl-117-wrapper.profile b/etc/profile-a-l/gl-117-wrapper.profile index d783940f3..52b812954 100644 --- a/etc/profile-a-l/gl-117-wrapper.profile +++ b/etc/profile-a-l/gl-117-wrapper.profile @@ -6,6 +6,7 @@ include gl-117-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin gl-117-wrapper diff --git a/etc/profile-a-l/glaxium-wrapper.profile b/etc/profile-a-l/glaxium-wrapper.profile index 7dc2cf65e..341f3ac4b 100644 --- a/etc/profile-a-l/glaxium-wrapper.profile +++ b/etc/profile-a-l/glaxium-wrapper.profile @@ -6,6 +6,7 @@ include glaxium-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin glaxium-wrapper diff --git a/etc/profile-a-l/gmpc.profile b/etc/profile-a-l/gmpc.profile index f3e045000..4d4a0d50e 100644 --- a/etc/profile-a-l/gmpc.profile +++ b/etc/profile-a-l/gmpc.profile @@ -47,8 +47,9 @@ private-etc private-tmp writable-run-user -# dbus-user none -# dbus-system none +dbus-user filter +dbus-user.talk org.mpris.MediaPlayer2.mpd +dbus-system none -# memory-deny-write-execute - breaks on Arch +#memory-deny-write-execute # breaks on Arch restrict-namespaces diff --git a/etc/profile-a-l/gnome-books.profile b/etc/profile-a-l/gnome-books.profile index 812923b2d..962b8b30f 100644 --- a/etc/profile-a-l/gnome-books.profile +++ b/etc/profile-a-l/gnome-books.profile @@ -39,7 +39,7 @@ protocol unix seccomp tracelog -# private-bin gjs,gnome-books +#private-bin gjs,gnome-books private-dev private-tmp diff --git a/etc/profile-a-l/gnome-boxes.profile b/etc/profile-a-l/gnome-boxes.profile new file mode 100644 index 000000000..d026fec88 --- /dev/null +++ b/etc/profile-a-l/gnome-boxes.profile @@ -0,0 +1,77 @@ +# Firejail profile for gnome-boxes +# Description: Simple GNOME application to access virtual systems +# This file is overwritten after every install/update +# Persistent local customizations +include gnome-boxes.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +noblacklist ${HOME}/.cache/gnome-boxes +noblacklist ${HOME}/.config/gnome-boxes +noblacklist ${HOME}/.local/share/gnome-boxes +noblacklist ${RUNUSER}/libvirt + +noblacklist /sbin +noblacklist /usr/sbin + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +# breaks app +#include disable-proc.inc +include disable-programs.inc +include disable-xdg.inc + +mkdir ${HOME}/.cache/gnome-boxes +mkdir ${HOME}/.config/gnome-boxes +mkdir ${HOME}/.local/share/gnome-boxes +whitelist ${DOWNLOADS} +whitelist ${HOME}/.cache/gnome-boxes +whitelist ${HOME}/.config/gnome-boxes +whitelist ${HOME}/.local/share/gnome-boxes +whitelist ${RUNUSER}/libvirt + +whitelist /run/libvirt +whitelist /usr/libexec/gnome-boxes* +whitelist /usr/share/gnome-boxes +whitelist /usr/share/libvirt +whitelist /usr/share/osinfo +whitelist /usr/share/qemu +whitelist /usr/share/seabios +whitelist /usr/share/vala* +# /usr/share/misc/usb.ids is a symlink to /var/lib/usbutils/usb.ids on Ubuntu 22.04 +whitelist /var/lib/usbutils/usb.ids +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +# breaks app +#apparmor +# For host-only network sys_admin is needed. +# See https://github.com/netblue30/firejail/issues/2868#issuecomment-518647630 +caps.keep net_raw,sys_nice +#caps.keep net_raw,sys_admin +netfilter +nodvd +notv +tracelog + +private-cache +private-etc @network,@sound,@tls-ca,@x11 +private-tmp + +dbus-user filter +dbus-user.own org.gnome.Boxes +dbus-user.talk ca.desrt.dconf +dbus-user.talk org.freedesktop.Notifications +?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher +dbus-system none + +deterministic-shutdown +# breaks app +#restrict-namespaces diff --git a/etc/profile-a-l/gnome-calculator.profile b/etc/profile-a-l/gnome-calculator.profile index e5c6022e8..40f799693 100644 --- a/etc/profile-a-l/gnome-calculator.profile +++ b/etc/profile-a-l/gnome-calculator.profile @@ -24,7 +24,7 @@ apparmor caps.drop all ipc-namespace machine-id -#net none -- breaks currency conversion +#net none # breaks currency conversion netfilter no3d nodvd diff --git a/etc/profile-a-l/gnome-calendar.profile b/etc/profile-a-l/gnome-calendar.profile index 70a302138..e6fe27774 100644 --- a/etc/profile-a-l/gnome-calendar.profile +++ b/etc/profile-a-l/gnome-calendar.profile @@ -15,7 +15,7 @@ include disable-shell.inc include disable-xdg.inc whitelist /usr/share/libgweather -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc @@ -53,7 +53,7 @@ dbus-user.talk ca.desrt.dconf dbus-user.talk org.gnome.evolution.dataserver.* #dbus-user.talk org.gnome.OnlineAccounts #dbus-user.talk org.gnome.ControlCenter -# NOTE: dbus-system none fails, filter without rules works. +# Note: dbus-system none fails, filter without rules works. dbus-system filter #dbus-system.talk org.freedesktop.timedate1 #dbus-system.talk org.freedesktop.login1 diff --git a/etc/profile-a-l/gnome-characters.profile b/etc/profile-a-l/gnome-characters.profile index 9e9730e53..9f592722c 100644 --- a/etc/profile-a-l/gnome-characters.profile +++ b/etc/profile-a-l/gnome-characters.profile @@ -52,8 +52,8 @@ private-etc @x11,gconf,mime.types private-tmp # Add the next lines to your gnome-characters.local if you don't need access to recently used chars. -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none read-only ${HOME} restrict-namespaces diff --git a/etc/profile-a-l/gnome-contacts.profile b/etc/profile-a-l/gnome-contacts.profile index 2326115c3..25a906c69 100644 --- a/etc/profile-a-l/gnome-contacts.profile +++ b/etc/profile-a-l/gnome-contacts.profile @@ -21,7 +21,7 @@ include whitelist-var-common.inc caps.drop all netfilter -#no3d - breaks on Arch +#no3d # breaks on Arch nodvd noinput nonewprivs diff --git a/etc/profile-a-l/gnome-keyring-daemon.profile b/etc/profile-a-l/gnome-keyring-daemon.profile new file mode 100644 index 000000000..b8c51991c --- /dev/null +++ b/etc/profile-a-l/gnome-keyring-daemon.profile @@ -0,0 +1,62 @@ +# Firejail profile for gnome-keyring-daemon +# Description: Stores passwords and encryption keys +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include gnome-keyring-daemon.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER}/wayland-* + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +#include disable-x11.inc # x11 none +include disable-x11.inc +include disable-xdg.inc + +whitelist ${RUNUSER}/gnupg +whitelist ${RUNUSER}/keyring +whitelist /usr/share/gnupg +whitelist /usr/share/gnupg2 +include whitelist-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noroot +nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog +x11 none + +disable-mnt +#private-bin gnome-keyrin*,secret-tool +private-cache +private-dev +#private-lib alternatives,gnome-keyring,libsecret-1.so.*,pkcs11,security +private-tmp + +#dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-a-l/gnome-keyring.profile b/etc/profile-a-l/gnome-keyring.profile index 45b6fd880..287c6dcf9 100644 --- a/etc/profile-a-l/gnome-keyring.profile +++ b/etc/profile-a-l/gnome-keyring.profile @@ -1,62 +1,17 @@ # Firejail profile for gnome-keyring # Description: Stores passwords and encryption keys # This file is overwritten after every install/update -quiet # Persistent local customizations include gnome-keyring.local # Persistent global definitions -include globals.local +# added by included profile +#include globals.local noblacklist ${HOME}/.gnupg -include disable-common.inc -include disable-devel.inc -include disable-exec.inc -include disable-interpreters.inc -include disable-programs.inc -include disable-xdg.inc - mkdir ${HOME}/.gnupg whitelist ${HOME}/.gnupg whitelist ${DOWNLOADS} -whitelist ${RUNUSER}/gnupg -whitelist ${RUNUSER}/keyring -whitelist /usr/share/gnupg -whitelist /usr/share/gnupg2 -include whitelist-common.inc -include whitelist-runuser-common.inc -include whitelist-usr-share-common.inc -include whitelist-var-common.inc -apparmor -caps.drop all -ipc-namespace -machine-id -netfilter -no3d -nodvd -nogroups -noinput -nonewprivs -noroot -nosound -notv -nou2f -novideo -protocol unix,inet,inet6 -seccomp -seccomp.block-secondary -tracelog - -disable-mnt -#private-bin gnome-keyrin*,secret-tool -private-cache -private-dev -#private-lib alternatives,gnome-keyring,libsecret-1.so.*,pkcs11,security -private-tmp - -# dbus-user none -dbus-system none - -memory-deny-write-execute -restrict-namespaces +# Redirect +include gnome-keyring-daemon.profile diff --git a/etc/profile-a-l/gnome-latex.profile b/etc/profile-a-l/gnome-latex.profile index b15439aee..911b341f3 100644 --- a/etc/profile-a-l/gnome-latex.profile +++ b/etc/profile-a-l/gnome-latex.profile @@ -19,7 +19,6 @@ include disable-interpreters.inc include disable-programs.inc whitelist /usr/share/gnome-latex -whitelist /usr/share/texlive include whitelist-runuser-common.inc include whitelist-usr-share-common.inc # May cause issues. diff --git a/etc/profile-a-l/gnome-logs.profile b/etc/profile-a-l/gnome-logs.profile index 61f4f4107..4d2681fbc 100644 --- a/etc/profile-a-l/gnome-logs.profile +++ b/etc/profile-a-l/gnome-logs.profile @@ -6,49 +6,15 @@ include gnome-logs.local # Persistent global definitions include globals.local -include disable-common.inc -include disable-devel.inc -include disable-exec.inc -include disable-interpreters.inc -include disable-programs.inc -include disable-shell.inc -include disable-xdg.inc +whitelist /usr/share/gnome-logs -whitelist /var/log/journal -include whitelist-runuser-common.inc -include whitelist-usr-share-common.inc -include whitelist-var-common.inc - -apparmor -caps.drop all -ipc-namespace -net none -no3d -nodvd -noinput -nonewprivs -nosound -notv -nou2f -novideo -protocol unix -seccomp -tracelog - -disable-mnt private-bin gnome-logs -private-cache -private-dev -private-etc private-lib gdk-pixbuf-2.*,gio,gvfs/libgvfscommon.so,libgconf-2.so.*,librsvg-2.so.* -private-tmp -writable-var-log dbus-user filter dbus-user.own org.gnome.Logs dbus-user.talk ca.desrt.dconf -dbus-system none +ignore dbus-user none -# Add 'ignore read-only ${HOME}' to your gnome-logs.local if you export logs to a file under your ${HOME}. -read-only ${HOME} -restrict-namespaces +# Redirect +include system-log-common.profile diff --git a/etc/profile-a-l/gnome-maps.profile b/etc/profile-a-l/gnome-maps.profile index 17f52e588..40c264c86 100644 --- a/etc/profile-a-l/gnome-maps.profile +++ b/etc/profile-a-l/gnome-maps.profile @@ -61,7 +61,7 @@ tracelog disable-mnt private-bin gjs,gnome-maps -# private-cache -- gnome-maps cache all maps/satelite-images +#private-cache # gnome-maps cache all maps/satelite-images private-dev private-etc @tls-ca,@x11,clutter-1.0,gconf,host.conf,mime.types,pkcs11,rpc,services private-tmp diff --git a/etc/profile-a-l/gnome-mplayer.profile b/etc/profile-a-l/gnome-mplayer.profile index 052e9ba9c..5315cbec6 100644 --- a/etc/profile-a-l/gnome-mplayer.profile +++ b/etc/profile-a-l/gnome-mplayer.profile @@ -26,7 +26,7 @@ nou2f protocol unix,inet,inet6 seccomp -# private-bin gnome-mplayer,mplayer +#private-bin gnome-mplayer,mplayer private-cache private-dev private-tmp diff --git a/etc/profile-a-l/gnome-nettool.profile b/etc/profile-a-l/gnome-nettool.profile index ce4e5edd8..7a8338cd7 100644 --- a/etc/profile-a-l/gnome-nettool.profile +++ b/etc/profile-a-l/gnome-nettool.profile @@ -14,7 +14,7 @@ include disable-programs.inc include disable-xdg.inc whitelist /usr/share/gnome-nettool -#include whitelist-common.inc -- see #903 +#include whitelist-common.inc # see #903 include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc @@ -35,7 +35,6 @@ notv nou2f novideo #seccomp -#shell none disable-mnt private diff --git a/etc/profile-a-l/gnome-photos.profile b/etc/profile-a-l/gnome-photos.profile index 1d0291aa2..4d2a3913f 100644 --- a/etc/profile-a-l/gnome-photos.profile +++ b/etc/profile-a-l/gnome-photos.profile @@ -36,7 +36,7 @@ seccomp seccomp.block-secondary tracelog -# private-bin gjs,gnome-photos +#private-bin gjs,gnome-photos private-dev private-tmp diff --git a/etc/profile-a-l/gnome-pie.profile b/etc/profile-a-l/gnome-pie.profile index ac0fb555d..dff6032d1 100644 --- a/etc/profile-a-l/gnome-pie.profile +++ b/etc/profile-a-l/gnome-pie.profile @@ -16,7 +16,7 @@ include disable-exec.inc caps.drop all ipc-namespace -# net none - breaks dbus +#net none # breaks dbus no3d nodvd nogroups diff --git a/etc/profile-a-l/gnome-ring.profile b/etc/profile-a-l/gnome-ring.profile index 8f2ab7fd6..898cdf1f8 100644 --- a/etc/profile-a-l/gnome-ring.profile +++ b/etc/profile-a-l/gnome-ring.profile @@ -27,7 +27,7 @@ protocol unix,inet,inet6,netlink seccomp disable-mnt -# private-dev +#private-dev private-tmp restrict-namespaces diff --git a/etc/profile-a-l/gnome-schedule.profile b/etc/profile-a-l/gnome-schedule.profile index b71d77621..33f22136e 100644 --- a/etc/profile-a-l/gnome-schedule.profile +++ b/etc/profile-a-l/gnome-schedule.profile @@ -46,7 +46,7 @@ apparmor caps.keep chown,dac_override,setgid,setuid ipc-namespace machine-id -#net none - breaks on Ubuntu +#net none # breaks on Ubuntu no3d nodvd nogroups diff --git a/etc/profile-a-l/gnome-system-log.profile b/etc/profile-a-l/gnome-system-log.profile index f4e985342..0d6116f4f 100644 --- a/etc/profile-a-l/gnome-system-log.profile +++ b/etc/profile-a-l/gnome-system-log.profile @@ -6,51 +6,13 @@ include gnome-system-log.local # Persistent global definitions include globals.local -include disable-common.inc -include disable-devel.inc -include disable-exec.inc -include disable-interpreters.inc -include disable-programs.inc -include disable-shell.inc -include disable-xdg.inc +# 'net none' breaks dbus +ignore net none -whitelist /var/log -include whitelist-common.inc -include whitelist-usr-share-common.inc -include whitelist-var-common.inc - -apparmor -caps.drop all -ipc-namespace -# net none - breaks dbus -no3d -nodvd -# When using 'volatile' storage (https://www.freedesktop.org/software/systemd/man/journald.conf.html), -# put 'ignore nogroups' and 'ignore noroot' in your gnome-system-log.local. -nogroups -noinput -nonewprivs -noroot -nosound -notv -nou2f -novideo -protocol unix -seccomp - -disable-mnt private-bin gnome-system-log -private-cache -private-dev -private-etc private-lib -private-tmp -writable-var-log - -# dbus-user none -# dbus-system none memory-deny-write-execute -# Add 'ignore read-only ${HOME}' to your gnome-system-log.local if you export logs to a file under your ${HOME}. -read-only ${HOME} -restrict-namespaces + +# Redirect +include system-log-common.profile diff --git a/etc/profile-a-l/gnome-weather.profile b/etc/profile-a-l/gnome-weather.profile index 147b84a19..8637f5019 100644 --- a/etc/profile-a-l/gnome-weather.profile +++ b/etc/profile-a-l/gnome-weather.profile @@ -41,9 +41,9 @@ seccomp.block-secondary tracelog disable-mnt -# private-bin gjs,gnome-weather +#private-bin gjs,gnome-weather private-dev -# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl +#private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl private-tmp restrict-namespaces diff --git a/etc/profile-a-l/gnubik.profile b/etc/profile-a-l/gnubik.profile index 025cb74b6..0c4ca35ac 100644 --- a/etc/profile-a-l/gnubik.profile +++ b/etc/profile-a-l/gnubik.profile @@ -15,7 +15,7 @@ include disable-shell.inc include disable-xdg.inc whitelist /usr/share/gnubik -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-a-l/godot.profile b/etc/profile-a-l/godot.profile index 5e41384ab..96bbffc41 100644 --- a/etc/profile-a-l/godot.profile +++ b/etc/profile-a-l/godot.profile @@ -34,7 +34,7 @@ seccomp tracelog -# private-bin godot +#private-bin godot private-cache private-dev private-etc @games,@tls-ca,@x11,mono diff --git a/etc/profile-a-l/goobox.profile b/etc/profile-a-l/goobox.profile index 8807a239d..96b72230d 100644 --- a/etc/profile-a-l/goobox.profile +++ b/etc/profile-a-l/goobox.profile @@ -28,9 +28,9 @@ protocol unix,inet,inet6 seccomp tracelog -# private-bin goobox +#private-bin goobox private-dev -# private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,machine-id,pki,pulse,ssl -# private-tmp +#private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,machine-id,pki,pulse,ssl +#private-tmp restrict-namespaces diff --git a/etc/profile-a-l/google-earth.profile b/etc/profile-a-l/google-earth.profile index 4af6ce36b..1087b3d6e 100644 --- a/etc/profile-a-l/google-earth.profile +++ b/etc/profile-a-l/google-earth.profile @@ -18,6 +18,7 @@ mkdir ${HOME}/.config/Google mkdir ${HOME}/.googleearth whitelist ${HOME}/.config/Google whitelist ${HOME}/.googleearth +whitelist /opt/google include whitelist-common.inc caps.drop all @@ -37,6 +38,5 @@ seccomp disable-mnt private-bin bash,dirname,google-earth,grep,ls,sed,sh private-dev -private-opt google restrict-namespaces diff --git a/etc/profile-a-l/google-play-music-desktop-player.profile b/etc/profile-a-l/google-play-music-desktop-player.profile index c2a7d89fd..1218631d8 100644 --- a/etc/profile-a-l/google-play-music-desktop-player.profile +++ b/etc/profile-a-l/google-play-music-desktop-player.profile @@ -17,8 +17,8 @@ include disable-interpreters.inc include disable-programs.inc mkdir ${HOME}/.config/Google Play Music Desktop Player -# whitelist ${HOME}/.config/pulse -# whitelist ${HOME}/.pulse +#whitelist ${HOME}/.config/pulse +#whitelist ${HOME}/.pulse whitelist ${HOME}/.config/Google Play Music Desktop Player include whitelist-common.inc diff --git a/etc/profile-a-l/googler-common.profile b/etc/profile-a-l/googler-common.profile index 58769643a..823228612 100644 --- a/etc/profile-a-l/googler-common.profile +++ b/etc/profile-a-l/googler-common.profile @@ -7,7 +7,6 @@ include googler-common.local # added by caller profile #include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER} noblacklist ${HOME}/.w3m @@ -23,6 +22,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include disable-xdg.inc whitelist ${HOME}/.w3m diff --git a/etc/profile-a-l/gpa.profile b/etc/profile-a-l/gpa.profile index e05cdf424..25498d89e 100644 --- a/etc/profile-a-l/gpa.profile +++ b/etc/profile-a-l/gpa.profile @@ -28,7 +28,7 @@ protocol unix,inet,inet6 seccomp tracelog -# private-bin gpa,gpg +#private-bin gpa,gpg private-dev restrict-namespaces diff --git a/etc/profile-a-l/gpg-agent.profile b/etc/profile-a-l/gpg-agent.profile index f4cd85e3a..102a4ef24 100644 --- a/etc/profile-a-l/gpg-agent.profile +++ b/etc/profile-a-l/gpg-agent.profile @@ -9,13 +9,13 @@ include globals.local noblacklist ${HOME}/.gnupg -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc include disable-devel.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc mkdir ${HOME}/.gnupg @@ -46,7 +46,7 @@ protocol unix,inet,inet6 seccomp tracelog -# private-bin gpg-agent +#private-bin gpg-agent private-cache private-dev diff --git a/etc/profile-a-l/gpg.profile b/etc/profile-a-l/gpg.profile index 60690852a..6becc80eb 100644 --- a/etc/profile-a-l/gpg.profile +++ b/etc/profile-a-l/gpg.profile @@ -9,13 +9,13 @@ include globals.local noblacklist ${HOME}/.gnupg -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc include disable-devel.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc whitelist ${RUNUSER}/gnupg whitelist ${RUNUSER}/keyring @@ -42,7 +42,7 @@ protocol unix,inet,inet6 seccomp tracelog -# private-bin gpg +#private-bin gpg private-cache private-dev diff --git a/etc/profile-a-l/gpg2.profile b/etc/profile-a-l/gpg2.profile index b831b0f62..a9d928f17 100644 --- a/etc/profile-a-l/gpg2.profile +++ b/etc/profile-a-l/gpg2.profile @@ -7,7 +7,7 @@ include gpg2.local # added by included profile #include globals.local -# private-bin gpg2 +#private-bin gpg2 # Redirect include gpg.profile diff --git a/etc/profile-a-l/gramps.profile b/etc/profile-a-l/gramps.profile index 5073e79c9..4b142e404 100644 --- a/etc/profile-a-l/gramps.profile +++ b/etc/profile-a-l/gramps.profile @@ -6,6 +6,7 @@ include gramps.local # Persistent global definitions include globals.local +noblacklist ${HOME}/.config/gramps noblacklist ${HOME}/.gramps # Allow python (blacklisted by disable-interpreters.inc) @@ -19,7 +20,9 @@ include disable-interpreters.inc include disable-programs.inc include disable-xdg.inc +mkdir ${HOME}/.config/gramps mkdir ${HOME}/.gramps +whitelist ${HOME}/.config/gramps whitelist ${HOME}/.gramps include whitelist-common.inc include whitelist-var-common.inc diff --git a/etc/profile-a-l/gravity-beams-and-evaporating-stars.profile b/etc/profile-a-l/gravity-beams-and-evaporating-stars.profile index 19af7c0b9..5ccce8447 100644 --- a/etc/profile-a-l/gravity-beams-and-evaporating-stars.profile +++ b/etc/profile-a-l/gravity-beams-and-evaporating-stars.profile @@ -15,7 +15,7 @@ include disable-shell.inc include disable-xdg.inc whitelist /usr/share/gravity-beams-and-evaporating-stars -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-a-l/green-recoder.profile b/etc/profile-a-l/green-recoder.profile new file mode 100644 index 000000000..77c980daa --- /dev/null +++ b/etc/profile-a-l/green-recoder.profile @@ -0,0 +1,72 @@ +# Firejail profile for green-recorder +# Description: A simple screen recorder for Linux desktop (supports Wayland & Xorg) +# This file is overwritten after every install/update +# Persistent local customizations +include green-recorder.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +noblacklist ${HOME}/.config/green-recorder + +# Allow python 3 (blacklisted by disable-interpreters.inc) +include allow-python3.inc + +# Allow /bin/sh (blacklisted by disable-shell.inc) +include allow-bin-sh.inc + +noblacklist ${VIDEOS} + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.config/green-recorder +whitelist ${HOME}/.config/green-recorder +whitelist ${DOWNLOADS} +whitelist ${VIDEOS} +whitelist /usr/share/ffmpeg +whitelist /usr/share/green-recorder +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +net none +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +notv +nou2f +novideo +protocol unix +# allow set_mempolicy, which is required to encode using libx265 +seccomp !set_mempolicy +seccomp.block-secondary +tracelog + +disable-mnt +private-bin awk,bash,convert,ffmpeg,green-recorder,grep,mv,pactl,ps,python*,sh,sleep,xdg-open,xdpyinfo,xwininfo +private-cache +private-dev +private-etc @x11 +private-tmp + +dbus-user filter +dbus-user.talk org.freedesktop.Notifications +dbus-user.talk org.gnome.Shell.* +?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher +dbus-system none + +restrict-namespaces diff --git a/etc/profile-a-l/gtk-youtube-viewers-common.profile b/etc/profile-a-l/gtk-youtube-viewers-common.profile index 049448a23..b27a4fa35 100644 --- a/etc/profile-a-l/gtk-youtube-viewers-common.profile +++ b/etc/profile-a-l/gtk-youtube-viewers-common.profile @@ -18,5 +18,5 @@ whitelist ${HOME}/.mozilla/firefox/profiles.ini private-bin firefox,xterm dbus-user filter -# allow D-Bus communication with firefox for opening links +# Allow D-Bus communication with Firefox for opening links dbus-user.talk org.mozilla.* diff --git a/etc/profile-a-l/gucharmap.profile b/etc/profile-a-l/gucharmap.profile index ef4aad4da..93db304da 100644 --- a/etc/profile-a-l/gucharmap.profile +++ b/etc/profile-a-l/gucharmap.profile @@ -22,7 +22,7 @@ include whitelist-var-common.inc apparmor caps.drop all machine-id -#net none - breaks dbus +#net none # breaks dbus no3d nodvd nogroups @@ -47,8 +47,8 @@ private-lib private-tmp # breaks state saving -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none read-only ${HOME} restrict-namespaces diff --git a/etc/profile-a-l/gwenview.profile b/etc/profile-a-l/gwenview.profile index 4be71f6d3..bc4084a38 100644 --- a/etc/profile-a-l/gwenview.profile +++ b/etc/profile-a-l/gwenview.profile @@ -14,6 +14,7 @@ noblacklist ${HOME}/.kde/share/apps/gwenview noblacklist ${HOME}/.kde/share/config/gwenviewrc noblacklist ${HOME}/.kde4/share/apps/gwenview noblacklist ${HOME}/.kde4/share/config/gwenviewrc +noblacklist ${HOME}/.local/share/Trash noblacklist ${HOME}/.local/share/gwenview noblacklist ${HOME}/.local/share/kxmlgui5/gwenview noblacklist ${HOME}/.local/share/org.kde.gwenview @@ -30,7 +31,7 @@ include whitelist-var-common.inc apparmor caps.drop all -# net none +#net none netfilter nodvd nogroups @@ -42,14 +43,14 @@ nou2f novideo protocol unix seccomp -# tracelog +#tracelog private-bin gimp*,gwenview,kbuildsycoca4,kdeinit4 private-dev private-etc @x11,gimp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-a-l/handbrake.profile b/etc/profile-a-l/handbrake.profile index e0ef23cce..0853a8d77 100644 --- a/etc/profile-a-l/handbrake.profile +++ b/etc/profile-a-l/handbrake.profile @@ -7,6 +7,7 @@ include handbrake.local include globals.local noblacklist ${HOME}/.config/ghb +noblacklist ${HOME}/.dvdcss noblacklist ${MUSIC} noblacklist ${VIDEOS} diff --git a/etc/profile-a-l/hashcat.profile b/etc/profile-a-l/hashcat.profile index e5b0a06af..b4e0d53f3 100644 --- a/etc/profile-a-l/hashcat.profile +++ b/etc/profile-a-l/hashcat.profile @@ -9,7 +9,9 @@ include globals.local blacklist ${RUNUSER}/wayland-* +noblacklist ${HOME}/.cache/hashcat noblacklist ${HOME}/.hashcat +noblacklist ${HOME}/.local/share/hashcat noblacklist /usr/include noblacklist ${DOCUMENTS} diff --git a/etc/profile-a-l/hexchat.profile b/etc/profile-a-l/hexchat.profile index df7f8f3a3..82c83f970 100644 --- a/etc/profile-a-l/hexchat.profile +++ b/etc/profile-a-l/hexchat.profile @@ -11,6 +11,9 @@ noblacklist ${HOME}/.config/hexchat # Allow /bin/sh (blacklisted by disable-shell.inc) include allow-bin-sh.inc +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + # Allow perl (blacklisted by disable-interpreters.inc) include allow-perl.inc @@ -18,41 +21,55 @@ include allow-perl.inc include allow-python2.inc include allow-python3.inc +blacklist /usr/libexec + include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc +include disable-proc.inc include disable-programs.inc include disable-shell.inc include disable-xdg.inc mkdir ${HOME}/.config/hexchat +whitelist ${DOWNLOADS} whitelist ${HOME}/.config/hexchat include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc include whitelist-var-common.inc caps.drop all -#machine-id -- breaks sound +#machine-id # breaks sound netfilter no3d nodvd nogroups noinput nonewprivs +noprinters noroot notv nou2f novideo protocol unix,inet,inet6 seccomp +seccomp.block-secondary tracelog disable-mnt -# debug note: private-bin requires perl, python, etc on some systems +# If you need Lua and/or Perl support, add the relevant binaries from +# allow-lua.inc/allow-perl.inc to private-bin in your hexchat.local. private-bin hexchat,python*,sh private-dev -#private-lib - python problems +#private-lib # python problems private-tmp -# memory-deny-write-execute - breaks python +dbus-user filter +dbus-user.own org.hexchat.service +dbus-system none + +#memory-deny-write-execute # breaks python restrict-namespaces diff --git a/etc/profile-a-l/homebank.profile b/etc/profile-a-l/homebank.profile index ccbb66333..d36cf0f46 100644 --- a/etc/profile-a-l/homebank.profile +++ b/etc/profile-a-l/homebank.profile @@ -28,7 +28,7 @@ include whitelist-var-common.inc apparmor caps.drop all machine-id -# net none +#net none netfilter nodvd no3d @@ -55,5 +55,5 @@ private-tmp dbus-user none dbus-system none -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-a-l/hugin.profile b/etc/profile-a-l/hugin.profile index c4085cf9c..683e1b5f7 100644 --- a/etc/profile-a-l/hugin.profile +++ b/etc/profile-a-l/hugin.profile @@ -38,7 +38,7 @@ novideo protocol unix seccomp -private-bin align_image_stack,autooptimiser,calibrate_lens_gui,celeste_standalone,checkpto,cpclean,cpfind,deghosting_mask,enblend,exiftool,fulla,geocpset,hugin,hugin_executor,hugin_hdrmerge,hugin_lensdb,hugin_stitch_project,icpfind,linefind,nona,pano_modify,pano_trafo,perl,PTBatcherGUI,pto_gen,pto_lensstack,pto_mask,pto_merge,pto_move,pto_template,pto_var,sh,tca_correct,uname,verdandi,vig_optimize +private-bin PTBatcherGUI,align_image_stack,autooptimiser,calibrate_lens_gui,celeste_standalone,checkpto,cpclean,cpfind,deghosting_mask,enblend,exiftool,fulla,geocpset,hugin,hugin_executor,hugin_hdrmerge,hugin_lensdb,hugin_stitch_project,icpfind,linefind,nona,pano_modify,pano_trafo,perl,pto_gen,pto_lensstack,pto_mask,pto_merge,pto_move,pto_template,pto_var,sh,tca_correct,uname,verdandi,vig_optimize private-cache private-dev private-tmp diff --git a/etc/profile-a-l/i3.profile b/etc/profile-a-l/i3.profile index 2268072ef..412e31762 100644 --- a/etc/profile-a-l/i3.profile +++ b/etc/profile-a-l/i3.profile @@ -8,6 +8,10 @@ include globals.local # all applications started in i3 will run in this profile noblacklist ${HOME}/.config/i3 +noblacklist ${RUNUSER}/i3 +noblacklist ${RUNUSER}/i3/ipc-socket.* +noblacklist /tmp/i3-* +noblacklist /tmp/i3-*/ipc-socket.* include disable-common.inc caps.drop all diff --git a/etc/profile-a-l/iagno.profile b/etc/profile-a-l/iagno.profile index 82cba7887..7129c70bb 100644 --- a/etc/profile-a-l/iagno.profile +++ b/etc/profile-a-l/iagno.profile @@ -14,11 +14,10 @@ include disable-programs.inc include disable-shell.inc whitelist ${HOME}/.local/share/glib-2.0/schemas -include whitelist-common.inc - -include whitelist-runuser-common.inc -whitelist /usr/share/iagno whitelist /usr/share/gdm +whitelist /usr/share/iagno +include whitelist-common.inc +include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc @@ -43,7 +42,7 @@ private-dev private-etc @x11,gconf private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/icecat.profile b/etc/profile-a-l/icecat.profile index 660343a29..19bda5454 100644 --- a/etc/profile-a-l/icecat.profile +++ b/etc/profile-a-l/icecat.profile @@ -12,9 +12,9 @@ mkdir ${HOME}/.cache/mozilla/icecat mkdir ${HOME}/.mozilla whitelist ${HOME}/.cache/mozilla/icecat whitelist ${HOME}/.mozilla +whitelist /usr/share/icecat -# private-etc must first be enabled in firefox-common.profile -#private-etc icecat +private-etc icecat # Redirect include firefox-common.profile diff --git a/etc/profile-a-l/iceweasel.profile b/etc/profile-a-l/iceweasel.profile index badd2648a..d6a925a77 100644 --- a/etc/profile-a-l/iceweasel.profile +++ b/etc/profile-a-l/iceweasel.profile @@ -6,8 +6,7 @@ include iceweasel.local # added by included profile #include globals.local -# private-etc must first be enabled in firefox-common.profile -#private-etc iceweasel +private-etc iceweasel # Redirect include firefox.profile diff --git a/etc/profile-a-l/idea.sh.profile b/etc/profile-a-l/idea.sh.profile index 31f65962f..2b4c68a4d 100644 --- a/etc/profile-a-l/idea.sh.profile +++ b/etc/profile-a-l/idea.sh.profile @@ -36,7 +36,7 @@ seccomp private-cache private-dev -# private-tmp +#private-tmp noexec /tmp restrict-namespaces diff --git a/etc/profile-a-l/img2txt.profile b/etc/profile-a-l/img2txt.profile index ee341423a..8091a4c9e 100644 --- a/etc/profile-a-l/img2txt.profile +++ b/etc/profile-a-l/img2txt.profile @@ -41,7 +41,7 @@ seccomp tracelog x11 none -# private-bin img2txt +#private-bin img2txt private-cache private-dev private-tmp diff --git a/etc/profile-a-l/impressive.profile b/etc/profile-a-l/impressive.profile index d9a256c11..9512da9ad 100644 --- a/etc/profile-a-l/impressive.profile +++ b/etc/profile-a-l/impressive.profile @@ -23,7 +23,6 @@ include disable-xdg.inc mkdir ${HOME}/.cache/mesa_shader_cache whitelist /usr/share/opengl-games-utils -whitelist /usr/share/zenity include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-a-l/inkscape.profile b/etc/profile-a-l/inkscape.profile index c4fc16c87..ced7a285f 100644 --- a/etc/profile-a-l/inkscape.profile +++ b/etc/profile-a-l/inkscape.profile @@ -61,7 +61,7 @@ protocol unix seccomp tracelog -# private-bin inkscape,potrace,python* - problems on Debian stretch +#private-bin inkscape,potrace,python* # problems on Debian stretch private-cache private-dev private-etc @x11,ImageMagick*,python* diff --git a/etc/profile-a-l/ipcalc.profile b/etc/profile-a-l/ipcalc.profile index 7eabbca84..369519947 100644 --- a/etc/profile-a-l/ipcalc.profile +++ b/etc/profile-a-l/ipcalc.profile @@ -14,11 +14,11 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc -# include disable-shell.inc +#include disable-shell.inc include disable-write-mnt.inc include disable-xdg.inc -# include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc @@ -26,7 +26,7 @@ include whitelist-var-common.inc apparmor caps.drop all ipc-namespace -# machine-id +#machine-id net none netfilter no3d @@ -39,14 +39,14 @@ nosound notv nou2f novideo -# protocol unix +#protocol unix seccomp -# tracelog +#tracelog disable-mnt private private-bin bash,ipcalc,ipcalc-ng,perl,sh -# private-cache +#private-cache private-dev # empty etc directory private-etc @@ -57,6 +57,6 @@ private-tmp dbus-user none dbus-system none -# memory-deny-write-execute -# read-only ${HOME} +#memory-deny-write-execute +#read-only ${HOME} restrict-namespaces diff --git a/etc/profile-a-l/irssi.profile b/etc/profile-a-l/irssi.profile new file mode 100644 index 000000000..5d5c5b087 --- /dev/null +++ b/etc/profile-a-l/irssi.profile @@ -0,0 +1,59 @@ +# Firejail profile for irssi +# Description: TUI IRC client +# This file is overwritten after every install/update +# Persistent local customizations +include irssi.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.irssi + +# Add the next line to irssi.local if you use perl scripting. +#include allow-perl.inc + +blacklist ${RUNUSER}/wayland-* + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-X11.inc +include disable-xdg.inc + +mkdir ${HOME}/.irssi +whitelist ${HOME}/.irssi +include whitelist-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +caps.drop all +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notpm +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary + +disable-mnt +private-cache +private-dev +# private-etc @network,@tls-ca +private-tmp + +dbus-user none +dbus-system none + +restrict-namespaces diff --git a/etc/profile-a-l/jitsi-meet-desktop.profile b/etc/profile-a-l/jitsi-meet-desktop.profile index bc2c33cfb..cc6fd2114 100644 --- a/etc/profile-a-l/jitsi-meet-desktop.profile +++ b/etc/profile-a-l/jitsi-meet-desktop.profile @@ -9,7 +9,6 @@ include globals.local # Disabled until someone reported positive feedback ignore nou2f ignore novideo -ignore shell none ignore noexec /tmp diff --git a/etc/profile-a-l/journal-viewer.profile b/etc/profile-a-l/journal-viewer.profile new file mode 100644 index 000000000..eb007b765 --- /dev/null +++ b/etc/profile-a-l/journal-viewer.profile @@ -0,0 +1,24 @@ +# Firejail profile for journal-viewer +# Description: Visualize systemd logs +# This file is overwritten after every install/update +# Persistent local customizations +include journal-viewer.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.cache/journal-viewer +noblacklist ${HOME}/.local/share/com.vmingueza.journal-viewer + +mkdir ${HOME}/.cache/journal-viewer +mkdir ${HOME}/.local/share/com.vmingueza.journal-viewer +whitelist ${HOME}/.cache/journal-viewer +whitelist ${HOME}/.local/share/com.vmingueza.journal-viewer + +private-bin journal-viewer +private-lib webkit2gtk-* + +read-write ${HOME}/.cache/journal-viewer +read-write ${HOME}/.local/share/com.vmingueza.journal-viewer + +# Redirect +include system-log-common.profile diff --git a/etc/profile-a-l/k3b.profile b/etc/profile-a-l/k3b.profile index 81d4f3458..8880cde6c 100644 --- a/etc/profile-a-l/k3b.profile +++ b/etc/profile-a-l/k3b.profile @@ -21,19 +21,20 @@ include disable-xdg.inc include whitelist-var-common.inc caps.keep chown,dac_override,ipc_lock,net_bind_service,sys_admin,sys_nice,sys_rawio,sys_resource -# net none +#net none netfilter no3d -# nonewprivs - breaks privileged helpers +#nodvd +#nonewprivs # breaks privileged helpers noinput -# noroot - breaks privileged helpers +#noroot # breaks privileged helpers nosound notv novideo -# protocol unix - breaks privileged helpers -# seccomp - breaks privileged helpers +#protocol unix # breaks privileged helpers +#seccomp # breaks privileged helpers -private-dev -# private-tmp +#private-dev # breaks detection of dvd drives (see #6279) +#private-tmp -# restrict-namespaces - breaks privileged helpers +#restrict-namespaces # breaks privileged helpers diff --git a/etc/profile-a-l/kaffeine.profile b/etc/profile-a-l/kaffeine.profile index 73417bf11..b84d144bd 100644 --- a/etc/profile-a-l/kaffeine.profile +++ b/etc/profile-a-l/kaffeine.profile @@ -36,7 +36,7 @@ novideo protocol unix,inet,inet6 seccomp -# private-bin kaffeine +#private-bin kaffeine private-dev private-tmp diff --git a/etc/profile-a-l/kalgebra.profile b/etc/profile-a-l/kalgebra.profile index a4e67cf6b..359c02b38 100644 --- a/etc/profile-a-l/kalgebra.profile +++ b/etc/profile-a-l/kalgebra.profile @@ -35,7 +35,7 @@ nou2f novideo protocol unix,netlink seccomp !chroot -# tracelog +#tracelog disable-mnt private-bin kalgebra,kalgebramobile @@ -47,4 +47,4 @@ private-tmp dbus-user none dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/kate.profile b/etc/profile-a-l/kate.profile index 152f73d5d..f141a25e1 100644 --- a/etc/profile-a-l/kate.profile +++ b/etc/profile-a-l/kate.profile @@ -28,17 +28,17 @@ noblacklist ${HOME}/.local/share/kxmlgui5/katesearch include allow-common-devel.inc include disable-common.inc -# include disable-devel.inc +#include disable-devel.inc include disable-exec.inc -# include disable-interpreters.inc +#include disable-interpreters.inc include disable-programs.inc include whitelist-run-common.inc include whitelist-var-common.inc -# apparmor +#apparmor caps.drop all -# net none +#net none netfilter nodvd nogroups @@ -52,13 +52,13 @@ novideo protocol unix seccomp -# private-bin kate,kbuildsycoca4,kdeinit4 +#private-bin kate,kbuildsycoca4,kdeinit4 private-dev -# private-etc alternatives,fonts,kde4rc,kde5rc,ld.so.cache,machine-id,xdg +#private-etc alternatives,fonts,kde4rc,kde5rc,ld.so.cache,machine-id,xdg private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces join-or-start kate diff --git a/etc/profile-a-l/kazam.profile b/etc/profile-a-l/kazam.profile index 70414eeea..5a19d2f50 100644 --- a/etc/profile-a-l/kazam.profile +++ b/etc/profile-a-l/kazam.profile @@ -45,7 +45,7 @@ seccomp tracelog disable-mnt -# private-bin kazam,python* +#private-bin kazam,python* private-cache private-dev private-etc @x11 diff --git a/etc/profile-a-l/kcalc.profile b/etc/profile-a-l/kcalc.profile index cfb756c43..9f10039df 100644 --- a/etc/profile-a-l/kcalc.profile +++ b/etc/profile-a-l/kcalc.profile @@ -60,7 +60,7 @@ private-bin kcalc private-cache private-dev private-etc -# private-lib - problems on Arch +#private-lib # problems on Arch private-tmp dbus-user none diff --git a/etc/profile-a-l/kdeinit4.profile b/etc/profile-a-l/kdeinit4.profile index 2f426e191..dce189c59 100644 --- a/etc/profile-a-l/kdeinit4.profile +++ b/etc/profile-a-l/kdeinit4.profile @@ -22,7 +22,7 @@ no3d nogroups noinput nonewprivs -# nosound - disabled for knotify +#nosound # disabled for knotify noroot nou2f novideo diff --git a/etc/profile-a-l/kdenlive.profile b/etc/profile-a-l/kdenlive.profile index d4933d816..717bfa8d6 100644 --- a/etc/profile-a-l/kdenlive.profile +++ b/etc/profile-a-l/kdenlive.profile @@ -21,7 +21,7 @@ include disable-programs.inc apparmor caps.drop all -# net none +#net none nodvd nogroups noinput @@ -34,9 +34,9 @@ seccomp private-bin dbus-launch,dvdauthor,ffmpeg,ffplay,ffprobe,genisoimage,kdeinit4,kdeinit4_shutdown,kdeinit4_wrapper,kdeinit5,kdeinit5_shutdown,kdeinit5_wrapper,kdenlive,kdenlive_render,kshell4,kshell5,melt,mlt-melt,vlc,xine private-dev -# private-etc alternatives,fonts,kde4rc,kde5rc,ld.so.cache,machine-id,passwd,pulse,X11,xdg +#private-etc alternatives,fonts,kde4rc,kde5rc,ld.so.cache,machine-id,passwd,pulse,X11,xdg -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/kdiff3.profile b/etc/profile-a-l/kdiff3.profile index d9e4480f5..02b389dff 100644 --- a/etc/profile-a-l/kdiff3.profile +++ b/etc/profile-a-l/kdiff3.profile @@ -12,8 +12,8 @@ noblacklist ${HOME}/.config/kdiff3rc # Add the next line to your kdiff3.local if you don't need to compare files in disable-common.inc. # By default we deny access only to .ssh and .gnupg. #include disable-common.inc -blacklist ${HOME}/.ssh blacklist ${HOME}/.gnupg +blacklist ${HOME}/.ssh include disable-devel.inc include disable-exec.inc diff --git a/etc/profile-a-l/keepassxc.profile b/etc/profile-a-l/keepassxc.profile index 4e8c8e449..1ba4f0eba 100644 --- a/etc/profile-a-l/keepassxc.profile +++ b/etc/profile-a-l/keepassxc.profile @@ -13,6 +13,8 @@ noblacklist ${HOME}/.config/keepassxc noblacklist ${HOME}/.config/KeePassXCrc noblacklist ${HOME}/.keepassxc noblacklist ${DOCUMENTS} +noblacklist ${RUNUSER}/app +noblacklist /tmp/ssh-* # Allow browser profiles, required for browser integration. noblacklist ${HOME}/.config/BraveSoftware @@ -62,8 +64,12 @@ include disable-xdg.inc #whitelist ${HOME}/.config/KeePassXCrc #include whitelist-common.inc +mkdir ${RUNUSER}/app/org.keepassxc.KeePassXC +whitelist ${RUNUSER}/app/org.keepassxc.KeePassXC +whitelist /tmp/ssh-* whitelist /usr/share/keepassxc include whitelist-run-common.inc +include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-a-l/kfind.profile b/etc/profile-a-l/kfind.profile index c70030a38..115f785eb 100644 --- a/etc/profile-a-l/kfind.profile +++ b/etc/profile-a-l/kfind.profile @@ -9,21 +9,21 @@ include globals.local # searching in blacklisted or masked paths fails silently # adjust filesystem restrictions as necessary -# noblacklist ${HOME}/.cache/kfind - disable-programs.inc is disabled, see below -# noblacklist ${HOME}/.config/kfindrc -# noblacklist ${HOME}/.kde/share/config/kfindrc -# noblacklist ${HOME}/.kde4/share/config/kfindrc +#noblacklist ${HOME}/.cache/kfind # disable-programs.inc is disabled, see below +#noblacklist ${HOME}/.config/kfindrc +#noblacklist ${HOME}/.kde/share/config/kfindrc +#noblacklist ${HOME}/.kde4/share/config/kfindrc include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc -# include disable-programs.inc +#include disable-programs.inc apparmor caps.drop all machine-id -# net none +#net none netfilter no3d nodvd @@ -38,11 +38,11 @@ novideo protocol unix seccomp -# private-bin kbuildsycoca4,kdeinit4,kfind +#private-bin kbuildsycoca4,kdeinit4,kfind private-dev private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/kget.profile b/etc/profile-a-l/kget.profile index dd45c1889..892577117 100644 --- a/etc/profile-a-l/kget.profile +++ b/etc/profile-a-l/kget.profile @@ -40,5 +40,5 @@ seccomp private-dev private-tmp -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-a-l/kiwix-desktop.profile b/etc/profile-a-l/kiwix-desktop.profile index 2e369b945..9f41f41db 100644 --- a/etc/profile-a-l/kiwix-desktop.profile +++ b/etc/profile-a-l/kiwix-desktop.profile @@ -27,13 +27,13 @@ apparmor caps.drop all ipc-namespace netfilter -# no3d +#no3d nodvd nogroups noinput nonewprivs noroot -# nosound +#nosound notv nou2f novideo @@ -49,4 +49,4 @@ private-tmp dbus-user none dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-a-l/kmail.profile b/etc/profile-a-l/kmail.profile index 02dbf5be6..c21b35e21 100644 --- a/etc/profile-a-l/kmail.profile +++ b/etc/profile-a-l/kmail.profile @@ -41,7 +41,7 @@ include disable-programs.inc include whitelist-run-common.inc include whitelist-var-common.inc -# apparmor +#apparmor caps.drop all netfilter nodvd @@ -55,10 +55,10 @@ novideo protocol unix,inet,inet6,netlink # we need to allow chroot, io_getevents, ioprio_set, io_setup, io_submit system calls seccomp !chroot,!io_getevents,!io_setup,!io_submit,!ioprio_set -# tracelog +#tracelog private-dev -# private-tmp - interrupts connection to akonadi, breaks opening of email attachments +#private-tmp # interrupts connection to akonadi, breaks opening of email attachments # writable-run-user is needed for signing and encrypting emails writable-run-user @@ -67,3 +67,4 @@ writable-run-user #dbus-user filter # restrict-namespaces + diff --git a/etc/profile-a-l/kmplayer.profile b/etc/profile-a-l/kmplayer.profile index 992b312ee..7615f00c4 100644 --- a/etc/profile-a-l/kmplayer.profile +++ b/etc/profile-a-l/kmplayer.profile @@ -33,7 +33,7 @@ nou2f protocol unix,inet,inet6,netlink seccomp -# private-bin kmplayer,mplayer +#private-bin kmplayer,mplayer private-cache private-dev private-tmp diff --git a/etc/profile-a-l/konversation.profile b/etc/profile-a-l/konversation.profile index e4781fea3..10a823c89 100644 --- a/etc/profile-a-l/konversation.profile +++ b/etc/profile-a-l/konversation.profile @@ -42,5 +42,5 @@ private-cache private-dev private-tmp -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-a-l/koreader.profile b/etc/profile-a-l/koreader.profile new file mode 100644 index 000000000..f210ba72c --- /dev/null +++ b/etc/profile-a-l/koreader.profile @@ -0,0 +1,65 @@ +# Firejail profile for koreader +# Description: Ebook reader application +# This file is overwritten after every install/update +# Persistent local customizations +include koreader.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +noblacklist ${HOME}/.config/koreader +noblacklist ${DOCUMENTS} + +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-xdg.inc + +mkdir ${HOME}/.config/koreader +whitelist ${HOME}/.config/koreader +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +net none +#no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,netlink +seccomp +seccomp.block-secondary +tracelog + +private-cache +private-dev +private-etc +private-lib +private-tmp + +dbus-user none +dbus-system none + +read-only ${HOME} +read-write ${HOME}/.config/koreader +read-write ${DOWNLOADS} +restrict-namespaces diff --git a/etc/profile-a-l/krita.profile b/etc/profile-a-l/krita.profile index a04376430..f61bf36a8 100644 --- a/etc/profile-a-l/krita.profile +++ b/etc/profile-a-l/krita.profile @@ -28,7 +28,7 @@ include disable-xdg.inc apparmor caps.drop all ipc-namespace -# net none +#net none netfilter nodvd nogroups @@ -46,7 +46,7 @@ private-cache private-dev private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/krunner.profile b/etc/profile-a-l/krunner.profile index 27feccf40..8af3657d1 100644 --- a/etc/profile-a-l/krunner.profile +++ b/etc/profile-a-l/krunner.profile @@ -6,23 +6,23 @@ include krunner.local # Persistent global definitions include globals.local -# - programs started in krunner run with this generic profile -# - when a file is opened in krunner, the file viewer runs in its own sandbox -# with its own profile, if it is sandboxed automatically +# Programs started in krunner run with this generic profile. +# When a file is opened in krunner, the file viewer runs in its own sandbox +# with its own profile, if it is sandboxed automatically. -# noblacklist ${HOME}/.cache/krunner -# noblacklist ${HOME}/.cache/krunnerbookmarkrunnerfirefoxdbfile.sqlite* -# noblacklist ${HOME}/.config/chromium +#noblacklist ${HOME}/.cache/krunner +#noblacklist ${HOME}/.cache/krunnerbookmarkrunnerfirefoxdbfile.sqlite* +#noblacklist ${HOME}/.config/chromium noblacklist ${HOME}/.config/krunnerrc noblacklist ${HOME}/.kde/share/config/krunnerrc noblacklist ${HOME}/.kde4/share/config/krunnerrc -# noblacklist ${HOME}/.local/share/baloo -# noblacklist ${HOME}/.mozilla +#noblacklist ${HOME}/.local/share/baloo +#noblacklist ${HOME}/.mozilla include disable-common.inc -# include disable-devel.inc -# include disable-interpreters.inc -# include disable-programs.inc +#include disable-devel.inc +#include disable-interpreters.inc +#include disable-programs.inc include whitelist-var-common.inc @@ -34,6 +34,6 @@ noroot protocol unix,inet,inet6 seccomp -# private-cache +#private-cache restrict-namespaces diff --git a/etc/profile-a-l/ktorrent.profile b/etc/profile-a-l/ktorrent.profile index da267b962..63bdc0b83 100644 --- a/etc/profile-a-l/ktorrent.profile +++ b/etc/profile-a-l/ktorrent.profile @@ -62,9 +62,9 @@ seccomp private-bin kbuildsycoca4,kdeinit4,ktmagnetdownloader,ktorrent,ktupnptest private-dev -# private-lib - problems on Arch +#private-lib # problems on Arch private-tmp deterministic-shutdown -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-a-l/kube.profile b/etc/profile-a-l/kube.profile index 5cf30ed40..67ff64954 100644 --- a/etc/profile-a-l/kube.profile +++ b/etc/profile-a-l/kube.profile @@ -6,14 +6,16 @@ include kube.local # Persistent global definitions include globals.local -noblacklist ${HOME}/.gnupg -noblacklist ${HOME}/.mozilla noblacklist ${HOME}/.cache/kube noblacklist ${HOME}/.config/kube noblacklist ${HOME}/.config/sink +noblacklist ${HOME}/.gnupg noblacklist ${HOME}/.local/share/kube noblacklist ${HOME}/.local/share/sink +# sh is needed to allow Firefox to open links +include allow-bin-sh.inc + include disable-common.inc include disable-devel.inc include disable-exec.inc @@ -22,23 +24,28 @@ include disable-programs.inc include disable-shell.inc include disable-xdg.inc -mkdir ${HOME}/.gnupg +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) +noblacklist ${HOME}/.mozilla +whitelist ${HOME}/.mozilla/firefox/profiles.ini + mkdir ${HOME}/.cache/kube mkdir ${HOME}/.config/kube mkdir ${HOME}/.config/sink +mkdir ${HOME}/.gnupg mkdir ${HOME}/.local/share/kube mkdir ${HOME}/.local/share/sink -whitelist ${HOME}/.gnupg -whitelist ${HOME}/.mozilla/firefox/profiles.ini whitelist ${HOME}/.cache/kube whitelist ${HOME}/.config/kube whitelist ${HOME}/.config/sink +whitelist ${HOME}/.gnupg whitelist ${HOME}/.local/share/kube whitelist ${HOME}/.local/share/sink whitelist ${RUNUSER}/gnupg -whitelist /usr/share/kube whitelist /usr/share/gnupg whitelist /usr/share/gnupg2 +whitelist /usr/share/kube include whitelist-common.inc include whitelist-runuser-common.inc include whitelist-usr-share-common.inc @@ -61,9 +68,8 @@ protocol unix,inet,inet6 seccomp tracelog -# disable-mnt +#disable-mnt # Add "gpg,gpg2,gpg-agent,pinentry-curses,pinentry-emacs,pinentry-fltk,pinentry-gnome3,pinentry-gtk,pinentry-gtk2,pinentry-gtk-2,pinentry-qt,pinentry-qt4,pinentry-tty,pinentry-x2go,pinentry-kwallet" for gpg -# Add "ignore private-bin" for hyperlinks or have a look at the private-bins in firefox.profile and firefox-common.profile. private-bin kube,sink_synchronizer private-cache private-dev @@ -73,8 +79,10 @@ writable-run-user dbus-user filter dbus-user.talk ca.desrt.dconf -dbus-user.talk org.freedesktop.secrets dbus-user.talk org.freedesktop.Notifications +dbus-user.talk org.freedesktop.secrets +# Allow D-Bus communication with Firefox for opening links +dbus-user.talk org.mozilla.* dbus-system none restrict-namespaces diff --git a/etc/profile-a-l/kwin_x11.profile b/etc/profile-a-l/kwin_x11.profile index 589811643..da430377e 100644 --- a/etc/profile-a-l/kwin_x11.profile +++ b/etc/profile-a-l/kwin_x11.profile @@ -5,7 +5,7 @@ include kwin_x11.local # Persistent global definitions include globals.local -# fix automatical kwin_x11 sandboxing: +# fix automatic kwin_x11 sandboxing: # echo KDEWM=kwin_x11 >> ~/.pam_environment noblacklist ${HOME}/.cache/kwin diff --git a/etc/profile-a-l/kwrite.profile b/etc/profile-a-l/kwrite.profile index 34fe2ace6..efc6b7c56 100644 --- a/etc/profile-a-l/kwrite.profile +++ b/etc/profile-a-l/kwrite.profile @@ -29,14 +29,14 @@ include whitelist-var-common.inc apparmor caps.drop all -# net none +#net none netfilter nodvd nogroups noinput nonewprivs noroot -# nosound - KWrite is using ALSA! +#nosound # KWrite is using ALSA! notv nou2f novideo @@ -49,8 +49,8 @@ private-dev private-etc @x11 private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces join-or-start kwrite diff --git a/etc/profile-a-l/lbreakouthd.profile b/etc/profile-a-l/lbreakouthd.profile new file mode 100644 index 000000000..e454772fc --- /dev/null +++ b/etc/profile-a-l/lbreakouthd.profile @@ -0,0 +1,58 @@ +# Firejail profile for lbreakouthd +# Persistent local customizations +include lbreakouthd.local +# Persistent global definitions +include globals.local + +# Note: this profile requires the current user to be a member of games group + +noblacklist ${HOME}/.lbreakouthd + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.lbreakouthd +whitelist ${HOME}/.lbreakouthd +whitelist ${RUNUSER}/pulse +whitelist /run/host/container-manager +whitelist /run/udev/control +whitelist /usr/share/games/lbreakouthd +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +net none +netfilter +nodvd +noinput +nonewprivs +noroot +notv +nou2f +novideo +protocol unix +seccomp +tracelog + +disable-mnt +private-bin lbreakouthd +private-dev +private-etc @games,@sound,@x11 +private-tmp +writable-var # game scores are stored under /var/games + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-a-l/lbry-viewer-gtk.profile b/etc/profile-a-l/lbry-viewer-gtk.profile new file mode 100644 index 000000000..8d0b7e8a0 --- /dev/null +++ b/etc/profile-a-l/lbry-viewer-gtk.profile @@ -0,0 +1,14 @@ +# Firejail profile for lbry-viewer-gtk +# Description: GTK front-end to lbry-viewer +# This file is overwritten after every install/update +# Persistent local customizations +include lbry-viewer-gtk.local +# added by included profile +#include globals.local + +private-bin lbry-viewer-gtk + +include gtk-youtube-viewers-common.profile + +# Redirect +include lbry-viewer.profile diff --git a/etc/profile-a-l/ledger-live-desktop.profile b/etc/profile-a-l/ledger-live-desktop.profile new file mode 100644 index 000000000..3640e730d --- /dev/null +++ b/etc/profile-a-l/ledger-live-desktop.profile @@ -0,0 +1,61 @@ +# Firejail profile for Ledger Live desktop app +# Description: Cryptocurrency wallet by the makers of Ledger hardware wallets +# This file is overwritten after every install/update +# Persistent local customizations +include ledger-live-desktop.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.config/Ledger Live + +# Added by disable-exec.inc, breaks hardware wallet manager +ignore noexec /tmp + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.config/Ledger Live +whitelist ${HOME}/.config/Ledger Live +whitelist ${DOWNLOADS} +whitelist /opt/ledger-live +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +nodvd +nogroups +nonewprivs +noprinters +noroot +nosound +notv +novideo +protocol unix,inet,inet6,netlink +seccomp !chroot +tracelog + +disable-mnt +private-cache +# enabling private-dev blocks USB hardware wallets, if you don't need access to +# USB devices you can add private-dev to your ledger-live-desktop.local +#private-dev +private-etc @network,@tls-ca,@x11,host.conf,rpc +private-lib +private-tmp + +# app attempts to connect to dbus but seems to work fine when blocked +dbus-user none +dbus-system none diff --git a/etc/profile-a-l/less.profile b/etc/profile-a-l/less.profile index 6efe23ade..661c0594a 100644 --- a/etc/profile-a-l/less.profile +++ b/etc/profile-a-l/less.profile @@ -36,8 +36,8 @@ x11 none # The user can have a custom coloring script configured in ${HOME}/.lessfilter. # Enable private-bin and private-lib if you are not using any filter. -# private-bin less -# private-lib +#private-bin less +#private-lib private-cache private-dev writable-var-log diff --git a/etc/profile-a-l/lettura.profile b/etc/profile-a-l/lettura.profile new file mode 100644 index 000000000..32f0909fb --- /dev/null +++ b/etc/profile-a-l/lettura.profile @@ -0,0 +1,79 @@ +# Firejail profile for lettura +# Description: Another free and open-source feed reader +# This file is overwritten after every install/update +# Persistent local customizations +include lettura.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.cache/lettura +noblacklist ${HOME}/.config/com.lettura.dev +noblacklist ${HOME}/.lettura +noblacklist ${HOME}/.local/share/com.lettura.dev + +# sh is needed to allow Firefox to open links +include allow-bin-sh.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.cache/lettura +mkdir ${HOME}/.config/com.lettura.dev +mkdir ${HOME}/.lettura +mkdir ${HOME}/.local/share/com.lettura.dev +whitelist ${HOME}/.cache/lettura +whitelist ${HOME}/.config/com.lettura.dev +whitelist ${HOME}/.lettura +whitelist ${HOME}/.local/share/com.lettura.dev +whitelist ${DOWNLOADS} +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) +noblacklist ${HOME}/.mozilla +whitelist ${HOME}/.mozilla/firefox/profiles.ini + +apparmor +caps.drop all +netfilter +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +#nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-bin lettura +private-cache +private-dev +private-etc @network,@sound,@tls-ca,@x11,mime.types +private-tmp + +dbus-user filter +dbus-user.talk org.freedesktop.Notifications +?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher +# Allow D-Bus communication with Firefox for opening links +dbus-user.talk org.mozilla.* +dbus-system none + +restrict-namespaces diff --git a/etc/profile-a-l/libreoffice.profile b/etc/profile-a-l/libreoffice.profile index d7144d8c3..f9e018a33 100644 --- a/etc/profile-a-l/libreoffice.profile +++ b/etc/profile-a-l/libreoffice.profile @@ -9,6 +9,16 @@ include globals.local noblacklist /usr/local/sbin noblacklist ${HOME}/.config/libreoffice +# libreoffice can sign documents with GPG +noblacklist ${HOME}/.gnupg +read-only ${HOME}/.gnupg/trustdb.gpg +read-only ${HOME}/.gnupg/pubring.kbx +blacklist ${HOME}/.gnupg/crls.d +blacklist ${HOME}/.gnupg/openpgp-revocs.d +blacklist ${HOME}/.gnupg/private-keys-v1.d +blacklist ${HOME}/.gnupg/pubring.kbx~ +blacklist ${HOME}/.gnupg/random_seed + # libreoffice uses java for some functionality. # Add 'ignore include allow-java.inc' to your libreoffice.local if you don't need that functionality. # Allow java (blacklisted by disable-devel.inc) diff --git a/etc/profile-a-l/librewolf.profile b/etc/profile-a-l/librewolf.profile index b84cbb119..23d2f78c2 100644 --- a/etc/profile-a-l/librewolf.profile +++ b/etc/profile-a-l/librewolf.profile @@ -1,4 +1,4 @@ -# Firejail profile for Librewolf +# Firejail profile for librewolf # Description: Firefox fork based on privacy # This file is overwritten after every install/update # Persistent local customizations @@ -14,44 +14,16 @@ mkdir ${HOME}/.librewolf whitelist ${HOME}/.cache/librewolf whitelist ${HOME}/.librewolf -# Add the next lines to your librewolf.local if you want to use the migration wizard. -#noblacklist ${HOME}/.mozilla -#whitelist ${HOME}/.mozilla - -# To enable KeePassXC Plugin add one of the following lines to your librewolf.local. -# NOTE: start KeePassXC before Librewolf and keep it open to allow communication between them. -#whitelist ${RUNUSER}/kpxc_server -#whitelist ${RUNUSER}/org.keepassxc.KeePassXC.BrowserServer - -whitelist /usr/share/doc -whitelist /usr/share/gtk-doc/html whitelist /usr/share/librewolf -whitelist /usr/share/mozilla -whitelist /usr/share/webext -include whitelist-usr-share-common.inc -# Add the next line to your librewolf.local to enable private-bin (Arch Linux). +# Add the next line to librewolf.local to enable private-bin. #private-bin dbus-launch,dbus-send,librewolf,sh -# Add the next line to your librewolf.local to enable private-etc. -# NOTE: private-etc must first be enabled in firefox-common.local. -#private-etc librewolf +private-etc librewolf dbus-user filter +dbus-user.own io.gitlab.firefox.* dbus-user.own io.gitlab.librewolf.* dbus-user.own org.mozilla.librewolf.* -# Add the next line to your librewolf.local to enable native notifications. -#dbus-user.talk org.freedesktop.Notifications -# Add the next line to your librewolf.local to allow inhibiting screensavers. -#dbus-user.talk org.freedesktop.ScreenSaver -# Add the next lines to your librewolf.local for plasma browser integration. -#dbus-user.own org.mpris.MediaPlayer2.plasma-browser-integration -#dbus-user.talk org.kde.JobViewServer -#dbus-user.talk org.kde.kuiserver -# Add the next line to your librewolf.local to allow screensharing under Wayland. -#dbus-user.talk org.freedesktop.portal.Desktop -# Also add the next line to your librewolf.local if screensharing does not work with -# the above lines (depends on the portal implementation). -#ignore noroot ignore apparmor ignore dbus-user none diff --git a/etc/profile-a-l/liferea.profile b/etc/profile-a-l/liferea.profile index b0e9015ee..739d2cc1e 100644 --- a/etc/profile-a-l/liferea.profile +++ b/etc/profile-a-l/liferea.profile @@ -33,13 +33,13 @@ include whitelist-var-common.inc caps.drop all netfilter -# no3d +#no3d nodvd nogroups noinput nonewprivs noroot -# nosound +#nosound notv nou2f novideo diff --git a/etc/profile-a-l/links-common.profile b/etc/profile-a-l/links-common.profile index 838d619b7..fd0aab879 100644 --- a/etc/profile-a-l/links-common.profile +++ b/etc/profile-a-l/links-common.profile @@ -4,7 +4,6 @@ include links-common.local # common profile for links browsers -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc @@ -14,6 +13,7 @@ include disable-interpreters.inc # Additional noblacklist files/directories (blacklisted in disable-programs.inc) # used as associated programs can be added in your links-common.local. include disable-programs.inc +include disable-x11.inc include disable-xdg.inc whitelist ${DOWNLOADS} @@ -52,7 +52,7 @@ private-cache private-dev private-etc @tls-ca # Add the next line to your links-common.local to allow external media players. -# private-etc alsa,asound.conf,machine-id,openal,pulse +#private-etc alsa,asound.conf,machine-id,openal,pulse private-tmp dbus-user none diff --git a/etc/profile-a-l/linuxqq.profile b/etc/profile-a-l/linuxqq.profile index 6ca8b8103..278797fb3 100644 --- a/etc/profile-a-l/linuxqq.profile +++ b/etc/profile-a-l/linuxqq.profile @@ -7,16 +7,22 @@ include linuxqq.local include globals.local noblacklist ${HOME}/.config/QQ -noblacklist ${HOME}/.mozilla +# sh is needed to allow Firefox to open links include allow-bin-sh.inc include disable-shell.inc +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) +noblacklist ${HOME}/.mozilla +whitelist ${HOME}/.mozilla/firefox/profiles.ini + mkdir ${HOME}/.config/QQ whitelist ${HOME}/.config/QQ -whitelist ${HOME}/.mozilla/firefox/profiles.ini whitelist ${DESKTOP} +whitelist /opt/QQ ignore apparmor noprinters @@ -24,7 +30,6 @@ noprinters # If you don't need/want to save anything to disk you can add `private` to your linuxqq.local. #private private-etc @tls-ca,@x11,host.conf,os-release -private-opt QQ dbus-user filter dbus-user.talk org.freedesktop.Notifications @@ -34,6 +39,7 @@ dbus-user.talk org.freedesktop.portal.IBus dbus-user.talk org.freedesktop.ScreenSaver dbus-user.talk org.gnome.Mutter.IdleMonitor ?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher +# Allow D-Bus communication with Firefox for opening links dbus-user.talk org.mozilla.* ignore dbus-user none diff --git a/etc/profile-a-l/lobster.profile b/etc/profile-a-l/lobster.profile index 4daa1d010..b46a689e8 100644 --- a/etc/profile-a-l/lobster.profile +++ b/etc/profile-a-l/lobster.profile @@ -17,6 +17,7 @@ noblacklist ${HOME}/.config/ueberzugpp noblacklist ${HOME}/.local/share/applications/lobster noblacklist ${HOME}/.local/share/lobster noblacklist ${PATH}/openssl +noblacklist ${PATH}/patch # Allow /bin/sh (blacklisted by disable-shell.inc) include allow-bin-sh.inc @@ -41,9 +42,9 @@ noprinters notv disable-mnt -private-bin base64,bash,cat,command,curl,cut,date,dirname,echo,ffmpeg,ffprobe,find,fzf,grep,head,hxunent,ln,lobster,ls,mkdir,mkfifo,nano,nohup,openssl,patch,pgrep,ps,rm,rofi,sed,sh,sleep,socat,tail,tee,tput,tr,ueberzugpp,uname,uuidgen,vim,wc +private-bin base64,basename,bash,cat,curl,cut,date,dirname,echo,ffmpeg,ffprobe,find,fzf,grep,head,hxunent,ln,lobster,ls,mkdir,mkfifo,nano,nohup,openssl,patch,pgrep,ps,rm,rofi,sed,sh,sleep,socat,tail,tee,tput,tr,ueberzugpp,uname,uuidgen,vim,wc #private-cache -private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg +private-etc X11,alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,xdg private-tmp # Redirect diff --git a/etc/profile-a-l/localsend_app.profile b/etc/profile-a-l/localsend_app.profile new file mode 100644 index 000000000..e9dbb0607 --- /dev/null +++ b/etc/profile-a-l/localsend_app.profile @@ -0,0 +1,65 @@ +# Firejail profile for localsend_app +# Description: An open source cross-platform alternative to AirDrop +# This file is overwritten after every install/update +# Persistent local customizations +include localsend_app.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +noblacklist ${HOME}/.local/share/localsend_app + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +#include disable-xdg.inc + +#mkdir ${HOME}/.local/share/localsend_app +#whitelist ${HOME}/.local/share/localsend_app +#whitelist ${DOWNLOADS} +#whitelist /usr/share/localsend_app +#include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +#no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog + +private-bin localsend_app +private-cache +private-dev +private-etc @network,@tls-ca +private-tmp + +dbus-user none +dbus-system none + +read-only ${HOME} +read-write ${HOME}/.local/share/localsend_app +read-write ${DOWNLOADS} +restrict-namespaces diff --git a/etc/profile-a-l/loupe.profile b/etc/profile-a-l/loupe.profile new file mode 100644 index 000000000..9406053fd --- /dev/null +++ b/etc/profile-a-l/loupe.profile @@ -0,0 +1,58 @@ +# Firejail profile for loupe +# Description: GNOME's modern Image Viewer program +# This file is overwritten after every install/update +# Persistent local customizations +include loupe.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.local/share/Trash +noblacklist ${HOME}/.Steam +noblacklist ${HOME}/.steam + +noblacklist ${PATH}/bwrap + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-write-mnt.inc + +#whitelist /usr/share/glycin-loaders +include whitelist-runuser-common.inc +#include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +#apparmor +caps.drop all +ipc-namespace +machine-id +net none +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,netlink +#loupe decodes all images in their own sandbox via glycin +#https://gitlab.gnome.org/sophie-h/glycin#sandboxing-and-inner-workings +#seccomp +seccomp.block-secondary +tracelog + +private-bin bwrap,loupe +private-cache +private-dev +private-etc @x11 +private-tmp + +dbus-user none +dbus-system none + +#read-only ${HOME} # breaks "Move to trash" and "Set as background" diff --git a/etc/profile-a-l/lutris.profile b/etc/profile-a-l/lutris.profile index 2658c5373..1255bd8e4 100644 --- a/etc/profile-a-l/lutris.profile +++ b/etc/profile-a-l/lutris.profile @@ -6,14 +6,20 @@ include lutris.local # Persistent global definitions include globals.local +# If you use gamescope, add the following to lutris.local to work around a bug +# (see #6191): +#ignore noroot +#ignore private-tmp + noblacklist ${PATH}/llvm* noblacklist ${HOME}/Games noblacklist ${HOME}/.cache/lutris noblacklist ${HOME}/.cache/wine noblacklist ${HOME}/.cache/winetricks +noblacklist ${HOME}/.config/MangoHud noblacklist ${HOME}/.config/lutris noblacklist ${HOME}/.local/share/lutris -# noblacklist ${HOME}/.wine +#noblacklist ${HOME}/.wine noblacklist /tmp/.wine-* # Don't block access to /sbin and /usr/sbin to allow using ldconfig. Otherwise # Lutris won't even start. @@ -39,15 +45,16 @@ mkdir ${HOME}/.cache/wine mkdir ${HOME}/.cache/winetricks mkdir ${HOME}/.config/lutris mkdir ${HOME}/.local/share/lutris -# mkdir ${HOME}/.wine +#mkdir ${HOME}/.wine whitelist ${DOWNLOADS} whitelist ${HOME}/Games whitelist ${HOME}/.cache/lutris whitelist ${HOME}/.cache/wine whitelist ${HOME}/.cache/winetricks +whitelist ${HOME}/.config/MangoHud whitelist ${HOME}/.config/lutris whitelist ${HOME}/.local/share/lutris -# whitelist ${HOME}/.wine +#whitelist ${HOME}/.wine whitelist /usr/share/lutris whitelist /usr/share/wine include whitelist-common.inc @@ -55,21 +62,21 @@ include whitelist-usr-share-common.inc include whitelist-runuser-common.inc include whitelist-var-common.inc -# allow-debuggers -# apparmor +#allow-debuggers +#apparmor caps.drop all ipc-namespace -# net none +#net none netfilter nodvd nogroups nonewprivs noroot notv -nou2f +#nou2f # may break gamepads in certain games (see #6523) novideo protocol unix,inet,inet6,netlink -seccomp !modify_ldt +seccomp !clone3,!modify_ldt,!process_vm_readv,!ptrace seccomp.32 !modify_ldt # Add the next line to your lutris.local if you do not need controller support. diff --git a/etc/profile-a-l/lynx.profile b/etc/profile-a-l/lynx.profile index caf8de104..233bdafb6 100644 --- a/etc/profile-a-l/lynx.profile +++ b/etc/profile-a-l/lynx.profile @@ -7,13 +7,13 @@ include lynx.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc include disable-devel.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc include whitelist-runuser-common.inc @@ -34,10 +34,10 @@ protocol unix,inet,inet6 seccomp tracelog -# private-bin lynx +#private-bin lynx private-cache private-dev -# private-etc alternatives,ca-certificates,crypto-policies,pki,ssl +#private-etc alternatives,ca-certificates,crypto-policies,pki,ssl private-tmp restrict-namespaces diff --git a/etc/profile-a-l/lyriek.profile b/etc/profile-a-l/lyriek.profile new file mode 100644 index 000000000..791fbf68c --- /dev/null +++ b/etc/profile-a-l/lyriek.profile @@ -0,0 +1,58 @@ +# Firejail profile for lyriek +# Description: A multi-threaded GTK application to fetch lyrics of currently playing songs +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include lyriek.local +# Persistent global definitions +include globals.local + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,inet +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-bin lyriek +private-cache +private-dev +private-etc @network,@tls-ca +private-lib +private-tmp + +dbus-user filter +dbus-user.talk org.mpris.MediaPlayer2.mpd +dbus-system none + +read-only ${HOME} +restrict-namespaces diff --git a/etc/profile-a-l/lyx.profile b/etc/profile-a-l/lyx.profile index c3366acef..46b40be0c 100644 --- a/etc/profile-a-l/lyx.profile +++ b/etc/profile-a-l/lyx.profile @@ -23,7 +23,6 @@ include allow-python3.inc whitelist /usr/share/lyx whitelist /usr/share/texinfo -whitelist /usr/share/texlive whitelist /usr/share/texmf-dist whitelist /usr/share/tlpkg include whitelist-usr-share-common.inc @@ -31,7 +30,7 @@ include whitelist-usr-share-common.inc apparmor machine-id -# private-bin atril,dvilualatex,env,latex,lua*,luatex,lyx,lyxclient,okular,pdf2latex,pdflatex,pdftex,perl*,python*,qpdf,qpdfview,sh,tex2lyx,texmf,xelatex +#private-bin atril,dvilualatex,env,latex,lua*,luatex,lyx,lyxclient,okular,pdf2latex,pdflatex,pdftex,perl*,python*,qpdf,qpdfview,sh,tex2lyx,texmf,xelatex private-etc @x11,lyx,mime.types,texmf # Redirect diff --git a/etc/profile-a-l/lz4.profile b/etc/profile-a-l/lz4.profile new file mode 100644 index 000000000..5e4e416f1 --- /dev/null +++ b/etc/profile-a-l/lz4.profile @@ -0,0 +1,11 @@ +# Firejail profile for lz4 +# Description: Compress or decompress .lz4 files +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include lz4.local +# Persistent global definitions +include globals.local + +# Redirect +include archiver-common.profile diff --git a/etc/profile-a-l/lz4c.profile b/etc/profile-a-l/lz4c.profile new file mode 100644 index 000000000..b05a81de1 --- /dev/null +++ b/etc/profile-a-l/lz4c.profile @@ -0,0 +1,11 @@ +# Firejail profile for lz4c +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include lz4c.local +# Persistent global definitions +# added by included profile +#include globals.local + +# Redirect +include lz4.profile diff --git a/etc/profile-a-l/lz4cat.profile b/etc/profile-a-l/lz4cat.profile new file mode 100644 index 000000000..90e056b1b --- /dev/null +++ b/etc/profile-a-l/lz4cat.profile @@ -0,0 +1,11 @@ +# Firejail profile for lz4cat +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include lz4cat.local +# Persistent global definitions +# added by included profile +#include globals.local + +# Redirect +include lz4.profile diff --git a/etc/profile-a-l/singularity.profile b/etc/profile-a-l/singularity.profile new file mode 100644 index 000000000..1e9fba35f --- /dev/null +++ b/etc/profile-a-l/singularity.profile @@ -0,0 +1,66 @@ +# Firejail profile for singularity +# Description: Simulation game about playing as an artificial intelligence +# This file is overwritten after every install/update +# Persistent local customizations +include singularity.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.config/singularity +noblacklist ${HOME}/.local/share/singularity + +# Allow /bin/sh (blacklisted by disable-shell.inc) +include allow-bin-sh.inc + +# Allow python (blacklisted by disable-interpreters.inc) +include allow-python3.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.config/singularity +mkdir ${HOME}/.local/share/singularity +whitelist ${HOME}/.config/singularity +whitelist ${HOME}/.local/share/singularity +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +net none +#no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +#nosound +notpm +notv +nou2f +novideo +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +#private-bin dirname,git,python*,singularity,sh +private-cache +private-dev +private-etc @games,@x11 +private-tmp + +dbus-user none +dbus-system none + +restrict-namespaces diff --git a/etc/profile-m-z/PCSX2.profile b/etc/profile-m-z/PCSX2.profile index e75de80ac..a6a9ba6bc 100644 --- a/etc/profile-m-z/PCSX2.profile +++ b/etc/profile-m-z/PCSX2.profile @@ -40,8 +40,8 @@ notv nou2f novideo protocol unix,netlink -#seccomp - breaks loading with no logs -#tracelog - 32/64 bit incompatibility +#seccomp # breaks loading with no logs +#tracelog # 32/64 bit incompatibility private-bin PCSX2 private-cache diff --git a/etc/profile-m-z/QMediathekView.profile b/etc/profile-m-z/QMediathekView.profile index f8b5cec13..3b5717c50 100644 --- a/etc/profile-m-z/QMediathekView.profile +++ b/etc/profile-m-z/QMediathekView.profile @@ -9,6 +9,7 @@ include globals.local noblacklist ${HOME}/.config/QMediathekView noblacklist ${HOME}/.local/share/QMediathekView +noblacklist ${HOME}/.cache/mpv noblacklist ${HOME}/.config/mpv noblacklist ${HOME}/.config/smplayer noblacklist ${HOME}/.config/totem @@ -16,9 +17,13 @@ noblacklist ${HOME}/.config/vlc noblacklist ${HOME}/.config/xplayer noblacklist ${HOME}/.local/share/totem noblacklist ${HOME}/.local/share/xplayer +noblacklist ${HOME}/.local/state/mpv noblacklist ${HOME}/.mplayer noblacklist ${VIDEOS} +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + include disable-common.inc include disable-devel.inc include disable-exec.inc @@ -35,6 +40,7 @@ whitelist ${HOME}/.local/share/QMediathekView whitelist ${DOWNLOADS} whitelist ${VIDEOS} +whitelist ${HOME}/.cache/mpv whitelist ${HOME}/.config/mpv whitelist ${HOME}/.config/smplayer whitelist ${HOME}/.config/totem @@ -42,8 +48,13 @@ whitelist ${HOME}/.config/vlc whitelist ${HOME}/.config/xplayer whitelist ${HOME}/.local/share/totem whitelist ${HOME}/.local/share/xplayer +whitelist ${HOME}/.local/state/mpv whitelist ${HOME}/.mplayer +whitelist /usr/share/lua* +whitelist /usr/share/mpv whitelist /usr/share/qtchooser +whitelist /usr/share/smplayer +whitelist /usr/share/vlc include whitelist-common.inc include whitelist-run-common.inc include whitelist-runuser-common.inc @@ -53,7 +64,7 @@ include whitelist-var-common.inc apparmor caps.drop all netfilter -# no3d +#no3d nodvd nogroups noinput @@ -68,7 +79,7 @@ seccomp tracelog disable-mnt -private-bin mplayer,mpv,QMediathekView,smplayer,totem,vlc,xplayer +private-bin QMediathekView,mplayer,mpv,smplayer,totem,vlc,xplayer private-cache private-dev private-etc @tls-ca @@ -77,5 +88,5 @@ private-tmp dbus-user none dbus-system none -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-m-z/QOwnNotes.profile b/etc/profile-m-z/QOwnNotes.profile index eed839041..023071f68 100644 --- a/etc/profile-m-z/QOwnNotes.profile +++ b/etc/profile-m-z/QOwnNotes.profile @@ -7,9 +7,10 @@ include QOwnNotes.local include globals.local noblacklist ${DOCUMENTS} -noblacklist ${HOME}/Nextcloud/Notes noblacklist ${HOME}/.config/PBE noblacklist ${HOME}/.local/share/PBE +noblacklist ${HOME}/Nextcloud +noblacklist ${HOME}/Nextcloud/Notes include disable-common.inc include disable-devel.inc @@ -19,13 +20,13 @@ include disable-programs.inc include disable-shell.inc include disable-xdg.inc -mkdir ${HOME}/Nextcloud/Notes mkdir ${HOME}/.config/PBE mkdir ${HOME}/.local/share/PBE +mkdir ${HOME}/Nextcloud/Notes whitelist ${DOCUMENTS} -whitelist ${HOME}/Nextcloud/Notes whitelist ${HOME}/.config/PBE whitelist ${HOME}/.local/share/PBE +whitelist ${HOME}/Nextcloud/Notes include whitelist-common.inc include whitelist-var-common.inc @@ -47,7 +48,7 @@ seccomp tracelog disable-mnt -private-bin gio,QOwnNotes +private-bin QOwnNotes,gio private-dev private-etc @tls-ca,host.conf private-tmp diff --git a/etc/profile-m-z/Viber.profile b/etc/profile-m-z/Viber.profile index 34d500bb1..ea7d8bfa7 100644 --- a/etc/profile-m-z/Viber.profile +++ b/etc/profile-m-z/Viber.profile @@ -31,8 +31,8 @@ protocol unix,inet,inet6 seccomp !chroot disable-mnt -private-bin awk,bash,dig,sh,Viber +private-bin Viber,awk,bash,dig,sh private-etc @tls-ca,@x11,mailcap,proxychains.conf private-tmp -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-m-z/XMind.profile b/etc/profile-m-z/XMind.profile index 97b9d2898..5b8747825 100644 --- a/etc/profile-m-z/XMind.profile +++ b/etc/profile-m-z/XMind.profile @@ -31,7 +31,7 @@ protocol unix,inet,inet6 seccomp disable-mnt -private-bin cp,sh,XMind +private-bin XMind,cp,sh private-tmp private-dev diff --git a/etc/profile-m-z/Xephyr.profile b/etc/profile-m-z/Xephyr.profile index 2fc1d1b8a..aae1808dd 100644 --- a/etc/profile-m-z/Xephyr.profile +++ b/etc/profile-m-z/Xephyr.profile @@ -16,7 +16,7 @@ include globals.local # whitelist /var/lib/xkb -include whitelist-common.inc +#include whitelist-common.inc # see #903 caps.drop all # Xephyr needs to be allowed access to the abstract Unix socket namespace. @@ -25,7 +25,7 @@ nogroups noinput nonewprivs # In noroot mode, Xephyr cannot create a socket in the real /tmp/.X11-unix. -# noroot +#noroot nosound notv nou2f @@ -35,10 +35,10 @@ seccomp disable-mnt # using a private home directory private -# private-bin sh,Xephyr,xkbcomp -# private-bin bash,cat,ls,sh,strace,Xephyr,xkbcomp +#private-bin sh,Xephyr,xkbcomp +#private-bin bash,cat,ls,sh,strace,Xephyr,xkbcomp private-dev -# private-etc alternatives,gai.conf,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,nsswitch.conf,resolv.conf +#private-etc alternatives,gai.conf,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,nsswitch.conf,resolv.conf #private-tmp restrict-namespaces diff --git a/etc/profile-m-z/Xvfb.profile b/etc/profile-m-z/Xvfb.profile index ee19fa3b0..052ea520d 100644 --- a/etc/profile-m-z/Xvfb.profile +++ b/etc/profile-m-z/Xvfb.profile @@ -19,7 +19,7 @@ include globals.local # whitelist /var/lib/xkb -include whitelist-common.inc +#include whitelist-common.inc # see #903 caps.drop all # Xvfb needs to be allowed access to the abstract Unix socket namespace. @@ -39,8 +39,8 @@ seccomp disable-mnt # using a private home directory private -# private-bin sh,xkbcomp,Xvfb -# private-bin bash,cat,ls,sh,strace,xkbcomp,Xvfb +#private-bin sh,xkbcomp,Xvfb +#private-bin bash,cat,ls,sh,strace,xkbcomp,Xvfb private-dev private-etc gai.conf,host.conf private-tmp diff --git a/etc/profile-m-z/makepkg.profile b/etc/profile-m-z/makepkg.profile index 266d00395..148e06840 100644 --- a/etc/profile-m-z/makepkg.profile +++ b/etc/profile-m-z/makepkg.profile @@ -7,25 +7,24 @@ include makepkg.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* # Note: see this Arch forum discussion https://bbs.archlinux.org/viewtopic.php?pid=1743138 # for potential issues and their solutions when Firejailing makepkg # This profile could be significantly strengthened by adding the following to makepkg.local -# whitelist ${HOME}/ -# whitelist ${HOME}/.gnupg +#whitelist ${HOME}/ +#whitelist ${HOME}/.gnupg # Enable severely restricted access to ${HOME}/.gnupg noblacklist ${HOME}/.gnupg read-only ${HOME}/.gnupg/trustdb.gpg read-only ${HOME}/.gnupg/pubring.kbx -blacklist ${HOME}/.gnupg/random_seed -blacklist ${HOME}/.gnupg/pubring.kbx~ -blacklist ${HOME}/.gnupg/private-keys-v1.d blacklist ${HOME}/.gnupg/crls.d blacklist ${HOME}/.gnupg/openpgp-revocs.d +blacklist ${HOME}/.gnupg/private-keys-v1.d +blacklist ${HOME}/.gnupg/pubring.kbx~ +blacklist ${HOME}/.gnupg/random_seed # Arch Linux (based distributions) need access to /var/lib/pacman. As we drop all capabilities this is automatically read-only. noblacklist /var/lib/pacman @@ -33,10 +32,11 @@ noblacklist /var/lib/pacman include disable-common.inc include disable-exec.inc include disable-programs.inc +include disable-x11.inc caps.drop all -machine-id ipc-namespace +machine-id netfilter no3d nodvd diff --git a/etc/profile-m-z/man.profile b/etc/profile-m-z/man.profile index cdf1d807f..96a2be1b1 100644 --- a/etc/profile-m-z/man.profile +++ b/etc/profile-m-z/man.profile @@ -12,6 +12,9 @@ blacklist ${RUNUSER} noblacklist ${HOME}/.local/share/man noblacklist ${HOME}/.rustup +# Allow perl (blacklisted by disable-interpreters.inc) +include allow-perl.inc + include disable-common.inc include disable-devel.inc include disable-exec.inc diff --git a/etc/profile-m-z/mediathekview.profile b/etc/profile-m-z/mediathekview.profile index 19ce6fcd1..fa00a8f0f 100644 --- a/etc/profile-m-z/mediathekview.profile +++ b/etc/profile-m-z/mediathekview.profile @@ -6,6 +6,7 @@ include mediathekview.local # Persistent global definitions include globals.local +noblacklist ${HOME}/.cache/mpv noblacklist ${HOME}/.config/mpv noblacklist ${HOME}/.config/smplayer noblacklist ${HOME}/.config/totem @@ -13,6 +14,7 @@ noblacklist ${HOME}/.config/vlc noblacklist ${HOME}/.config/xplayer noblacklist ${HOME}/.local/share/totem noblacklist ${HOME}/.local/share/xplayer +noblacklist ${HOME}/.local/state/mpv noblacklist ${HOME}/.mediathek3 noblacklist ${HOME}/.mplayer noblacklist ${VIDEOS} @@ -22,6 +24,9 @@ ignore noexec /tmp # Allow java (blacklisted by disable-devel.inc) include allow-java.inc +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + include disable-common.inc include disable-devel.inc include disable-exec.inc diff --git a/etc/profile-m-z/menulibre.profile b/etc/profile-m-z/menulibre.profile index fcac70fb3..6e1992038 100644 --- a/etc/profile-m-z/menulibre.profile +++ b/etc/profile-m-z/menulibre.profile @@ -20,7 +20,6 @@ include disable-xdg.inc # Whitelist your system icon directory,varies by distro whitelist /usr/share/app-info whitelist /usr/share/desktop-directories -whitelist /usr/share/icons whitelist /usr/share/menulibre whitelist /var/lib/app-info/icons whitelist /var/lib/flatpak/exports/share/applications diff --git a/etc/profile-m-z/metadata-cleaner.profile b/etc/profile-m-z/metadata-cleaner.profile new file mode 100644 index 000000000..4ea49c46b --- /dev/null +++ b/etc/profile-m-z/metadata-cleaner.profile @@ -0,0 +1,65 @@ +# Firejail profile for metadata-cleaner +# Description: Python GTK application to view and clean metadata in files, using mat2 +# This file is overwritten after every install/update +# Persistent local customizations +include metadata-cleaner.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +# Allow perl (blacklisted by disable-interpreters.inc) +include allow-perl.inc + +# Allow python3 (blacklisted by disable-interpreters.inc) +include allow-python3.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc + +whitelist /usr/share/metadata-remover +whitelist /usr/share/perl-image-exiftool +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +net none +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +notv +nou2f +novideo +nosound +protocol unix,netlink +seccomp +seccomp.block-secondary +tracelog + +#disable-mnt +private-bin bash,exiftool,ffmpeg,metadata-cleaner,perl,python,python*,sh,which +private-cache +private-dev +private-etc @x11,mime.types +private-tmp + +dbus-user filter +dbus-user.own fr.romainvigier.MetadataCleaner +dbus-user.talk ca.desrt.dconf +dbus-user.talk org.gtk.vfs.UDisks2VolumeMonitor +dbus-system none + +restrict-namespaces diff --git a/etc/profile-m-z/meteo-qt.profile b/etc/profile-m-z/meteo-qt.profile index db87b21bc..3c752a0c7 100644 --- a/etc/profile-m-z/meteo-qt.profile +++ b/etc/profile-m-z/meteo-qt.profile @@ -6,7 +6,11 @@ include meteo-qt.local # Persistent global definitions include globals.local -noblacklist ${HOME}/.config/autostart +# To allow the program to autostart, add the following to meteo-qt.local: +# Warning: This allows the program to easily escape the sandbox. +#noblacklist ${HOME}/.config/autostart +#whitelist ${HOME}/.config/autostart + noblacklist ${HOME}/.config/meteo-qt # Allow python (blacklisted by disable-interpreters.inc) @@ -21,7 +25,6 @@ include disable-shell.inc include disable-xdg.inc mkdir ${HOME}/.config/meteo-qt -whitelist ${HOME}/.config/autostart whitelist ${HOME}/.config/meteo-qt include whitelist-common.inc include whitelist-var-common.inc diff --git a/etc/profile-m-z/microsoft-edge-beta.profile b/etc/profile-m-z/microsoft-edge-beta.profile index 6843c11c7..e07bbe6e5 100644 --- a/etc/profile-m-z/microsoft-edge-beta.profile +++ b/etc/profile-m-z/microsoft-edge-beta.profile @@ -14,10 +14,7 @@ mkdir ${HOME}/.cache/microsoft-edge-beta mkdir ${HOME}/.config/microsoft-edge-beta whitelist ${HOME}/.cache/microsoft-edge-beta whitelist ${HOME}/.config/microsoft-edge-beta - whitelist /opt/microsoft/msedge-beta -# private-opt might break the file-copy-limit, see #5307 -#private-opt microsoft # Redirect include chromium-common.profile diff --git a/etc/profile-m-z/midori.profile b/etc/profile-m-z/midori.profile index d1655fabb..fcc4845df 100644 --- a/etc/profile-m-z/midori.profile +++ b/etc/profile-m-z/midori.profile @@ -13,8 +13,8 @@ noblacklist ${HOME}/.cache/midori noblacklist ${HOME}/.config/midori noblacklist ${HOME}/.local/share/midori noblacklist ${HOME}/.local/share/pki -# noblacklist ${HOME}/.local/share/webkit -# noblacklist ${HOME}/.local/share/webkitgtk +#noblacklist ${HOME}/.local/share/webkit +#noblacklist ${HOME}/.local/share/webkitgtk noblacklist ${HOME}/.pki noblacklist ${HOME}/.cache/gnome-mplayer @@ -54,7 +54,7 @@ caps.drop all netfilter nodvd nonewprivs -# noroot - problems on Ubuntu 14.04 +#noroot # problems on Ubuntu 14.04 notv protocol unix,inet,inet6,netlink seccomp diff --git a/etc/profile-m-z/mimetype.profile b/etc/profile-m-z/mimetype.profile new file mode 100644 index 000000000..6d9af90cb --- /dev/null +++ b/etc/profile-m-z/mimetype.profile @@ -0,0 +1,48 @@ +# Firejail profile for mimetype +# Description: Determines the file type +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include mimetype.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER}/wayland-* + +include disable-exec.inc +include disable-proc.inc +include disable-x11.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +net none +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix +seccomp +seccomp.block-secondary +tracelog +x11 none + +private-dev + +dbus-user none +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +read-only ${RUNUSER} +read-only /tmp + +restrict-namespaces diff --git a/etc/profile-m-z/minecraft-launcher.profile b/etc/profile-m-z/minecraft-launcher.profile index 4f2c89b27..15adbcb36 100644 --- a/etc/profile-m-z/minecraft-launcher.profile +++ b/etc/profile-m-z/minecraft-launcher.profile @@ -25,6 +25,8 @@ include disable-xdg.inc mkdir ${HOME}/.minecraft whitelist ${HOME}/.minecraft +# Needs keyring access in order to save logins +whitelist ${RUNUSER}/keyring include whitelist-common.inc include whitelist-runuser-common.inc include whitelist-usr-share-common.inc @@ -54,7 +56,10 @@ private-etc @tls-ca,@x11,host.conf,java*,mime.types,services,timezone private-opt minecraft-launcher private-tmp -dbus-user none +dbus-user filter +dbus-user.talk org.freedesktop.secrets +dbus-user.talk org.gnome.keyring.* +dbus-user.talk org.gnome.seahorse.* dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/minetest.profile b/etc/profile-m-z/minetest.profile index 15474c96e..7b0135695 100644 --- a/etc/profile-m-z/minetest.profile +++ b/etc/profile-m-z/minetest.profile @@ -6,8 +6,9 @@ include minetest.local # Persistent global definitions include globals.local -# In order to save in-game screenshots to a persistent location edit ~/.minetest/minetest.conf: -# screenshot_path = /home//.minetest/screenshots +# In order to save in-game screenshots to a persistent location, +# edit ~/.minetest/minetest.conf: +# screenshot_path = /home//.minetest/screenshots noblacklist ${HOME}/.cache/minetest noblacklist ${HOME}/.minetest diff --git a/etc/profile-m-z/mirrormagic.profile b/etc/profile-m-z/mirrormagic.profile index 4943a80af..a8c6e3533 100644 --- a/etc/profile-m-z/mirrormagic.profile +++ b/etc/profile-m-z/mirrormagic.profile @@ -39,7 +39,6 @@ seccomp tracelog disable-mnt -private private-bin mirrormagic private-cache private-dev diff --git a/etc/profile-m-z/mocp.profile b/etc/profile-m-z/mocp.profile index 2ba03ec97..18e7331f3 100644 --- a/etc/profile-m-z/mocp.profile +++ b/etc/profile-m-z/mocp.profile @@ -10,15 +10,24 @@ include globals.local noblacklist ${HOME}/.moc noblacklist ${MUSIC} +blacklist ${RUNUSER}/wayland-* + include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc +include disable-proc.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc -include whitelist-usr-share-common.inc +mkdir ${HOME}/.moc +whitelist ${HOME}/.moc +whitelist ${MUSIC} +include whitelist-common.inc +include whitelist-run-common.inc include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc include whitelist-var-common.inc apparmor @@ -30,18 +39,20 @@ nodvd nogroups noinput nonewprivs +noprinters noroot notv nou2f novideo -protocol unix,inet,inet6,netlink +protocol unix,inet,inet6 seccomp +seccomp.block-secondary tracelog private-bin mocp private-cache private-dev -private-etc @tls-ca +private-etc @network,@tls-ca private-tmp dbus-user none diff --git a/etc/profile-m-z/mov-cli.profile b/etc/profile-m-z/mov-cli.profile index c5f764912..85f72f478 100644 --- a/etc/profile-m-z/mov-cli.profile +++ b/etc/profile-m-z/mov-cli.profile @@ -8,9 +8,18 @@ include mov-cli.local # added by included profile #include globals.local +noblacklist ${HOME}/.config/mov-cli + +# Allow /bin/sh (blacklisted by disable-shell.inc) +include allow-bin-sh.inc + include disable-proc.inc include disable-xdg.inc +mkdir ${HOME}/.config/mov-cli +whitelist ${HOME}/.config/mov-cli +whitelist ${DOWNLOADS} +whitelist /usr/share/nano include whitelist-run-common.inc include whitelist-runuser-common.inc @@ -20,9 +29,9 @@ noprinters notv disable-mnt -private-bin ffmpeg,fzf,mov-cli +private-bin fzf,mov-cli,nano,sh,uname #private-cache -private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,group,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,magic,magic.mgc,mime.types,nsswitch.conf,pango,passwd,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg +private-etc X11,alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,group,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,magic,magic.mgc,mime.types,nanorc,nsswitch.conf,pango,passwd,pki,protocols,pulse,resolv.conf,rpc,services,ssl,xdg private-tmp # Redirect diff --git a/etc/profile-m-z/mpDris2.profile b/etc/profile-m-z/mpDris2.profile index a9631733c..ab1c93eaf 100644 --- a/etc/profile-m-z/mpDris2.profile +++ b/etc/profile-m-z/mpDris2.profile @@ -52,7 +52,11 @@ private-etc private-lib libdbus-1.so.*,libdbus-glib-1.so.*,libgirepository-1.0.so.*,libnotify.so.*,libpython*,python2*,python3* private-tmp -#memory-deny-write-execute - breaks on Arch (see issue #1803) +dbus-user filter +dbus-user.own org.mpris.MediaPlayer2.mpd +dbus-system none + +#memory-deny-write-execute # breaks on Arch (see issue #1803) read-only ${HOME} restrict-namespaces diff --git a/etc/profile-m-z/mpd.profile b/etc/profile-m-z/mpd.profile index d1c4bd24f..6bf881faf 100644 --- a/etc/profile-m-z/mpd.profile +++ b/etc/profile-m-z/mpd.profile @@ -41,4 +41,8 @@ private-cache private-dev private-tmp +dbus-user filter +dbus-user.talk org.mpris.MediaPlayer2.mpd +dbus-system none + restrict-namespaces diff --git a/etc/profile-m-z/mplayer.profile b/etc/profile-m-z/mplayer.profile index 7d9ff39ad..c4f989a77 100644 --- a/etc/profile-m-z/mplayer.profile +++ b/etc/profile-m-z/mplayer.profile @@ -6,6 +6,7 @@ include mplayer.local # Persistent global definitions include globals.local +noblacklist ${HOME}/.dvdcss noblacklist ${HOME}/.mplayer include disable-common.inc @@ -16,6 +17,7 @@ include disable-programs.inc read-only ${DESKTOP} mkdir ${HOME}/.mplayer +whitelist ${HOME}/.dvdcss whitelist ${HOME}/.mplayer include whitelist-common.inc include whitelist-player-common.inc @@ -24,9 +26,9 @@ include whitelist-var-common.inc apparmor caps.drop all -# net none - mplayer can be used for streaming. +#net none # mplayer can be used for streaming. netfilter -# nogroups +#nogroups noinput nonewprivs noroot diff --git a/etc/profile-m-z/mpsyt.profile b/etc/profile-m-z/mpsyt.profile index e73e3142c..e4f76855e 100644 --- a/etc/profile-m-z/mpsyt.profile +++ b/etc/profile-m-z/mpsyt.profile @@ -6,9 +6,11 @@ include mpsyt.local # Persistent global definitions include globals.local +noblacklist ${HOME}/.cache/mpv noblacklist ${HOME}/.config/mps-youtube noblacklist ${HOME}/.config/mpv noblacklist ${HOME}/.config/youtube-dl +noblacklist ${HOME}/.local/state/mpv noblacklist ${HOME}/.mplayer noblacklist ${HOME}/.netrc noblacklist ${HOME}/mps @@ -32,13 +34,13 @@ include disable-shell.inc include disable-xdg.inc mkdir ${HOME}/.config/mps-youtube -mkdir ${HOME}/.config/mpv -mkdir ${HOME}/.config/youtube-dl mkdir ${HOME}/.mplayer mkdir ${HOME}/mps +whitelist ${HOME}/.cache/mpv whitelist ${HOME}/.config/mps-youtube whitelist ${HOME}/.config/mpv whitelist ${HOME}/.config/youtube-dl +whitelist ${HOME}/.local/state/mpv whitelist ${HOME}/.mplayer whitelist ${HOME}/.netrc whitelist ${HOME}/mps diff --git a/etc/profile-m-z/mpv.profile b/etc/profile-m-z/mpv.profile index 85f414562..1d03e894c 100644 --- a/etc/profile-m-z/mpv.profile +++ b/etc/profile-m-z/mpv.profile @@ -9,7 +9,7 @@ include globals.local # In order to save screenshots to a persistent location, # edit ~/.config/mpv/foobar.conf: -# screenshot-directory=~/Pictures +# screenshot-directory=~/Pictures # mpv has a powerful Lua API and some of the Lua scripts interact with # external resources which are blocked by firejail. In such cases you need to @@ -24,10 +24,13 @@ include globals.local #include allow-bin-sh.inc #private-bin sh +noblacklist ${HOME}/.cache/mpv noblacklist ${HOME}/.config/mpv noblacklist ${HOME}/.config/youtube-dl noblacklist ${HOME}/.config/yt-dlp noblacklist ${HOME}/.config/yt-dlp.conf +noblacklist ${HOME}/.dvdcss +noblacklist ${HOME}/.local/state/mpv noblacklist ${HOME}/.netrc noblacklist ${HOME}/yt-dlp.conf noblacklist ${HOME}/yt-dlp.conf.txt @@ -49,18 +52,22 @@ include disable-programs.inc include disable-shell.inc read-only ${DESKTOP} +mkdir ${HOME}/.cache/mpv mkdir ${HOME}/.config/mpv +mkdir ${HOME}/.local/state/mpv mkfile ${HOME}/.netrc +whitelist ${HOME}/.cache/mpv whitelist ${HOME}/.config/mpv whitelist ${HOME}/.config/youtube-dl whitelist ${HOME}/.config/yt-dlp whitelist ${HOME}/.config/yt-dlp.conf +whitelist ${HOME}/.dvdcss +whitelist ${HOME}/.local/state/mpv whitelist ${HOME}/.netrc whitelist ${HOME}/yt-dlp.conf whitelist ${HOME}/yt-dlp.conf.txt -whitelist /usr/share/lua whitelist /usr/share/lua* -whitelist /usr/share/vulkan +whitelist /usr/share/mpv include whitelist-common.inc include whitelist-player-common.inc include whitelist-usr-share-common.inc diff --git a/etc/profile-m-z/mullvad-browser.profile b/etc/profile-m-z/mullvad-browser.profile new file mode 100644 index 000000000..6706386aa --- /dev/null +++ b/etc/profile-m-z/mullvad-browser.profile @@ -0,0 +1,96 @@ +# Firejail profile for mullvad-browser +# Description: Privacy-focused web browser developed in a collaboration between Mullvad VPN and the Tor Project +# This file is overwritten after every install/update +# Persistent local customizations +include mullvad-browser.local +# Persistent global definitions +include globals.local + +# IMPORTANT ########################################## +# The mullvad-browser can be downloaded from the official website +# and installed manually or via the AUR for Arch Linux (derivatives). +# The latter installs the browser under /opt/mullvad-browser, while +# the former can be installed under ${HOME} just about anywhere. +# If you decide to install it under ${HOME} this profile assumes to find +# the browser files under ${HOME}/.local/share/mullvad-browser. +# When you divert from that location you will need to make the needed +# path adjustments yourself in the below instructions. +#################################################### + +# If you installed under ${HOME}, put the below line in your +# mullvad-browser.local +# Note: The relevant rule in /etc/apparmor.d/local/firejail-default will +# need to be uncommented for the 'apparmor' option to work as expected. +#ignore noexec ${HOME} + +noblacklist ${HOME}/.cache/mullvad/mullvadbrowser +noblacklist ${HOME}/.config/mullvad-browser-flags.conf +noblacklist ${HOME}/.local/share/mullvad-browser +noblacklist ${HOME}/.mullvad/mullvadbrowser + +# Allow python 3 (blacklisted by disable-interpreters.inc) +include allow-python3.inc + +blacklist /srv +blacklist /sys/class/net +blacklist /usr/libexec + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-xdg.inc + +mkdir ${HOME}/.cache/mullvad/mullvadbrowser +mkdir ${HOME}/.local/share/mullvad-browser +mkdir ${HOME}/.mullvad/mullvadbrowser +mkfile ${HOME}/.config/mullvad-browser-flags.conf +whitelist ${DOWNLOADS} +whitelist ${HOME}/.cache/mullvad/mullvadbrowser +whitelist ${HOME}/.config/mullvad-browser-flags.conf +whitelist ${HOME}/.local/share/mullvad-browser +whitelist ${HOME}/.mullvad/mullvadbrowser +whitelist /opt/mullvad-browser +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +netfilter +nodvd +nogroups +noinput +nonewprivs +noroot +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp !chroot +seccomp.block-secondary +#tracelog # may cause issues, see #1930 + +disable-mnt +private-bin bash,cat,cp,cut,dirname,env,expr,file,gpg,grep,gxmessage,id,kdialog,ln,mkdir,mullvad-browser,mv,python*,rm,sed,sh,tail,tar,tclsh,test,update-desktop-database,xmessage,xz,zenity +private-dev +private-etc @tls-ca +private-tmp + +blacklist ${PATH}/curl +blacklist ${PATH}/wget +blacklist ${PATH}/wget2 + +dbus-user filter +dbus-user.own org.mozilla.mullvadbrowser.* +dbus-system none + +# cfr. start-mullvad-browser +# do not (try to) connect to the session manager +rmenv SESSION_MANAGER + +#restrict-namespaces diff --git a/etc/profile-m-z/multimc5.profile b/etc/profile-m-z/multimc5.profile index 73107680c..734d9c11f 100644 --- a/etc/profile-m-z/multimc5.profile +++ b/etc/profile-m-z/multimc5.profile @@ -8,11 +8,16 @@ include globals.local noblacklist ${HOME}/.local/share/multimc noblacklist ${HOME}/.local/share/multimc5 noblacklist ${HOME}/.multimc5 +noblacklist ${HOME}/.cache/JNA +noblacklist /tmp/lwjgl_* # Ignore noexec on ${HOME} as MultiMC installs LWJGL native # libraries in ${HOME}/.local/share/multimc ignore noexec ${HOME} +# Ignore noexec on /tmp as LWJGL extracts libraries to /tmp +ignore noexec /tmp + # Allow java (blacklisted by disable-devel.inc) include allow-java.inc @@ -25,9 +30,12 @@ include disable-programs.inc mkdir ${HOME}/.local/share/multimc mkdir ${HOME}/.local/share/multimc5 mkdir ${HOME}/.multimc5 +mkdir ${HOME}/.cache/JNA whitelist ${HOME}/.local/share/multimc whitelist ${HOME}/.local/share/multimc5 whitelist ${HOME}/.multimc5 +whitelist ${HOME}/.cache/JNA +whitelist /tmp/lwjgl_* include whitelist-common.inc caps.drop all @@ -41,12 +49,15 @@ notv nou2f novideo protocol unix,inet,inet6 -# seccomp +#seccomp disable-mnt # private-bin works, but causes weirdness -# private-bin apt-file,awk,bash,chmod,dirname,dnf,grep,java,kdialog,ldd,mkdir,multimc5,pfl,pkgfile,readlink,sort,valgrind,which,yum,zenity,zypper +#private-bin apt-file,awk,bash,chmod,dirname,dnf,grep,java,kdialog,ldd,mkdir,multimc5,pfl,pkgfile,readlink,sort,valgrind,which,yum,zenity,zypper private-dev private-tmp -# restrict-namespaces +dbus-user none +dbus-system none + +#restrict-namespaces diff --git a/etc/profile-m-z/mumble.profile b/etc/profile-m-z/mumble.profile index ef09e6fca..52dc46800 100644 --- a/etc/profile-m-z/mumble.profile +++ b/etc/profile-m-z/mumble.profile @@ -41,5 +41,5 @@ disable-mnt private-bin mumble private-tmp -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-m-z/musescore.profile b/etc/profile-m-z/musescore.profile index ca951f70c..b62674ad6 100644 --- a/etc/profile-m-z/musescore.profile +++ b/etc/profile-m-z/musescore.profile @@ -37,7 +37,7 @@ protocol unix,inet,inet6 seccomp !chroot tracelog -# private-bin musescore,mscore +#private-bin musescore,mscore private-tmp -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-m-z/musixmatch.profile b/etc/profile-m-z/musixmatch.profile index 7ce7fbd19..d67cd24bd 100644 --- a/etc/profile-m-z/musixmatch.profile +++ b/etc/profile-m-z/musixmatch.profile @@ -35,4 +35,4 @@ disable-mnt private-dev private-etc @tls-ca -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-m-z/mutt.profile b/etc/profile-m-z/mutt.profile index 288ffedf1..bc8aaffbe 100644 --- a/etc/profile-m-z/mutt.profile +++ b/etc/profile-m-z/mutt.profile @@ -13,6 +13,7 @@ noblacklist ${DOCUMENTS} noblacklist ${HOME}/.Mail noblacklist ${HOME}/.bogofilter noblacklist ${HOME}/.cache/mutt +noblacklist ${HOME}/.config/msmtp noblacklist ${HOME}/.config/mutt noblacklist ${HOME}/.config/nano noblacklist ${HOME}/.elinks @@ -35,8 +36,8 @@ noblacklist ${HOME}/Mail noblacklist ${HOME}/mail noblacklist ${HOME}/postponed noblacklist ${HOME}/sent +noblacklist /etc/msmtprc -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* # Add the next lines to your mutt.local for oauth.py,S/MIME support. @@ -49,6 +50,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc mkdir ${HOME}/.Mail @@ -69,6 +71,7 @@ whitelist ${DOWNLOADS} whitelist ${HOME}/.Mail whitelist ${HOME}/.bogofilter whitelist ${HOME}/.cache/mutt +whitelist ${HOME}/.config/msmtp whitelist ${HOME}/.config/mutt whitelist ${HOME}/.config/nano whitelist ${HOME}/.elinks @@ -121,10 +124,10 @@ seccomp seccomp.block-secondary tracelog -# disable-mnt +#disable-mnt private-cache private-dev -private-etc @tls-ca,@x11,Mutt,Muttrc,Muttrc.d,gai.conf,gnupg,gnutls,hosts.conf,mail,mailname,nntpserver,terminfo +private-etc @tls-ca,@x11,Mutt,Muttrc,Muttrc.d,gai.conf,gnupg,hosts.conf,mail,mailname,msmtprc,nntpserver,terminfo private-tmp writable-run-user writable-var diff --git a/etc/profile-m-z/nano.profile b/etc/profile-m-z/nano.profile index 6b4074dfb..ba63b2067 100644 --- a/etc/profile-m-z/nano.profile +++ b/etc/profile-m-z/nano.profile @@ -41,7 +41,7 @@ seccomp tracelog x11 none -# disable-mnt +#disable-mnt private-bin nano,rnano private-cache private-dev diff --git a/etc/profile-m-z/natron.profile b/etc/profile-m-z/natron.profile index b979e1aee..30dd164b6 100644 --- a/etc/profile-m-z/natron.profile +++ b/etc/profile-m-z/natron.profile @@ -30,7 +30,7 @@ nou2f protocol unix seccomp -private-bin natron,Natron,NatronRenderer +private-bin Natron,NatronRenderer,natron dbus-user none dbus-system none diff --git a/etc/profile-m-z/ncdu.profile b/etc/profile-m-z/ncdu.profile index 09687199b..5cfd8290a 100644 --- a/etc/profile-m-z/ncdu.profile +++ b/etc/profile-m-z/ncdu.profile @@ -29,7 +29,7 @@ seccomp x11 none private-dev -# private-tmp +#private-tmp dbus-user none dbus-system none diff --git a/etc/profile-m-z/neochat.profile b/etc/profile-m-z/neochat.profile index 80e28a5e5..d1a36e079 100644 --- a/etc/profile-m-z/neochat.profile +++ b/etc/profile-m-z/neochat.profile @@ -45,7 +45,7 @@ nosound notv nou2f novideo -protocol unix,inet,inet6 +protocol unix,inet,inet6,netlink seccomp seccomp.block-secondary tracelog diff --git a/etc/profile-m-z/neomutt.profile b/etc/profile-m-z/neomutt.profile index 5bd1e7cba..4101e74ee 100644 --- a/etc/profile-m-z/neomutt.profile +++ b/etc/profile-m-z/neomutt.profile @@ -10,6 +10,7 @@ include globals.local noblacklist ${DOCUMENTS} noblacklist ${HOME}/.Mail noblacklist ${HOME}/.bogofilter +noblacklist ${HOME}/.config/msmtp noblacklist ${HOME}/.config/mutt noblacklist ${HOME}/.config/nano noblacklist ${HOME}/.config/neomutt @@ -34,10 +35,10 @@ noblacklist ${HOME}/Mail noblacklist ${HOME}/mail noblacklist ${HOME}/postponed noblacklist ${HOME}/sent +noblacklist /etc/msmtprc noblacklist /var/mail noblacklist /var/spool/mail -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include allow-lua.inc @@ -47,6 +48,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc mkdir ${HOME}/.Mail @@ -59,6 +61,7 @@ whitelist ${DOCUMENTS} whitelist ${DOWNLOADS} whitelist ${HOME}/.Mail whitelist ${HOME}/.bogofilter +whitelist ${HOME}/.config/msmtp whitelist ${HOME}/.config/mutt whitelist ${HOME}/.config/nano whitelist ${HOME}/.config/neomutt @@ -113,10 +116,10 @@ seccomp seccomp.block-secondary tracelog -# disable-mnt +#disable-mnt private-cache private-dev -private-etc @tls-ca,@x11,Mutt,Muttrc,Muttrc.d,gnupg,hosts.conf,mail,mailname,neomuttrc,neomuttrc.d,nntpserver +private-etc @tls-ca,@x11,Mutt,Muttrc,Muttrc.d,gnupg,hosts.conf,mail,mailname,msmtprc,neomuttrc,neomuttrc.d,nntpserver private-tmp writable-run-user writable-var diff --git a/etc/profile-m-z/neverball-wrapper.profile b/etc/profile-m-z/neverball-wrapper.profile index 534e41dd1..086bd6e5e 100644 --- a/etc/profile-m-z/neverball-wrapper.profile +++ b/etc/profile-m-z/neverball-wrapper.profile @@ -6,6 +6,7 @@ include neverball-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin neverball-wrapper diff --git a/etc/profile-m-z/neverputt-wrapper.profile b/etc/profile-m-z/neverputt-wrapper.profile index dacd113cc..d29809c9a 100644 --- a/etc/profile-m-z/neverputt-wrapper.profile +++ b/etc/profile-m-z/neverputt-wrapper.profile @@ -6,6 +6,7 @@ include neverputt-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin neverputt-wrapper diff --git a/etc/profile-m-z/nextcloud.profile b/etc/profile-m-z/nextcloud.profile index d4bad2f67..b6453f6a9 100644 --- a/etc/profile-m-z/nextcloud.profile +++ b/etc/profile-m-z/nextcloud.profile @@ -6,9 +6,10 @@ include nextcloud.local # Persistent global definitions include globals.local -noblacklist ${HOME}/Nextcloud noblacklist ${HOME}/.config/Nextcloud noblacklist ${HOME}/.local/share/Nextcloud +noblacklist ${HOME}/Nextcloud +noblacklist ${HOME}/Nextcloud/Notes # Add the next lines to your nextcloud.local to allow sync in more directories. #noblacklist ${DOCUMENTS} #noblacklist ${MUSIC} @@ -23,12 +24,12 @@ include disable-programs.inc include disable-shell.inc include disable-xdg.inc -mkdir ${HOME}/Nextcloud mkdir ${HOME}/.config/Nextcloud mkdir ${HOME}/.local/share/Nextcloud -whitelist ${HOME}/Nextcloud +mkdir ${HOME}/Nextcloud whitelist ${HOME}/.config/Nextcloud whitelist ${HOME}/.local/share/Nextcloud +whitelist ${HOME}/Nextcloud whitelist /usr/share/nextcloud # Add the next lines to your nextcloud.local to allow sync in more directories. #whitelist ${DOCUMENTS} @@ -61,11 +62,16 @@ tracelog disable-mnt private-bin nextcloud,nextcloud-desktop private-cache -private-etc @tls-ca,@x11,Nextcloud,host.conf,os-release private-dev +private-etc @tls-ca,@x11,Nextcloud,host.conf,os-release private-tmp +# IMPORTANT: create ~/.local/share/dbus-1/services/com.nextcloudgmbh.Nextcloud.service +# referencing the firejailed /usr/local/bin/nextcloud to keep nextcloud running sandboxed +# even when its dbus name gets activated +# see https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions#how-do-i-sandbox-applications-started-via-systemd-or-d-bus-services dbus-user filter +dbus-user.own com.nextcloudgmbh.Nextcloud dbus-user.talk org.freedesktop.secrets ?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher dbus-system none diff --git a/etc/profile-m-z/nhex.profile b/etc/profile-m-z/nhex.profile new file mode 100644 index 000000000..184e41a9a --- /dev/null +++ b/etc/profile-m-z/nhex.profile @@ -0,0 +1,62 @@ +# Firejail profile for nhex +# Description: Tauri-based IRC client inspired by HexChat +# This file is overwritten after every install/update +# Persistent local customizations +include nhex.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.cache/nhex +noblacklist ${HOME}/.local/share/dev.nhex + +blacklist /usr/libexec + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.cache/nhex +mkdir ${HOME}/.local/share/dev.nhex +whitelist ${DOWNLOADS} +whitelist ${HOME}/.cache/nhex +whitelist ${HOME}/.local/share/dev.nhex +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +caps.drop all +machine-id +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-bin nhex +private-cache +private-dev +private-tmp + +dbus-user none +dbus-system none + +restrict-namespaces diff --git a/etc/profile-m-z/nicotine.profile b/etc/profile-m-z/nicotine.profile index 568899eea..d1680e666 100644 --- a/etc/profile-m-z/nicotine.profile +++ b/etc/profile-m-z/nicotine.profile @@ -43,7 +43,6 @@ noinput nonewprivs noprinters noroot -nosound notv nou2f novideo @@ -57,7 +56,9 @@ private-cache private-dev private-tmp -dbus-user none +dbus-user filter +dbus-user.own org.nicotine_plus.Nicotine +dbus-user.talk ca.desrt.dconf dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/nitroshare.profile b/etc/profile-m-z/nitroshare.profile index 7a97ca825..254eb789a 100644 --- a/etc/profile-m-z/nitroshare.profile +++ b/etc/profile-m-z/nitroshare.profile @@ -42,11 +42,11 @@ private-bin awk,grep,nitroshare,nitroshare-cli,nitroshare-nmh,nitroshare-send,ni private-cache private-dev private-etc @tls-ca,@x11 -# private-lib libnitroshare.so.*,libqhttpengine.so.*,libqmdnsengine.so.*,nitroshare +#private-lib libnitroshare.so.*,libqhttpengine.so.*,libqmdnsengine.so.*,nitroshare private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-m-z/nodejs-common.profile b/etc/profile-m-z/nodejs-common.profile index f3b0c8a49..43fafc3de 100644 --- a/etc/profile-m-z/nodejs-common.profile +++ b/etc/profile-m-z/nodejs-common.profile @@ -7,7 +7,7 @@ include nodejs-common.local # added by caller profile #include globals.local -# NOTE: gulp, node-gyp, npm, npx, semver and yarn are all node scripts +# Note: gulp, node-gyp, npm, npx, pnpm, pnpx, semver and yarn are all node scripts # using the `#!/usr/bin/env node` shebang. By sandboxing node the full # node.js stack will be firejailed. The only exception is nvm, which is implemented # as a sourced shell function, not an executable binary. Hence it is not @@ -22,6 +22,7 @@ ignore read-only ${HOME}/.npmrc ignore read-only ${HOME}/.nvm ignore read-only ${HOME}/.yarnrc +noblacklist ${HOME}/.local/share/pnpm noblacklist ${HOME}/.node-gyp noblacklist ${HOME}/.npm noblacklist ${HOME}/.npmrc @@ -38,11 +39,12 @@ include disable-common.inc include disable-exec.inc include disable-programs.inc include disable-shell.inc -include disable-X11.inc +include disable-x11.inc include disable-xdg.inc # If you want whitelisting, change ${HOME}/Projects below to your node projects directory # and add the next lines to your nodejs-common.local. +#mkdir ${HOME}/.local/share/pnpm #mkdir ${HOME}/.node-gyp #mkdir ${HOME}/.npm #mkdir ${HOME}/.npm-packages @@ -52,6 +54,7 @@ include disable-xdg.inc #mkdir ${HOME}/.yarn-config #mkdir ${HOME}/.yarncache #mkfile ${HOME}/.yarnrc +#whitelist ${HOME}/.local/share/pnpm #whitelist ${HOME}/.node-gyp #whitelist ${HOME}/.npm #whitelist ${HOME}/.npm-packages diff --git a/etc/profile-m-z/noprofile.profile b/etc/profile-m-z/noprofile.profile index db4113f94..c2e4999ea 100644 --- a/etc/profile-m-z/noprofile.profile +++ b/etc/profile-m-z/noprofile.profile @@ -1,21 +1,22 @@ # This is the weakest possible firejail profile. -# If a program still fail with this profile, it is incompatible with firejail. +# If a program still fails with this profile, it is incompatible with firejail. # (from https://gist.github.com/rusty-snake/bb234cb3e50e1e4e7429f29a7931cc72) # # Usage: -# 1. download -# 2. firejail --profile=noprofile.profile /path/to/program +# $ firejail --profile=noprofile.profile /path/to/program # Keep in mind that even with this profile some things are done -# which can break the program. -# - some env-vars are cleared -# - /etc/firejail/firejail.config can contain options such as 'force-nonewprivs yes' -# - a new private pid-namespace is created -# - a minimal hardcoded blacklist is applied +# which can break the program: +# - some env-vars are cleared; +# - /etc/firejail/firejail.config can contain options such as 'force-nonewprivs yes'; +# - a new private pid-namespace is created; +# - a minimal hardcoded blacklist is applied; # - ... noblacklist /sys/fs noblacklist /sys/module +nowhitelist /sys/module/nvidia* +ignore read-only /sys/module/nvidia* allow-debuggers allusers diff --git a/etc/profile-m-z/notable.profile b/etc/profile-m-z/notable.profile index 9fbbf94c0..4bd3d45ac 100644 --- a/etc/profile-m-z/notable.profile +++ b/etc/profile-m-z/notable.profile @@ -14,11 +14,12 @@ include globals.local noblacklist ${HOME}/.config/Notable noblacklist ${HOME}/.notable +whitelist /opt/Notable + net none nosound ?HAS_APPIMAGE: ignore private-dev -private-opt Notable dbus-user filter dbus-user.talk ca.desrt.dconf diff --git a/etc/profile-m-z/notify-send.profile b/etc/profile-m-z/notify-send.profile index f0f2cca2e..5ec81c2ac 100644 --- a/etc/profile-m-z/notify-send.profile +++ b/etc/profile-m-z/notify-send.profile @@ -18,7 +18,7 @@ include disable-shell.inc include disable-write-mnt.inc include disable-xdg.inc -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-m-z/nslookup.profile b/etc/profile-m-z/nslookup.profile index dcd76f2ad..5313d2906 100644 --- a/etc/profile-m-z/nslookup.profile +++ b/etc/profile-m-z/nslookup.profile @@ -7,7 +7,6 @@ include nslookup.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER} noblacklist ${PATH}/nslookup @@ -17,6 +16,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc whitelist ${HOME}/.nslookuprc diff --git a/etc/profile-m-z/nuclear.profile b/etc/profile-m-z/nuclear.profile index dec48c827..6d1e3cd8a 100644 --- a/etc/profile-m-z/nuclear.profile +++ b/etc/profile-m-z/nuclear.profile @@ -14,12 +14,12 @@ include disable-shell.inc mkdir ${HOME}/.config/nuclear whitelist ${HOME}/.config/nuclear +whitelist /opt/nuclear no3d -# private-bin nuclear +#private-bin nuclear private-etc @tls-ca,@x11,host.conf,mime.types -private-opt nuclear # Redirect include electron-common.profile diff --git a/etc/profile-m-z/obs.profile b/etc/profile-m-z/obs.profile index 82e7a4137..dbcc07809 100644 --- a/etc/profile-m-z/obs.profile +++ b/etc/profile-m-z/obs.profile @@ -10,6 +10,9 @@ noblacklist ${MUSIC} noblacklist ${PICTURES} noblacklist ${VIDEOS} +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + # Allow python (blacklisted by disable-interpreters.inc) include allow-python2.inc include allow-python3.inc diff --git a/etc/profile-m-z/obsidian.profile b/etc/profile-m-z/obsidian.profile new file mode 100644 index 000000000..80ca334ba --- /dev/null +++ b/etc/profile-m-z/obsidian.profile @@ -0,0 +1,22 @@ +# Firejail profile for obsidian +# Description: Personal knowledge base and note-taking with Markdown files. +# This file is overwritten after every install/update +# Persistent local customizations +include obsidian.local +# Persistent global definitions +include globals.local + +noblacklist ${DOCUMENTS} +noblacklist ${HOME}/.config/obsidian + +ipc-namespace +nonewprivs +noroot +protocol unix,inet,inet6 +#net none # networking is needed to download/update plugins + +private-bin basename,bash,cat,cut,electron,electron[0-9],electron[0-9][0-9],gawk,grep,obsidian,realpath,tr +private-etc @network,@tls-ca,@x11,gnutls,libva.conf + +# Redirect +include electron-common.profile diff --git a/etc/profile-m-z/ocenaudio.profile b/etc/profile-m-z/ocenaudio.profile index 830483bd4..3fe5a4712 100644 --- a/etc/profile-m-z/ocenaudio.profile +++ b/etc/profile-m-z/ocenaudio.profile @@ -25,6 +25,7 @@ whitelist ${HOME}/.cache/ocenaudio whitelist ${HOME}/.local/share/ocenaudio whitelist ${DOWNLOADS} whitelist ${MUSIC} +whitelist /opt/ocenaudio include whitelist-common.inc include whitelist-run-common.inc include whitelist-runuser-common.inc @@ -54,7 +55,6 @@ private-bin ocenaudio,ocenvst private-cache private-dev private-etc @tls-ca,@x11,mime.types -private-opt ocenaudio private-tmp dbus-user none diff --git a/etc/profile-m-z/okular.profile b/etc/profile-m-z/okular.profile index 8e0758c37..645510124 100644 --- a/etc/profile-m-z/okular.profile +++ b/etc/profile-m-z/okular.profile @@ -33,7 +33,6 @@ whitelist /usr/share/config.kcfg/okular.kcfg whitelist /usr/share/config.kcfg/okular_core.kcfg whitelist /usr/share/ghostscript whitelist /usr/share/kconf_update/okular.upd -whitelist /usr/share/kxmlgui5/okular whitelist /usr/share/okular whitelist /usr/share/poppler include whitelist-run-common.inc @@ -44,7 +43,7 @@ include whitelist-var-common.inc apparmor caps.drop all machine-id -# net none +#net none netfilter nodvd nogroups @@ -59,15 +58,16 @@ protocol unix seccomp tracelog -private-bin kbuildsycoca4,kdeinit4,lpr,okular,unar,unrar +private-bin kbuildsycoca4,kdeinit4,lpr,okular,ps2pdf,unar,unrar private-dev private-etc @x11,cups -# private-tmp - on KDE we need access to the real /tmp for data exchange with email clients +# on KDE we need access to the real /tmp for data exchange with email clients +#private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces join-or-start okular diff --git a/etc/profile-m-z/onionshare-gui.profile b/etc/profile-m-z/onionshare-gui.profile index 47ac9fc05..3338cadf5 100644 --- a/etc/profile-m-z/onionshare-gui.profile +++ b/etc/profile-m-z/onionshare-gui.profile @@ -50,7 +50,7 @@ novideo protocol unix,inet,inet6 seccomp seccomp.block-secondary -#tracelog - may cause issues, see #1930 +#tracelog # may cause issues, see #1930 disable-mnt private-bin onionshare,onionshare-cli,onionshare-gui,python*,tor* diff --git a/etc/profile-m-z/openclonk.profile b/etc/profile-m-z/openclonk.profile index 3449ac686..e10f6011b 100644 --- a/etc/profile-m-z/openclonk.profile +++ b/etc/profile-m-z/openclonk.profile @@ -24,7 +24,7 @@ include whitelist-var-common.inc apparmor caps.drop all ipc-namespace -# net none - networked game +#net none # networked game netfilter nodvd nogroups diff --git a/etc/profile-m-z/orage.profile b/etc/profile-m-z/orage.profile index fa16c05e2..c4849b958 100644 --- a/etc/profile-m-z/orage.profile +++ b/etc/profile-m-z/orage.profile @@ -24,7 +24,7 @@ nogroups noinput nonewprivs noroot -# nosound - calendar application, It must be able to play sound to wake you up. +#nosound # calendar application, It must be able to play sound to wake you up. notv nou2f novideo diff --git a/etc/profile-m-z/otter-browser.profile b/etc/profile-m-z/otter-browser.profile index a1c0462ba..76d4a2c52 100644 --- a/etc/profile-m-z/otter-browser.profile +++ b/etc/profile-m-z/otter-browser.profile @@ -57,4 +57,4 @@ private-tmp dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-m-z/palemoon.profile b/etc/profile-m-z/palemoon.profile index 24701b657..8e1a5daf5 100644 --- a/etc/profile-m-z/palemoon.profile +++ b/etc/profile-m-z/palemoon.profile @@ -12,15 +12,16 @@ mkdir ${HOME}/.cache/moonchild productions/pale moon mkdir ${HOME}/.moonchild productions whitelist ${HOME}/.cache/moonchild productions/pale moon whitelist ${HOME}/.moonchild productions +whitelist /opt/palemoon +whitelist /usr/share/moonchild productions +whitelist /usr/share/palemoon # Palemoon can use the full firejail seccomp filter (unlike firefox >= 60) seccomp ignore seccomp #private-bin palemoon -# private-etc must first be enabled in firefox-common.profile -#private-etc palemoon -#private-opt palemoon +private-etc palemoon restrict-namespaces ignore restrict-namespaces diff --git a/etc/profile-m-z/patch.profile b/etc/profile-m-z/patch.profile index 5a0f69f79..23e734b43 100644 --- a/etc/profile-m-z/patch.profile +++ b/etc/profile-m-z/patch.profile @@ -10,6 +10,7 @@ include globals.local blacklist ${RUNUSER} noblacklist ${DOCUMENTS} +noblacklist ${PATH}/patch include disable-common.inc include disable-devel.inc diff --git a/etc/profile-m-z/pavucontrol-qt.profile b/etc/profile-m-z/pavucontrol-qt.profile index f96ba14d2..79ed8777d 100644 --- a/etc/profile-m-z/pavucontrol-qt.profile +++ b/etc/profile-m-z/pavucontrol-qt.profile @@ -9,8 +9,9 @@ include pavucontrol-qt.local noblacklist ${HOME}/.config/pavucontrol-qt -mkdir ${HOME}/.config/pavucontrol-qt -whitelist ${HOME}/.config/pavucontrol-qt +# whitelisting in ${HOME} is broken, see #3112 +#mkdir ${HOME}/.config/pavucontrol-qt +#whitelist ${HOME}/.config/pavucontrol-qt private-bin pavucontrol-qt ignore private-lib diff --git a/etc/profile-m-z/pidgin.profile b/etc/profile-m-z/pidgin.profile index d78478687..5bc0bd700 100644 --- a/etc/profile-m-z/pidgin.profile +++ b/etc/profile-m-z/pidgin.profile @@ -38,10 +38,9 @@ notv nou2f protocol unix,inet,inet6,netlink seccomp -# shell none tracelog -# private-bin pidgin +#private-bin pidgin private-cache private-dev private-tmp diff --git a/etc/profile-m-z/pinball-wrapper.profile b/etc/profile-m-z/pinball-wrapper.profile index 2b5ed6e27..fec4c3132 100644 --- a/etc/profile-m-z/pinball-wrapper.profile +++ b/etc/profile-m-z/pinball-wrapper.profile @@ -6,6 +6,7 @@ include pinball-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin pinball-wrapper diff --git a/etc/profile-m-z/ping.profile b/etc/profile-m-z/ping.profile index 4520ac2fa..785de68cb 100644 --- a/etc/profile-m-z/ping.profile +++ b/etc/profile-m-z/ping.profile @@ -15,10 +15,10 @@ include disable-exec.inc include disable-interpreters.inc include disable-proc.inc include disable-programs.inc -include disable-X11.inc +include disable-x11.inc include disable-xdg.inc -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-run-common.inc include whitelist-runuser-common.inc include whitelist-usr-share-common.inc @@ -55,7 +55,7 @@ tracelog disable-mnt private -#private-bin ping - has mammoth problems with execvp: "No such file or directory" +#private-bin ping # has mammoth problems with execvp: "No such file or directory" private-cache private-dev private-etc @tls-ca diff --git a/etc/profile-m-z/pingus.profile b/etc/profile-m-z/pingus.profile index 3ff033e0b..e274b6443 100644 --- a/etc/profile-m-z/pingus.profile +++ b/etc/profile-m-z/pingus.profile @@ -23,8 +23,9 @@ include disable-xdg.inc mkdir ${HOME}/.pingus whitelist ${HOME}/.pingus +# Debian keeps games data under /usr/share/games +whitelist /usr/share/games/pingus whitelist /usr/share/pingus -whitelist /usr/share/games/pingus # Debian keeps games data under /usr/share/games include whitelist-common.inc include whitelist-runuser-common.inc include whitelist-usr-share-common.inc diff --git a/etc/profile-m-z/pipe-viewer-gtk.profile b/etc/profile-m-z/pipe-viewer-gtk.profile new file mode 100644 index 000000000..790dbfe25 --- /dev/null +++ b/etc/profile-m-z/pipe-viewer-gtk.profile @@ -0,0 +1,14 @@ +# Firejail profile for pipe-viewer-gtk +# Description: GTK front-end to pipe-viewer +# This file is overwritten after every install/update +# Persistent local customizations +include pipe-viewer-gtk.local +# added by included profile +#include globals.local + +private-bin pipe-viewer-gtk + +include gtk-youtube-viewers-common.profile + +# Redirect +include pipe-viewer.profile diff --git a/etc/profile-m-z/pkglog.profile b/etc/profile-m-z/pkglog.profile index 799c8f607..2f200e154 100644 --- a/etc/profile-m-z/pkglog.profile +++ b/etc/profile-m-z/pkglog.profile @@ -6,6 +6,8 @@ include pkglog.local # Persistent global definitions include globals.local +blacklist ${RUNUSER} + # Allow python (blacklisted by disable-interpreters.inc) include allow-python3.inc @@ -14,6 +16,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +#include disable-x11.inc # x11 none include disable-xdg.inc whitelist /var/log/apt/history.log @@ -37,6 +40,7 @@ nou2f novideo seccomp tracelog +x11 none disable-mnt private diff --git a/etc/profile-m-z/pluma.profile b/etc/profile-m-z/pluma.profile index efcdaa661..6e56208d5 100644 --- a/etc/profile-m-z/pluma.profile +++ b/etc/profile-m-z/pluma.profile @@ -21,10 +21,10 @@ include disable-shell.inc include whitelist-var-common.inc -# apparmor - makes settings immutable +#apparmor # makes settings immutable caps.drop all machine-id -# net none - makes settings immutable +#net none # makes settings immutable no3d nodvd nogroups @@ -45,8 +45,8 @@ private-lib aspell,gconv,libgspell-1.so.*,libreadline.so.*,libtinfo.so.*,pluma private-tmp # makes settings immutable -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces join-or-start pluma diff --git a/etc/profile-m-z/plv.profile b/etc/profile-m-z/plv.profile index 34e18cbd7..38fa01553 100644 --- a/etc/profile-m-z/plv.profile +++ b/etc/profile-m-z/plv.profile @@ -53,7 +53,7 @@ writable-var-log dbus-user none dbus-system none -#memory-deny-write-execute - breaks opening file-chooser +#memory-deny-write-execute # breaks opening file-chooser read-only ${HOME} read-write ${HOME}/.config/PacmanLogViewer read-only /var/log/pacman.log diff --git a/etc/profile-m-z/pnpm.profile b/etc/profile-m-z/pnpm.profile new file mode 100644 index 000000000..08f88be43 --- /dev/null +++ b/etc/profile-m-z/pnpm.profile @@ -0,0 +1,11 @@ +# Firejail profile for pnpm +# Description: Fast, disk space efficient package manager +quiet +# This file is overwritten after every install/update +# Persistent local customizations +include pnpm.local +# Persistent global definitions +include globals.local + +# Redirect +include nodejs-common.profile diff --git a/etc/profile-m-z/pnpx.profile b/etc/profile-m-z/pnpx.profile new file mode 100644 index 000000000..a99d1232a --- /dev/null +++ b/etc/profile-m-z/pnpx.profile @@ -0,0 +1,11 @@ +# Firejail profile for pnpx +# Description: Part of the Node.js stack +quiet +# This file is overwritten after every install/update +# Persistent local customizations +include pnpx.local +# Persistent global definitions +include globals.local + +# Redirect +include nodejs-common.profile diff --git a/etc/profile-m-z/postman.profile b/etc/profile-m-z/postman.profile index c8f00584d..a74b72695 100644 --- a/etc/profile-m-z/postman.profile +++ b/etc/profile-m-z/postman.profile @@ -17,7 +17,7 @@ include whitelist-run-common.inc protocol unix,inet,inet6,netlink -private-bin electron,electron[0-9],electron[0-9][0-9],locale,node,Postman,postman,sh +private-bin Postman,electron,electron[0-9],electron[0-9][0-9],locale,node,postman,sh private-etc alternatives,ca-certificates,crypto-policies,fonts,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,nsswitch.conf,pki,resolv.conf,ssl # private-opt breaks file-copy-limit, use a whitelist instead of draining RAM # https://github.com/netblue30/firejail/discussions/5307 diff --git a/etc/profile-m-z/ppsspp.profile b/etc/profile-m-z/ppsspp.profile index da16ae912..5ae6ccf04 100644 --- a/etc/profile-m-z/ppsspp.profile +++ b/etc/profile-m-z/ppsspp.profile @@ -39,7 +39,7 @@ novideo protocol unix,netlink seccomp -private-bin ppsspp,PPSSPP,PPSSPPQt,PPSSPPSDL +private-bin PPSSPP,PPSSPPQt,PPSSPPSDL,ppsspp # Add the next line to your ppsspp.local if you do not need controller support. #private-dev private-etc @tls-ca,@x11,host.conf diff --git a/etc/profile-m-z/prismlauncher.profile b/etc/profile-m-z/prismlauncher.profile new file mode 100644 index 000000000..14f5c0f6d --- /dev/null +++ b/etc/profile-m-z/prismlauncher.profile @@ -0,0 +1,41 @@ +# Firejail profile for PrismLauncher +# Description: An Open Source Minecraft launcher with the ability to manage multiple instances, accounts and mods. +# This file is overwritten after every install/update +# Persistent local customizations +include prismlauncher.local +# Persistent global definitions +include globals.local + +include allow-java.inc + +include disable-common.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-shell.inc + +whitelist ${HOME}/.local/share/PrismLauncher +whitelist ${HOME}/Downloads + +apparmor +caps.drop all +netfilter +nodvd +nogroups +nonewprivs +noprinters +noroot +notpm +notv +nou2f +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary + +disable-mnt +private-cache +private-dev +private-tmp + +dbus-system none + +restrict-namespaces diff --git a/etc/profile-m-z/psi-plus.profile b/etc/profile-m-z/psi-plus.profile index af117c3b5..7a735bba7 100644 --- a/etc/profile-m-z/psi-plus.profile +++ b/etc/profile-m-z/psi-plus.profile @@ -43,4 +43,4 @@ disable-mnt private-dev private-tmp -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-m-z/psi.profile b/etc/profile-m-z/psi.profile index a1a0606b9..1417a87c9 100644 --- a/etc/profile-m-z/psi.profile +++ b/etc/profile-m-z/psi.profile @@ -62,7 +62,7 @@ novideo nou2f protocol unix,inet,inet6,netlink seccomp !chroot -#tracelog - breaks on Arch +#tracelog # breaks on Arch disable-mnt # Add the next line to your psi.local to enable GPG support. diff --git a/etc/profile-m-z/pycharm-community.profile b/etc/profile-m-z/pycharm-community.profile index 875b83e8e..fa307fc88 100644 --- a/etc/profile-m-z/pycharm-community.profile +++ b/etc/profile-m-z/pycharm-community.profile @@ -34,8 +34,8 @@ nou2f novideo tracelog -# private-etc alternatives,fonts,passwd - minimal required to run but will probably break -# program! +# minimum required to run but will probably break the program! +#private-etc alternatives,fonts,passwd private-dev private-tmp diff --git a/etc/profile-m-z/qbittorrent.profile b/etc/profile-m-z/qbittorrent.profile index 9605da3ac..ae0a2cdf1 100644 --- a/etc/profile-m-z/qbittorrent.profile +++ b/etc/profile-m-z/qbittorrent.profile @@ -55,12 +55,12 @@ seccomp private-bin python*,qbittorrent private-dev -# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,resolv.conf,ssl,X11,xdg +#private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,resolv.conf,ssl,X11,xdg private-tmp # See https://github.com/netblue30/firejail/issues/3707 for tray-icon dbus-user none dbus-system none -# memory-deny-write-execute - problems on Arch, see #1690 on GitHub repo +#memory-deny-write-execute # problems on Arch, see #1690 on GitHub repo restrict-namespaces diff --git a/etc/profile-m-z/qemu-common.profile b/etc/profile-m-z/qemu-common.profile new file mode 100644 index 000000000..bf8c2b977 --- /dev/null +++ b/etc/profile-m-z/qemu-common.profile @@ -0,0 +1,28 @@ +# Firejail profile for QEMU +# Description: Machine & userspace emulator and virtualizer +# This file is overwritten after every install/update +# Persistent local customizations +include qemu-common.local +# Persistent global definitions +# added by caller profile +#include globals.local + +include disable-common.inc +include disable-programs.inc + +caps.drop all +netfilter +nodvd +nogroups +nonewprivs +noroot +notv +protocol unix,inet,inet6 +seccomp +tracelog + +private-cache +private-tmp + +noexec /tmp +restrict-namespaces diff --git a/etc/profile-m-z/qemu-launcher.profile b/etc/profile-m-z/qemu-launcher.profile index 8484d3705..5eab480dc 100644 --- a/etc/profile-m-z/qemu-launcher.profile +++ b/etc/profile-m-z/qemu-launcher.profile @@ -7,22 +7,5 @@ include globals.local noblacklist ${HOME}/.qemu-launcher -include disable-common.inc -include disable-programs.inc - -caps.drop all -netfilter -nodvd -nogroups -nonewprivs -noroot -notv -protocol unix,inet,inet6 -seccomp -tracelog - -private-cache -private-tmp - -noexec /tmp -restrict-namespaces +# Redirect +include qemu-common.profile diff --git a/etc/profile-m-z/qemu-system-x86_64.profile b/etc/profile-m-z/qemu-system-x86_64.profile index 495c469f7..27dd31af1 100644 --- a/etc/profile-m-z/qemu-system-x86_64.profile +++ b/etc/profile-m-z/qemu-system-x86_64.profile @@ -6,22 +6,5 @@ include qemu-system-x86_64.local # Persistent global definitions include globals.local -include disable-common.inc -include disable-programs.inc - -caps.drop all -netfilter -nodvd -nogroups -nonewprivs -noroot -notv -protocol unix,inet,inet6 -seccomp -tracelog - -private-cache -private-tmp - -noexec /tmp -restrict-namespaces +# Redirect +include qemu-common.profile diff --git a/etc/profile-m-z/qmmp.profile b/etc/profile-m-z/qmmp.profile index ecd62a7d1..66c8f3238 100644 --- a/etc/profile-m-z/qmmp.profile +++ b/etc/profile-m-z/qmmp.profile @@ -18,7 +18,7 @@ include disable-xdg.inc caps.drop all netfilter -# no3d +#no3d nogroups noinput nonewprivs diff --git a/etc/profile-m-z/qpdf.profile b/etc/profile-m-z/qpdf.profile index edec7cf0a..a5b65aa8e 100644 --- a/etc/profile-m-z/qpdf.profile +++ b/etc/profile-m-z/qpdf.profile @@ -18,7 +18,7 @@ include disable-interpreters.inc include disable-proc.inc include disable-programs.inc include disable-shell.inc -include disable-X11.inc +include disable-x11.inc include disable-xdg.inc whitelist ${DOCUMENTS} diff --git a/etc/profile-m-z/qpdfview.profile b/etc/profile-m-z/qpdfview.profile index 4caa0917f..784d2fafd 100644 --- a/etc/profile-m-z/qpdfview.profile +++ b/etc/profile-m-z/qpdfview.profile @@ -41,7 +41,7 @@ private-dev private-tmp # needs D-Bus when started from a file manager -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/qt5ct.profile b/etc/profile-m-z/qt5ct.profile new file mode 100644 index 000000000..83d22c2cd --- /dev/null +++ b/etc/profile-m-z/qt5ct.profile @@ -0,0 +1,65 @@ +# Firejail profile for qt5ct +# Description: Qt5 Configuration Utility +# This file is overwritten after every install/update +# Persistent local customizations +include qt5ct.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.config/qt5ct +mkdir ${HOME}/.local/share/qt5ct +whitelist ${HOME}/.config/qt5ct +whitelist ${HOME}/.local/share/qt5ct + +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +machine-id +net none +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-bin qt5ct +private-cache +private-dev +private-etc dbus-1,machine-id +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +read-write ${HOME}/.config/qt5ct +read-write ${HOME}/.local/share/qt5ct +restrict-namespaces diff --git a/etc/profile-m-z/qt6ct.profile b/etc/profile-m-z/qt6ct.profile new file mode 100644 index 000000000..76b76d183 --- /dev/null +++ b/etc/profile-m-z/qt6ct.profile @@ -0,0 +1,67 @@ +# Firejail profile for qt6ct +# Description: Qt6 Configuration Utility +# This file is overwritten after every install/update +# Persistent local customizations +include qt6ct.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.config/qt6ct +mkdir ${HOME}/.local/share/qt6ct +whitelist ${HOME}/.config/qt6ct +whitelist ${HOME}/.local/share/qt6ct + +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +machine-id +net none +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-bin qt6ct +private-cache +private-dev +private-etc dbus-1,machine-id +private-tmp + +dbus-user filter +dbus-user.talk org.freedesktop.portal.Desktop +dbus-user.talk org.freedesktop.portal.Settings +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +read-write ${HOME}/.config/qt6ct +read-write ${HOME}/.local/share/qt6ct +restrict-namespaces diff --git a/etc/profile-m-z/qtox.profile b/etc/profile-m-z/qtox.profile index ab0f9425a..20c84c5a8 100644 --- a/etc/profile-m-z/qtox.profile +++ b/etc/profile-m-z/qtox.profile @@ -48,5 +48,5 @@ private-tmp dbus-user none dbus-system none -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-m-z/quassel.profile b/etc/profile-m-z/quassel.profile index 4589c9e4a..4ec990e95 100644 --- a/etc/profile-m-z/quassel.profile +++ b/etc/profile-m-z/quassel.profile @@ -25,4 +25,4 @@ seccomp !chroot private-cache private-tmp -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-m-z/quiterss.profile b/etc/profile-m-z/quiterss.profile index a59f01f85..4102b1ea0 100644 --- a/etc/profile-m-z/quiterss.profile +++ b/etc/profile-m-z/quiterss.profile @@ -50,6 +50,6 @@ tracelog disable-mnt private-bin quiterss private-dev -# private-etc alternatives,ca-certificates,crypto-policies,pki,ssl,X11 +#private-etc alternatives,ca-certificates,crypto-policies,pki,ssl,X11 restrict-namespaces diff --git a/etc/profile-m-z/rawtherapee.profile b/etc/profile-m-z/rawtherapee.profile new file mode 100644 index 000000000..0cf946eec --- /dev/null +++ b/etc/profile-m-z/rawtherapee.profile @@ -0,0 +1,39 @@ +# Firejail profile for rawtherapee +# Description: Free cross-platform raw image processing program +# This file is overwritten after every install/update +# Persistent local customizations +include rawtherapee.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.cache/RawTherapee +noblacklist ${HOME}/.config/RawTherapee +noblacklist ${PICTURES} + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +caps.drop all +netfilter +nodvd +nogroups +noinput +nonewprivs +noroot +nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp + +private-bin rawtherapee +private-dev +private-tmp + +restrict-namespaces diff --git a/etc/profile-m-z/reader.profile b/etc/profile-m-z/reader.profile new file mode 100644 index 000000000..31c45fe84 --- /dev/null +++ b/etc/profile-m-z/reader.profile @@ -0,0 +1,63 @@ +# Firejail profile for reader +# Description: Better readability of web pages on the CLI +# This file is overwritten after every install/update +# Persistent local customizations +include reader.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +#include whitelist-common.inc # see #903 +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol inet +seccomp +seccomp.block-secondary +tracelog +x11 none + +disable-mnt +private +private-bin reader +private-cache +private-dev +private-etc @network,@tls-ca +private-lib +private-opt none +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +restrict-namespaces diff --git a/etc/profile-m-z/rhythmbox.profile b/etc/profile-m-z/rhythmbox.profile index 77c032a53..c2343db02 100644 --- a/etc/profile-m-z/rhythmbox.profile +++ b/etc/profile-m-z/rhythmbox.profile @@ -26,7 +26,7 @@ include disable-shell.inc include disable-xdg.inc whitelist /usr/share/rhythmbox -whitelist /usr/share/lua +whitelist /usr/share/lua* whitelist /usr/share/libquvi-scripts whitelist /usr/share/tracker include whitelist-runuser-common.inc diff --git a/etc/profile-m-z/rocketchat.profile b/etc/profile-m-z/rocketchat.profile index bad384090..a95cc18d7 100644 --- a/etc/profile-m-z/rocketchat.profile +++ b/etc/profile-m-z/rocketchat.profile @@ -15,7 +15,6 @@ ignore include whitelist-usr-share-common.inc ignore include whitelist-var-common.inc ignore nou2f ignore novideo -ignore shell none ignore disable-mnt ignore private-cache ignore private-dev diff --git a/etc/profile-m-z/rpcs3.profile b/etc/profile-m-z/rpcs3.profile index 405ab818d..603ec8ff4 100644 --- a/etc/profile-m-z/rpcs3.profile +++ b/etc/profile-m-z/rpcs3.profile @@ -54,7 +54,8 @@ tracelog disable-mnt #private-cache -#private-etc alternatives,ca-certificates,crypto-policies,machine-id,pki,resolv.conf,ssl # seems to need awk +# seems to need awk +#private-etc alternatives,ca-certificates,crypto-policies,machine-id,pki,resolv.conf,ssl private-tmp dbus-user none diff --git a/etc/profile-m-z/rssguard.profile b/etc/profile-m-z/rssguard.profile index 81381c205..127bfe863 100644 --- a/etc/profile-m-z/rssguard.profile +++ b/etc/profile-m-z/rssguard.profile @@ -8,6 +8,7 @@ include globals.local noblacklist ${HOME}/.config/RSS Guard 4 +# Allow nodejs (blacklisted by disable-interpreters.inc) include allow-nodejs.inc include disable-common.inc @@ -31,13 +32,13 @@ include whitelist-var-common.inc apparmor caps.drop all netfilter -# no3d +#no3d nodvd nogroups noinput nonewprivs noroot -# nosound +#nosound notv nou2f novideo diff --git a/etc/profile-m-z/rsync-download_only.profile b/etc/profile-m-z/rsync-download_only.profile index ce90012e3..12724a077 100644 --- a/etc/profile-m-z/rsync-download_only.profile +++ b/etc/profile-m-z/rsync-download_only.profile @@ -11,7 +11,6 @@ include globals.local # not as a daemon (rsync --daemon) nor to create backups. # Usage: firejail --profile=rsync-download_only rsync -blacklist /tmp/.X11-unix blacklist ${RUNUSER} include disable-common.inc @@ -20,6 +19,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include disable-xdg.inc # Add the next line to your rsync-download_only.local to enable extra hardening. diff --git a/etc/profile-m-z/rtin.profile b/etc/profile-m-z/rtin.profile index 87aa69bcb..b1acf8b2e 100644 --- a/etc/profile-m-z/rtin.profile +++ b/etc/profile-m-z/rtin.profile @@ -1,6 +1,6 @@ # Firejail profile for rtin # Description: ncurses-based Usenet newsreader -# symlink to tin, same as `tin -r` +# symlink to tin, same as `tin -r` # This file is overwritten after every install/update # Persistent local customizations include rtin.local diff --git a/etc/profile-m-z/rtv-addons.profile b/etc/profile-m-z/rtv-addons.profile index cc6db5043..7af7241d0 100644 --- a/etc/profile-m-z/rtv-addons.profile +++ b/etc/profile-m-z/rtv-addons.profile @@ -11,13 +11,20 @@ ignore nosound ignore private-bin ignore dbus-user none +noblacklist ${HOME}/.cache/mpv noblacklist ${HOME}/.config/mpv +noblacklist ${HOME}/.local/state/mpv noblacklist ${HOME}/.mailcap noblacklist ${HOME}/.netrc noblacklist ${HOME}/.w3m +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + +whitelist ${HOME}/.cache/mpv whitelist ${HOME}/.cache/youtube-dl/youtube-sigfuncs whitelist ${HOME}/.config/mpv +whitelist ${HOME}/.local/state/mpv whitelist ${HOME}/.mailcap whitelist ${HOME}/.netrc whitelist ${HOME}/.w3m diff --git a/etc/profile-m-z/rtv.profile b/etc/profile-m-z/rtv.profile index 0d57e6916..5219f73f6 100644 --- a/etc/profile-m-z/rtv.profile +++ b/etc/profile-m-z/rtv.profile @@ -6,7 +6,6 @@ include rtv.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* noblacklist ${HOME}/.config/rtv @@ -28,6 +27,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc mkdir ${HOME}/.config/rtv diff --git a/etc/profile-m-z/rymdport.profile b/etc/profile-m-z/rymdport.profile new file mode 100644 index 000000000..b357eb75c --- /dev/null +++ b/etc/profile-m-z/rymdport.profile @@ -0,0 +1,62 @@ +# Firejail profile for rymdport +# Description: Encrypted sharing of files, folders, and text between devices +# This file is overwritten after every install/update +# Persistent local customizations +include rymdport.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +noblacklist ${HOME}/.config/fyne + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +#include disable-xdg.inc + +#mkdir ${HOME}/.config/fyne +#whitelist ${HOME}/.config/fyne +#whitelist ${DOWNLOADS} +#include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog + +#disable-mnt +private-bin rymdport +private-cache +private-dev +private-etc @network,@tls-ca,@x11 +private-tmp + +dbus-user none +dbus-system none + +restrict-namespaces diff --git a/etc/profile-m-z/scorched3d-wrapper.profile b/etc/profile-m-z/scorched3d-wrapper.profile index e76caec1d..a8713edbf 100644 --- a/etc/profile-m-z/scorched3d-wrapper.profile +++ b/etc/profile-m-z/scorched3d-wrapper.profile @@ -3,6 +3,7 @@ # Persistent local customizations include scorched3d-wrapper.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin scorched3d-wrapper diff --git a/etc/profile-m-z/scribus.profile b/etc/profile-m-z/scribus.profile index 34cf783fe..8e25375b0 100644 --- a/etc/profile-m-z/scribus.profile +++ b/etc/profile-m-z/scribus.profile @@ -55,7 +55,7 @@ protocol unix seccomp tracelog -# private-bin gimp*,gs,scribus +#private-bin gimp*,gs,scribus private-dev private-tmp diff --git a/etc/profile-m-z/seahorse-adventures.profile b/etc/profile-m-z/seahorse-adventures.profile index 5985e0da3..49d98d9f5 100644 --- a/etc/profile-m-z/seahorse-adventures.profile +++ b/etc/profile-m-z/seahorse-adventures.profile @@ -23,7 +23,7 @@ include disable-xdg.inc whitelist /usr/share/seahorse-adventures whitelist /usr/share/games/seahorse-adventures -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-m-z/seahorse-daemon.profile b/etc/profile-m-z/seahorse-daemon.profile index b3ead7191..f409b1930 100644 --- a/etc/profile-m-z/seahorse-daemon.profile +++ b/etc/profile-m-z/seahorse-daemon.profile @@ -9,7 +9,7 @@ include seahorse-daemon.local #include globals.local blacklist ${RUNUSER}/wayland-* -include disable-X11.inc +include disable-x11.inc memory-deny-write-execute diff --git a/etc/profile-m-z/seamonkey.profile b/etc/profile-m-z/seamonkey.profile index c2dbbc2c6..1171a52f0 100644 --- a/etc/profile-m-z/seamonkey.profile +++ b/etc/profile-m-z/seamonkey.profile @@ -55,7 +55,7 @@ seccomp tracelog disable-mnt -# private-etc adobe,alternatives,asound.conf,ca-certificates,crypto-policies,firefox,fonts,group,gtk-2.0,hostname,hosts,iceweasel,localtime,machine-id,mailcap,mime.types,nsswitch.conf,pango,passwd,pki,pulse,resolv.conf,ssl +#private-etc adobe,alternatives,asound.conf,ca-certificates,crypto-policies,firefox,fonts,group,gtk-2.0,hostname,hosts,iceweasel,localtime,machine-id,mailcap,mime.types,nsswitch.conf,pango,passwd,pki,pulse,resolv.conf,ssl writable-run-user restrict-namespaces diff --git a/etc/profile-m-z/server.profile b/etc/profile-m-z/server.profile index 05170267b..a2978ab19 100644 --- a/etc/profile-m-z/server.profile +++ b/etc/profile-m-z/server.profile @@ -34,63 +34,62 @@ include globals.local noblacklist /sbin noblacklist /usr/sbin noblacklist /etc/init.d -# noblacklist /var/opt +#noblacklist /var/opt -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc -# include disable-devel.inc -# include disable-exec.inc -# include disable-interpreters.inc +#include disable-devel.inc +#include disable-exec.inc +#include disable-interpreters.inc include disable-programs.inc include disable-write-mnt.inc +include disable-x11.inc include disable-xdg.inc -# include whitelist-runuser-common.inc -# include whitelist-usr-share-common.inc -# include whitelist-var-common.inc +#include whitelist-runuser-common.inc +#include whitelist-usr-share-common.inc +#include whitelist-var-common.inc # people use to install servers all over the place! # apparmor runs executable only from default system locations -# apparmor +#apparmor caps -# ipc-namespace +#ipc-namespace machine-id -# netfilter /etc/firejail/webserver.net +#netfilter /etc/firejail/webserver.net no3d nodvd -# nogroups +#nogroups noinput nonewprivs -# noroot +#noroot nosound notv nou2f novideo protocol unix,inet,inet6,netlink,packet seccomp -# shell none tab # allow tab completion disable-mnt private -# private-bin program -# private-cache +#private-bin program +#private-cache private-dev # see /usr/share/doc/firejail/profile.template for more common private-etc paths. -# private-etc alternatives -# private-lib -# private-opt none +#private-etc alternatives +#private-lib +#private-opt none private-tmp -# writable-run-user -# writable-var -# writable-var-log +#writable-run-user +#writable-var +#writable-var-log dbus-user none -# dbus-system none +#dbus-system none -# deterministic-shutdown -# memory-deny-write-execute -# read-only ${HOME} -# restrict-namespaces +#deterministic-shutdown +#memory-deny-write-execute +#read-only ${HOME} +#restrict-namespaces diff --git a/etc/profile-m-z/session-desktop.profile b/etc/profile-m-z/session-desktop.profile new file mode 100644 index 000000000..b1076b080 --- /dev/null +++ b/etc/profile-m-z/session-desktop.profile @@ -0,0 +1,71 @@ +# Firejail profile for session-desktop +# Description: Encrypted messenger +# This file is overwritten after every install/update +# Persistent local customizations +include session-desktop.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +ignore noexec /tmp + +noblacklist ${HOME}/.config/Session + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.config/Session +whitelist ${DOWNLOADS} +whitelist ${HOME}/.config/Session +whitelist /opt/Session +whitelist /opt/session-desktop +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +netfilter +nodvd +nogroups +?HAS_APPIMAGE: ignore noinput +noinput +nonewprivs +noprinters +noroot +notv +nou2f +protocol unix,inet,inet6,netlink +seccomp !chroot +seccomp.block-secondary +tracelog + +disable-mnt +private-bin session-desktop*,session-messenger-desktop* +private-cache +?HAS_APPIMAGE: ignore private-dev +private-dev +private-etc @network,@tls-ca,@x11 +private-tmp + +dbus-user filter +dbus-user.talk org.freedesktop.impl.* +dbus-user.talk org.freedesktop.Notifications +dbus-user.talk org.freedesktop.portal.* +dbus-user.talk org.freedesktop.secrets +?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher +?ALLOW_TRAY: dbus-user.own org.kde.* +dbus-system none + +# breaks app +#restrict-namespaces diff --git a/etc/profile-m-z/session-messenger-desktop.profile b/etc/profile-m-z/session-messenger-desktop.profile new file mode 100644 index 000000000..3b42c8db1 --- /dev/null +++ b/etc/profile-m-z/session-messenger-desktop.profile @@ -0,0 +1,11 @@ +# Firejail profile for session-messenger-desktop +# Description: Encrypted messenger +# This file is overwritten after every install/update +# Persistent local customizations +include session-messenger-desktop.local +# Persistent global definitions +# added by included profile +#include globals.local + +# Redirect +include session-desktop.profile diff --git a/etc/profile-m-z/session-messenger.profile b/etc/profile-m-z/session-messenger.profile new file mode 100644 index 000000000..739cfb8b1 --- /dev/null +++ b/etc/profile-m-z/session-messenger.profile @@ -0,0 +1,11 @@ +# Firejail profile for session-messenger +# Description: Encrypted messenger +# This file is overwritten after every install/update +# Persistent local customizations +include session-messenger.local +# Persistent global definitions +# added by included profile +#include globals.local + +# Redirect +include session-desktop.profile diff --git a/etc/profile-m-z/signal-cli.profile b/etc/profile-m-z/signal-cli.profile index d881db714..67bb45141 100644 --- a/etc/profile-m-z/signal-cli.profile +++ b/etc/profile-m-z/signal-cli.profile @@ -6,7 +6,6 @@ include signal-cli.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* noblacklist ${HOME}/.local/share/signal-cli @@ -18,6 +17,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc mkdir ${HOME}/.local/share/signal-cli diff --git a/etc/profile-m-z/signal-desktop.profile b/etc/profile-m-z/signal-desktop.profile index 3e1899ef3..c8d908aa8 100644 --- a/etc/profile-m-z/signal-desktop.profile +++ b/etc/profile-m-z/signal-desktop.profile @@ -5,13 +5,18 @@ include signal-desktop.local # Persistent global definitions include globals.local +# sh is needed to allow Firefox to open links +include allow-bin-sh.inc + ignore novideo ignore noexec /tmp noblacklist ${HOME}/.config/Signal -# These lines are needed to allow Firefox to open links +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) noblacklist ${HOME}/.mozilla whitelist ${HOME}/.mozilla/firefox/profiles.ini @@ -21,11 +26,11 @@ whitelist ${HOME}/.config/Signal private-etc @tls-ca dbus-user filter - # allow D-Bus notifications dbus-user.talk org.freedesktop.Notifications - -# allow D-Bus communication with Firefox browsers for opening links +# Allow D-Bus communication with Freedesktop.org secrets API to decrypt local key +dbus-user.talk org.freedesktop.secrets +# Allow D-Bus communication with Firefox for opening links dbus-user.talk org.mozilla.* ignore dbus-user none diff --git a/etc/profile-m-z/silentarmy.profile b/etc/profile-m-z/silentarmy.profile index 96e4cf283..154e29ccf 100644 --- a/etc/profile-m-z/silentarmy.profile +++ b/etc/profile-m-z/silentarmy.profile @@ -7,7 +7,7 @@ include globals.local include disable-common.inc -# include disable-devel.inc +#include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc diff --git a/etc/profile-m-z/simple-scan.profile b/etc/profile-m-z/simple-scan.profile index 14846cf58..f8bcd3c6e 100644 --- a/etc/profile-m-z/simple-scan.profile +++ b/etc/profile-m-z/simple-scan.profile @@ -28,15 +28,15 @@ nonewprivs noroot nosound notv -# novideo +#novideo protocol unix,inet,inet6,netlink # blacklisting of ioperm system calls breaks simple-scan seccomp !ioperm tracelog -# private-bin simple-scan -# private-dev -# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl -# private-tmp +#private-bin simple-scan +#private-dev +#private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl +#private-tmp restrict-namespaces diff --git a/etc/profile-m-z/simutrans.profile b/etc/profile-m-z/simutrans.profile index f88ae65c8..995b59538 100644 --- a/etc/profile-m-z/simutrans.profile +++ b/etc/profile-m-z/simutrans.profile @@ -33,7 +33,7 @@ novideo protocol unix seccomp -# private-bin simutrans +#private-bin simutrans private-dev private-etc @games,@x11 private-tmp diff --git a/etc/profile-m-z/skanlite.profile b/etc/profile-m-z/skanlite.profile index 6b73b2289..3b78f7fd2 100644 --- a/etc/profile-m-z/skanlite.profile +++ b/etc/profile-m-z/skanlite.profile @@ -22,16 +22,16 @@ nonewprivs noroot nosound notv -# novideo +#novideo protocol unix,inet,inet6,netlink # blacklisting of ioperm system calls breaks skanlite seccomp !ioperm -# private-bin kbuildsycoca4,kdeinit4,skanlite -# private-dev -# private-tmp +#private-bin kbuildsycoca4,kdeinit4,skanlite +#private-dev +#private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/smplayer.profile b/etc/profile-m-z/smplayer.profile index 0ab398ebd..d2e872c5c 100644 --- a/etc/profile-m-z/smplayer.profile +++ b/etc/profile-m-z/smplayer.profile @@ -8,6 +8,7 @@ include globals.local noblacklist ${HOME}/.config/smplayer noblacklist ${HOME}/.config/youtube-dl +noblacklist ${HOME}/.dvdcss noblacklist ${HOME}/.mplayer # Allow lua (blacklisted by disable-interpreters.inc) @@ -30,14 +31,13 @@ include disable-xdg.inc whitelist /usr/share/lua* whitelist /usr/share/smplayer -whitelist /usr/share/vulkan include whitelist-usr-share-common.inc include whitelist-var-common.inc apparmor caps.drop all netfilter -# nogroups +#nogroups noinput nonewprivs noroot @@ -50,7 +50,7 @@ private-dev private-tmp # problems with KDE -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/smtube.profile b/etc/profile-m-z/smtube.profile index b617444af..bf348d7a2 100644 --- a/etc/profile-m-z/smtube.profile +++ b/etc/profile-m-z/smtube.profile @@ -6,15 +6,20 @@ include smtube.local # Persistent global definitions include globals.local +noblacklist ${HOME}/.cache/mpv +noblacklist ${HOME}/.config/mpv noblacklist ${HOME}/.config/smplayer noblacklist ${HOME}/.config/smtube -noblacklist ${HOME}/.config/mpv -noblacklist ${HOME}/.mplayer noblacklist ${HOME}/.config/vlc noblacklist ${HOME}/.local/share/vlc +noblacklist ${HOME}/.local/state/mpv +noblacklist ${HOME}/.mplayer noblacklist ${MUSIC} noblacklist ${VIDEOS} +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + include disable-common.inc include disable-devel.inc include disable-exec.inc @@ -22,8 +27,11 @@ include disable-interpreters.inc include disable-programs.inc include disable-xdg.inc +whitelist /usr/share/lua* +whitelist /usr/share/mpv whitelist /usr/share/smplayer whitelist /usr/share/smtube +whitelist /usr/share/vlc include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-m-z/sniffnet.profile b/etc/profile-m-z/sniffnet.profile new file mode 100644 index 000000000..940c35b2e --- /dev/null +++ b/etc/profile-m-z/sniffnet.profile @@ -0,0 +1,49 @@ +# Firejail profile for sniffnet +# Description: Network traffic monitor +# This file is overwritten after every install/update +# Persistent local customizations +include sniffnet.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.config/sniffnet + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-xdg.inc + +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +#caps.drop all +caps.keep net_admin,net_raw +netfilter +nodvd +nogroups +noinput +#nonewprivs # breaks network traffic capture for unprivileged users +#noroot +notv +nou2f +novideo +#seccomp +tracelog + +disable-mnt +#private-bin sniffnet +# private-dev prevents (some) interfaces from being shown. +private-etc @network,@tls-ca +private-tmp + +dbus-user none +dbus-system none + +#restrict-namespaces diff --git a/etc/profile-m-z/softmaker-common.profile b/etc/profile-m-z/softmaker-common.profile index 7ce6748d1..3a3a9062e 100644 --- a/etc/profile-m-z/softmaker-common.profile +++ b/etc/profile-m-z/softmaker-common.profile @@ -42,7 +42,7 @@ tracelog private-bin freeoffice-planmaker,freeoffice-presentations,freeoffice-textmaker,planmaker18,planmaker18free,presentations18,presentations18free,sh,textmaker18,textmaker18free private-cache private-dev -private-etc @tls-ca,fstab,SoftMaker +private-etc @tls-ca,SoftMaker,fstab private-tmp dbus-user none diff --git a/etc/profile-m-z/sol.profile b/etc/profile-m-z/sol.profile index e2be4e9e0..07f9b0094 100644 --- a/etc/profile-m-z/sol.profile +++ b/etc/profile-m-z/sol.profile @@ -21,13 +21,13 @@ apparmor caps.drop all ipc-namespace net none -# no3d +#no3d nodvd nogroups noinput nonewprivs noroot -# nosound +#nosound notv nou2f novideo @@ -43,5 +43,5 @@ private-tmp dbus-user none dbus-system none -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-m-z/sound-juicer.profile b/etc/profile-m-z/sound-juicer.profile index f5ac6c739..5c5763538 100644 --- a/etc/profile-m-z/sound-juicer.profile +++ b/etc/profile-m-z/sound-juicer.profile @@ -38,7 +38,7 @@ private-cache private-dev private-tmp -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/spotify.profile b/etc/profile-m-z/spotify.profile index f07b10319..63c2c5086 100644 --- a/etc/profile-m-z/spotify.profile +++ b/etc/profile-m-z/spotify.profile @@ -16,6 +16,7 @@ include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc +include disable-proc.inc include disable-programs.inc mkdir ${HOME}/.cache/spotify @@ -25,6 +26,7 @@ whitelist ${HOME}/.cache/spotify whitelist ${HOME}/.config/spotify whitelist ${HOME}/.config/spotify-adblock whitelist ${HOME}/.local/share/spotify +whitelist /opt/spotify include whitelist-common.inc include whitelist-var-common.inc @@ -34,6 +36,7 @@ nodvd nogroups noinput nonewprivs +noprinters noroot notv nou2f @@ -46,12 +49,14 @@ private-bin bash,cat,dirname,find,grep,head,rm,sh,spotify,tclsh,touch,zenity private-dev # If you want to see album covers or want to use the radio, add 'ignore private-etc' to your spotify.local. private-etc @tls-ca,host.conf,spotify-adblock -private-opt spotify private-srv none private-tmp -# dbus needed for MPRIS -# dbus-user none -# dbus-system none +dbus-user filter +dbus-user.own org.mpris.MediaPlayer2.spotify +dbus-user.talk org.freedesktop.Notifications +dbus-user.talk org.freedesktop.secrets +dbus-user.talk org.mpris.MediaPlayer2.Player +dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/sqlitebrowser.profile b/etc/profile-m-z/sqlitebrowser.profile index 4e28958e4..013c7ac13 100644 --- a/etc/profile-m-z/sqlitebrowser.profile +++ b/etc/profile-m-z/sqlitebrowser.profile @@ -7,6 +7,7 @@ include sqlitebrowser.local include globals.local noblacklist ${HOME}/.config/sqlitebrowser +noblacklist ${HOME}/.local/share/sqlitebrowser noblacklist ${DOCUMENTS} include disable-common.inc @@ -45,8 +46,8 @@ private-etc @tls-ca private-tmp # breaks proxy creation -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-m-z/ssh-agent.profile b/etc/profile-m-z/ssh-agent.profile index 76755def4..97ddfd292 100644 --- a/etc/profile-m-z/ssh-agent.profile +++ b/etc/profile-m-z/ssh-agent.profile @@ -9,11 +9,11 @@ include globals.local # Allow ssh (blacklisted by disable-common.inc) include allow-ssh.inc -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc include disable-programs.inc +include disable-x11.inc include whitelist-usr-share-common.inc diff --git a/etc/profile-m-z/ssh.profile b/etc/profile-m-z/ssh.profile index a7956a76e..96839d082 100644 --- a/etc/profile-m-z/ssh.profile +++ b/etc/profile-m-z/ssh.profile @@ -18,10 +18,13 @@ include disable-common.inc include disable-exec.inc include disable-programs.inc -whitelist ${RUNUSER}/gnupg/S.gpg-agent.ssh +whitelist ${RUNUSER}/gcr/ssh +whitelist ${RUNUSER}/gnupg/*/S.gpg-agent.ssh # custom gpg homedir setup +whitelist ${RUNUSER}/gnupg/S.gpg-agent.ssh # default gpg homedir setup +whitelist ${RUNUSER}/gvfsd-sftp whitelist ${RUNUSER}/keyring/ssh -include whitelist-usr-share-common.inc include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc apparmor caps.drop all @@ -32,10 +35,10 @@ nodvd nogroups noinput nonewprivs -# noroot - see issue #1543 +#noroot # see issue #1543 nosound notv -# nou2f - OpenSSH >= 8.2 supports U2F +#nou2f # OpenSSH >= 8.2 supports U2F novideo protocol unix,inet,inet6 seccomp @@ -43,7 +46,7 @@ tracelog private-cache private-dev -# private-tmp # Breaks when exiting +#private-tmp # Breaks when exiting writable-run-user dbus-user none diff --git a/etc/profile-m-z/ssmtp.profile b/etc/profile-m-z/ssmtp.profile index 1a224e7b0..8e2c21498 100644 --- a/etc/profile-m-z/ssmtp.profile +++ b/etc/profile-m-z/ssmtp.profile @@ -16,6 +16,7 @@ noblacklist /sbin noblacklist /usr/sbin noblacklist ${DOCUMENTS} +noblacklist ${PATH}/ssmtp include disable-common.inc include disable-devel.inc include disable-exec.inc @@ -23,8 +24,8 @@ include disable-interpreters.inc include disable-proc.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include disable-xdg.inc -include disable-X11.inc mkfile ${HOME}/dead.letter whitelist ${HOME}/dead.letter diff --git a/etc/profile-m-z/standardnotes-desktop.profile b/etc/profile-m-z/standardnotes-desktop.profile index 3fe0963a9..fe4e4b6d7 100644 --- a/etc/profile-m-z/standardnotes-desktop.profile +++ b/etc/profile-m-z/standardnotes-desktop.profile @@ -47,4 +47,4 @@ private-etc @tls-ca,@x11,host.conf dbus-user none dbus-system none -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-m-z/statusof.profile b/etc/profile-m-z/statusof.profile new file mode 100644 index 000000000..6422f979b --- /dev/null +++ b/etc/profile-m-z/statusof.profile @@ -0,0 +1,68 @@ +# Firejail profile for statusof +# Description: Small python script to check the status of a list of urls +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include statusof.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} +blacklist /usr/libexec + +# Allow python (blacklisted by disable-interpreters.inc) +include allow-python3.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-x11.inc +include disable-xdg.inc + +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol inet +seccomp +seccomp.block-secondary +tracelog +x11 none + +disable-mnt +private +private-bin python*,statusof +private-cache +private-dev +private-etc @network,@tls-ca,httpd +private-lib engines*,libcrypto.so.*,libssl.so.*,libz.so.*,python* +private-tmp + +dbus-user none +dbus-system none + +memory-deny-write-execute +read-only ${HOME} +restrict-namespaces diff --git a/etc/profile-m-z/steam.profile b/etc/profile-m-z/steam.profile index 63d629a32..6f71cf684 100644 --- a/etc/profile-m-z/steam.profile +++ b/etc/profile-m-z/steam.profile @@ -12,10 +12,13 @@ noblacklist ${HOME}/.config/MangoHud noblacklist ${HOME}/.config/ModTheSpire noblacklist ${HOME}/.config/RogueLegacy noblacklist ${HOME}/.config/RogueLegacyStorageContainer +noblacklist ${HOME}/.config/UNDERTALE +noblacklist ${HOME}/.factorio noblacklist ${HOME}/.killingfloor noblacklist ${HOME}/.klei noblacklist ${HOME}/.local/share/3909/PapersPlease noblacklist ${HOME}/.local/share/aspyr-media +noblacklist ${HOME}/.local/share/Baba_Is_You noblacklist ${HOME}/.local/share/bohemiainteractive noblacklist ${HOME}/.local/share/cdprojektred noblacklist ${HOME}/.local/share/Colossal Order @@ -42,6 +45,7 @@ noblacklist ${HOME}/.prey noblacklist ${HOME}/.steam noblacklist ${HOME}/.steampath noblacklist ${HOME}/.steampid +noblacklist ${HOME}/Zomboid # needed for STEAM_RUNTIME_PREFER_HOST_LIBRARIES=1 to work noblacklist /sbin noblacklist /usr/sbin @@ -63,11 +67,14 @@ mkdir ${HOME}/.config/Loop_Hero mkdir ${HOME}/.config/MangoHud mkdir ${HOME}/.config/ModTheSpire mkdir ${HOME}/.config/RogueLegacy +mkdir ${HOME}/.config/UNDERTALE mkdir ${HOME}/.config/unity3d +mkdir ${HOME}/.factorio mkdir ${HOME}/.killingfloor mkdir ${HOME}/.klei mkdir ${HOME}/.local/share/3909/PapersPlease mkdir ${HOME}/.local/share/aspyr-media +mkdir ${HOME}/.local/share/Baba_Is_You mkdir ${HOME}/.local/share/bohemiainteractive mkdir ${HOME}/.local/share/cdprojektred mkdir ${HOME}/.local/share/Colossal Order @@ -91,6 +98,7 @@ mkdir ${HOME}/.paradoxinteractive mkdir ${HOME}/.paradoxlauncher mkdir ${HOME}/.prey mkdir ${HOME}/.steam +mkdir ${HOME}/Zomboid mkfile ${HOME}/.steampath mkfile ${HOME}/.steampid whitelist ${HOME}/.config/Epic @@ -99,11 +107,14 @@ whitelist ${HOME}/.config/MangoHud whitelist ${HOME}/.config/ModTheSpire whitelist ${HOME}/.config/RogueLegacy whitelist ${HOME}/.config/RogueLegacyStorageContainer +whitelist ${HOME}/.config/UNDERTALE whitelist ${HOME}/.config/unity3d +whitelist ${HOME}/.factorio whitelist ${HOME}/.killingfloor whitelist ${HOME}/.klei whitelist ${HOME}/.local/share/3909/PapersPlease whitelist ${HOME}/.local/share/aspyr-media +whitelist ${HOME}/.local/share/Baba_Is_You whitelist ${HOME}/.local/share/bohemiainteractive whitelist ${HOME}/.local/share/cdprojektred whitelist ${HOME}/.local/share/Colossal Order @@ -130,12 +141,13 @@ whitelist ${HOME}/.prey whitelist ${HOME}/.steam whitelist ${HOME}/.steampath whitelist ${HOME}/.steampid +whitelist ${HOME}/Zomboid include whitelist-common.inc include whitelist-var-common.inc -# NOTE: The following were intentionally left out as they are alternative +# Note: The following were intentionally left out as they are alternative # (i.e.: unnecessary and/or legacy) paths whose existence may potentially -# clobber other paths (see #4225). If you use any, either add the entry to +# clobber other paths (see #4225). If you use any, either add the entry to # steam.local or move the contents to a path listed above (or open an issue if # it's missing above). #mkdir ${HOME}/.config/RogueLegacyStorageContainer @@ -149,15 +161,16 @@ nogroups nonewprivs noroot notv -nou2f -# For VR support add 'ignore novideo' to your steam.local. +#nou2f # may break gamepads in certain games (see #6523) +# To allow VR and camera-based motion tracking, add 'ignore novideo' to your +# steam.local. novideo protocol unix,inet,inet6,netlink # seccomp sometimes causes issues (see #2951, #3267). # Add 'ignore seccomp' to your steam.local if you experience this. # mount, name_to_handle_at, pivot_root and umount2 are used by Proton >= 5.13 # (see #4366). -seccomp !chroot,!mount,!name_to_handle_at,!pivot_root,!ptrace,!umount2 +seccomp !chroot,!mount,!name_to_handle_at,!pivot_root,!process_vm_readv,!ptrace,!umount2 # process_vm_readv is used by GE-Proton7-18 (see #5185). seccomp.32 !process_vm_readv # tracelog breaks integrated browser diff --git a/etc/profile-m-z/subdownloader.profile b/etc/profile-m-z/subdownloader.profile index 6de288c46..8b5d7e253 100644 --- a/etc/profile-m-z/subdownloader.profile +++ b/etc/profile-m-z/subdownloader.profile @@ -49,5 +49,5 @@ private-tmp dbus-user none dbus-system none -#memory-deny-write-execute - breaks on Arch (see issue #1803) +#memory-deny-write-execute # breaks on Arch (see issue #1803) restrict-namespaces diff --git a/etc/profile-m-z/supertux2.profile b/etc/profile-m-z/supertux2.profile index 2ad107f1a..65aea6667 100644 --- a/etc/profile-m-z/supertux2.profile +++ b/etc/profile-m-z/supertux2.profile @@ -41,7 +41,7 @@ seccomp.block-secondary tracelog disable-mnt -# private-bin supertux2 +#private-bin supertux2 private-cache private-etc private-dev diff --git a/etc/profile-m-z/supertuxkart-wrapper.profile b/etc/profile-m-z/supertuxkart-wrapper.profile index af8d73deb..20744090c 100644 --- a/etc/profile-m-z/supertuxkart-wrapper.profile +++ b/etc/profile-m-z/supertuxkart-wrapper.profile @@ -6,6 +6,7 @@ include supertuxkart-wrapper.local # added by included profile #include globals.local +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc private-bin supertuxkart-wrapper diff --git a/etc/profile-m-z/sushi.profile b/etc/profile-m-z/sushi.profile index 7b6a87b31..728db012e 100644 --- a/etc/profile-m-z/sushi.profile +++ b/etc/profile-m-z/sushi.profile @@ -13,7 +13,7 @@ include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc -# include disable-programs.inc +#include disable-programs.inc include disable-shell.inc include whitelist-runuser-common.inc diff --git a/etc/profile-m-z/sway.profile b/etc/profile-m-z/sway.profile index f71905150..b7f90f6ad 100644 --- a/etc/profile-m-z/sway.profile +++ b/etc/profile-m-z/sway.profile @@ -10,6 +10,10 @@ include globals.local noblacklist ${HOME}/.config/sway # sway uses ~/.config/i3 as fallback if there is no ~/.config/sway noblacklist ${HOME}/.config/i3 +# allow creation of IPC socket +noblacklist ${RUNUSER}/sway-ipc.* +noblacklist /tmp/sway-ipc.* + include disable-common.inc caps.drop all diff --git a/etc/profile-m-z/sylpheed.profile b/etc/profile-m-z/sylpheed.profile index 5fb35aa04..7cef394c2 100644 --- a/etc/profile-m-z/sylpheed.profile +++ b/etc/profile-m-z/sylpheed.profile @@ -13,7 +13,7 @@ whitelist ${HOME}/.sylpheed-2.0 whitelist /usr/share/sylpheed -# private-bin curl,gpg,gpg2,gpg-agent,gpgsm,pinentry,pinentry-gtk-2,sylpheed +#private-bin curl,gpg,gpg2,gpg-agent,gpgsm,pinentry,pinentry-gtk-2,sylpheed # Redirect include email-common.profile diff --git a/etc/profile-m-z/syncthing.profile b/etc/profile-m-z/syncthing.profile new file mode 100644 index 000000000..dd6b109a7 --- /dev/null +++ b/etc/profile-m-z/syncthing.profile @@ -0,0 +1,75 @@ +# Firejail profile for syncthing +# Description: File synchronization using public networks +# This file is overwritten after every install/update + +# Persistent local customizations +include syncthing.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.local/state/syncthing +# NOTE: this assumes a ~/Sync directory to be shared by default. Maybe leave a requirement to edit local file to set dirs? +noblacklist ${HOME}/Sync + +# NOTE: will cause WARNING: Failed to lower process +# priority: set I/O priority: operation not permitted +# So, we try to preemptively set it here: +nice 2 + +blacklist ${RUNUSER}/wayland-* +blacklist ${RUNUSER} +blacklist /usr/libexec + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + + +mkdir ${HOME}/.local/state/syncthing +whitelist ${HOME}/.local/state/syncthing +mkdir ${HOME}/Sync +whitelist ${HOME}/Sync + +include whitelist-common.inc + +#apparmor +caps.drop all +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +#notpm # this line causes error +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +##seccomp !chroot +##seccomp.drop SYSCALLS (see syscalls.txt) +#seccomp.block-secondary +##seccomp-error-action log (only for debugging seccomp issues) +#tracelog +#x11 none # desirable but too complex to add + +disable-mnt +private-cache +private-dev +#private-etc +# Networking: ca-certificates,crypto-policies,host.conf,hostname,hosts,nsswitch.conf,pki,protocols,resolv.conf,rpc,services,ssl +#private-tmp + +dbus-user none +dbus-system none + +restrict-namespaces + diff --git a/etc/profile-m-z/sysprof.profile b/etc/profile-m-z/sysprof.profile index 726baf336..b0a80fc27 100644 --- a/etc/profile-m-z/sysprof.profile +++ b/etc/profile-m-z/sysprof.profile @@ -59,11 +59,11 @@ seccomp tracelog disable-mnt -#private-bin sysprof - breaks help menu +#private-bin sysprof # breaks help menu private-cache private-dev private-etc @tls-ca -# private-lib - breaks help menu +#private-lib # breaks help menu #private-lib gdk-pixbuf-2.*,gio,gtk3,gvfs/libgvfscommon.so,libgconf-2.so.*,librsvg-2.so.*,libsysprof-2.so,libsysprof-ui-2.so private-tmp @@ -73,5 +73,5 @@ dbus-user.own org.gnome.Yelp dbus-user.own org.gnome.Sysprof3 dbus-user.talk ca.desrt.dconf -# memory-deny-write-execute - breaks on Arch +#memory-deny-write-execute # breaks on Arch restrict-namespaces diff --git a/etc/profile-m-z/system-log-common.profile b/etc/profile-m-z/system-log-common.profile new file mode 100644 index 000000000..dda8bdc47 --- /dev/null +++ b/etc/profile-m-z/system-log-common.profile @@ -0,0 +1,60 @@ +# Firejail profile for system-log-common +# Description: Common profile for GUI system log viewers +# This file is overwritten after every install/update +# Persistent local customizations +include system-log-common.local +# Persistent global definitions +# added by caller profile +#include globals.local + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +whitelist /run/log/journal +whitelist /var/log/journal +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +net none +no3d +nodvd +#nogroups +noinput +nonewprivs +noprinters +#noroot +nosound +notv +nou2f +novideo +protocol unix +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-cache +private-dev +private-etc machine-id +private-tmp + +dbus-user none +dbus-system none + +restrict-namespaces +# Add 'ignore read-only ${HOME}' to your system-log-common.local +# if you export logs to a file under your ${HOME}. +read-only ${HOME} +writable-var-log diff --git a/etc/profile-m-z/tar.profile b/etc/profile-m-z/tar.profile index da3b4f782..ca1234db0 100644 --- a/etc/profile-m-z/tar.profile +++ b/etc/profile-m-z/tar.profile @@ -17,7 +17,6 @@ ignore include disable-shell.inc # all capabilities this is automatically read-only. noblacklist /var/lib/pacman -private-etc #private-lib libfakeroot,liblzma.so.*,libreadline.so.* # Debian based distributions need this for 'dpkg --unpack' (incl. synaptic) writable-var diff --git a/etc/profile-m-z/teamspeak3.profile b/etc/profile-m-z/teamspeak3.profile index 41da4ee13..06b547b3d 100644 --- a/etc/profile-m-z/teamspeak3.profile +++ b/etc/profile-m-z/teamspeak3.profile @@ -39,4 +39,4 @@ disable-mnt private-dev private-tmp -# restrict-namespaces +#restrict-namespaces diff --git a/etc/profile-m-z/telegram.profile b/etc/profile-m-z/telegram.profile index ba915c2d4..7ed3d98d4 100644 --- a/etc/profile-m-z/telegram.profile +++ b/etc/profile-m-z/telegram.profile @@ -7,6 +7,7 @@ include globals.local noblacklist ${HOME}/.TelegramDesktop noblacklist ${HOME}/.local/share/TelegramDesktop +noblacklist ${HOME}/.local/share/telegram-desktop # Allow opening hyperlinks include allow-bin-sh.inc @@ -21,8 +22,10 @@ include disable-xdg.inc mkdir ${HOME}/.TelegramDesktop mkdir ${HOME}/.local/share/TelegramDesktop +mkdir ${HOME}/.local/share/telegram-desktop whitelist ${HOME}/.TelegramDesktop whitelist ${HOME}/.local/share/TelegramDesktop +whitelist ${HOME}/.local/share/telegram-desktop whitelist ${DOWNLOADS} whitelist /usr/share/TelegramDesktop include whitelist-common.inc @@ -43,7 +46,7 @@ seccomp seccomp.block-secondary disable-mnt -private-bin bash,sh,telegram,Telegram,telegram-desktop,xdg-open +private-bin Telegram,bash,sh,telegram,telegram-desktop,xdg-open private-cache private-dev private-etc @tls-ca,@x11,os-release diff --git a/etc/profile-m-z/telnet.profile b/etc/profile-m-z/telnet.profile index 13a47c958..ec27b89a8 100644 --- a/etc/profile-m-z/telnet.profile +++ b/etc/profile-m-z/telnet.profile @@ -17,7 +17,7 @@ include disable-proc.inc include disable-programs.inc #include disable-shell.inc include disable-write-mnt.inc -include disable-X11.inc +include disable-x11.inc include disable-xdg.inc apparmor diff --git a/etc/profile-m-z/termshark.profile b/etc/profile-m-z/termshark.profile new file mode 100644 index 000000000..64f52cf6d --- /dev/null +++ b/etc/profile-m-z/termshark.profile @@ -0,0 +1,16 @@ +# Firejail profile for termshark +# Description: Terminal UI for tshark, inspired by Wireshark +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include termshark.local +# Persistent global definitions +# added by included profile +#include globals.local + +blacklist ${RUNUSER} + +include disable-x11.inc + +# Redirect +include wireshark.profile diff --git a/etc/profile-m-z/tesseract.profile b/etc/profile-m-z/tesseract.profile index 5babfb8d2..2a7c2e902 100644 --- a/etc/profile-m-z/tesseract.profile +++ b/etc/profile-m-z/tesseract.profile @@ -1,6 +1,7 @@ # Firejail profile for tesseract # Description: An OCR program # This file is overwritten after every install/update +quiet # Persistent local customizations include tesseract.local # Persistent global definitions @@ -26,6 +27,7 @@ include whitelist-common.inc include whitelist-run-common.inc include whitelist-runuser-common.inc whitelist /usr/share/tessdata +whitelist /usr/share/tesseract-ocr include whitelist-usr-share-common.inc include whitelist-var-common.inc @@ -55,7 +57,7 @@ private-cache private-dev private-etc #private-lib libtesseract.so.* -private-tmp +#private-tmp # breaks ocrmypdf (see #6550) dbus-user none dbus-system none diff --git a/etc/profile-m-z/textroom.profile b/etc/profile-m-z/textroom.profile new file mode 100644 index 000000000..912fce6c1 --- /dev/null +++ b/etc/profile-m-z/textroom.profile @@ -0,0 +1,64 @@ +# Firejail profile for textroom +# Description: Full Screen text editor heavily inspired by Q10 and JDarkRoom +# This file is overwritten after every install/update +# Persistent local customizations +include textroom.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER}/wayland-* +blacklist /usr/libexec + +noblacklist ${HOME}/.config/textroom + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-proc.inc +include disable-programs.inc +include disable-shell.inc +#include disable-xdg.inc + +#mkdir ${HOME}/.config/textroom +#whitelist ${HOME}/.config/textroom +#whitelist ${DOCUMENTS} +#whitelist ${DOWNLOADS} +#whitelist /usr/share/textroom +#include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +notv +nou2f +novideo +protocol unix,inet +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-bin textroom +private-cache +private-dev +private-etc +private-tmp + +dbus-user filter +dbus-user.talk ca.desrt.dconf +dbus-system none + +restrict-namespaces diff --git a/etc/profile-m-z/thunderbird-beta.profile b/etc/profile-m-z/thunderbird-beta.profile index 46a1e57c8..e01a9d2d8 100644 --- a/etc/profile-m-z/thunderbird-beta.profile +++ b/etc/profile-m-z/thunderbird-beta.profile @@ -6,7 +6,7 @@ include thunderbird-beta.local # added by included profile #include globals.local -private-opt thunderbird-beta +whitelist /opt/thunderbird-beta # Redirect include thunderbird.profile diff --git a/etc/profile-m-z/thunderbird.profile b/etc/profile-m-z/thunderbird.profile index 5df207e25..50c724d73 100644 --- a/etc/profile-m-z/thunderbird.profile +++ b/etc/profile-m-z/thunderbird.profile @@ -8,9 +8,17 @@ include globals.local ignore include whitelist-runuser-common.inc -# writable-run-user and dbus are needed by enigmail +# TB stopped supporting enigmail in 2020 (v78) - let's harden D-Bus +# https://support.mozilla.org/en-US/kb/openpgp-thunderbird-howto-and-faq ignore dbus-user none -ignore dbus-system none +dbus-user filter +dbus-user.own org.mozilla.thunderbird.* +dbus-user.talk ca.desrt.dconf +dbus-user.talk org.freedesktop.Notifications +# Allow D-Bus communication with Firefox for opening links +dbus-user.talk org.mozilla.* +# e2ee email needs writable-run-user +# https://support.mozilla.org/en-US/kb/introduction-to-e2e-encryption writable-run-user # If you want to read local mail stored in /var/mail edit /etc/apparmor.d/firejail-default accordingly @@ -27,7 +35,7 @@ whitelist ${HOME}/.mozilla/firefox/profiles.ini noblacklist ${HOME}/.cache/thunderbird noblacklist ${HOME}/.gnupg -# noblacklist ${HOME}/.icedove +#noblacklist ${HOME}/.icedove noblacklist ${HOME}/.thunderbird include disable-xdg.inc @@ -38,24 +46,23 @@ include disable-xdg.inc # See https://github.com/netblue30/firejail/issues/2357 mkdir ${HOME}/.cache/thunderbird mkdir ${HOME}/.gnupg -# mkdir ${HOME}/.icedove +#mkdir ${HOME}/.icedove mkdir ${HOME}/.thunderbird whitelist ${HOME}/.cache/thunderbird whitelist ${HOME}/.gnupg -# whitelist ${HOME}/.icedove +#whitelist ${HOME}/.icedove whitelist ${HOME}/.thunderbird whitelist /usr/share/gnupg whitelist /usr/share/gnupg2 -whitelist /usr/share/mozilla whitelist /usr/share/thunderbird -whitelist /usr/share/webext -include whitelist-usr-share-common.inc # machine-id breaks audio in browsers; enable or put it in your thunderbird.local when sound is not required #machine-id novideo +private-etc thunderbird + # We need the real /tmp for data exchange when xdg-open handles email attachments on KDE ignore private-tmp diff --git a/etc/profile-m-z/tidal-hifi.profile b/etc/profile-m-z/tidal-hifi.profile new file mode 100644 index 000000000..d2e23239e --- /dev/null +++ b/etc/profile-m-z/tidal-hifi.profile @@ -0,0 +1,39 @@ +# Firejail profile for tidal-hifi +# Description: The web version of Tidal running in electron with hifi support thanks to widevine. +# This file is overwritten after every install/update +# Persistent local customizations +include tidal-hifi.local +# Persistent global definitions +include globals.local + +ignore noexec ${HOME} + +noblacklist ${HOME}/.config/tidal-hifi + +include disable-proc.inc +include disable-shell.inc + +whitelist ${HOME}/.config/tidal-hifi + +caps.drop all +no3d +nonewprivs +noprinters +noroot +protocol unix,inet,inet6 +seccomp !chroot +seccomp.block-secondary +tracelog + +private-bin chrome-sandbox,tidal-hifi +private-etc @network,@sound,@tls-ca,@xdg +private-opt tidal-hifi + +ignore dbus-user none +dbus-user filter +dbus-user.own org.mpris.MediaPlayer2.tidal-hifi +dbus-user.talk org.freedesktop.Notifications + +join-or-start tidal-hifi + +include electron-common.profile diff --git a/etc/profile-m-z/tin.profile b/etc/profile-m-z/tin.profile index a03a6caa0..865735a79 100644 --- a/etc/profile-m-z/tin.profile +++ b/etc/profile-m-z/tin.profile @@ -9,7 +9,6 @@ include globals.local noblacklist ${HOME}/.newsrc noblacklist ${HOME}/.tin -blacklist /tmp/.X11-unix blacklist ${RUNUSER} blacklist /usr/libexec @@ -19,13 +18,14 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include disable-xdg.inc mkdir ${HOME}/.tin mkfile ${HOME}/.newsrc # Note: files/directories directly in ${HOME} can't be whitelisted, as -# tin saves .newsrc by renaming a temporary file, which is not possible for -# bind-mounted files. +# tin saves .newsrc by renaming a temporary file, which is not possible for +# bind-mounted files. #whitelist ${HOME}/.newsrc #whitelist ${HOME}/.tin #include whitelist-common.inc diff --git a/etc/profile-m-z/tiny-rdm.profile b/etc/profile-m-z/tiny-rdm.profile new file mode 100644 index 000000000..4134d666c --- /dev/null +++ b/etc/profile-m-z/tiny-rdm.profile @@ -0,0 +1,61 @@ +# Firejail profile for tiny-rdm +# Description: A Modern Redis GUI Client +# This file is overwritten after every install/update +# Persistent local customizations +include tiny-rdm.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.cache/tiny-rdm +noblacklist ${HOME}/.config/TinyRDM + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-proc.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.cache/tiny-rdm +mkdir ${HOME}/.config/TinyRDM +whitelist ${HOME}/.cache/tiny-rdm +whitelist ${HOME}/.config/TinyRDM +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +notv +nou2f +novideo +nosound +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog + +disable-mnt +private-bin tiny-rdm +private-cache +private-dev +private-etc @network,@tls-ca,@x11 +private-tmp + +dbus-user none +dbus-system none + +restrict-namespaces diff --git a/etc/profile-m-z/tmux.profile b/etc/profile-m-z/tmux.profile index a855ff839..a846b7f02 100644 --- a/etc/profile-m-z/tmux.profile +++ b/etc/profile-m-z/tmux.profile @@ -7,15 +7,15 @@ include tmux.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER} noblacklist /tmp/tmux-* -# include disable-common.inc -# include disable-devel.inc -# include disable-exec.inc -# include disable-programs.inc +#include disable-common.inc +#include disable-devel.inc +#include disable-exec.inc +#include disable-programs.inc +include disable-x11.inc caps.drop all ipc-namespace @@ -36,9 +36,9 @@ seccomp seccomp.block-secondary tracelog -# private-cache +#private-cache private-dev -# private-tmp +#private-tmp dbus-user none dbus-system none diff --git a/etc/profile-m-z/torbrowser-launcher.profile b/etc/profile-m-z/torbrowser-launcher.profile index 41ac6f7a7..ca13d3623 100644 --- a/etc/profile-m-z/torbrowser-launcher.profile +++ b/etc/profile-m-z/torbrowser-launcher.profile @@ -22,6 +22,7 @@ include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc +include disable-proc.inc include disable-programs.inc include disable-xdg.inc @@ -33,9 +34,10 @@ whitelist ${HOME}/.local/share/torbrowser whitelist /opt/tor-browser whitelist /usr/share/torbrowser-launcher include whitelist-common.inc -include whitelist-var-common.inc +include whitelist-run-common.inc include whitelist-runuser-common.inc include whitelist-usr-share-common.inc +include whitelist-var-common.inc # Add 'apparmor' to your torbrowser-launcher.local to enable AppArmor support. # IMPORTANT: the relevant rule in /etc/apparmor.d/local/firejail-default will need @@ -53,10 +55,11 @@ nou2f novideo protocol unix,inet,inet6 seccomp !chroot -#tracelog - may cause issues, see #1930 +seccomp.block-secondary +#tracelog # may cause issues, see #1930 disable-mnt -private-bin bash,cat,cp,cut,dirname,env,expr,file,gpg,grep,gxmessage,id,kdialog,ln,mkdir,mv,python*,rm,sed,sh,tail,tar,tclsh,test,tor-browser,tor-browser-en,torbrowser-launcher,update-desktop-database,xmessage,xz,zenity +private-bin bash,cat,cp,cut,dirname,env,execdesktop,expr,file,gpg,grep,gxmessage,id,kdialog,ln,mkdir,mv,python*,rm,sed,sh,tail,tar,tclsh,test,tor-browser,tor-browser-en,torbrowser-launcher,update-desktop-database,xmessage,xz,zenity private-dev private-etc @tls-ca private-tmp diff --git a/etc/profile-m-z/torbrowser.profile b/etc/profile-m-z/torbrowser.profile index 15ca5b550..669394aaf 100644 --- a/etc/profile-m-z/torbrowser.profile +++ b/etc/profile-m-z/torbrowser.profile @@ -12,8 +12,8 @@ ignore dbus-user none noblacklist ${HOME}/.cache/mozilla noblacklist ${HOME}/.mozilla -blacklist /usr/libexec blacklist /sys/class/net +blacklist /usr/libexec mkdir ${HOME}/.cache/mozilla/torbrowser mkdir ${HOME}/.mozilla diff --git a/etc/profile-m-z/totem.profile b/etc/profile-m-z/totem.profile index a4cb49171..4d5f4a1f0 100644 --- a/etc/profile-m-z/totem.profile +++ b/etc/profile-m-z/totem.profile @@ -14,6 +14,7 @@ include allow-lua.inc include allow-python3.inc noblacklist ${HOME}/.config/totem +noblacklist ${HOME}/.dvdcss noblacklist ${HOME}/.local/share/totem include disable-common.inc @@ -27,6 +28,7 @@ read-only ${DESKTOP} mkdir ${HOME}/.config/totem mkdir ${HOME}/.local/share/totem whitelist ${HOME}/.config/totem +whitelist ${HOME}/.dvdcss whitelist ${HOME}/.local/share/totem whitelist /usr/share/totem include whitelist-common.inc @@ -35,7 +37,7 @@ include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc -# apparmor - makes settings immutable +#apparmor # makes settings immutable caps.drop all netfilter nogroups @@ -55,7 +57,7 @@ private-etc @tls-ca,@x11,python* private-tmp # makes settings immutable -# dbus-user none +#dbus-user none dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/tqemu.profile b/etc/profile-m-z/tqemu.profile new file mode 100644 index 000000000..d46cf15d9 --- /dev/null +++ b/etc/profile-m-z/tqemu.profile @@ -0,0 +1,19 @@ +# Firejail profile for tqemu +# Description: QEMU frontend without libvirt +# This file is overwritten after every install/update +# Persistent local customizations +include tqemu.local +# Persistent global definitions +include globals.local + +# breaks app +ignore restrict-namespaces + +# For host-only network sys_admin is needed. +# See https://github.com/netblue30/firejail/issues/2868#issuecomment-518647630 +ignore caps.drop all +caps.keep net_raw,sys_nice +#caps.keep net_raw,sys_admin + +# Redirect +include qemu-common.profile diff --git a/etc/profile-m-z/tracker.profile b/etc/profile-m-z/tracker.profile index f30b0aef6..d7de4310f 100644 --- a/etc/profile-m-z/tracker.profile +++ b/etc/profile-m-z/tracker.profile @@ -8,7 +8,6 @@ include globals.local # Tracker is started by systemd on most systems. Therefore it is not firejailed by default -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* include disable-common.inc @@ -16,6 +15,7 @@ include disable-devel.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include whitelist-runuser-common.inc @@ -33,8 +33,8 @@ protocol unix seccomp tracelog -# private-bin tracker -# private-dev -# private-tmp +#private-bin tracker +#private-dev +#private-tmp restrict-namespaces diff --git a/etc/profile-m-z/transgui.profile b/etc/profile-m-z/transgui.profile index 645c55c3b..bac48805c 100644 --- a/etc/profile-m-z/transgui.profile +++ b/etc/profile-m-z/transgui.profile @@ -12,6 +12,7 @@ include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc +include disable-proc.inc include disable-programs.inc include disable-shell.inc include disable-xdg.inc @@ -19,7 +20,10 @@ include disable-xdg.inc mkdir ${HOME}/.config/transgui whitelist ${HOME}/.config/transgui whitelist ${DOWNLOADS} +whitelist /usr/share/transgui include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc @@ -44,8 +48,8 @@ tracelog private-bin geoiplookup,geoiplookup6,transgui private-cache private-dev -private-etc -private-lib libgdk_pixbuf-2.0.so.*,libGeoIP.so*,libgthread-2.0.so.*,libgtk-x11-2.0.so.*,libX11.so.* +private-etc @network,@tls-ca,@x11 +private-lib libGeoIP.so*,libX11.so.*,libgdk_pixbuf-2.0.so.*,libgthread-2.0.so.*,libgtk-x11-2.0.so.* private-tmp dbus-user none diff --git a/etc/profile-m-z/trojita.profile b/etc/profile-m-z/trojita.profile index ba68ccb53..dc0f5b906 100644 --- a/etc/profile-m-z/trojita.profile +++ b/etc/profile-m-z/trojita.profile @@ -7,10 +7,12 @@ include trojita.local include globals.local noblacklist ${HOME}/.abook -noblacklist ${HOME}/.mozilla noblacklist ${HOME}/.cache/flaska.net/trojita noblacklist ${HOME}/.config/flaska.net +# sh is needed to allow Firefox to open links +include allow-bin-sh.inc + include disable-common.inc include disable-devel.inc include disable-exec.inc @@ -19,11 +21,16 @@ include disable-programs.inc include disable-shell.inc include disable-xdg.inc +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) +noblacklist ${HOME}/.mozilla +whitelist ${HOME}/.mozilla/firefox/profiles.ini + mkdir ${HOME}/.abook mkdir ${HOME}/.cache/flaska.net/trojita mkdir ${HOME}/.config/flaska.net whitelist ${HOME}/.abook -whitelist ${HOME}/.mozilla/firefox/profiles.ini whitelist ${HOME}/.cache/flaska.net/trojita whitelist ${HOME}/.config/flaska.net include whitelist-common.inc @@ -48,8 +55,7 @@ protocol unix,inet,inet6,netlink seccomp tracelog -# disable-mnt -# Add "ignore private-bin" for hyperlinks or have a look at the private-bins in firefox.profile and firefox-common.profile. +#disable-mnt private-bin trojita private-cache private-dev @@ -58,6 +64,8 @@ private-tmp dbus-user filter dbus-user.talk org.freedesktop.secrets +# Allow D-Bus communication with Firefox for opening links +dbus-user.talk org.mozilla.* dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/tshark.profile b/etc/profile-m-z/tshark.profile index 3f5a9647e..8e57de6cb 100644 --- a/etc/profile-m-z/tshark.profile +++ b/etc/profile-m-z/tshark.profile @@ -7,5 +7,9 @@ include tshark.local # added by included profile #include globals.local +blacklist ${RUNUSER} + +include disable-x11.inc + # Redirect include wireshark.profile diff --git a/etc/profile-m-z/tutanota-desktop.profile b/etc/profile-m-z/tutanota-desktop.profile index 55e4a4392..6c6de108b 100644 --- a/etc/profile-m-z/tutanota-desktop.profile +++ b/etc/profile-m-z/tutanota-desktop.profile @@ -22,6 +22,7 @@ mkdir ${HOME}/.config/tuta_integration mkdir ${HOME}/.config/tutanota-desktop whitelist ${HOME}/.config/tuta_integration whitelist ${HOME}/.config/tutanota-desktop +whitelist /opt/tutanota-desktop # The lines below are needed to find the default Firefox profile name, to allow # opening links in an existing instance of Firefox (note that it still fails if @@ -34,13 +35,12 @@ nosound ?HAS_APPIMAGE: ignore private-dev private-etc @tls-ca -private-opt tutanota-desktop dbus-user filter dbus-user.talk org.freedesktop.Notifications dbus-user.talk org.freedesktop.secrets dbus-user.talk org.gnome.keyring.SystemPrompter -# allow D-Bus communication with firefox for opening links +# Allow D-Bus communication with Firefox for opening links dbus-user.talk org.mozilla.* # Redirect diff --git a/etc/profile-m-z/tuxtype.profile b/etc/profile-m-z/tuxtype.profile new file mode 100644 index 000000000..12b58850a --- /dev/null +++ b/etc/profile-m-z/tuxtype.profile @@ -0,0 +1,54 @@ +# Firejail profile for tuxtype +# Persistent local customizations +include tuxtype.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.tuxtype + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.tuxtype +whitelist ${HOME}/.tuxtype +whitelist ${RUNUSER}/pulse +whitelist /usr/share/tuxtype +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +net none +netfilter +nodvd +noinput +nonewprivs +noroot +notv +nou2f +novideo +protocol unix +seccomp +tracelog + +disable-mnt +private-bin tuxtype +private-dev +private-etc @games,@sound,@x11,tuxtype +private-tmp +writable-var # game scores are stored under /var/games + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-m-z/tvbrowser.profile b/etc/profile-m-z/tvbrowser.profile index 518dc95c7..16162f989 100644 --- a/etc/profile-m-z/tvbrowser.profile +++ b/etc/profile-m-z/tvbrowser.profile @@ -1,5 +1,5 @@ # Firejail profile for tvbrowser -# Description: java tv programm form tvbrowser.org +# Description: java tv program form tvbrowser.org # This file is overwritten after every install/update # Persistent local customizations include tvbrowser.local diff --git a/etc/profile-m-z/tvnamer.profile b/etc/profile-m-z/tvnamer.profile new file mode 100644 index 000000000..c71434f2a --- /dev/null +++ b/etc/profile-m-z/tvnamer.profile @@ -0,0 +1,74 @@ +# Firejail profile for tvnamer +# Description: Automatic TV episode file renamer +quiet +# Persistent local customizations +include tvnamer.local +# Persistent global definitions +include globals.local + +blacklist ${RUNUSER} +blacklist /usr/libexec + +noblacklist ${HOME}/.config/tvnamer +noblacklist ${VIDEOS} + +# Allow python (blacklisted by disable-interpreters.inc) +include allow-python2.inc +include allow-python3.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-proc.inc +include disable-shell.inc +include disable-x11.inc +include disable-xdg.inc + +mkdir ${HOME}/.config/tvnamer +whitelist ${HOME}/.config/tvnamer +whitelist ${DOWNLOADS} +whitelist ${VIDEOS} +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +machine-id +netfilter +no3d +nodvd +nogroups +noinput +nonewprivs +noprinters +noroot +nosound +notv +nou2f +novideo +protocol unix,inet,inet6 +seccomp +seccomp.block-secondary +tracelog +x11 none + +#disable-mnt +private-bin python*,tvnamer +private-cache +private-dev +private-etc @network,@tls-ca +private-tmp + +dbus-user none +dbus-system none + +read-only ${HOME} +read-write ${HOME}/.config/tvnamer +read-write ${DOWNLOADS} +read-write ${VIDEOS} +restrict-namespaces diff --git a/etc/profile-m-z/twitch.profile b/etc/profile-m-z/twitch.profile index d53acdaf7..55106d622 100644 --- a/etc/profile-m-z/twitch.profile +++ b/etc/profile-m-z/twitch.profile @@ -1,5 +1,5 @@ # Firejail profile for twitch -# Description: Unofficial electron based desktop warpper for Twitch +# Description: Unofficial electron based desktop wrapper for Twitch # This file is overwritten after every install/update # Persistent local customizations include twitch.local @@ -16,10 +16,10 @@ include disable-shell.inc mkdir ${HOME}/.config/Twitch whitelist ${HOME}/.config/Twitch +whitelist /opt/Twitch private-bin electron,electron[0-9],electron[0-9][0-9],twitch private-etc @tls-ca,@x11,bumblebee,host.conf,mime.types -private-opt Twitch # Redirect include electron-common.profile diff --git a/etc/profile-m-z/typespeed.profile b/etc/profile-m-z/typespeed.profile new file mode 100644 index 000000000..b98777665 --- /dev/null +++ b/etc/profile-m-z/typespeed.profile @@ -0,0 +1,49 @@ +# Firejail profile for typespeed +# Persistent local customizations +include typespeed.local +# Persistent global definitions +include globals.local + +# Note: This profile requires the current user to be a member of the games +# group. + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-xdg.inc + +whitelist /usr/share/typespeed +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +ipc-namespace +netfilter +nodvd +noinput +nonewprivs +noroot +notv +nou2f +novideo +protocol unix,inet,inet6,netlink +seccomp +tracelog + +disable-mnt +private +private-dev +private-etc @games,@sound,@x11 +private-tmp +writable-var # game scores are stored under /var/games + +dbus-user none +dbus-system none + +memory-deny-write-execute +restrict-namespaces diff --git a/etc/profile-m-z/udiskie.profile b/etc/profile-m-z/udiskie.profile index c182326bb..175ae4591 100644 --- a/etc/profile-m-z/udiskie.profile +++ b/etc/profile-m-z/udiskie.profile @@ -36,8 +36,8 @@ tracelog private-bin awk,cut,dbus-send,egrep,file,grep,head,python*,readlink,sed,sh,udiskie,uname,which,xdg-mime,xdg-open,xprop # add your configured file browser in udiskie.local, e. g. -# private-bin nautilus -# private-bin thunar +#private-bin nautilus +#private-bin thunar private-cache private-dev private-etc @x11,mime.types diff --git a/etc/profile-m-z/unbound.profile b/etc/profile-m-z/unbound.profile index 63d84688c..c12054d47 100644 --- a/etc/profile-m-z/unbound.profile +++ b/etc/profile-m-z/unbound.profile @@ -9,7 +9,6 @@ include globals.local noblacklist /sbin noblacklist /usr/sbin -blacklist /tmp/.X11-unix blacklist ${RUNUSER} include disable-common.inc @@ -17,6 +16,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc whitelist /usr/share/dns diff --git a/etc/profile-m-z/unknown-horizons.profile b/etc/profile-m-z/unknown-horizons.profile index 3e2b28dec..4e7dc3705 100644 --- a/etc/profile-m-z/unknown-horizons.profile +++ b/etc/profile-m-z/unknown-horizons.profile @@ -34,11 +34,11 @@ protocol unix,inet,inet6,netlink seccomp disable-mnt -# private-bin unknown-horizons +#private-bin unknown-horizons private-dev -# private-etc alternatives,ca-certificates,crypto-policies,pki,ssl +#private-etc alternatives,ca-certificates,crypto-policies,pki,ssl private-tmp # doesn't work - maybe all Tcl/Tk programs have this problem -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-m-z/unlz4.profile b/etc/profile-m-z/unlz4.profile new file mode 100644 index 000000000..00e7496e4 --- /dev/null +++ b/etc/profile-m-z/unlz4.profile @@ -0,0 +1,11 @@ +# Firejail profile for unlz4 +# This file is overwritten after every install/update +quiet +# Persistent local customizations +include unlz4.local +# Persistent global definitions +# added by included profile +#include globals.local + +# Redirect +include lz4.profile diff --git a/etc/profile-m-z/unrar.profile b/etc/profile-m-z/unrar.profile index 43d5dae5e..ed2acb12d 100644 --- a/etc/profile-m-z/unrar.profile +++ b/etc/profile-m-z/unrar.profile @@ -8,7 +8,6 @@ include unrar.local include globals.local private-bin unrar -private-etc private-tmp # Redirect diff --git a/etc/profile-m-z/unzip.profile b/etc/profile-m-z/unzip.profile index 9fefe6ad3..88341a3ad 100644 --- a/etc/profile-m-z/unzip.profile +++ b/etc/profile-m-z/unzip.profile @@ -10,7 +10,5 @@ include globals.local # GNOME Shell integration (chrome-gnome-shell) noblacklist ${HOME}/.local/share/gnome-shell -private-etc - # Redirect include archiver-common.profile diff --git a/etc/profile-m-z/viewnior.profile b/etc/profile-m-z/viewnior.profile index aa8199442..8c6efaa1c 100644 --- a/etc/profile-m-z/viewnior.profile +++ b/etc/profile-m-z/viewnior.profile @@ -49,5 +49,5 @@ private-tmp dbus-user none dbus-system none -#memory-deny-write-execute - breaks on Arch (see issues #1803 and #1808) +#memory-deny-write-execute # breaks on Arch (see issues #1803 and #1808) restrict-namespaces diff --git a/etc/profile-m-z/virt-manager.profile b/etc/profile-m-z/virt-manager.profile new file mode 100644 index 000000000..a93d873a8 --- /dev/null +++ b/etc/profile-m-z/virt-manager.profile @@ -0,0 +1,74 @@ +# Firejail profile for virt-manager +# Description: Manage virtual machines +# This file is overwritten after every install/update +# Persistent local customizations +include virt-manager.local +# Persistent global definitions +include globals.local + +blacklist /usr/libexec + +noblacklist ${HOME}/.cache/virt-manager +noblacklist ${RUNUSER}/libvirt + +noblacklist /sbin +noblacklist /usr/sbin + +# Allow python 3 (blacklisted by disable-interpreters.inc) +include allow-python3.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +# breaks app +#include disable-proc.inc +include disable-programs.inc +include disable-xdg.inc + +mkdir ${HOME}/.cache/virt-manager +whitelist ${DOWNLOADS} +whitelist ${HOME}/.cache/virt-manager +whitelist ${RUNUSER}/libvirt +whitelist /run/libvirt + +whitelist /usr/share/libvirt +whitelist /usr/share/osinfo +whitelist /usr/share/qemu +whitelist /usr/share/seabios +whitelist /usr/share/virt-manager +# /usr/share/misc/usb.ids is a symlink to /var/lib/usbutils/usb.ids on Ubuntu 22.04 +whitelist /var/lib/usbutils/usb.ids +include whitelist-common.inc +include whitelist-run-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +# breaks app +#apparmor +# For host-only network sys_admin is needed. +# See https://github.com/netblue30/firejail/issues/2868#issuecomment-518647630 +caps.keep net_raw,sys_nice +#caps.keep net_raw,sys_admin +netfilter +nodvd +notv +tracelog + +private-cache +private-etc @network,@sound,@tls-ca,@x11 +private-tmp +writable-var + +dbus-user filter +dbus-user.own org.virt-manager.virt-manager +dbus-user.talk ca.desrt.dconf +dbus-user.talk org.freedesktop.Notifications +?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher +dbus-system none + +# breaks app +#deterministic-shutdown +# breaks app +#restrict-namespaces diff --git a/etc/profile-m-z/virtualbox.profile b/etc/profile-m-z/virtualbox.profile index ae8afbbf1..b768a635a 100644 --- a/etc/profile-m-z/virtualbox.profile +++ b/etc/profile-m-z/virtualbox.profile @@ -9,7 +9,7 @@ include globals.local noblacklist ${HOME}/.VirtualBox noblacklist ${HOME}/.config/VirtualBox noblacklist ${HOME}/VirtualBox VMs -# noblacklist /usr/bin/virtualbox +#noblacklist /usr/bin/virtualbox noblacklist /usr/lib/virtualbox noblacklist /usr/lib64/virtualbox diff --git a/etc/profile-m-z/vlc.profile b/etc/profile-m-z/vlc.profile index 34e580085..3fc36a625 100644 --- a/etc/profile-m-z/vlc.profile +++ b/etc/profile-m-z/vlc.profile @@ -9,6 +9,7 @@ include globals.local noblacklist ${HOME}/.cache/vlc noblacklist ${HOME}/.config/vlc noblacklist ${HOME}/.config/aacs +noblacklist ${HOME}/.dvdcss noblacklist ${HOME}/.local/share/vlc include disable-common.inc @@ -24,6 +25,7 @@ mkdir ${HOME}/.local/share/vlc whitelist ${HOME}/.cache/vlc whitelist ${HOME}/.config/vlc whitelist ${HOME}/.config/aacs +whitelist ${HOME}/.dvdcss whitelist ${HOME}/.local/share/vlc include whitelist-common.inc include whitelist-player-common.inc diff --git a/etc/profile-m-z/w3m.profile b/etc/profile-m-z/w3m.profile index edc08ca44..6c8d84ea4 100644 --- a/etc/profile-m-z/w3m.profile +++ b/etc/profile-m-z/w3m.profile @@ -14,7 +14,6 @@ include globals.local noblacklist ${HOME}/.w3m -blacklist /tmp/.X11-unix blacklist ${RUNUSER}/wayland-* # Allow /bin/sh (blacklisted by disable-shell.inc) @@ -29,6 +28,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include disable-xdg.inc mkdir ${HOME}/.w3m diff --git a/etc/profile-m-z/warzone2100.profile b/etc/profile-m-z/warzone2100.profile index 79ba41d44..a7b0f5f1d 100644 --- a/etc/profile-m-z/warzone2100.profile +++ b/etc/profile-m-z/warzone2100.profile @@ -15,7 +15,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc -#include disable-shell.inc - problems on Debian 11 +#include disable-shell.inc # problems on Debian 11 mkdir ${HOME}/.local/share/warzone2100 mkdir ${HOME}/.local/share/warzone2100-3.3.0 diff --git a/etc/profile-m-z/waterfox.profile b/etc/profile-m-z/waterfox.profile index 18f1ca79a..cf2fced64 100644 --- a/etc/profile-m-z/waterfox.profile +++ b/etc/profile-m-z/waterfox.profile @@ -12,6 +12,7 @@ mkdir ${HOME}/.cache/waterfox mkdir ${HOME}/.waterfox whitelist ${HOME}/.cache/waterfox whitelist ${HOME}/.waterfox +whitelist /usr/share/waterfox # Add the next lines to your watefox.local if you want to use the migration wizard. #noblacklist ${HOME}/.mozilla @@ -20,9 +21,7 @@ whitelist ${HOME}/.waterfox # waterfox requires a shell to launch on Arch. We can possibly remove sh though. # Add the next line to your waterfox.local to enable private-bin. #private-bin bash,dbus-launch,dbus-send,env,sh,waterfox,waterfox-classic,waterfox-current,which -# Add the next line to your waterfox.local to enable private-etc. Note that private-etc must first be -# enabled in your firefox-common.local. -#private-etc waterfox +private-etc waterfox # Redirect include firefox-common.profile diff --git a/etc/profile-m-z/wesnoth.profile b/etc/profile-m-z/wesnoth.profile index b6f29cfbf..90de16bdb 100644 --- a/etc/profile-m-z/wesnoth.profile +++ b/etc/profile-m-z/wesnoth.profile @@ -10,6 +10,9 @@ noblacklist ${HOME}/.cache/wesnoth noblacklist ${HOME}/.config/wesnoth noblacklist ${HOME}/.local/share/wesnoth +# Allow lua (blacklisted by disable-interpreters.inc) +include allow-lua.inc + include disable-common.inc include disable-devel.inc include disable-interpreters.inc diff --git a/etc/profile-m-z/wget.profile b/etc/profile-m-z/wget.profile index 5e1823593..2810bdf31 100644 --- a/etc/profile-m-z/wget.profile +++ b/etc/profile-m-z/wget.profile @@ -7,6 +7,8 @@ include wget.local # Persistent global definitions include globals.local +noblacklist ${HOME}/.config/wget +noblacklist ${HOME}/.local/share/wget noblacklist ${HOME}/.netrc noblacklist ${HOME}/.wget-hsts noblacklist ${HOME}/.wgetrc @@ -15,7 +17,6 @@ noblacklist ${HOME}/.wgetrc #ignore read-only ${HOME}/.nvm #noblacklist ${HOME}/.nvm -blacklist /tmp/.X11-unix blacklist ${RUNUSER} include disable-common.inc @@ -24,6 +25,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc # Depending on workflow you can add the next line to your wget.local. #include disable-xdg.inc @@ -54,7 +56,7 @@ private-bin wget private-cache private-dev # Depending on workflow you can add the next line to your wget.local. -#private-etc alternatives,ca-certificates,crypto-policies,pki,resolv.conf,ssl,wgetrc +#private-etc alternatives,ca-certificates,crypto-policies,pki,resolv.conf,ssl,wget2rc,wgetrc #private-tmp dbus-user none diff --git a/etc/profile-m-z/wget2.profile b/etc/profile-m-z/wget2.profile index ac58f3468..3d0c3ae82 100644 --- a/etc/profile-m-z/wget2.profile +++ b/etc/profile-m-z/wget2.profile @@ -8,13 +8,7 @@ include wget2.local # added by included profile #include globals.local -noblacklist ${HOME}/.config/wget -noblacklist ${HOME}/.local/share/wget -ignore noblacklist ${HOME}/.wgetrc - private-bin wget2 -# Depending on workflow you can add the next line to your wget2.local. -#private-etc wget2rc # Redirect include wget.profile diff --git a/etc/profile-m-z/whois.profile b/etc/profile-m-z/whois.profile index 8265e1ff8..42ce3bc5c 100644 --- a/etc/profile-m-z/whois.profile +++ b/etc/profile-m-z/whois.profile @@ -7,7 +7,6 @@ include whois.local # Persistent global definitions include globals.local -blacklist /tmp/.X11-unix blacklist ${RUNUSER} include disable-common.inc @@ -15,6 +14,7 @@ include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-programs.inc +include disable-x11.inc include disable-xdg.inc include whitelist-usr-share-common.inc diff --git a/etc/profile-m-z/wine.profile b/etc/profile-m-z/wine.profile index 1e2b164b9..33f404464 100644 --- a/etc/profile-m-z/wine.profile +++ b/etc/profile-m-z/wine.profile @@ -20,23 +20,23 @@ include disable-devel.inc include disable-interpreters.inc include disable-programs.inc -# whitelist /usr/share/wine -# include whitelist-usr-share-common.inc +#whitelist /usr/share/wine +#include whitelist-usr-share-common.inc include whitelist-var-common.inc # Some applications don't need allow-debuggers. Add 'ignore allow-debuggers' to your wine.local if you want to override this. allow-debuggers caps.drop all -# net none +#net none netfilter nodvd nogroups noinput nonewprivs noroot -# nosound +#nosound notv -# novideo +#novideo seccomp private-dev diff --git a/etc/profile-m-z/wireshark.profile b/etc/profile-m-z/wireshark.profile index d1b757a25..55c4e6ac7 100644 --- a/etc/profile-m-z/wireshark.profile +++ b/etc/profile-m-z/wireshark.profile @@ -9,6 +9,7 @@ include globals.local noblacklist ${HOME}/.config/wireshark noblacklist ${HOME}/.wireshark noblacklist ${DOCUMENTS} +noblacklist ${PATH}/dumpcap # Allow lua (blacklisted by disable-interpreters.inc) include allow-lua.inc @@ -25,29 +26,30 @@ include whitelist-usr-share-common.inc include whitelist-var-common.inc apparmor -# caps.drop all +#caps.drop all caps.keep dac_override,dac_read_search,net_admin,net_raw netfilter no3d -# nogroups - breaks network traffic capture for unprivileged users +#nogroups # breaks network traffic capture for unprivileged users noinput -# nonewprivs - breaks network traffic capture for unprivileged users -# noroot +#nonewprivs # breaks network traffic capture for unprivileged users +#noroot nodvd nosound notv nou2f novideo -# protocol unix,inet,inet6,netlink,packet,bluetooth - commented out in case they bring in new protocols +# commented out in case they bring in new protocols +#protocol unix,inet,inet6,netlink,packet,bluetooth #seccomp tracelog -# private-bin wireshark +#private-bin wireshark private-cache # private-dev prevents (some) interfaces from being shown. # Add the below line to your wirehsark.local if you only want to inspect pcap files. #private-dev -# private-etc alternatives,ca-certificates,crypto-policies,fonts,group,hosts,machine-id,passwd,pki,resolv.conf,ssl +#private-etc alternatives,ca-certificates,crypto-policies,fonts,group,hosts,machine-id,passwd,pki,resolv.conf,ssl private-tmp dbus-user none diff --git a/etc/profile-m-z/wordwarvi.profile b/etc/profile-m-z/wordwarvi.profile index 310e8b470..970063f93 100644 --- a/etc/profile-m-z/wordwarvi.profile +++ b/etc/profile-m-z/wordwarvi.profile @@ -40,7 +40,6 @@ seccomp tracelog disable-mnt -private private-bin wordwarvi private-cache private-dev diff --git a/etc/profile-m-z/xbill.profile b/etc/profile-m-z/xbill.profile index e85bb9f18..46e3e81bc 100644 --- a/etc/profile-m-z/xbill.profile +++ b/etc/profile-m-z/xbill.profile @@ -16,7 +16,7 @@ include disable-xdg.inc whitelist /usr/share/xbill whitelist /var/games/xbill/scores -include whitelist-common.inc +#include whitelist-common.inc # see #903 include whitelist-usr-share-common.inc include whitelist-var-common.inc diff --git a/etc/profile-m-z/xed.profile b/etc/profile-m-z/xed.profile index dda803bd5..b47437e2d 100644 --- a/etc/profile-m-z/xed.profile +++ b/etc/profile-m-z/xed.profile @@ -23,10 +23,10 @@ include disable-shell.inc include whitelist-var-common.inc -# apparmor - makes settings immutable +#apparmor # makes settings immutable caps.drop all machine-id -# net none - makes settings immutable +#net none # makes settings immutable no3d nodvd nogroups @@ -46,9 +46,9 @@ private-dev private-tmp # makes settings immutable -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none # xed uses python plugins, memory-deny-write-execute breaks python -# memory-deny-write-execute +#memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-m-z/xfburn.profile b/etc/profile-m-z/xfburn.profile index 141fda909..96edc15ab 100644 --- a/etc/profile-m-z/xfburn.profile +++ b/etc/profile-m-z/xfburn.profile @@ -25,8 +25,8 @@ protocol unix seccomp tracelog -# private-bin xfburn -# private-dev -# private-tmp +#private-bin xfburn +#private-dev +#private-tmp restrict-namespaces diff --git a/etc/profile-m-z/xfce4-mixer.profile b/etc/profile-m-z/xfce4-mixer.profile index 9c4fa8293..6c3a5812b 100644 --- a/etc/profile-m-z/xfce4-mixer.profile +++ b/etc/profile-m-z/xfce4-mixer.profile @@ -53,5 +53,5 @@ dbus-user.own org.xfce.xfce4-mixer dbus-user.talk org.xfce.Xfconf dbus-system none -# memory-deny-write-execute - breaks on Arch +#memory-deny-write-execute # breaks on Arch restrict-namespaces diff --git a/etc/profile-m-z/xfce4-screenshooter.profile b/etc/profile-m-z/xfce4-screenshooter.profile index 4d841b35c..9094a7872 100644 --- a/etc/profile-m-z/xfce4-screenshooter.profile +++ b/etc/profile-m-z/xfce4-screenshooter.profile @@ -47,5 +47,5 @@ private-tmp dbus-user none dbus-system none -# memory-deny-write-execute -- see #3790 +#memory-deny-write-execute # see #3790 restrict-namespaces diff --git a/etc/profile-m-z/xmr-stak.profile b/etc/profile-m-z/xmr-stak.profile index b8bf0ae96..06f0b5833 100644 --- a/etc/profile-m-z/xmr-stak.profile +++ b/etc/profile-m-z/xmr-stak.profile @@ -16,6 +16,7 @@ include disable-shell.inc include disable-xdg.inc mkdir ${HOME}/.xmr-stak +whitelist /opt/cuda include whitelist-var-common.inc caps.drop all @@ -39,7 +40,6 @@ private-bin xmr-stak private-dev private-etc @tls-ca #private-lib libxmrstak_opencl_backend,libxmrstak_cuda_backend -private-opt cuda private-tmp memory-deny-write-execute diff --git a/etc/profile-m-z/xonotic.profile b/etc/profile-m-z/xonotic.profile index 87e75986d..ad4ed4d8b 100644 --- a/etc/profile-m-z/xonotic.profile +++ b/etc/profile-m-z/xonotic.profile @@ -8,7 +8,10 @@ include globals.local noblacklist ${HOME}/.xonotic +# Allow /bin/sh (blacklisted by disable-shell.inc) include allow-bin-sh.inc + +# Allow opengl-game wrapper script (distribution-specific) include allow-opengl-game.inc include disable-common.inc diff --git a/etc/profile-m-z/xplayer.profile b/etc/profile-m-z/xplayer.profile index a673d6aa3..9741888f0 100644 --- a/etc/profile-m-z/xplayer.profile +++ b/etc/profile-m-z/xplayer.profile @@ -27,7 +27,7 @@ include whitelist-common.inc include whitelist-player-common.inc include whitelist-var-common.inc -# apparmor - makes settings immutable +#apparmor # makes settings immutable caps.drop all netfilter nogroups @@ -41,11 +41,11 @@ tracelog private-bin xplayer,xplayer-audio-preview,xplayer-video-thumbnailer private-dev -# private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,machine-id,pki,pulse,ssl +#private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,machine-id,pki,pulse,ssl private-tmp # makes settings immutable -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none restrict-namespaces diff --git a/etc/profile-m-z/xpra.profile b/etc/profile-m-z/xpra.profile index 05c12b9a2..b00307394 100644 --- a/etc/profile-m-z/xpra.profile +++ b/etc/profile-m-z/xpra.profile @@ -45,11 +45,11 @@ seccomp disable-mnt # private home directory doesn't work on some distros, so we go for a regular home -# private +#private # older Xpra versions also use Xvfb -# private-bin bash,cat,dbus-launch,ldconfig,ls,pactl,python*,sh,strace,which,xauth,xkbcomp,Xorg,xpra,Xvfb +#private-bin bash,cat,dbus-launch,ldconfig,ls,pactl,python*,sh,strace,which,xauth,xkbcomp,Xorg,xpra,Xvfb private-dev -# private-etc alternatives,gai.conf,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,machine-id,nsswitch.conf,resolv.conf,X11,xpra +#private-etc alternatives,gai.conf,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,machine-id,nsswitch.conf,resolv.conf,X11,xpra private-tmp restrict-namespaces diff --git a/etc/profile-m-z/xreader.profile b/etc/profile-m-z/xreader.profile index 6edbf9357..cad836fdc 100644 --- a/etc/profile-m-z/xreader.profile +++ b/etc/profile-m-z/xreader.profile @@ -18,9 +18,9 @@ include disable-programs.inc include disable-xdg.inc # Breaks xreader on Mint 18.3 -# include whitelist-var-common.inc +#include whitelist-var-common.inc -# apparmor +#apparmor caps.drop all no3d nodvd diff --git a/etc/profile-m-z/xviewer.profile b/etc/profile-m-z/xviewer.profile index 6c31df4a9..575c1bf68 100644 --- a/etc/profile-m-z/xviewer.profile +++ b/etc/profile-m-z/xviewer.profile @@ -19,9 +19,9 @@ include disable-shell.inc include whitelist-var-common.inc -# apparmor - makes settings immutable +#apparmor # makes settings immutable caps.drop all -# net none - makes settings immutable +#net none # makes settings immutable no3d nodvd nogroups @@ -42,8 +42,8 @@ private-lib private-tmp # makes settings immutable -# dbus-user none -# dbus-system none +#dbus-user none +#dbus-system none memory-deny-write-execute restrict-namespaces diff --git a/etc/profile-m-z/yelp.profile b/etc/profile-m-z/yelp.profile index f5dd0c309..dbde8e0be 100644 --- a/etc/profile-m-z/yelp.profile +++ b/etc/profile-m-z/yelp.profile @@ -8,6 +8,9 @@ include globals.local noblacklist ${HOME}/.config/yelp +# sh is needed to allow Firefox to open links +include allow-bin-sh.inc + include disable-common.inc include disable-devel.inc include disable-exec.inc @@ -16,6 +19,12 @@ include disable-programs.inc include disable-shell.inc include disable-xdg.inc +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) +noblacklist ${HOME}/.mozilla +whitelist ${HOME}/.mozilla/firefox/profiles.ini + mkdir ${HOME}/.config/yelp whitelist ${HOME}/.config/yelp whitelist /usr/libexec/webkit2gtk-4.0 @@ -33,16 +42,14 @@ include whitelist-var-common.inc apparmor caps.drop all -# machine-id breaks sound - add the next line to your yelp.local if you don't need sound support. -#machine-id +#machine-id # add this to your yelp.local if you don't need sound support. net none nodvd nogroups noinput nonewprivs noroot -# nosound - add the next line to your yelp.local if you don't need sound support. -#nosound +#nosound # add this to your yelp.local if you don't need sound support. notv nou2f novideo @@ -61,6 +68,8 @@ private-tmp dbus-user filter dbus-user.own org.gnome.Yelp dbus-user.talk ca.desrt.dconf +# Allow D-Bus communication with Firefox for opening links +dbus-user.talk org.mozilla.* dbus-system none # read-only ${HOME} breaks some features: diff --git a/etc/profile-m-z/youtube-viewer-gtk.profile b/etc/profile-m-z/youtube-viewer-gtk.profile new file mode 100644 index 000000000..cd5b0219a --- /dev/null +++ b/etc/profile-m-z/youtube-viewer-gtk.profile @@ -0,0 +1,14 @@ +# Firejail profile for youtube-viewer-gtk +# Description: GTK front-end to youtube-viewer +# This file is overwritten after every install/update +# Persistent local customizations +include youtube-viewer-gtk.local +# added by included profile +#include globals.local + +private-bin youtube-viewer-gtk + +include gtk-youtube-viewers-common.profile + +# Redirect +include youtube-viewer.profile diff --git a/etc/profile-m-z/youtube-viewers-common.profile b/etc/profile-m-z/youtube-viewers-common.profile index c9d2ea53b..803eb85fb 100644 --- a/etc/profile-m-z/youtube-viewers-common.profile +++ b/etc/profile-m-z/youtube-viewers-common.profile @@ -7,8 +7,10 @@ include youtube-viewers-common.local # added by caller profile #include globals.local +noblacklist ${HOME}/.cache/mpv noblacklist ${HOME}/.cache/youtube-dl noblacklist ${HOME}/.config/mpv +noblacklist ${HOME}/.local/state/mpv # Allow lua (blacklisted by disable-interpreters.inc) include allow-lua.inc @@ -30,6 +32,8 @@ include disable-xdg.inc whitelist ${DOWNLOADS} whitelist ${HOME}/.cache/youtube-dl/youtube-sigfuncs whitelist ${HOME}/.config/mpv +whitelist /usr/share/lua* +whitelist /usr/share/mpv include whitelist-common.inc include whitelist-run-common.inc include whitelist-runuser-common.inc diff --git a/etc/profile-m-z/youtube.profile b/etc/profile-m-z/youtube.profile index 4d1e9a063..0fb87f747 100644 --- a/etc/profile-m-z/youtube.profile +++ b/etc/profile-m-z/youtube.profile @@ -1,5 +1,5 @@ # Firejail profile for youtube -# Description: Unofficial electron based desktop warpper for YouTube +# Description: Unofficial electron based desktop wrapper for YouTube # This file is overwritten after every install/update # Persistent local customizations include youtube.local @@ -15,10 +15,10 @@ include disable-shell.inc mkdir ${HOME}/.config/Youtube whitelist ${HOME}/.config/Youtube +whitelist /opt/Youtube private-bin electron,electron[0-9],electron[0-9][0-9],youtube private-etc @tls-ca,@x11,bumblebee,host.conf,mime.types -private-opt Youtube # Redirect include electron-common.profile diff --git a/etc/profile-m-z/youtubemusic-nativefier.profile b/etc/profile-m-z/youtubemusic-nativefier.profile index cfee8c426..e5ece41bc 100644 --- a/etc/profile-m-z/youtubemusic-nativefier.profile +++ b/etc/profile-m-z/youtubemusic-nativefier.profile @@ -1,8 +1,8 @@ # Firejail profile for youtubemusic-nativefier -# Description: Unofficial electron based desktop warpper for YouTube Music +# Description: Unofficial electron based desktop wrapper for YouTube Music # This file is overwritten after every install/update # Persistent local customizations -include youtube.local +include youtubemusic-nativefier.local # Persistent global definitions include globals.local @@ -12,10 +12,10 @@ include disable-shell.inc mkdir ${HOME}/.config/youtubemusic-nativefier-040164 whitelist ${HOME}/.config/youtubemusic-nativefier-040164 +whitelist /opt/youtubemusic-nativefier private-bin electron,electron[0-9],electron[0-9][0-9],youtubemusic-nativefier private-etc @tls-ca,@x11,bumblebee,host.conf,mime.types -private-opt youtubemusic-nativefier # Redirect include electron-common.profile diff --git a/etc/profile-m-z/yt-dlp.profile b/etc/profile-m-z/yt-dlp.profile index 97f9e620a..41cf907bd 100644 --- a/etc/profile-m-z/yt-dlp.profile +++ b/etc/profile-m-z/yt-dlp.profile @@ -29,7 +29,6 @@ noblacklist ${VIDEOS} # Allow python (blacklisted by disable-interpreters.inc) include allow-python3.inc -blacklist /tmp/.X11-unix blacklist ${RUNUSER} include disable-common.inc @@ -38,6 +37,7 @@ include disable-exec.inc include disable-interpreters.inc include disable-programs.inc include disable-shell.inc +include disable-x11.inc include disable-xdg.inc include whitelist-usr-share-common.inc diff --git a/etc/profile-m-z/ytmdesktop.profile b/etc/profile-m-z/ytmdesktop.profile index de07e3ddf..ccf5f1e63 100644 --- a/etc/profile-m-z/ytmdesktop.profile +++ b/etc/profile-m-z/ytmdesktop.profile @@ -13,9 +13,9 @@ noblacklist ${HOME}/.config/youtube-music-desktop-app mkdir ${HOME}/.config/youtube-music-desktop-app whitelist ${HOME}/.config/youtube-music-desktop-app -# private-bin env,ytmdesktop +#private-bin env,ytmdesktop private-etc @tls-ca,@x11,bumblebee,host.conf,mime.types -# private-opt +#private-opt # Redirect include electron-common.profile diff --git a/etc/profile-m-z/zeal.profile b/etc/profile-m-z/zeal.profile index 09a1d37a3..f862bfce0 100644 --- a/etc/profile-m-z/zeal.profile +++ b/etc/profile-m-z/zeal.profile @@ -10,6 +10,9 @@ noblacklist ${HOME}/.cache/Zeal noblacklist ${HOME}/.config/Zeal noblacklist ${HOME}/.local/share/Zeal +# sh is needed to allow Firefox to open links +include allow-bin-sh.inc + include disable-common.inc include disable-devel.inc include disable-exec.inc @@ -19,8 +22,9 @@ include disable-programs.inc include disable-shell.inc include disable-xdg.inc -# Allow zeal to open links in Firefox browsers. -# This also requires dbus-user filtering (see below). +# The lines below are needed to find the default Firefox profile name, to allow +# opening links in an existing instance of Firefox (note that it still fails if +# there isn't a Firefox instance running with the default profile; see #5352) noblacklist ${HOME}/.mozilla whitelist ${HOME}/.mozilla/firefox/profiles.ini @@ -63,9 +67,10 @@ private-etc @tls-ca,@x11,host.conf,mime.types,rpc,services private-tmp dbus-user filter -dbus-user.talk org.mozilla.* ?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher +# Allow D-Bus communication with Firefox for opening links +dbus-user.talk org.mozilla.* dbus-system none -# memory-deny-write-execute - breaks on Arch +#memory-deny-write-execute # breaks on Arch restrict-namespaces diff --git a/etc/profile-m-z/zoom.profile b/etc/profile-m-z/zoom.profile index 306212f85..430934df2 100644 --- a/etc/profile-m-z/zoom.profile +++ b/etc/profile-m-z/zoom.profile @@ -19,6 +19,7 @@ ignore dbus-system none noblacklist ${HOME}/.config/zoom.conf noblacklist ${HOME}/.config/zoomus.conf noblacklist ${HOME}/.zoom +noblacklist ${DOCUMENTS} nowhitelist ${DOWNLOADS} @@ -26,10 +27,12 @@ mkdir ${HOME}/.cache/zoom mkfile ${HOME}/.config/zoom.conf mkfile ${HOME}/.config/zoomus.conf mkdir ${HOME}/.zoom +mkdir ${HOME}/Documents/Zoom whitelist ${HOME}/.cache/zoom whitelist ${HOME}/.config/zoom.conf whitelist ${HOME}/.config/zoomus.conf whitelist ${HOME}/.zoom +whitelist ${HOME}/Documents/Zoom # Disable for now, see https://github.com/netblue30/firejail/issues/3726 #private-etc alternatives,ca-certificates,crypto-policies,fonts,group,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,nsswitch.conf,pki,resolv.conf,ssl diff --git a/etc/templates/profile.template b/etc/templates/profile.template index b88566f54..d7c170303 100644 --- a/etc/templates/profile.template +++ b/etc/templates/profile.template @@ -31,7 +31,7 @@ # MKDIRS # WHITELISTS # WHITELIST INCLUDES -# OPTIONS (caps*, net*, no*, protocol, seccomp*, shell none, tracelog) +# OPTIONS (caps*, net*, no*, protocol, seccomp*, tracelog) # PRIVATE OPTIONS (disable-mnt, private-*, writable-*) # DBUS FILTER # SPECIAL OPTIONS (mdwx, noexec, read-only, join-or-start) @@ -88,9 +88,18 @@ include globals.local # Allow lua (blacklisted by disable-interpreters.inc) #include allow-lua.inc +# Allow nodejs (blacklisted by disable-interpreters.inc) +#include allow-nodejs.inc + +# Allow opengl-game wrapper script (distribution-specific) +#include allow-opengl-game.inc + # Allow perl (blacklisted by disable-interpreters.inc) #include allow-perl.inc +# Allow php (blacklisted by disable-interpreters.inc) +#include allow-php.inc + # Allow python (blacklisted by disable-interpreters.inc) #include allow-python2.inc #include allow-python3.inc @@ -120,7 +129,7 @@ include globals.local #include disable-programs.inc #include disable-shell.inc #include disable-write-mnt.inc -#include disable-X11.inc +#include disable-x11.inc #include disable-xdg.inc # This section often mirrors noblacklist section above. The idea is @@ -137,6 +146,14 @@ include globals.local #include whitelist-usr-share-common.inc #include whitelist-var-common.inc +# Landlock commands +##landlock.fs.read PATH +##landlock.fs.write PATH +##landlock.fs.makeipc PATH +##landlock.fs.makedev PATH +##landlock.fs.execute PATH +#include landlock-common.inc + ##allusers #apparmor #caps.drop all @@ -158,6 +175,7 @@ include globals.local #noprinters #noroot #nosound +#notpm #notv #nou2f #novideo @@ -172,9 +190,8 @@ include globals.local ##seccomp.drop SYSCALLS (see syscalls.txt) #seccomp.block-secondary ##seccomp-error-action log (only for debugging seccomp issues) -#shell none #tracelog -# Prefer 'x11 none' instead of 'disable-X11.inc' if 'net none' is set +# Prefer 'x11 none' instead of 'disable-x11.inc' if 'net none' is set ##x11 none #disable-mnt @@ -197,6 +214,13 @@ include globals.local # Extra: gai.conf,proxychains.conf # Qt: Trolltech.conf ##private-lib LIBS +## Note: private-opt copies the entire path(s) to RAM, which may break +## file-copy-limit in firejail.config (see firejail(1)). +## For sizeable apps (if in doubt, do this): +## - never use 'private-opt NAME' +## - place 'whitelist /opt/NAME' in the whitelist section above +## For acceptable apps: +## - use 'private-opt NAME' ##private-opt NAME #private-tmp ##writable-etc diff --git a/etc/templates/syscalls.txt b/etc/templates/syscalls.txt index c33e6d602..569509534 100644 --- a/etc/templates/syscalls.txt +++ b/etc/templates/syscalls.txt @@ -47,7 +47,7 @@ Definition of groups @obsolete=_sysctl,afs_syscall,bdflush,break,create_module,ftime,get_kernel_syms,getpmsg,gtty,idle,lock,mpx,prof,profil,putpmsg,query_module,security,sgetmask,ssetmask,stty,sysfs,tuxcall,ulimit,uselib,ustat,vserver @privileged=@chown,@clock,@module,@raw-io,@reboot,@swap,_sysctl,acct,bpf,capset,chroot,fanotify_init,mount,nfsservctl,open_by_handle_at,pivot_root,quotactl,setdomainname,setfsuid,setfsuid32,setgroups,setgroups32,sethostname,setresuid,setresuid32,setreuid,setreuid32,setuid,setuid32,umount2,vhangup @process=arch_prctl,capget,clone,clone3,execveat,fork,getrusage,kill,pidfd_open,pidfd_send_signal,prctl,rt_sigqueueinfo,rt_tgsigqueueinfo,setns,swapcontext,tgkill,times,tkill,unshare,vfork,wait4,waitid,waitpid -@raw-io=ioperm,iopl,pciconfig_iobase,pciconfig_read,pciconfig_write,s390_mmio_read,s390_mmio_write +@raw-io=ioperm,iopl,pciconfig_iobase,pciconfig_read,pciconfig_write,s390_pci_mmio_read,s390_pci_mmio_write @reboot=kexec_load,kexec_file_load,reboot @resources=ioprio_set,mbind,migrate_pages,move_pages,nice,sched_setaffinity,sched_setattr,sched_setparam,sched_setscheduler,set_mempolicy @setuid=setgid,setgid32,setgroups,setgroups32,setregid,setregid32,setresgid,setresgid32,setresuid,setresuid32,setreuid,setreuid32,setuid,setuid32 diff --git a/gcov.sh b/gcov.sh index 735205668..db508723b 100755 --- a/gcov.sh +++ b/gcov.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # GCOV test setup @@ -12,14 +12,22 @@ gcov_generate() { USER="$(whoami)" find . -exec sudo chown "$USER:$USER" '{}' + - lcov -q --capture -d src/firejail -d src/lib -d src/firecfg -d src/firemon \ - -d src/fnet -d src/fnetfilter -d src/fcopy -d src/fseccomp --output-file gcov-file + lcov -q --capture \ + -d src/firejail -d src/lib -d src/firecfg -d src/firemon \ + -d src/fnet -d src/fnetfilter -d src/fcopy \ + -d src/fseccomp --output-file gcov-file + genhtml -q gcov-file --output-directory gcov-dir } -make distclean && ./configure --prefix=/usr --enable-apparmor --enable-gcov --enable-fatal-warnings && make -j4 && sudo make install +make distclean && +./configure --prefix=/usr --enable-fatal-warnings \ + --enable-apparmor --enable-gcov && +make -j "$(nproc)" && +sudo make install + rm -fr gcov-dir gcov-file -firejail --version +make print-version gcov_generate make test-firecfg | grep TESTING diff --git a/install.sh b/install.sh index 30155cab4..a5aba4a9a 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/sh # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 echo "installing..." diff --git a/linecnt.sh b/linecnt.sh index 93cdbd8fc..71d623bc2 100755 --- a/linecnt.sh +++ b/linecnt.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 gcov_init() { diff --git a/mkasc.sh b/mkasc.sh index de9bf9851..ce83aae57 100755 --- a/mkasc.sh +++ b/mkasc.sh @@ -1,13 +1,15 @@ #!/bin/sh # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 -echo "Calculating SHA256 for all files in /transfer - firejail version $1" +. "$(dirname "$0")/config.sh" || exit 1 + +printf 'Calculating SHA256 for all files in /transfer - %s version %s' "$TARNAME" "$VERSION" cd /transfer || exit 1 -sha256sum ./* > "firejail-$1-unsigned" -gpg --clearsign --digest-algo SHA256 < "firejail-$1-unsigned" > "firejail-$1.asc" -gpg --verify "firejail-$1.asc" -gpg --detach-sign --armor "firejail-$1.tar.xz" -rm "firejail-$1-unsigned" +sha256sum ./* > "$TARNAME-$VERSION-unsigned" +gpg --clearsign --digest-algo SHA256 < "$TARNAME-$VERSION-unsigned" > "$TARNAME-$VERSION.asc" +gpg --verify "$TARNAME-$VERSION.asc" +gpg --detach-sign --armor "$TARNAME-$VERSION.tar.xz" +rm "$TARNAME-$VERSION-unsigned" diff --git a/mkdeb.sh b/mkdeb.sh index edb16fb93..3911a7d8a 100755 --- a/mkdeb.sh +++ b/mkdeb.sh @@ -1,6 +1,6 @@ #!/bin/sh # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # based on http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/ @@ -26,7 +26,7 @@ tar -xJvf "$CODE_ARCHIVE" #mkdir -p "$INSTALL_DIR" cd "$CODE_DIR" ./configure --prefix=/usr --enable-apparmor "$@" -make -j2 +make -j "$(nproc)" mkdir debian DESTDIR=debian make install-strip diff --git a/mketc.sh b/mketc.sh index c95e688c0..17e04d50f 100755 --- a/mketc.sh +++ b/mketc.sh @@ -1,6 +1,6 @@ #!/bin/sh # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 sed -i -e ' diff --git a/mkuid.sh b/mkuid.sh index 90f536aa6..b9cc70726 100755 --- a/mkuid.sh +++ b/mkuid.sh @@ -1,6 +1,6 @@ #!/bin/sh # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 echo "extracting UID_MIN and GID_MIN" diff --git a/platform/debian/control.amd64 b/platform/debian/control.amd64 index f666200d5..59776d325 100644 --- a/platform/debian/control.amd64 +++ b/platform/debian/control.amd64 @@ -8,7 +8,7 @@ Suggests: python, python3 Section: admin Priority: optional Homepage: https://github.com/netblue30/firejail -Description: Linux namepaces sandbox program. +Description: Linux namespaces sandbox program. Firejail is a SUID sandbox program that reduces the risk of security breaches by restricting the running environment of untrusted applications using Linux namespaces and seccmp-bpf. It includes sandbox profiles for diff --git a/platform/debian/control.i386 b/platform/debian/control.i386 index ab9e0fc52..3d3f217c9 100644 --- a/platform/debian/control.i386 +++ b/platform/debian/control.i386 @@ -8,7 +8,7 @@ Suggests: python, python3 Section: admin Priority: optional Homepage: https://github.com/netblue30/firejail -Description: Linux namepaces sandbox program. +Description: Linux namespaces sandbox program. Firejail is a SUID sandbox program that reduces the risk of security breaches by restricting the running environment of untrusted applications using Linux namespaces and seccmp-bpf. It includes sandbox profiles for diff --git a/platform/debian/copyright b/platform/debian/copyright index 0c9b982c6..e7e7eb743 100644 --- a/platform/debian/copyright +++ b/platform/debian/copyright @@ -7,7 +7,7 @@ This is the Debian/Ubuntu prepackaged version of firejail. and networking stack isolation, and it runs on any recent Linux system. It includes a sandbox profile for Mozilla Firefox. - Copyright (C) 2014-2023 Firejail Authors (see README file for more details) + Copyright (C) 2014-2024 Firejail Authors (see README file for more details) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/platform/rpm/mkrpm.sh b/platform/rpm/mkrpm.sh index d32ccd360..46bb90036 100755 --- a/platform/rpm/mkrpm.sh +++ b/platform/rpm/mkrpm.sh @@ -1,53 +1,57 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # -# Usage: ./platform/rpm/mkrpm.sh firejail "" +# Usage: ./platform/rpm/mkrpm.sh # # Builds rpms in a temporary directory then places the result in the # current working directory. -name=$1 -# Strip any trailing prefix from the version like -rc1 etc -version=$(echo "$2" | sed 's/\-.*//g') -config_opt=$3 +set -e -if [[ ! -f platform/rpm/${name}.spec ]]; then - echo error: spec file not found for name \"${name}\" +# shellcheck source=config.sh +. "$(dirname "$0")/../../config.sh" || exit 1 + +name="$TARNAME" +# Strip any trailing prefix from the version like -rc1 etc +version="$(printf '%s\n' "$VERSION" | sed 's/\-.*//g')" + +# Note: rpmbuild itself already passes --prefix=/usr to ./configure +config_opt="--disable-userns --disable-contrib-install $*" + +if [[ ! -f "platform/rpm/${name}.spec" ]]; then + printf 'error: spec file not found for name %s\n' "${name}" >&2 exit 1 fi if [[ -z "${version}" ]]; then - echo error: version must be given + printf 'error: version must be given\n' >&2 exit 1 fi -if [[ -z "${config_opt}" ]]; then - config_opt="--disable-userns --disable-contrib-install" -fi - # Make a temporary directory and arrange to clean up on exit -tmpdir=$(mktemp -d) -mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS} +tmpdir="$(mktemp -d)" +mkdir -p "${tmpdir}"/{BUILD,RPMS,SOURCES,SPECS,SRPMS} function cleanup { - rm -rf ${tmpdir} + rm -rf "${tmpdir}" } trap cleanup EXIT # Create the spec file -tmp_spec_file=${tmpdir}/SPECS/${name}.spec -sed -e "s/__NAME__/${name}/g" \ - -e "s/__VERSION__/${version}/g" \ - -e "s/__CONFIG_OPT__/${config_opt}/g" \ - platform/rpm/${name}.spec >${tmp_spec_file} +tmp_spec_file="${tmpdir}/SPECS/${name}.spec" +sed -e "s|__NAME__|${name}|g" \ + -e "s|__VERSION__|${version}|g" \ + -e "s|__CONFIG_OPT__|${config_opt}|g" \ + "platform/rpm/${name}.spec" >"${tmp_spec_file}" # FIXME: We could parse RELNOTES and create a %changelog section here # Copy the source to build into a tarball -tar --exclude='./.git*' --transform "s/^./${name}-${version}/" -czf ${tmpdir}/SOURCES/${name}-${version}.tar.gz . +tar --exclude='./.git*' --transform "s/^./${name}-${version}/" \ + -czf "${tmpdir}/SOURCES/${name}-${version}.tar.gz" . # Build the files (rpm, debug rpm and source rpm) -rpmbuild --quiet --define "_topdir ${tmpdir}" -ba ${tmp_spec_file} +rpmbuild --define "_topdir ${tmpdir}" -ba "${tmp_spec_file}" # Copy the results to cwd -mv ${tmpdir}/SRPMS/*.rpm ${tmpdir}/RPMS/*/*rpm . +mv "${tmpdir}/SRPMS"/*.rpm "${tmpdir}/RPMS"/*/*rpm . diff --git a/src/bash_completion/Makefile b/src/bash_completion/Makefile index 516805886..c06323f64 100644 --- a/src/bash_completion/Makefile +++ b/src/bash_completion/Makefile @@ -2,17 +2,17 @@ ROOT = ../.. -include $(ROOT)/config.mk +GAWK ?= gawk +RM ?= rm -f + .PHONY: all all: firejail.bash_completion firejail.bash_completion: firejail.bash_completion.in $(ROOT)/config.mk - gawk -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp + $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@ - rm $@.tmp + $(RM) $@.tmp .PHONY: clean clean: - rm -fr firejail.bash_completion - -.PHONY: distclean -distclean: clean + $(RM) -r firejail.bash_completion diff --git a/src/bash_completion/firejail.bash_completion.in b/src/bash_completion/firejail.bash_completion.in index 8e047ce90..4a1adbc26 100644 --- a/src/bash_completion/firejail.bash_completion.in +++ b/src/bash_completion/firejail.bash_completion.in @@ -42,6 +42,29 @@ _firejail() _filedir -d return 0 ;; + --landlock.enforce) + return 0 + ;; + --landlock.fs.read) + _filedir + return 0 + ;; + --landlock.fs.write) + _filedir + return 0 + ;; + --landlock.fs.makeipc) + _filedir + return 0 + ;; + --landlock.fs.makedev) + _filedir + return 0 + ;; + --landlock.fs.execute) + _filedir + return 0 + ;; --tmpfs) _filedir return 0 @@ -82,10 +105,6 @@ _firejail() _filedir return 0 ;; - --shell) - _filedir - return 0 - ;; --net) comps=$(__interfaces) COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) diff --git a/src/etc-cleanup/Makefile b/src/etc-cleanup/Makefile index 296ed41d8..d9dcdbea8 100644 --- a/src/etc-cleanup/Makefile +++ b/src/etc-cleanup/Makefile @@ -2,10 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/etc-cleanup -PROG = etc-cleanup +MOD = etc-cleanup +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/etc_groups.h - include $(ROOT)/src/prog.mk diff --git a/src/etc-cleanup/main.c b/src/etc-cleanup/main.c index f15ba53cd..5da0ccd7c 100644 --- a/src/etc-cleanup/main.c +++ b/src/etc-cleanup/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fbuilder/Makefile b/src/fbuilder/Makefile index 1f6a28780..70c5fb008 100644 --- a/src/fbuilder/Makefile +++ b/src/fbuilder/Makefile @@ -2,10 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fbuilder -PROG = fbuilder +MOD = fbuilder +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/syscall.h - include $(ROOT)/src/prog.mk diff --git a/src/fbuilder/build_bin.c b/src/fbuilder/build_bin.c index 2a88d44c0..f91a543eb 100644 --- a/src/fbuilder/build_bin.c +++ b/src/fbuilder/build_bin.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -27,7 +27,7 @@ static void process_bin(const char *fname) { // process trace file FILE *fp = fopen(fname, "r"); if (!fp) { - fprintf(stderr, "Error: cannot open %s\n", fname); + fprintf(stderr, "Error fbuilder: cannot open %s\n", fname); exit(1); } diff --git a/src/fbuilder/build_fs.c b/src/fbuilder/build_fs.c index f00134e1d..3147fac82 100644 --- a/src/fbuilder/build_fs.c +++ b/src/fbuilder/build_fs.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -31,7 +31,7 @@ static void process_file(const char *fname, const char *dir, void (*callback)(ch // process trace file FILE *fp = fopen(fname, "r"); if (!fp) { - fprintf(stderr, "Error: cannot open %s\n", fname); + fprintf(stderr, "Error fbuilder: cannot open %s\n", fname); exit(1); } diff --git a/src/fbuilder/build_home.c b/src/fbuilder/build_home.c index 15c54911b..8afe257ce 100644 --- a/src/fbuilder/build_home.c +++ b/src/fbuilder/build_home.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -31,7 +31,7 @@ void process_home(const char *fname, char *home, int home_len) { // process trace file FILE *fp = fopen(fname, "r"); if (!fp) { - fprintf(stderr, "Error: cannot open %s\n", fname); + fprintf(stderr, "Error fbuilder: cannot open %s\n", fname); exit(1); } diff --git a/src/fbuilder/build_profile.c b/src/fbuilder/build_profile.c index 75f1c10d7..089dff663 100644 --- a/src/fbuilder/build_profile.c +++ b/src/fbuilder/build_profile.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -26,7 +26,7 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { // next index is the application name if (index >= argc) { - fprintf(stderr, "Error: application name missing\n"); + fprintf(stderr, "Error fbuilder: application name missing\n"); exit(1); } @@ -138,12 +138,12 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { fprintf(fp, "#noinput\t# disable input devices\n"); fprintf(fp, "nonewprivs\n"); fprintf(fp, "noroot\n"); + fprintf(fp, "#notpm\t# disable TPM devices\n"); fprintf(fp, "#notv\t# disable DVB TV devices\n"); fprintf(fp, "#nou2f\t# disable U2F devices\n"); fprintf(fp, "#novideo\t# disable video capture devices\n"); build_protocol(trace_output, fp); fprintf(fp, "seccomp !chroot\t# allowing chroot, just in case this is an Electron app\n"); - fprintf(fp, "shell none\n"); fprintf(fp, "#tracelog\t# send blacklist violations to syslog\n"); fprintf(fp, "\n"); @@ -166,7 +166,7 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { unlink(trace_output); } else { - fprintf(stderr, "Error: cannot run the sandbox\n"); + fprintf(stderr, "Error fbuilder: cannot run the sandbox\n"); exit(1); } } diff --git a/src/fbuilder/build_seccomp.c b/src/fbuilder/build_seccomp.c index 159340dea..14a249b77 100644 --- a/src/fbuilder/build_seccomp.c +++ b/src/fbuilder/build_seccomp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -27,7 +27,7 @@ void build_seccomp(const char *fname, FILE *fp) { FILE *fp2 = fopen(fname, "r"); if (!fp2) { - fprintf(stderr, "Error: cannot open %s\n", fname); + fprintf(stderr, "Error fbuilder: cannot open %s\n", fname); exit(1); } @@ -54,7 +54,7 @@ void build_seccomp(const char *fname, FILE *fp) { } else if (line == 2) { if (*buf != '-') { - fprintf(stderr, "Error: invalid strace output\n%s\n", buf); + fprintf(stderr, "Error fbuilder: invalid strace output\n%s\n", buf); exit(1); } } @@ -96,7 +96,7 @@ static void process_protocol(const char *fname) { // process trace file FILE *fp = fopen(fname, "r"); if (!fp) { - fprintf(stderr, "Error: cannot open %s\n", fname); + fprintf(stderr, "Error fbuilder: cannot open %s\n", fname); exit(1); } diff --git a/src/fbuilder/fbuilder.h b/src/fbuilder/fbuilder.h index c82f90c8d..f42b9805d 100644 --- a/src/fbuilder/fbuilder.h +++ b/src/fbuilder/fbuilder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fbuilder/filedb.c b/src/fbuilder/filedb.c index 5a3b389ae..d9a8a99b3 100644 --- a/src/fbuilder/filedb.c +++ b/src/fbuilder/filedb.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -94,7 +94,7 @@ FileDB *filedb_load_whitelist(FileDB *head, const char *fname, const char *prefi errExit("asprintf"); FILE *fp = fopen(f, "r"); if (!fp) { - fprintf(stderr, "Error: cannot open %s\n", f); + fprintf(stderr, "Error fbuilder: cannot open %s\n", f); free(f); exit(1); } diff --git a/src/fbuilder/main.c b/src/fbuilder/main.c index a85d4a931..884971d42 100644 --- a/src/fbuilder/main.c +++ b/src/fbuilder/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -66,21 +66,21 @@ printf("\n"); // don't run if the file exists if (access(argv[i] + 8, F_OK) == 0) { - fprintf(stderr, "Error: the profile file already exists. Please use a different file name.\n"); + fprintf(stderr, "Error fbuilder: the profile file already exists. Please use a different file name.\n"); exit(1); } // check file access fp = fopen(argv[i] + 8, "w"); if (!fp) { - fprintf(stderr, "Error: cannot open profile file.\n"); + fprintf(stderr, "Error fbuilder: cannot open profile file.\n"); exit(1); } prof_file = argv[i] + 8; } else { if (*argv[i] == '-') { - fprintf(stderr, "Error: invalid program\n"); + fprintf(stderr, "Error fbuilder: invalid program\n"); usage(); exit(1); } @@ -90,7 +90,7 @@ printf("\n"); } if (prog_index == 0) { - fprintf(stderr, "Error : program and arguments required\n"); + fprintf(stderr, "Error fbuilder: program and arguments required\n"); usage(); if (prof_file) { fclose(fp); diff --git a/src/fbuilder/utils.c b/src/fbuilder/utils.c index 91c5a1a5e..10f6e1430 100644 --- a/src/fbuilder/utils.c +++ b/src/fbuilder/utils.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fcopy/Makefile b/src/fcopy/Makefile index f82d3a073..4897980e7 100644 --- a/src/fcopy/Makefile +++ b/src/fcopy/Makefile @@ -2,11 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fcopy -PROG = fcopy +MOD = fcopy +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/syscall.h EXTRA_OBJS = ../lib/common.o include $(ROOT)/src/prog.mk diff --git a/src/fcopy/main.c b/src/fcopy/main.c index a56e8a91b..24f5fd629 100644 --- a/src/fcopy/main.c +++ b/src/fcopy/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -277,7 +277,7 @@ static int fs_copydir(const char *infname, const struct stat *st, int ftype, str // don't copy it if we already have the file struct stat s; - if (stat(outfname, &s) == 0) { + if (lstat(outfname, &s) == 0) { if (first) first = 0; else if (!arg_quiet) @@ -286,7 +286,7 @@ static int fs_copydir(const char *infname, const struct stat *st, int ftype, str } // extract mode and ownership - if (stat(infname, &s) != 0) + if (lstat(infname, &s) != 0) goto out; uid_t uid = s.st_uid; diff --git a/src/fids/Makefile b/src/fids/Makefile index c03740e3d..dadb17a1b 100644 --- a/src/fids/Makefile +++ b/src/fids/Makefile @@ -2,10 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fids -PROG = fids +MOD = fids +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h - include $(ROOT)/src/prog.mk diff --git a/src/fids/blake2b.c b/src/fids/blake2b.c index ca884dfc0..cde2694f6 100644 --- a/src/fids/blake2b.c +++ b/src/fids/blake2b.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fids/db.c b/src/fids/db.c index 7cad11cca..446e14801 100644 --- a/src/fids/db.c +++ b/src/fids/db.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fids/db_exclude.c b/src/fids/db_exclude.c index aedb95e4f..d65cc5bab 100644 --- a/src/fids/db_exclude.c +++ b/src/fids/db_exclude.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fids/fids.h b/src/fids/fids.h index 8bbdcb6db..e20d8a920 100644 --- a/src/fids/fids.h +++ b/src/fids/fids.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fids/main.c b/src/fids/main.c index 915edb6ca..415694f1e 100644 --- a/src/fids/main.c +++ b/src/fids/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -106,9 +106,9 @@ static void file_checksum(const char *fname) { } else { content = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); - close(fd); mmapped = 1; } + close(fd); unsigned char checksum[KEY_SIZE / 8]; blake2b(checksum, sizeof(checksum), content, size); diff --git a/src/firecfg/Makefile b/src/firecfg/Makefile index 322ce3e3f..6cbd1b5ba 100644 --- a/src/firecfg/Makefile +++ b/src/firecfg/Makefile @@ -2,17 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/firecfg -PROG = firecfg +MOD = firecfg +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = \ -../include/common.h \ -../include/euid_common.h \ -../include/libnetlink.h \ -../include/firejail_user.h \ -../include/pid.h - EXTRA_OBJS = ../lib/common.o ../lib/firejail_user.o include $(ROOT)/src/prog.mk diff --git a/src/firecfg/desktop_files.c b/src/firecfg/desktop_files.c index 7ac60f70c..8c21757ab 100644 --- a/src/firecfg/desktop_files.c +++ b/src/firecfg/desktop_files.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -57,7 +57,7 @@ static int check_profile(const char *name, const char *homedir) { } -// look for a profile file in /etc/firejail diectory and in homedir/.config/firejail directory +// look for a profile file in /etc/firejail and ~/.config/firejail static int have_profile(const char *filename, const char *homedir) { assert(filename); assert(homedir); @@ -118,6 +118,9 @@ void fix_desktop_files(const char *homedir) { exit(1); } + // build ignorelist + parse_config_all(0); + // destination // create ~/.local/share/applications directory if necessary char *user_apps_dir; @@ -163,7 +166,8 @@ void fix_desktop_files(const char *homedir) { // copy struct dirent *entry; while ((entry = readdir(dir)) != NULL) { - if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) + const char *filename = entry->d_name; + if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0) continue; // skip if not regular file or link @@ -172,10 +176,25 @@ void fix_desktop_files(const char *homedir) { continue; // skip if not .desktop file - if (strstr(entry->d_name,".desktop") != (entry->d_name+strlen(entry->d_name)-8)) + char *exec = strdup(filename); + if (!exec) + errExit("strdup"); + char *ptr = strstr(exec, ".desktop"); + if (ptr == NULL || *(ptr + 8) != '\0') { + printf(" %s skipped (not a .desktop file)\n", exec); + free(exec); continue; + } - char *filename = entry->d_name; + // skip if program is in ignorelist + *ptr = '\0'; + if (in_ignorelist(exec)) { + printf(" %s ignored\n", exec); + free(exec); + continue; + } + + free(exec); // skip links - Discord on Arch #4235 seems to be a symlink to /opt directory // if (is_link(filename)) @@ -221,7 +240,7 @@ void fix_desktop_files(const char *homedir) { } // get executable name - char *ptr = strstr(buf,"\nExec="); + ptr = strstr(buf,"\nExec="); if (!ptr || strlen(ptr) < 7) { if (arg_debug) printf(" %s - skipped: wrong format?\n", filename); @@ -281,6 +300,7 @@ void fix_desktop_files(const char *homedir) { if (stat(outname, &sb) == 0) { printf(" %s skipped: file exists\n", filename); + free(outname); if (change_exec) free(change_exec); continue; @@ -289,6 +309,7 @@ void fix_desktop_files(const char *homedir) { FILE *fpin = fopen(filename, "r"); if (!fpin) { fprintf(stderr, "Warning: cannot open /usr/share/applications/%s\n", filename); + free(outname); if (change_exec) free(change_exec); continue; @@ -298,6 +319,7 @@ void fix_desktop_files(const char *homedir) { if (!fpout) { fprintf(stderr, "Warning: cannot open ~/.local/share/applications/%s\n", outname); fclose(fpin); + free(outname); if (change_exec) free(change_exec); continue; diff --git a/src/firecfg/firecfg.config b/src/firecfg/firecfg.config index 4041a85db..1ceb55ef6 100644 --- a/src/firecfg/firecfg.config +++ b/src/firecfg/firecfg.config @@ -1,6 +1,8 @@ # /etc/firejail/firecfg.config - firecfg utility configuration file # This is the list of programs in alphabetical order handled by firecfg utility # +# Note: Normal comment lines should start with `# ` and commented code lines +# should start with just `#` (no spaces). 0ad 1password 2048-qt @@ -41,6 +43,7 @@ abrowser akonadi_control akregator alacarte +alienblaster alpine alpinef amarok @@ -48,10 +51,11 @@ amule amuled android-studio ani-cli +anki anydesk apktool apostrophe -# ar - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#ar # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) arch-audit archaudit-report ardour4 @@ -60,12 +64,13 @@ arduino aria2c ark arm +armcord artha assogiate asunder -# atom -# atom-beta -# atool - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#atom +#atom-beta +#atool # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) atril atril-previewer atril-thumbnailer @@ -82,6 +87,7 @@ avidemux3_cli avidemux3_jobs_qt5 avidemux3_qt5 aweather +axel ballbuster baloo_file baloo_filemetadata_temp_extractor @@ -92,18 +98,21 @@ basilisk bcompare beaker bibletime -bijiben +#bijiben # webkit2gtk-4.x requires bwrap (see #3647) bitcoin-qt bitlbee bitwarden +bitwarden-desktop bleachbit blender blender-2.8 +blender-3.6 bless blobby blobwars bluefish bnox +bpftop brackets brasero brave @@ -112,10 +121,10 @@ brave-browser-beta brave-browser-dev brave-browser-nightly brave-browser-stable -# bunzip2 - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# bzcat - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#bunzip2 # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#bzcat # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) bzflag -# bzip2 - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#bzip2 # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) cachy-browser calibre calligra @@ -145,12 +154,13 @@ chromium-freeworld cin cinelerra cinelerra-gg +clac clamdscan clamdtop clamscan clamtk -clawsker claws-mail +clawsker clementine clion clion-eap @@ -158,6 +168,7 @@ clipgrab clipit cliqz clocks +cloneit cmus code code-oss @@ -182,16 +193,20 @@ crow cryptocat cvlc cyberfox +d-feet +d-spy +daisy darktable dconf-editor ddgr ddgtk deadbeef +deadlink deluge desktopeditors devhelp dex2jar -d-feet +dexios dia dig digikam @@ -205,7 +220,7 @@ display display-im6.q16 dnox dnscrypt-proxy -dnsmasq +#dnsmasq # server; problems with libvirt on Arch (see #6121) dolphin-emu dooble dooble-qt4 @@ -214,12 +229,14 @@ dragon drawio drill dropbox +dtui easystroke ebook-convert ebook-edit ebook-meta ebook-polish ebook-viewer +editorconfiger electron-mail electrum element-desktop @@ -235,14 +252,15 @@ enpass eog eom ephemeral -#epiphany - see #2995 +#epiphany # see #2995 equalx +erd et etr evince evince-previewer evince-thumbnailer -#evolution - see #3647 +#evolution # see #3647 exfalso exiftool falkon @@ -269,9 +287,11 @@ fix-qdf flacsplt flameshot flashpeak-slimjet +floorp flowblade -fontforge +fluffychat font-manager +fontforge fossamail four-in-a-row fractal @@ -301,12 +321,15 @@ gcalccmd gcloud gconf-editor gdu -geany -geary -gedit +#geany # text editor (see #6002) +#geary # webkit2gtk-4.x requires bwrap (see #3647) +#gedit # text editor (see #6002) geekbench geeqie +geki2 +geki3 gfeeds +gh ghb ghostwriter gimp @@ -318,7 +341,7 @@ git-cola gitg github-desktop gitter -# gjs -- https://github.com/netblue30/firejail/issues/3333#issuecomment-612601102 +#gjs # https://github.com/netblue30/firejail/issues/3333#issuecomment-612601102 gl-117 glaxium globaltime @@ -336,6 +359,9 @@ gnome-contacts gnome-documents gnome-font-viewer gnome-hexgl +gnome-keyring +gnome-keyring-3 +gnome-keyring-daemon gnome-klotski gnome-latex gnome-logs @@ -382,13 +408,14 @@ gpredict gradio gramps gravity-beams-and-evaporating-stars +green-recorder gthumb -gtk2-youtube-viewer -gtk3-youtube-viewer gtk-lbry-viewer gtk-pipe-viewer gtk-straw-viewer gtk-youtube-viewer +gtk2-youtube-viewer +gtk3-youtube-viewer guayadeque gucharmap gummi @@ -409,8 +436,8 @@ icecat icedove iceweasel idea -ideaIC idea.sh +ideaIC imagej img2txt impressive @@ -423,12 +450,14 @@ ipcalc ipcalc-ng iridium iridium-browser +irssi jami jd-gui jdownloader jerry jitsi jitsi-meet-desktop +journal-viewer jumpnbump jumpnbump-menu k3b @@ -436,10 +465,10 @@ kaffeine kalgebra kalgebramobile karbon -kate +#kate # text editor (see #6002) kazam kcalc -# kdeinit4 +#kdeinit4 kdenlive kdiff3 keepass @@ -449,7 +478,7 @@ keepassx2 keepassxc keepassxc-cli keepassxc-proxy -# kfind +#kfind kget kid3 kid3-cli @@ -466,16 +495,20 @@ kodi kontact konversation kopete +koreader krita -# krunner +#krunner ktorrent ktouch kube -# kwin_x11 -kwrite +#kwin_x11 +#kwrite # text editor (see #6002) +lbreakouthd lbry-viewer -leafpad -# less - breaks man +lbry-viewer-gtk +#leafpad # text editor (see #6002) +#less # breaks man +lettura librecad libreoffice librewolf @@ -492,25 +525,31 @@ lmms lobase lobster localc +localsend_app lodraw loffice lofromtemplate loimpress lollypop lomath +loupe loweb lowriter -# lrunzip - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# lrz - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# lrzcat - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# lrzip - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# lrztar - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# lrzuntar - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#lrunzip # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#lrz # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#lrzcat # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#lrzip # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#lrztar # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#lrzuntar # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) luminance-hdr lximage-qt lxmusic lynx +lyriek lyx +#lz4 # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#lz4c # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#lz4cat # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) macrofusion magicor man @@ -537,6 +576,7 @@ meld mencoder mendeleydesktop menulibre +metadata-cleaner meteo-qt microsoft-edge microsoft-edge-beta @@ -551,7 +591,7 @@ minitube mirage mirrormagic mocp -mousepad +#mousepad # text editor (see #6002) mov-cli mp3splt mp3splt-gtk @@ -559,7 +599,6 @@ mp3wrap mpDris2 mpg123 mpg123-alsa -mpg123.bin mpg123-id3dump mpg123-jack mpg123-nas @@ -568,6 +607,7 @@ mpg123-oss mpg123-portaudio mpg123-pulse mpg123-strip +mpg123.bin mplayer mpsyt mpv @@ -580,6 +620,7 @@ ms-powerpoint ms-skype ms-word mtpaint +mullvad-browser multimc multimc5 mumble @@ -612,6 +653,7 @@ newsflash nextcloud nextcloud-desktop nheko +nhex nicotine nitroshare nitroshare-cli @@ -635,11 +677,11 @@ onionshare-cli onionshare-gui ooffice ooviewdoc +open-invaders openarena openarena_ded opencity openclonk -open-invaders openmw openmw-launcher openoffice.org @@ -676,29 +718,30 @@ pingus pinta pioneer pipe-viewer +pipe-viewer-gtk pithos pitivi pix planmaker18 planmaker18free playonlinux -pluma +#pluma # text editor (see #6002) plv pngquant polari -porn-cli postman ppsspp pragha presentations18 presentations18free +prismlauncher profanity psi psi-plus pybitmessage -# pycharm-community - FB note: may enable later -# pycharm-professional -# pzstd - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#pycharm-community # FB note: may enable later +#pycharm-professional +#pzstd # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) qbittorrent qcomicbook qemu-launcher @@ -711,6 +754,8 @@ qpdf qpdfview qq qt-faststart +qt5ct +qt6ct qtox quadrapassel quassel @@ -720,6 +765,7 @@ qupzilla qutebrowser raincat rambox +reader redeclipse rednotebook redshift @@ -738,6 +784,7 @@ rpcs3 rssguard rtorrent runenpass.sh +rymdport sayonara scallion scorched3d @@ -752,6 +799,9 @@ seahorse-tool seamonkey seamonkey-bin secret-tool +session-desktop +session-messenger +session-messenger-desktop sha1sum sha224sum sha256sum @@ -767,6 +817,7 @@ silentarmy simple-scan simplescreenrecorder simutrans +singularity skanlite skypeforlinux slack @@ -774,25 +825,27 @@ slashem smplayer smtube smuxi-frontend-gnome +sniffnet snox soffice sol -soundconverter sound-juicer -spectacle +soundconverter +#spectacle # may be broken on wayland (see #5127) spectral spotify sqlitebrowser ssh -# ssh-agent - problems on Arch with Fish shell (#1568) +#ssh-agent # problems on Arch with Fish shell (#1568) standardnotes-desktop start-tor-browser +statusof steam steam-native steam-runtime stellarium -strawberry straw-viewer +strawberry strings studio.sh subdownloader @@ -803,6 +856,7 @@ surf sushi swell-foop sylpheed +#syncthing # server synfigstudio sysprof sysprof-cli @@ -815,15 +869,18 @@ telegram telegram-desktop telnet terasology +termshark tesseract textmaker18 textmaker18free +textroom thunderbird thunderbird-beta thunderbird-wayland +tidal-hifi tilp +tiny-rdm tor-browser -torbrowser tor-browser-ar tor-browser-ca tor-browser-cs @@ -845,7 +902,6 @@ tor-browser-it tor-browser-ja tor-browser-ka tor-browser-ko -torbrowser-launcher tor-browser-nb tor-browser-nl tor-browser-pl @@ -856,8 +912,11 @@ tor-browser-tr tor-browser-vi tor-browser-zh-cn tor-browser-zh-tw +torbrowser +torbrowser-launcher torcs totem +tqemu tracker transgui transmission-cli @@ -877,15 +936,19 @@ tshark tuir tutanota-desktop tuxguitar +tuxtype tvbrowser +tvnamer twitch +typespeed udiskie uefitool uget-gtk unbound unf unknown-horizons -# unzstd - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#unlz4 # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#unzstd # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) url-eater utox uudeview @@ -898,10 +961,10 @@ vivaldi-beta vivaldi-snapshot vivaldi-stable vlc -#vmplayer - unable to install kernel modules (see #5861) -#vmware - unable to install kernel modules (see #5861) -#vmware-player - unable to install kernel modules (see #5861) -#vmware-workstation - unable to install kernel modules (see #5861) +#vmplayer # unable to install kernel modules (see #5861) +#vmware # unable to install kernel modules (see #5861) +#vmware-player # unable to install kernel modules (see #5861) +#vmware-workstation # unable to install kernel modules (see #5861) vscodium vulturesclaw vultureseye @@ -935,7 +998,7 @@ x2goclient xbill xcalc xchat -xed +#xed # text editor (see #6002) xfburn xfce4-dict xfce4-mixer @@ -965,8 +1028,9 @@ yelp youtube youtube-dl youtube-dl-gui -youtubemusic-nativefier youtube-viewer +youtube-viewer-gtk +youtubemusic-nativefier yt-dlp ytmdesktop zaproxy @@ -976,10 +1040,10 @@ zeal zim zlib-flate zoom -# zpaq - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# zstd - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# zstdcat - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# zstdgrep - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# zstdless - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) -# zstdmt - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#zpaq # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#zstd # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#zstdcat # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#zstdgrep # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#zstdless # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) +#zstdmt # disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095) zulip diff --git a/src/firecfg/firecfg.h b/src/firecfg/firecfg.h index 8f74a1198..d5996461e 100644 --- a/src/firecfg/firecfg.h +++ b/src/firecfg/firecfg.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -37,9 +37,21 @@ #include "../include/common.h" #define MAX_BUF 4096 +// config files +#define FIRECFG_CFGFILE SYSCONFDIR "/firecfg.config" +#define FIRECFG_CONF_GLOB SYSCONFDIR "/firecfg.d/*.conf" + +// programs +#define FIREJAIL_EXEC PREFIX "/bin/firejail" +#define FIREJAIL_WELCOME_SH LIBDIR "/firejail/firejail-welcome.sh" +#define FZENITY_EXEC LIBDIR "/firejail/fzenity" +#define ZENITY_EXEC "/usr/bin/zenity" +#define SUDO_EXEC "sudo" // main.c extern int arg_debug; +int in_ignorelist(const char *const str); +void parse_config_all(int do_symlink); // util.c int which(const char *program); diff --git a/src/firecfg/firejail-welcome.sh b/src/firecfg/firejail-welcome.sh index a8482a957..47ee904eb 100755 --- a/src/firecfg/firejail-welcome.sh +++ b/src/firecfg/firejail-welcome.sh @@ -1,7 +1,7 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2020-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # # Usage: firejail-welcome PROGRAM SYSCONFDIR USER_NAME diff --git a/src/firecfg/main.c b/src/firecfg/main.c index 4ec81c5b3..74a9c0fef 100644 --- a/src/firecfg/main.c +++ b/src/firecfg/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -20,9 +20,12 @@ #include "firecfg.h" #include "../include/firejail_user.h" +#include + int arg_debug = 0; char *arg_bindir = "/usr/local/bin"; int arg_guide = 0; +int done_config = 0; static const char *const usage_str = "Firecfg is the desktop configuration utility for Firejail software. The utility\n" @@ -76,10 +79,6 @@ static void list(void) { exit(1); } - char *firejail_exec; - if (asprintf(&firejail_exec, "%s/bin/firejail", PREFIX) == -1) - errExit("asprintf"); - struct dirent *entry; while ((entry = readdir(dir)) != NULL) { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) @@ -92,7 +91,7 @@ static void list(void) { if (is_link(fullname)) { char* fname = realpath(fullname, NULL); if (fname) { - if (strcmp(fname, firejail_exec) == 0) + if (strcmp(fname, FIREJAIL_EXEC) == 0) printf("%s\n", fullname); free(fname); } @@ -101,7 +100,6 @@ static void list(void) { } closedir(dir); - free(firejail_exec); } static void clean(void) { @@ -114,10 +112,6 @@ static void clean(void) { exit(1); } - char *firejail_exec; - if (asprintf(&firejail_exec, "%s/bin/firejail", PREFIX) == -1) - errExit("asprintf"); - struct dirent *entry; while ((entry = readdir(dir)) != NULL) { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) @@ -130,7 +124,7 @@ static void clean(void) { if (is_link(fullname)) { char* fname = realpath(fullname, NULL); if (fname) { - if (strcmp(fname, firejail_exec) == 0) { + if (strcmp(fname, FIREJAIL_EXEC) == 0) { char *ptr = strrchr(fullname, '/'); assert(ptr); ptr++; @@ -147,10 +141,43 @@ static void clean(void) { } closedir(dir); - free(firejail_exec); printf("\n"); } +#define ignorelist_maxlen 2048 +static const char *ignorelist[ignorelist_maxlen]; +static int ignorelist_len = 0; + +static int append_ignorelist(const char *const str) { + assert(str); + if (ignorelist_len >= ignorelist_maxlen) { + fprintf(stderr, "Warning: Ignore list is full (%d/%d), skipping %s\n", + ignorelist_len, ignorelist_maxlen, str); + return 0; + } + + printf(" ignoring '%s'\n", str); + const char *const dup = strdup(str); + if (!dup) + errExit("strdup"); + + ignorelist[ignorelist_len] = dup; + ignorelist_len++; + + return 1; +} + +int in_ignorelist(const char *const str) { + assert(str); + int i; + for (i = 0; i < ignorelist_len; i++) { + if (strcmp(str, ignorelist[i]) == 0) + return 1; + } + + return 0; +} + static void set_file(const char *name, const char *firejail_exec) { if (which(name) == 0) return; @@ -165,35 +192,29 @@ static void set_file(const char *name, const char *firejail_exec) { if (rv) { fprintf(stderr, "Error: cannot create %s symbolic link\n", fname); perror("symlink"); - } - else + } else { printf(" %s created\n", name); - } - else { - fprintf(stderr, "Warning: cannot create %s - already exists! Skipping...\n", fname); + } + } else { + fprintf(stderr, "Warning: cannot create %s - already exists! Skipping...\n", fname); } free(fname); } -// parse /etc/firejail/firecfg.config file -static void set_links_firecfg(void) { - char *cfgfile; - if (asprintf(&cfgfile, "%s/firecfg.config", SYSCONFDIR) == -1) - errExit("asprintf"); +// parse a single config file +static void parse_config_file(const char *cfgfile, int do_symlink) { + if (do_symlink) + printf("Configuring symlinks in %s\n", arg_bindir); - char *firejail_exec; - if (asprintf(&firejail_exec, "%s/bin/firejail", PREFIX) == -1) - errExit("asprintf"); + printf("Parsing %s\n", cfgfile); - // parse /etc/firejail/firecfg.config file FILE *fp = fopen(cfgfile, "r"); if (!fp) { perror("fopen"); fprintf(stderr, "Error: cannot open %s\n", cfgfile); exit(1); } - printf("Configuring symlinks in %s based on firecfg.config\n", arg_bindir); char buf[MAX_BUF]; int lineno = 0; @@ -223,13 +244,59 @@ static void set_links_firecfg(void) { if (*start == '\0') continue; + // handle ignore command + if (*start == '!') { + append_ignorelist(start + 1); + continue; + } + + // skip ignored programs + if (in_ignorelist(start)) { + printf(" %s ignored\n", start); + continue; + } + // set link - set_file(start, firejail_exec); + if (do_symlink) + set_file(start, FIREJAIL_EXEC); } fclose(fp); - free(cfgfile); - free(firejail_exec); + printf("\n"); +} + +// parse all config files matching pattern +static void parse_config_glob(const char *pattern, int do_symlink) { + printf("Looking for config files in %s\n", pattern); + + glob_t globbuf; + int globerr = glob(pattern, 0, NULL, &globbuf); + if (globerr == GLOB_NOMATCH) { + fprintf(stderr, "No matches for glob pattern %s\n", pattern); + goto out; + } else if (globerr != 0) { + fprintf(stderr, "Warning: Failed to match glob pattern %s: %s\n", + pattern, strerror(errno)); + goto out; + } + + size_t i; + for (i = 0; i < globbuf.gl_pathc; i++) + parse_config_file(globbuf.gl_pathv[i], do_symlink); +out: + globfree(&globbuf); +} + +// parse all config files +// do_symlink 0 just builds the ignorelist, 1 creates the symlinks +void parse_config_all(int do_symlink) { + if (done_config) + return; + + parse_config_glob(FIRECFG_CONF_GLOB, do_symlink); + parse_config_file(FIRECFG_CFGFILE, do_symlink); + + done_config = 1; } // parse ~/.config/firejail/ directory @@ -246,10 +313,6 @@ static void set_links_homedir(const char *homedir) { return; } - char *firejail_exec; - if (asprintf(&firejail_exec, "%s/bin/firejail", PREFIX) == -1) - errExit("asprintf"); - // parse ~/.config/firejail/ directory printf("\nConfiguring symlinks in %s based on local firejail config directory\n", arg_bindir); @@ -260,6 +323,7 @@ static void set_links_homedir(const char *homedir) { free(dirname); return; } + free(dirname); struct dirent *entry; while ((entry = readdir(dir))) { @@ -270,22 +334,22 @@ static void set_links_homedir(const char *homedir) { if (!exec) errExit("strdup"); char *ptr = strrchr(exec, '.'); - if (!ptr) { - free(exec); - continue; - } - if (strcmp(ptr, ".profile") != 0) { - free(exec); - continue; - } + if (!ptr) + goto next; + if (strcmp(ptr, ".profile") != 0) + goto next; *ptr = '\0'; - set_file(exec, firejail_exec); + if (in_ignorelist(exec)) { + printf(" %s ignored\n", exec); + goto next; + } + + set_file(exec, FIREJAIL_EXEC); +next: free(exec); } closedir(dir); - - free(firejail_exec); } static const char *get_sudo_user(void) { @@ -449,18 +513,20 @@ int main(int argc, char **argv) { } if (arg_guide) { + const char *zenity_exec; + if (arg_debug) + zenity_exec = FZENITY_EXEC; + else + zenity_exec = ZENITY_EXEC; + char *cmd; -if (arg_debug) { - if (asprintf(&cmd, "sudo %s/firejail/firejail-welcome.sh /usr/lib/firejail/fzenity %s %s", LIBDIR, SYSCONFDIR, user) == -1) + if (asprintf(&cmd, "%s %s %s %s %s", + SUDO_EXEC, FIREJAIL_WELCOME_SH, zenity_exec, SYSCONFDIR, user) == -1) errExit("asprintf"); -} -else { - if (asprintf(&cmd, "sudo %s/firejail/firejail-welcome.sh /usr/bin/zenity %s %s", LIBDIR, SYSCONFDIR, user) == -1) - errExit("asprintf"); -} + int status = system(cmd); if (status == -1) { - fprintf(stderr, "Error: cannot run firejail-welcome.sh\n"); + fprintf(stderr, "Error: cannot run %s\n", FIREJAIL_WELCOME_SH); exit(1); } free(cmd); @@ -474,12 +540,12 @@ else { // clear all symlinks clean(); - // set new symlinks based on /etc/firejail/firecfg.config - set_links_firecfg(); + // set new symlinks based on config files + parse_config_all(1); if (getuid() == 0) { // add user to firejail access database - only for root - printf("\nAdding user %s to Firejail access database in %s/firejail.users\n", user, SYSCONFDIR); + printf("Adding user %s to Firejail access database in %s/firejail.users\n", user, SYSCONFDIR); // temporarily set the umask, access database must be world-readable mode_t orig_umask = umask(022); firejail_user_add(user); diff --git a/src/firecfg/sound.c b/src/firecfg/sound.c index 2c8c28191..e0ea7fe64 100644 --- a/src/firecfg/sound.c +++ b/src/firecfg/sound.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firecfg/util.c b/src/firecfg/util.c index 4185b52dd..06ff9f8a3 100644 --- a/src/firecfg/util.c +++ b/src/firecfg/util.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/Makefile b/src/firejail/Makefile index a817b1757..e7b334cd8 100644 --- a/src/firejail/Makefile +++ b/src/firejail/Makefile @@ -2,23 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/firejail -PROG = firejail +MOD = firejail +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = \ -../include/rundefs.h \ -../include/common.h \ -../include/ldd_utils.h \ -../include/euid_common.h \ -../include/pid.h \ -../include/seccomp.h \ -../include/syscall_i386.h \ -../include/syscall_x86_64.h \ -../include/firejail_user.h \ -../include/etc_groups.h - - EXTRA_OBJS = \ ../lib/common.o \ ../lib/ldd_utils.o \ diff --git a/src/firejail/appimage.c b/src/firejail/appimage.c index a4f727c0a..c8c7a7859 100644 --- a/src/firejail/appimage.c +++ b/src/firejail/appimage.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -43,6 +43,16 @@ int appimage_find_profile(const char *archive) { assert(archive); assert(strlen(archive)); + // extract the name of the appimage from a full path + // example: archive = /opt/kdenlive-20.12.2-x86_64.appimage + const char *arc = strrchr(archive, '/'); + if (arc) + arc++; + else + arc = archive; + if (arg_debug) + printf("Looking for a %s profile\n", arc); + // try to match the name of the archive with the list of programs in /etc/firejail/firecfg.config FILE *fp = fopen(SYSCONFDIR "/firecfg.config", "r"); if (!fp) { @@ -56,7 +66,8 @@ int appimage_find_profile(const char *archive) { char *ptr = strchr(buf, '\n'); if (ptr) *ptr = '\0'; - if (strcasestr(archive, buf)) { + char *found = strcasestr(arc, buf); + if (found == arc) { fclose(fp); return profile_find_firejail(buf, 1); } diff --git a/src/firejail/appimage_size.c b/src/firejail/appimage_size.c index 60c4c0364..c11dd8fe5 100644 --- a/src/firejail/appimage_size.c +++ b/src/firejail/appimage_size.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/arp.c b/src/firejail/arp.c index ed14eb171..8441d58b5 100644 --- a/src/firejail/arp.c +++ b/src/firejail/arp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/bandwidth.c b/src/firejail/bandwidth.c index b6a588e36..cbfcc90ed 100644 --- a/src/firejail/bandwidth.c +++ b/src/firejail/bandwidth.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -198,6 +198,8 @@ static void read_bandwidth_file(pid_t pid) { fclose(fp); } + + free(fname); } static void write_bandwidth_file(pid_t pid) { @@ -217,6 +219,7 @@ static void write_bandwidth_file(pid_t pid) { ptr = ptr->next; } fclose(fp); + free(fname); } else goto errout; diff --git a/src/firejail/caps.c b/src/firejail/caps.c index d11adc9d5..40ec2b57b 100644 --- a/src/firejail/caps.c +++ b/src/firejail/caps.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c index d2289bb40..bab0e819f 100644 --- a/src/firejail/checkcfg.c +++ b/src/firejail/checkcfg.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -349,15 +349,15 @@ static const char *const compiletime_support = "disabled" #endif - "\n\t- firetunnel support is " -#ifdef HAVE_FIRETUNNEL + "\n\t- IDS support is " +#ifdef HAVE_IDS "enabled" #else "disabled" #endif - "\n\t- IDS support is " -#ifdef HAVE_IDS + "\n\t- Landlock support is " +#ifdef HAVE_LANDLOCK "enabled" #else "disabled" diff --git a/src/firejail/chroot.c b/src/firejail/chroot.c index 132ac94ba..67097852e 100644 --- a/src/firejail/chroot.c +++ b/src/firejail/chroot.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -273,7 +273,10 @@ void fs_chroot(const char *rootdir) { errExit("mounting /proc"); // create all other /run/firejail files and directories - preproc_build_firejail_dir(); + preproc_build_firejail_dir_unlocked(); + preproc_lock_firejail_dir(); + preproc_build_firejail_dir_locked(); + preproc_unlock_firejail_dir(); // update /var directory in order to support multiple sandboxes running on the same root directory // if (!arg_private_dev) diff --git a/src/firejail/cmdline.c b/src/firejail/cmdline.c index 45b82f4f7..41396ece7 100644 --- a/src/firejail/cmdline.c +++ b/src/firejail/cmdline.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/cpu.c b/src/firejail/cpu.c index 804d51caa..52c13596b 100644 --- a/src/firejail/cpu.c +++ b/src/firejail/cpu.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/dbus.c b/src/firejail/dbus.c index b2f9fe2d2..13d7823ad 100644 --- a/src/firejail/dbus.c +++ b/src/firejail/dbus.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/dhcp.c b/src/firejail/dhcp.c index 60fa34517..9c507023f 100644 --- a/src/firejail/dhcp.c +++ b/src/firejail/dhcp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/env.c b/src/firejail/env.c index da3c3ac53..73be0f5ff 100644 --- a/src/firejail/env.c +++ b/src/firejail/env.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h index c791913ea..8683e0f77 100644 --- a/src/firejail/firejail.h +++ b/src/firejail/firejail.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -150,6 +150,18 @@ typedef struct profile_entry_t { } ProfileEntry; +typedef struct landlock_entry_t { + struct landlock_entry_t *next; +#define LL_FS_READ 0 +#define LL_FS_WRITE 1 +#define LL_FS_MAKEIPC 2 +#define LL_FS_MAKEDEV 3 +#define LL_FS_EXEC 4 +#define LL_MAX 5 + int type; + char *data; +} LandlockEntry; + typedef struct config_t { // user data char *username; @@ -159,6 +171,7 @@ typedef struct config_t { // filesystem ProfileEntry *profile; ProfileEntry *profile_rebuild_etc; // blacklist files in /etc directory used by fs_rebuild_etc() + LandlockEntry *lprofile; #define MAX_PROFILE_IGNORE 32 char *profile_ignore[MAX_PROFILE_IGNORE]; @@ -269,6 +282,8 @@ static inline int any_dhcp(void) { return any_ip_dhcp() || any_ip6_dhcp(); } +extern int lockfd_directory; +extern int lockfd_network; extern int arg_private; // mount private /home extern int arg_private_cache; // private home/.cache extern int arg_debug; // print debug messages @@ -281,6 +296,8 @@ extern int arg_overlay; // overlay option extern int arg_overlay_keep; // place overlay diff in a known directory extern int arg_overlay_reuse; // allow the reuse of overlays +extern int arg_landlock_enforce; // enforce the Landlock ruleset + extern int arg_seccomp; // enable default seccomp filter extern int arg_seccomp32; // enable default seccomp filter for 32 bit arch extern int arg_seccomp_postexec; // need postexec ld.preload library? @@ -351,6 +368,7 @@ extern int arg_noprofile; // use default.profile if none other found/specified extern int arg_memory_deny_write_execute; // block writable and executable memory extern int arg_notv; // --notv extern int arg_nodvd; // --nodvd +extern int arg_notpm; // --notpm extern int arg_nou2f; // --nou2f extern int arg_noinput; // --noinput extern int arg_deterministic_exit_code; // always exit with first child's exit status @@ -414,7 +432,12 @@ int net_get_mac(const char *ifname, unsigned char mac[6]); void net_config_interface(const char *dev, uint32_t ip, uint32_t mask, int mtu); // preproc.c -void preproc_build_firejail_dir(void); +void preproc_lock_firejail_dir(void); +void preproc_unlock_firejail_dir(void); +void preproc_lock_firejail_network_dir(void); +void preproc_unlock_firejail_network_dir(void); +void preproc_build_firejail_dir_unlocked(void); +void preproc_build_firejail_dir_locked(void); void preproc_mount_mnt_dir(void); void preproc_clean_run(void); @@ -478,7 +501,7 @@ void tree(void); void top(void); // usage.c -void print_version(void); +void print_version(FILE *stream); void print_version_full(void); void usage(void); @@ -624,6 +647,7 @@ void fs_dev_disable_3d(void); void fs_dev_disable_video(void); void fs_dev_disable_tv(void); void fs_dev_disable_dvd(void); +void fs_dev_disable_tpm(void); void fs_dev_disable_u2f(void); void fs_dev_disable_input(void); @@ -950,4 +974,9 @@ void run_ids(int argc, char **argv); // oom.c void oom_set(const char *oom_string); +// landlock.c +int ll_get_fd(void); +int ll_restrict(uint32_t flags); +void ll_add_profile(int type, const char *data); + #endif diff --git a/src/firejail/fs.c b/src/firejail/fs.c index 182f26e53..abef85515 100644 --- a/src/firejail/fs.c +++ b/src/firejail/fs.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -281,6 +281,8 @@ void fs_blacklist(void) { if (!entry) return; + timetrace_start(); + size_t noblacklist_c = 0; size_t noblacklist_m = 32; char **noblacklist = calloc(noblacklist_m, sizeof(*noblacklist)); @@ -463,6 +465,8 @@ void fs_blacklist(void) { for (i = 0; i < noblacklist_c; i++) free(noblacklist[i]); free(noblacklist); + + fmessage("Base filesystem installed in %0.2f ms\n", timetrace_end()); } //*********************************************** @@ -739,10 +743,20 @@ void fs_proc_sys_dev_boot(void) { disable_file(BLACKLIST_FILE, "/sys/firmware"); disable_file(BLACKLIST_FILE, "/sys/hypervisor"); - { // allow user access to some directories in /sys/ by specifying 'noblacklist' option - profile_add("blacklist /sys/fs"); + + // Soft-block some paths in /sys/ (can be undone in profiles). + profile_add("blacklist /sys/fs"); + + // Hardware acceleration with the nvidia proprietary driver may fail + // without access to these paths (see #6372). + if (access("/dev/nvidiactl", R_OK) == 0 && arg_no3d == 0) { + profile_add("whitelist /sys/module/nvidia*"); + profile_add("read-only /sys/module/nvidia*"); + } + else { profile_add("blacklist /sys/module"); } + disable_file(BLACKLIST_FILE, "/sys/power"); disable_file(BLACKLIST_FILE, "/sys/kernel/debug"); disable_file(BLACKLIST_FILE, "/sys/kernel/vmcoreinfo"); diff --git a/src/firejail/fs_bin.c b/src/firejail/fs_bin.c index 04c5a7d07..ea7057917 100644 --- a/src/firejail/fs_bin.c +++ b/src/firejail/fs_bin.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_dev.c b/src/firejail/fs_dev.c index 9ca73eb35..34a26464a 100644 --- a/src/firejail/fs_dev.c +++ b/src/firejail/fs_dev.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -39,6 +39,7 @@ typedef enum { DEV_VIDEO, DEV_TV, DEV_DVD, + DEV_TPM, DEV_U2F, DEV_INPUT } DEV_TYPE; @@ -52,7 +53,8 @@ typedef struct { static DevEntry dev[] = { {"/dev/snd", RUN_DEV_DIR "/snd", DEV_SOUND}, // sound device - {"/dev/dri", RUN_DEV_DIR "/dri", DEV_3D}, // 3d device + {"/dev/dri", RUN_DEV_DIR "/dri", DEV_3D}, // 3d devices + {"/dev/kfd", RUN_DEV_DIR "/kfd", DEV_3D}, {"/dev/nvidia0", RUN_DEV_DIR "/nvidia0", DEV_3D}, {"/dev/nvidia1", RUN_DEV_DIR "/nvidia1", DEV_3D}, {"/dev/nvidia2", RUN_DEV_DIR "/nvidia2", DEV_3D}, @@ -78,6 +80,12 @@ static DevEntry dev[] = { {"/dev/video9", RUN_DEV_DIR "/video9", DEV_VIDEO}, {"/dev/dvb", RUN_DEV_DIR "/dvb", DEV_TV}, // DVB (Digital Video Broadcasting) - TV device {"/dev/sr0", RUN_DEV_DIR "/sr0", DEV_DVD}, // for DVD and audio CD players + {"/dev/tpm0", RUN_DEV_DIR "/tpm0", DEV_TPM}, // TPM (Trusted Platform Module) devices + {"/dev/tpm1", RUN_DEV_DIR "/tpm1", DEV_TPM}, + {"/dev/tpm2", RUN_DEV_DIR "/tpm2", DEV_TPM}, + {"/dev/tpm3", RUN_DEV_DIR "/tpm3", DEV_TPM}, + {"/dev/tpm4", RUN_DEV_DIR "/tpm4", DEV_TPM}, + {"/dev/tpm5", RUN_DEV_DIR "/tpm5", DEV_TPM}, {"/dev/hidraw0", RUN_DEV_DIR "/hidraw0", DEV_U2F}, {"/dev/hidraw1", RUN_DEV_DIR "/hidraw1", DEV_U2F}, {"/dev/hidraw2", RUN_DEV_DIR "/hidraw2", DEV_U2F}, @@ -104,6 +112,7 @@ static void deventry_mount(void) { (dev[i].type == DEV_VIDEO && arg_novideo == 0) || (dev[i].type == DEV_TV && arg_notv == 0) || (dev[i].type == DEV_DVD && arg_nodvd == 0) || + (dev[i].type == DEV_TPM && arg_notpm == 0) || (dev[i].type == DEV_U2F && arg_nou2f == 0) || (dev[i].type == DEV_INPUT && arg_noinput == 0)) { @@ -383,6 +392,15 @@ void fs_dev_disable_dvd(void) { } } +void fs_dev_disable_tpm(void) { + int i = 0; + while (dev[i].dev_fname != NULL) { + if (dev[i].type == DEV_TPM) + disable_file_or_dir(dev[i].dev_fname); + i++; + } +} + void fs_dev_disable_u2f(void) { int i = 0; while (dev[i].dev_fname != NULL) { diff --git a/src/firejail/fs_etc.c b/src/firejail/fs_etc.c index dc4e5c228..f58b25aee 100644 --- a/src/firejail/fs_etc.c +++ b/src/firejail/fs_etc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_home.c b/src/firejail/fs_home.c index fd2441832..9d9832c15 100644 --- a/src/firejail/fs_home.c +++ b/src/firejail/fs_home.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -67,8 +67,10 @@ static void skel(const char *homedir) { if (asprintf(&fname, "%s/.zshrc", homedir) == -1) errExit("asprintf"); // don't copy it if we already have the file - if (access(fname, F_OK) == 0) + if (access(fname, F_OK) == 0) { + free(fname); return; + } if (is_link(fname)) { // access(3) on dangling symlinks fails, try again using lstat fprintf(stderr, "Error: invalid %s file\n", fname); exit(1); @@ -91,8 +93,10 @@ static void skel(const char *homedir) { if (asprintf(&fname, "%s/.cshrc", homedir) == -1) errExit("asprintf"); // don't copy it if we already have the file - if (access(fname, F_OK) == 0) + if (access(fname, F_OK) == 0) { + free(fname); return; + } if (is_link(fname)) { // access(3) on dangling symlinks fails, try again using lstat fprintf(stderr, "Error: invalid %s file\n", fname); exit(1); @@ -115,8 +119,10 @@ static void skel(const char *homedir) { if (asprintf(&fname, "%s/.bashrc", homedir) == -1) errExit("asprintf"); // don't copy it if we already have the file - if (access(fname, F_OK) == 0) + if (access(fname, F_OK) == 0) { + free(fname); return; + } if (is_link(fname)) { // access(3) on dangling symlinks fails, try again using lstat fprintf(stderr, "Error: invalid %s file\n", fname); exit(1); diff --git a/src/firejail/fs_hostname.c b/src/firejail/fs_hostname.c index 29f805e1a..c05813843 100644 --- a/src/firejail/fs_hostname.c +++ b/src/firejail/fs_hostname.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_lib.c b/src/firejail/fs_lib.c index ba7a291ee..0dedf74b1 100644 --- a/src/firejail/fs_lib.c +++ b/src/firejail/fs_lib.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_lib2.c b/src/firejail/fs_lib2.c index 583888e0e..5835643fc 100644 --- a/src/firejail/fs_lib2.c +++ b/src/firejail/fs_lib2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_logger.c b/src/firejail/fs_logger.c index b2db40a62..8ddddb0e7 100644 --- a/src/firejail/fs_logger.c +++ b/src/firejail/fs_logger.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_mkdir.c b/src/firejail/fs_mkdir.c index d59735401..6433d8ae4 100644 --- a/src/firejail/fs_mkdir.c +++ b/src/firejail/fs_mkdir.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_overlayfs.c b/src/firejail/fs_overlayfs.c index b2b24cf69..c60e2135b 100644 --- a/src/firejail/fs_overlayfs.c +++ b/src/firejail/fs_overlayfs.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_trace.c b/src/firejail/fs_trace.c index 05fd89f53..89e95b804 100644 --- a/src/firejail/fs_trace.c +++ b/src/firejail/fs_trace.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_var.c b/src/firejail/fs_var.c index 4787df21e..1ff59cdeb 100644 --- a/src/firejail/fs_var.c +++ b/src/firejail/fs_var.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c index 471fa3a56..daa9127ca 100644 --- a/src/firejail/fs_whitelist.c +++ b/src/firejail/fs_whitelist.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/ids.c b/src/firejail/ids.c index e371f5c6d..0759a205d 100644 --- a/src/firejail/ids.c +++ b/src/firejail/ids.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -42,6 +42,7 @@ static void ids_init(void) { if (dup(fd) != STDOUT_FILENO) errExit("dup"); close(fd); + free(fname); sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FIDS, "--init", cfg.homedir); } @@ -63,6 +64,7 @@ static void ids_check(void) { if (dup(fd) != STDIN_FILENO) errExit("dup"); close(fd); + free(fname); sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP| SBOX_ALLOW_STDIN, 3, PATH_FIDS, "--check", cfg.homedir); } diff --git a/src/firejail/join.c b/src/firejail/join.c index 742cda80b..46c02bf0c 100644 --- a/src/firejail/join.c +++ b/src/firejail/join.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/landlock.c b/src/firejail/landlock.c new file mode 100644 index 000000000..2b3512320 --- /dev/null +++ b/src/firejail/landlock.c @@ -0,0 +1,315 @@ +/* + * Copyright (C) 2014-2024 Firejail Authors + * + * This file is part of firejail project + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include "firejail.h" +#include +#include +#include +#include +#include + +#ifdef HAVE_LANDLOCK + +#include + +static int ll_ruleset_fd = -1; +static int ll_abi = -1; + +int ll_get_fd(void) { + return ll_ruleset_fd; +} + +#ifndef landlock_create_ruleset +static inline int +landlock_create_ruleset(const struct landlock_ruleset_attr *const attr, + const size_t size, const __u32 flags) { + return syscall(__NR_landlock_create_ruleset, attr, size, flags); +} +#endif + +#ifndef landlock_add_rule +static inline int +landlock_add_rule(const int ruleset_fd, + const enum landlock_rule_type rule_type, + const void *const rule_attr, + const __u32 flags) { + return syscall(__NR_landlock_add_rule, ruleset_fd, rule_type, + rule_attr, flags); +} +#endif + +#ifndef landlock_restrict_self +static inline int +landlock_restrict_self(const int ruleset_fd, const __u32 flags) { + return syscall(__NR_landlock_restrict_self, ruleset_fd, flags); +} +#endif + +static int ll_is_supported(void) { + if (ll_abi != -1) + goto out; + + ll_abi = landlock_create_ruleset(NULL, 0, + LANDLOCK_CREATE_RULESET_VERSION); + if (ll_abi < 1) { + ll_abi = 0; + fprintf(stderr, "Warning: %s: Landlock is disabled or not supported: %s, " + "ignoring landlock commands\n", + __func__, strerror(errno)); + goto out; + } + + if (arg_debug) { + fprintf(stderr, "%s: Detected Landlock ABI version %d\n", + __func__, ll_abi); + } +out: + return ll_abi; +} + +static int ll_create_full_ruleset(void) { + struct landlock_ruleset_attr attr = {0}; + attr.handled_access_fs = + LANDLOCK_ACCESS_FS_EXECUTE | + LANDLOCK_ACCESS_FS_MAKE_BLOCK | + LANDLOCK_ACCESS_FS_MAKE_CHAR | + LANDLOCK_ACCESS_FS_MAKE_DIR | + LANDLOCK_ACCESS_FS_MAKE_FIFO | + LANDLOCK_ACCESS_FS_MAKE_REG | + LANDLOCK_ACCESS_FS_MAKE_SOCK | + LANDLOCK_ACCESS_FS_MAKE_SYM | + LANDLOCK_ACCESS_FS_READ_DIR | + LANDLOCK_ACCESS_FS_READ_FILE | + LANDLOCK_ACCESS_FS_REMOVE_DIR | + LANDLOCK_ACCESS_FS_REMOVE_FILE | + LANDLOCK_ACCESS_FS_WRITE_FILE; + + if (arg_debug) { + fprintf(stderr, "%s: Creating Landlock ruleset (abi=%d fs=%llx)\n", + __func__, ll_abi, attr.handled_access_fs); + } + + int ruleset_fd = landlock_create_ruleset(&attr, sizeof(attr), 0); + if (ruleset_fd < 0) { + fprintf(stderr, "Error: %s: failed to create Landlock ruleset " + "(abi=%d fs=%llx): %s\n", + __func__, ll_abi, attr.handled_access_fs, + strerror(errno)); + } + return ruleset_fd; +} + +static void _ll_fs(const char *allowed_path, const __u64 allowed_access, + const char *caller) { + if (ll_ruleset_fd == -1) + ll_ruleset_fd = ll_create_full_ruleset(); + + if (arg_debug) { + fprintf(stderr, "%s: Adding Landlock rule (abi=%d fs=%llx) for %s\n", + caller, ll_abi, allowed_access, allowed_path); + } + + int allowed_fd = open(allowed_path, O_PATH | O_CLOEXEC); + if (allowed_fd < 0) { + if (arg_debug) { + fprintf(stderr, "%s: failed to open %s: %s\n", + caller, allowed_path, strerror(errno)); + } + return; + } + + struct landlock_path_beneath_attr target = {0}; + target.parent_fd = allowed_fd; + target.allowed_access = allowed_access; + int error = landlock_add_rule(ll_ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, + &target, 0); + if (error) { + fprintf(stderr, "Error: %s: failed to add Landlock rule " + "(abi=%d fs=%llx) for %s: %s\n", + caller, ll_abi, allowed_access, allowed_path, + strerror(errno)); + } + close(allowed_fd); +} + +static void ll_fs(const char *allowed_path, const __u64 allowed_access, + const char *caller) { + char *expanded_path; + + // ${PATH} macro is not included by default in expand_macros() + if (strncmp(allowed_path, "${PATH}", 7) == 0) { + char **paths = build_paths(); + int i = 0; + while (paths[i] != NULL) { + if (asprintf(&expanded_path, "%s%s", paths[i], allowed_path + 7) == -1) + errExit("asprintf"); + if (arg_debug) + fprintf(stderr, "landlock expand path %s\n", expanded_path); + + _ll_fs(expanded_path, allowed_access, caller); + free(expanded_path); + i++; + } + return; + } + + expanded_path = expand_macros(allowed_path); + _ll_fs(expanded_path, allowed_access, caller); + free(expanded_path); +} + +static void ll_fs_read(const char *allowed_path) { + __u64 allowed_access = + LANDLOCK_ACCESS_FS_READ_DIR | + LANDLOCK_ACCESS_FS_READ_FILE; + + ll_fs(allowed_path, allowed_access, __func__); +} + +static void ll_fs_write(const char *allowed_path) { + __u64 allowed_access = + LANDLOCK_ACCESS_FS_MAKE_DIR | + LANDLOCK_ACCESS_FS_MAKE_REG | + LANDLOCK_ACCESS_FS_MAKE_SYM | + LANDLOCK_ACCESS_FS_REMOVE_DIR | + LANDLOCK_ACCESS_FS_REMOVE_FILE | + LANDLOCK_ACCESS_FS_WRITE_FILE; + + ll_fs(allowed_path, allowed_access, __func__); +} + +static void ll_fs_makeipc(const char *allowed_path) { + __u64 allowed_access = + LANDLOCK_ACCESS_FS_MAKE_FIFO | + LANDLOCK_ACCESS_FS_MAKE_SOCK; + + ll_fs(allowed_path, allowed_access, __func__); +} + +static void ll_fs_makedev(const char *allowed_path) { + __u64 allowed_access = + LANDLOCK_ACCESS_FS_MAKE_BLOCK | + LANDLOCK_ACCESS_FS_MAKE_CHAR; + + ll_fs(allowed_path, allowed_access, __func__); +} + +static void ll_fs_exec(const char *allowed_path) { + __u64 allowed_access = + LANDLOCK_ACCESS_FS_EXECUTE; + + ll_fs(allowed_path, allowed_access, __func__); +} + +int ll_restrict(uint32_t flags) { + if (!ll_is_supported()) + return 0; + + timetrace_start(); + + if (arg_debug) + fprintf(stderr, "%s: Starting Landlock restrict\n", __func__); + + void (*fnc[])(const char *) = { + ll_fs_read, + ll_fs_write, + ll_fs_makeipc, + ll_fs_makedev, + ll_fs_exec, + NULL + }; + + LandlockEntry *ptr = cfg.lprofile; + int rules = 0; + while (ptr) { + rules++; + fnc[ptr->type](ptr->data); + ptr = ptr->next; + } + + if (ll_ruleset_fd == -1) + return 0; + + int error; + error = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); + if (error) { + fprintf(stderr, "Error: %s: failed to restrict privileges: %s\n", + __func__, strerror(errno)); + goto out; + } + error = landlock_restrict_self(ll_ruleset_fd, flags); + if (error) { + fprintf(stderr, "Error: %s: failed to enforce Landlock: %s\n", + __func__, strerror(errno)); + goto out; + } + fmessage("%d Landlock rules initialized in %0.2f ms\n", rules, timetrace_end()); + +out: + close(ll_ruleset_fd); + return error; +} + +void ll_add_profile(int type, const char *data) { + assert(type >= 0); + assert(type < LL_MAX); + assert(data); + + while (*data == ' ' || *data == '\t') + data++; + + LandlockEntry *entry = malloc(sizeof(LandlockEntry)); + if (!entry) + errExit("malloc"); + memset(entry, 0, sizeof(LandlockEntry)); + entry->type = type; + entry->data = strdup(data); + if (!entry->data) + errExit("strdup"); + + // add entry to the list + if (cfg.lprofile == NULL) { + cfg.lprofile = entry; + return; + } + LandlockEntry *ptr = cfg.lprofile; + while (ptr->next != NULL) + ptr = ptr->next; + ptr->next = entry; +} + +#else + +int ll_get_fd(void) { + return -1; +} + +int ll_restrict(uint32_t flags) { + (void) flags; + + return 0; +} + +void ll_add_profile(int type, const char *data) { + (void) type; + (void) data; +} + +#endif /* HAVE_LANDLOCK */ diff --git a/src/firejail/ls.c b/src/firejail/ls.c index f2ab1c188..c8866d2c0 100644 --- a/src/firejail/ls.c +++ b/src/firejail/ls.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -154,7 +154,7 @@ static void print_file_or_dir(const char *path, const char *fname) { // file size char *sz; - if (asprintf(&sz, "%d", (int) s.st_size) == -1) + if (asprintf(&sz, "%jd", (intmax_t) s.st_size) == -1) errExit("asprintf"); // file name diff --git a/src/firejail/macros.c b/src/firejail/macros.c index af7d02c2a..9dd18970a 100644 --- a/src/firejail/macros.c +++ b/src/firejail/macros.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/main.c b/src/firejail/main.c index 45b199db4..27ae68eb0 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -63,6 +63,8 @@ gid_t firejail_gid = 0; static char child_stack[STACK_SIZE] __attribute__((aligned(STACK_ALIGNMENT))); // space for child's stack Config cfg; // configuration +int lockfd_directory = -1; +int lockfd_network = -1; int arg_private = 0; // mount private /home and /tmp directoryu int arg_private_cache = 0; // mount private home/.cache int arg_debug = 0; // print debug messages @@ -75,6 +77,8 @@ int arg_overlay = 0; // overlay option int arg_overlay_keep = 0; // place overlay diff in a known directory int arg_overlay_reuse = 0; // allow the reuse of overlays +int arg_landlock_enforce = 0; // enforce the Landlock ruleset + int arg_seccomp = 0; // enable default seccomp filter int arg_seccomp32 = 0; // enable default seccomp filter for 32 bit arch int arg_seccomp_postexec = 0; // need postexec ld.preload library? @@ -151,6 +155,7 @@ int arg_noprofile = 0; // use default.profile if none other found/specified int arg_memory_deny_write_execute = 0; // block writable and executable memory int arg_notv = 0; // --notv int arg_nodvd = 0; // --nodvd +int arg_notpm = 0; // --notpm int arg_nou2f = 0; // --nou2f int arg_noinput = 0; // --noinput int arg_deterministic_exit_code = 0; // always exit with first child's exit status @@ -420,7 +425,6 @@ static void run_cmd_and_exit(int i, int argc, char **argv) { exit_err_feature("x11"); } #endif -#ifdef HAVE_NETWORK else if (strcmp(argv[i], "--nettrace") == 0) { if (checkcfg(CFG_NETWORK)) { if (getuid() != 0) { @@ -524,8 +528,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) { exit(0); } - - +#ifdef HAVE_NETWORK else if (strncmp(argv[i], "--bandwidth=", 12) == 0) { if (checkcfg(CFG_NETWORK)) { logargs(argc, argv); @@ -1056,8 +1059,6 @@ static int check_postexec(const char *list) { int main(int argc, char **argv, char **envp) { int i; int prog_index = -1; // index in argv where the program command starts - int lockfd_network = -1; - int lockfd_directory = -1; int custom_profile = 0; // custom profile loaded int arg_caps_cmdline = 0; // caps requested on command line (used to break out of --chroot) char **ptr; @@ -1166,19 +1167,13 @@ int main(int argc, char **argv, char **envp) { #endif // build /run/firejail directory structure - preproc_build_firejail_dir(); + preproc_build_firejail_dir_unlocked(); + preproc_lock_firejail_dir(); + preproc_build_firejail_dir_locked(); const char *container_name = env_get("container"); - if (!container_name || strcmp(container_name, "firejail")) { - lockfd_directory = open(RUN_DIRECTORY_LOCK_FILE, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR); - if (lockfd_directory != -1) { - int rv = fchown(lockfd_directory, 0, 0); - (void) rv; - flock(lockfd_directory, LOCK_EX); - } + if (!container_name || strcmp(container_name, "firejail")) preproc_clean_run(); - flock(lockfd_directory, LOCK_UN); - close(lockfd_directory); - } + preproc_unlock_firejail_dir(); delete_run_files(getpid()); atexit(clear_atexit); @@ -1502,6 +1497,20 @@ int main(int argc, char **argv, char **envp) { else exit_err_feature("seccomp"); } +#ifdef HAVE_LANDLOCK + else if (strncmp(argv[i], "--landlock.enforce", 18) == 0) + arg_landlock_enforce = 1; + else if (strncmp(argv[i], "--landlock.fs.read=", 19) == 0) + ll_add_profile(LL_FS_READ, argv[i] + 19); + else if (strncmp(argv[i], "--landlock.fs.write=", 20) == 0) + ll_add_profile(LL_FS_WRITE, argv[i] + 20); + else if (strncmp(argv[i], "--landlock.fs.makeipc=", 22) == 0) + ll_add_profile(LL_FS_MAKEIPC, argv[i] + 22); + else if (strncmp(argv[i], "--landlock.fs.makedev=", 22) == 0) + ll_add_profile(LL_FS_MAKEDEV, argv[i] + 22); + else if (strncmp(argv[i], "--landlock.fs.execute=", 22) == 0) + ll_add_profile(LL_FS_EXEC, argv[i] + 22); +#endif else if (strcmp(argv[i], "--memory-deny-write-execute") == 0) { if (checkcfg(CFG_SECCOMP)) arg_memory_deny_write_execute = 1; @@ -1574,7 +1583,7 @@ int main(int argc, char **argv, char **envp) { arg_trace = 1; else if (strncmp(argv[i], "--trace=", 8) == 0) { arg_trace = 1; - arg_tracefile = argv[i] + 8; + arg_tracefile = expand_macros(argv[i] + 8); if (*arg_tracefile == '\0') { fprintf(stderr, "Error: invalid trace option\n"); exit(1); @@ -1584,13 +1593,6 @@ int main(int argc, char **argv, char **envp) { fprintf(stderr, "Error: invalid file name %s\n", arg_tracefile); exit(1); } - // if the filename starts with ~, expand the home directory - if (*arg_tracefile == '~') { - char *tmp; - if (asprintf(&tmp, "%s%s", cfg.homedir, arg_tracefile + 1) == -1) - errExit("asprintf"); - arg_tracefile = tmp; - } } else if (strcmp(argv[i], "--tracelog") == 0) { if (checkcfg(CFG_TRACELOG)) @@ -1821,33 +1823,6 @@ int main(int argc, char **argv, char **envp) { else exit_err_feature("overlayfs"); } -#endif -#ifdef HAVE_FIRETUNNEL - else if (strcmp(argv[i], "--tunnel") == 0) { - // try to connect to the default client side of the tunnel - // if this fails, try the default server side of the tunnel - if (access("/run/firetunnel/ftc", R_OK) == 0) - profile_read("/run/firetunnel/ftc"); - else if (access("/run/firetunnel/fts", R_OK) == 0) - profile_read("/run/firetunnel/fts"); - else { - fprintf(stderr, "Error: no default firetunnel found, please specify it using --tunnel=devname option\n"); - exit(1); - } - } - else if (strncmp(argv[i], "--tunnel=", 9) == 0) { - char *fname; - - if (asprintf(&fname, "/run/firetunnel/%s", argv[i] + 9) == -1) - errExit("asprintf"); - invalid_filename(fname, 0); // no globbing - if (access(fname, R_OK) == 0) - profile_read(fname); - else { - fprintf(stderr, "Error: tunnel not found\n"); - exit(1); - } - } #endif else if (strncmp(argv[i], "--include=", 10) == 0) { char *ppath = expand_macros(argv[i] + 10); @@ -1955,20 +1930,13 @@ int main(int argc, char **argv, char **envp) { } // extract chroot dirname - cfg.chrootdir = argv[i] + 9; + cfg.chrootdir = expand_macros(argv[i] + 9); if (*cfg.chrootdir == '\0') { fprintf(stderr, "Error: invalid chroot option\n"); exit(1); } invalid_filename(cfg.chrootdir, 0); // no globbing - // if the directory starts with ~, expand the home directory - if (*cfg.chrootdir == '~') { - char *tmp; - if (asprintf(&tmp, "%s%s", cfg.homedir, cfg.chrootdir + 1) == -1) - errExit("asprintf"); - cfg.chrootdir = tmp; - } // check chroot directory fs_check_chroot_dir(); } @@ -2242,6 +2210,8 @@ int main(int argc, char **argv, char **envp) { arg_notv = 1; else if (strcmp(argv[i], "--nodvd") == 0) arg_nodvd = 1; + else if (strcmp(argv[i], "--notpm") == 0) + arg_notpm = 1; else if (strcmp(argv[i], "--nou2f") == 0) arg_nou2f = 1; else if (strcmp(argv[i], "--noinput") == 0) @@ -2750,16 +2720,7 @@ int main(int argc, char **argv, char **envp) { else if (strncmp(argv[i], "--netfilter=", 12) == 0) { if (checkcfg(CFG_NETWORK)) { arg_netfilter = 1; - arg_netfilter_file = argv[i] + 12; - - // expand tilde - if (*arg_netfilter_file == '~') { - char *tmp; - if (asprintf(&tmp, "%s%s", cfg.homedir, arg_netfilter_file + 1) == -1) - errExit("asprintf"); - arg_netfilter_file = tmp; - } - + arg_netfilter_file = expand_macros(argv[i] + 12); check_netfilter_file(arg_netfilter_file); } else @@ -2769,16 +2730,7 @@ int main(int argc, char **argv, char **envp) { else if (strncmp(argv[i], "--netfilter6=", 13) == 0) { if (checkcfg(CFG_NETWORK)) { arg_netfilter6 = 1; - arg_netfilter6_file = argv[i] + 13; - - // expand tilde - if (*arg_netfilter6_file == '~') { - char *tmp; - if (asprintf(&tmp, "%s%s", cfg.homedir, arg_netfilter6_file + 1) == -1) - errExit("asprintf"); - arg_netfilter6_file = tmp; - } - + arg_netfilter6_file = expand_macros(argv[i] + 13); check_netfilter_file(arg_netfilter6_file); } else @@ -2806,7 +2758,7 @@ int main(int argc, char **argv, char **envp) { // already handled } else if (strncmp(argv[i], "--shell=", 8) == 0) { - fprintf(stderr, "Warning: --shell feature has been deprecated\n"); + fprintf(stderr, "Error: \"shell none\" is done by default now; the \"shell\" command has been removed\n"); exit(1); } else if (strcmp(argv[i], "-c") == 0) { @@ -3004,10 +2956,10 @@ int main(int argc, char **argv, char **envp) { } EUID_ASSERT(); - // Note: Only attempt to print non-debug information to stdout after - // all profiles have been loaded (because a profile may set arg_quiet) + // Note: Only attempt to print non-debug information after all profiles + // have been loaded (because a profile may set arg_quiet) if (!arg_quiet) - print_version(); + print_version(stderr); // block X11 sockets if (arg_x11_block) @@ -3035,12 +2987,7 @@ int main(int argc, char **argv, char **envp) { // check and assign an IP address - for macvlan it will be done again in the sandbox! if (any_bridge_configured()) { EUID_ROOT(); - lockfd_network = open(RUN_NETWORK_LOCK_FILE, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR); - if (lockfd_network != -1) { - int rv = fchown(lockfd_network, 0, 0); - (void) rv; - flock(lockfd_network, LOCK_EX); - } + preproc_lock_firejail_network_dir(); if (cfg.bridge0.configured && cfg.bridge0.arg_ip_none == 0) check_network(&cfg.bridge0); @@ -3069,21 +3016,13 @@ int main(int argc, char **argv, char **envp) { // set name and x11 run files EUID_ROOT(); - lockfd_directory = open(RUN_DIRECTORY_LOCK_FILE, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR); - if (lockfd_directory != -1) { - int rv = fchown(lockfd_directory, 0, 0); - (void) rv; - flock(lockfd_directory, LOCK_EX); - } + preproc_lock_firejail_dir(); if (cfg.name) set_name_run_file(sandbox_pid); int display = x11_display(); if (display > 0) set_x11_run_file(sandbox_pid, display); - if (lockfd_directory != -1) { - flock(lockfd_directory, LOCK_UN); - close(lockfd_directory); - } + preproc_unlock_firejail_dir(); EUID_USER(); #ifdef HAVE_DBUSPROXY @@ -3217,13 +3156,18 @@ int main(int argc, char **argv, char **envp) { gid_t g; if (!arg_nogroups || !check_can_drop_all_groups()) { - // add audio group + // add audio groups if (!arg_nosound) { g = get_group_id("audio"); if (g) { sprintf(ptr, "%d %d 1\n", g, g); ptr += strlen(ptr); } + g = get_group_id("pipewire"); + if (g) { + sprintf(ptr, "%d %d 1\n", g, g); + ptr += strlen(ptr); + } } // add video group @@ -3316,10 +3260,7 @@ int main(int argc, char **argv, char **envp) { close(parent_to_child_fds[1]); EUID_ROOT(); - if (lockfd_network != -1) { - flock(lockfd_network, LOCK_UN); - close(lockfd_network); - } + preproc_unlock_firejail_network_dir(); EUID_USER(); // lock netfilter firewall diff --git a/src/firejail/mountinfo.c b/src/firejail/mountinfo.c index c9be158da..3734d48a9 100644 --- a/src/firejail/mountinfo.c +++ b/src/firejail/mountinfo.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/netfilter.c b/src/firejail/netfilter.c index 458fb0dd1..fc3ca924b 100644 --- a/src/firejail/netfilter.c +++ b/src/firejail/netfilter.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -65,7 +65,7 @@ void netfilter_netlock(pid_t pid) { umask(orig_umask); char *cmd; - if (asprintf(&cmd, "%s -e \"%s/firejail/fnettrace --tail --log=%s\"", terminal, LIBDIR, flog) == -1) + if (asprintf(&cmd, "%s -e \"%s/firejail/fnetlock --tail --log=%s\"", terminal, LIBDIR, flog) == -1) errExit("asprintf"); int rv = system(cmd); (void) rv; @@ -74,7 +74,7 @@ void netfilter_netlock(pid_t pid) { } char *cmd; - if (asprintf(&cmd, "%s/firejail/fnettrace --netfilter --log=%s", LIBDIR, flog) == -1) + if (asprintf(&cmd, "%s/firejail/fnetlock --log=%s", LIBDIR, flog) == -1) errExit("asprintf"); free(flog); diff --git a/src/firejail/netns.c b/src/firejail/netns.c index 2a4624695..826869021 100644 --- a/src/firejail/netns.c +++ b/src/firejail/netns.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Firejail Authors + * Copyright (C) 2020-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/network.c b/src/firejail/network.c index 3da51e195..b7fc2b356 100644 --- a/src/firejail/network.c +++ b/src/firejail/network.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/network_main.c b/src/firejail/network_main.c index 78697b010..758966b2c 100644 --- a/src/firejail/network_main.c +++ b/src/firejail/network_main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/no_sandbox.c b/src/firejail/no_sandbox.c index 9c5e3ee58..d0abda6c3 100644 --- a/src/firejail/no_sandbox.c +++ b/src/firejail/no_sandbox.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/oom.c b/src/firejail/oom.c index 482fc0ad0..a685f4bed 100644 --- a/src/firejail/oom.c +++ b/src/firejail/oom.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/output.c b/src/firejail/output.c index 687aaba9c..43f96c9da 100644 --- a/src/firejail/output.c +++ b/src/firejail/output.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/paths.c b/src/firejail/paths.c index 6bc6230f0..8098095d5 100644 --- a/src/firejail/paths.c +++ b/src/firejail/paths.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -47,6 +47,16 @@ static void init_paths(void) { errExit("calloc"); memset(paths, 0, path_cnt * sizeof(char *)); // get rid of false positive error from GCC static analyzer + // lots of distros set /bin as a symlink to /usr/bin; + // we remove /bin form the path to speed up path-based operations such as blacklist + int bin_symlink = 0; + p = realpath("/bin", NULL); + if (p) { + if (strcmp(p, "/usr/bin") == 0) + bin_symlink = 1; + } + free(p); + // fill in 'paths' with pointers to elements of 'path' unsigned int i = 0, j; unsigned int len; @@ -62,19 +72,36 @@ static void init_paths(void) { if (len == 0) goto skip; + //deal with /bin - /usr/bin symlink + if (bin_symlink > 0) { + if (strcmp(elt, "/bin") == 0 || strcmp(elt, "/usr/bin") == 0) + bin_symlink++; + if (bin_symlink == 3) { + bin_symlink = 0; + if (arg_debug) + printf("...skip path %s\n", elt); + goto skip; + } + } + // filter out duplicate entries for (j = 0; j < i; j++) if (strcmp(elt, paths[j]) == 0) goto skip; + if (arg_debug) + printf("Add path entry %s\n", elt); paths[i++] = elt; if (len > longest_path_elt) longest_path_elt = len; - skip:; +skip:; } - assert(paths[i] == NULL); + path_cnt = i; + if (arg_debug) + printf("Number of path entries: %u\n", path_cnt); + // path_cnt may be too big now, if entries were skipped above path_cnt = i+1; } diff --git a/src/firejail/preproc.c b/src/firejail/preproc.c index e0c11a005..e0ca2141f 100644 --- a/src/firejail/preproc.c +++ b/src/firejail/preproc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -18,15 +18,101 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "firejail.h" +#include #include #include #include #include +#include static int tmpfs_mounted = 0; +static void preproc_lock_file(const char *path, int *lockfd_ptr) { + assert(path != NULL); + assert(lockfd_ptr != NULL); + + long pid = (long)getpid(); + if (arg_debug) + fprintf(stderr, "pid=%ld: locking %s ...\n", pid, path); + + if (*lockfd_ptr != -1) { + if (arg_debug) + fprintf(stderr, "pid=%ld: already locked %s\n", pid, path); + return; + } + + int lockfd = open(path, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR); + if (lockfd == -1) { + fprintf(stderr, "Error: cannot create a lockfile at %s\n", path); + errExit("open"); + } + + if (fchown(lockfd, 0, 0) == -1) { + fprintf(stderr, "Error: cannot chown root:root %s\n", path); + errExit("fchown"); + } + + if (flock(lockfd, LOCK_EX) == -1) { + fprintf(stderr, "Error: cannot lock %s\n", path); + errExit("flock"); + } + + *lockfd_ptr = lockfd; + if (arg_debug) + fprintf(stderr, "pid=%ld: locked %s\n", pid, path); +} + +static void preproc_unlock_file(const char *path, int *lockfd_ptr) { + assert(path != NULL); + assert(lockfd_ptr != NULL); + + long pid = (long)getpid(); + if (arg_debug) + fprintf(stderr, "pid=%ld: unlocking %s ...\n", pid, path); + + int lockfd = *lockfd_ptr; + if (lockfd == -1) { + if (arg_debug) + fprintf(stderr, "pid=%ld: already unlocked %s\n", pid, path); + return; + } + + if (flock(lockfd, LOCK_UN) == -1) { + fprintf(stderr, "Error: cannot unlock %s\n", path); + errExit("flock"); + } + + if (close(lockfd) == -1) { + fprintf(stderr, "Error: cannot close %s\n", path); + errExit("close"); + } + + *lockfd_ptr = -1; + if (arg_debug) + fprintf(stderr, "pid=%ld: unlocked %s\n", pid, path); +} + +void preproc_lock_firejail_dir(void) { + preproc_lock_file(RUN_DIRECTORY_LOCK_FILE, &lockfd_directory); +} + +void preproc_unlock_firejail_dir(void) { + preproc_unlock_file(RUN_DIRECTORY_LOCK_FILE, &lockfd_directory); +} + +void preproc_lock_firejail_network_dir(void) { + preproc_lock_file(RUN_NETWORK_LOCK_FILE, &lockfd_network); +} + +void preproc_unlock_firejail_network_dir(void) { + preproc_unlock_file(RUN_NETWORK_LOCK_FILE, &lockfd_network); +} + // build /run/firejail directory -void preproc_build_firejail_dir(void) { +// +// Note: This creates the base directory of the rundir lockfile; +// it should be called before preproc_lock_firejail_dir(). +void preproc_build_firejail_dir_unlocked(void) { struct stat s; // CentOS 6 doesn't have /run directory @@ -35,6 +121,14 @@ void preproc_build_firejail_dir(void) { } create_empty_dir_as_root(RUN_FIREJAIL_DIR, 0755); +} + +// build directory hierarchy under /run/firejail +// +// Note: Remounts have timing hazards. This function should +// only be called after acquiring the directory lock via +// preproc_lock_firejail_dir(). +void preproc_build_firejail_dir_locked(void) { create_empty_dir_as_root(RUN_FIREJAIL_NETWORK_DIR, 0755); create_empty_dir_as_root(RUN_FIREJAIL_BANDWIDTH_DIR, 0755); create_empty_dir_as_root(RUN_FIREJAIL_NAME_DIR, 0755); diff --git a/src/firejail/process.c b/src/firejail/process.c index 7faa2221a..adec2a2ff 100644 --- a/src/firejail/process.c +++ b/src/firejail/process.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/profile.c b/src/firejail/profile.c index 07449f646..1bb008f5f 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -371,8 +371,8 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { arg_caps_drop_all = 1; return 0; } - else if (strcmp(ptr, "shell none") == 0) { - fprintf(stderr, "Warning: \"shell none\" command in the profile file is done by default; the command will be deprecated\n"); + else if (strcmp(ptr, "shell ") == 0) { + fprintf(stderr, "Warning: \"shell none\" is done by default now; the \"shell\" command has been removed\n"); return 0; } else if (strcmp(ptr, "tracelog") == 0) { @@ -484,7 +484,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { #endif return 0; } - else if (strncmp("dbus-user ", ptr, 10) == 0) { + else if (strncmp(ptr, "dbus-user ", 10) == 0) { #ifdef HAVE_DBUSPROXY ptr += 10; if (strcmp("filter", ptr) == 0) { @@ -551,7 +551,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { #endif return 1; } - else if (strncmp("dbus-system ", ptr, 12) == 0) { + else if (strncmp(ptr, "dbus-system ", 12) == 0) { #ifdef HAVE_DBUSPROXY ptr += 12; if (strcmp("filter", ptr) == 0) { @@ -618,6 +618,10 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { #endif return 1; } + else if (strcmp(ptr, "notpm") == 0) { + arg_notpm = 1; + return 0; + } else if (strcmp(ptr, "nou2f") == 0) { arg_nou2f = 1; return 0; @@ -635,9 +639,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { #ifdef HAVE_NETWORK if (checkcfg(CFG_NETWORK)) { arg_netfilter = 1; - arg_netfilter_file = strdup(ptr + 10); - if (!arg_netfilter_file) - errExit("strdup"); + arg_netfilter_file = expand_macros(ptr + 10); check_netfilter_file(arg_netfilter_file); } else @@ -649,9 +651,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { #ifdef HAVE_NETWORK if (checkcfg(CFG_NETWORK)) { arg_netfilter6 = 1; - arg_netfilter6_file = strdup(ptr + 11); - if (!arg_netfilter6_file) - errExit("strdup"); + arg_netfilter6_file = expand_macros(ptr + 11); check_netfilter_file(arg_netfilter6_file); } else @@ -1077,6 +1077,37 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { return 0; } +//#ifdef HAVE_LANDLOCK +// landlock-common.inc is included by default.profile, so the entries of the +// former should be processed or ignored instead of aborting. +// Note that all landlock functions are empty when building without landlock +// support. + if (strncmp(ptr, "landlock.enforce", 16) == 0) { + arg_landlock_enforce = 1; + return 0; + } + if (strncmp(ptr, "landlock.fs.read ", 17) == 0) { + ll_add_profile(LL_FS_READ, ptr + 17); + return 0; + } + if (strncmp(ptr, "landlock.fs.write ", 18) == 0) { + ll_add_profile(LL_FS_WRITE, ptr + 18); + return 0; + } + if (strncmp(ptr, "landlock.fs.makeipc ", 20) == 0) { + ll_add_profile(LL_FS_MAKEIPC, ptr + 20); + return 0; + } + if (strncmp(ptr, "landlock.fs.makedev ", 20) == 0) { + ll_add_profile(LL_FS_MAKEDEV, ptr + 20); + return 0; + } + if (strncmp(ptr, "landlock.fs.execute ", 20) == 0) { + ll_add_profile(LL_FS_EXEC, ptr + 20); + return 0; + } +//#endif + // memory deny write&execute if (strcmp(ptr, "memory-deny-write-execute") == 0) { if (checkcfg(CFG_SECCOMP)) @@ -1901,8 +1932,7 @@ void profile_read(const char *fname) { fclose(fp); } -char *profile_list_normalize(char *list) -{ +char *profile_list_normalize(char *list) { /* Remove redundant commas. * * As result is always shorter than original, diff --git a/src/firejail/protocol.c b/src/firejail/protocol.c index 91d63b505..788f8f4eb 100644 --- a/src/firejail/protocol.c +++ b/src/firejail/protocol.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/pulseaudio.c b/src/firejail/pulseaudio.c index ce20e1098..fa5b5d92f 100644 --- a/src/firejail/pulseaudio.c +++ b/src/firejail/pulseaudio.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/restrict_users.c b/src/firejail/restrict_users.c index c5c66549d..e258f6204 100644 --- a/src/firejail/restrict_users.c +++ b/src/firejail/restrict_users.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -210,9 +210,9 @@ static void sanitize_passwd(void) { goto errout; // process uid - int uid; + int uid = -1; int rv = sscanf(ptr, "%d:", &uid); - if (rv == 0 || uid < 0) + if (rv != 1 || uid < 0) goto errout; assert(uid_min); if (uid < uid_min || uid == 65534) { // on Debian platforms user nobody is 65534 @@ -349,9 +349,9 @@ static void sanitize_group(void) { goto errout; // process uid - int gid; + int gid = -1; int rv = sscanf(ptr, "%d:", &gid); - if (rv == 0 || gid < 0) + if (rv != 1 || gid < 0) goto errout; assert(gid_min); if (gid < gid_min || gid == 65534) { // on Debian platforms 65534 is group nogroup diff --git a/src/firejail/restricted_shell.c b/src/firejail/restricted_shell.c index 79e0bd9df..f872c673b 100644 --- a/src/firejail/restricted_shell.c +++ b/src/firejail/restricted_shell.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/rlimit.c b/src/firejail/rlimit.c index d583cbefa..30943a631 100644 --- a/src/firejail/rlimit.c +++ b/src/firejail/rlimit.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/run_files.c b/src/firejail/run_files.c index a20085294..4bd0ba459 100644 --- a/src/firejail/run_files.c +++ b/src/firejail/run_files.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -122,6 +122,7 @@ void set_name_run_file(pid_t pid) { // mode and ownership SET_PERMS_STREAM(fp, 0, 0, 0644); fclose(fp); + free(fname); } @@ -141,6 +142,7 @@ void set_x11_run_file(pid_t pid, int display) { // mode and ownership SET_PERMS_STREAM(fp, 0, 0, 0644); fclose(fp); + free(fname); } void set_profile_run_file(pid_t pid, const char *fname) { diff --git a/src/firejail/run_symlink.c b/src/firejail/run_symlink.c index dc247280b..8a71044a4 100644 --- a/src/firejail/run_symlink.c +++ b/src/firejail/run_symlink.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c index 538f5be67..57c90d489 100644 --- a/src/firejail/sandbox.c +++ b/src/firejail/sandbox.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -516,6 +516,21 @@ void start_application(int no_sandbox, int fd, char *set_sandbox_status) { printf("LD_PRELOAD=%s\n", getenv("LD_PRELOAD")); } +#ifdef HAVE_LANDLOCK + //**************************** + // Configure Landlock + //**************************** + if (arg_landlock_enforce && ll_restrict(0)) { + // It isn't safe to continue if Landlock self-restriction was + // enabled and the "landlock_restrict_self" syscall has failed. + fprintf(stderr, "Error: ll_restrict() failed, exiting...\n"); + exit(1); + } else { + if (arg_debug) + fprintf(stderr, "Not enforcing Landlock\n"); + } +#endif + if (just_run_the_shell) { char *arg[2]; arg[0] = cfg.usershell; @@ -878,7 +893,8 @@ int sandbox(void* sandbox_arg) { //**************************** // appimage //**************************** - appimage_mount(); + if (arg_appimage) + appimage_mount(); //**************************** // private mode @@ -1085,6 +1101,9 @@ int sandbox(void* sandbox_arg) { if (arg_nodvd) fs_dev_disable_dvd(); + if (arg_notpm) + fs_dev_disable_tpm(); + if (arg_nou2f) fs_dev_disable_u2f(); diff --git a/src/firejail/sbox.c b/src/firejail/sbox.c index 59b74ec5c..2a9268f87 100644 --- a/src/firejail/sbox.c +++ b/src/firejail/sbox.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/seccomp.c b/src/firejail/seccomp.c index 15a707d3f..5e554bddc 100644 --- a/src/firejail/seccomp.c +++ b/src/firejail/seccomp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/selinux.c b/src/firejail/selinux.c index 08f3b3122..198308107 100644 --- a/src/firejail/selinux.c +++ b/src/firejail/selinux.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ /* * Copyright (C) 2009-2020 The systemd Authors - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project, from systemd selinux-util.c */ diff --git a/src/firejail/shutdown.c b/src/firejail/shutdown.c index 67b605acd..f49e6aaa3 100644 --- a/src/firejail/shutdown.c +++ b/src/firejail/shutdown.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firejail/usage.c b/src/firejail/usage.c index e8758c807..01a7330fd 100644 --- a/src/firejail/usage.c +++ b/src/firejail/usage.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -133,6 +133,14 @@ static const char *const usage_str = " --keep-fd - inherit open file descriptors to sandbox.\n" " --keep-shell-rc - do not copy shell rc files from /etc/skel\n" " --keep-var-tmp - /var/tmp directory is untouched.\n" +#ifdef HAVE_LANDLOCK + " --landlock.enforce - enforce the Landlock ruleset.\n" + " --landlock.fs.read=path - add a read access rule for the path to the Landlock ruleset.\n" + " --landlock.fs.write=path - add a write access rule for the path to the Landlock ruleset.\n" + " --landlock.fs.makeipc=path - add an access rule for the path to the Landlock ruleset for creating named pipes and sockets.\n" + " --landlock.fs.makedev=path - add an access rule for the path to the Landlock ruleset for creating block/char devices.\n" + " --landlock.fs.execute=path - add an execute access rule for the path to the Landlock ruleset.\n" +#endif " --list - list all sandboxes.\n" #ifdef HAVE_FILE_TRANSFER " --ls=name|pid dir_or_filename - list files in sandbox container.\n" @@ -181,8 +189,8 @@ static const char *const usage_str = " --noroot - install a user namespace with only the current user.\n" #endif " --nosound - disable sound system.\n" - " --noautopulse - disable automatic ~/.config/pulse init.\n" " --novideo - disable video devices.\n" + " --notpm - disable TPM devices.\n" " --nou2f - disable U2F devices.\n" " --nowhitelist=filename - disable whitelist for file or directory.\n" " --oom=value - configure OutOfMemory killer for the sandbox\n" @@ -313,16 +321,16 @@ static const char *const usage_str = "License GPL version 2 or later\n" "Homepage: https://firejail.wordpress.com\n"; -void print_version(void) { - printf("firejail version %s\n\n", VERSION); +void print_version(FILE *stream) { + fprintf(stream, "firejail version %s\n\n", VERSION); } void print_version_full(void) { - print_version(); + print_version(stdout); print_compiletime_support(); } void usage(void) { - print_version(); + print_version(stdout); puts(usage_str); } diff --git a/src/firejail/util.c b/src/firejail/util.c index 87b771867..5d7c244b1 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -207,6 +207,8 @@ static void clean_supplementary_groups(gid_t gid) { if (!arg_nosound) { copy_group_ifcont("audio", groups, ngroups, new_groups, &new_ngroups, MAX_GROUPS); + copy_group_ifcont("pipewire", groups, ngroups, + new_groups, &new_ngroups, MAX_GROUPS); } if (!arg_novideo) { @@ -1336,6 +1338,13 @@ void close_all(int *keep_list, size_t sz) { if (keep) continue; +#ifdef HAVE_LANDLOCK + // Don't close the file descriptor of the Landlock ruleset; it + // will be automatically closed by the "ll_restrict" wrapper + // function. + if (fd == ll_get_fd()) + continue; +#endif close(fd); } closedir(dir); @@ -1383,6 +1392,7 @@ void enter_network_namespace(pid_t pid) { fprintf(stderr, "Error: the sandbox doesn't use a new network namespace\n"); exit(1); } + free(name); // join the namespace EUID_ROOT(); @@ -1474,7 +1484,7 @@ int ascii_isxdigit(unsigned char c) { return ret; } -// Note: Keep this in sync with NAME VALIDATION in src/man/firejail.txt. +// Note: Keep this in sync with NAME VALIDATION in src/man/firejail.1.in. // // Allow only ASCII letters, digits and a few special characters; names with // only numbers are rejected; spaces and control characters are rejected. diff --git a/src/firejail/x11.c b/src/firejail/x11.c index 2eaa9bde5..806089ab7 100644 --- a/src/firejail/x11.c +++ b/src/firejail/x11.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/Makefile b/src/firemon/Makefile index 649bad0af..02e3b6eed 100644 --- a/src/firemon/Makefile +++ b/src/firemon/Makefile @@ -2,11 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/firemon -PROG = firemon +MOD = firemon +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/pid.h EXTRA_OBJS = ../lib/common.o ../lib/pid.o include $(ROOT)/src/prog.mk diff --git a/src/firemon/apparmor.c b/src/firemon/apparmor.c index 462853f02..54afc3b35 100644 --- a/src/firemon/apparmor.c +++ b/src/firemon/apparmor.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/arp.c b/src/firemon/arp.c index 863d551f8..4eb0e74f5 100644 --- a/src/firemon/arp.c +++ b/src/firemon/arp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/caps.c b/src/firemon/caps.c index 5a73cc37e..534e31c12 100644 --- a/src/firemon/caps.c +++ b/src/firemon/caps.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/cpu.c b/src/firemon/cpu.c index b5e824933..acfaefe16 100644 --- a/src/firemon/cpu.c +++ b/src/firemon/cpu.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/firemon.c b/src/firemon/firemon.c index 958fa1b03..dc69e6b36 100644 --- a/src/firemon/firemon.c +++ b/src/firemon/firemon.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/firemon.h b/src/firemon/firemon.h index be83352bb..5742c001d 100644 --- a/src/firemon/firemon.h +++ b/src/firemon/firemon.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/list.c b/src/firemon/list.c index d068e653c..c27735ea6 100644 --- a/src/firemon/list.c +++ b/src/firemon/list.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/netstats.c b/src/firemon/netstats.c index 6bf013d9d..e70174b1e 100644 --- a/src/firemon/netstats.c +++ b/src/firemon/netstats.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -152,10 +152,12 @@ static void print_proc(int index, int itv, int col) { struct stat s; if (stat(name, &s) == -1) { // the sandbox doesn't have a --net= option, don't print + free(name); if (cmd) free(cmd); return; } + free(name); // pid char pidstr[11]; diff --git a/src/firemon/procevent.c b/src/firemon/procevent.c index 77739c1f3..1a6f23919 100644 --- a/src/firemon/procevent.c +++ b/src/firemon/procevent.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -185,7 +185,7 @@ static int procevent_netlink_setup(void) { if (getsockopt(sock, SOL_SOCKET, SO_RCVBUF, &bsize, &blen) == -1) fprintf(stderr, "Error: cannot read rx buffer size\n"); else - printf("rx buffer size %d\n", bsize / 2); // the value returned is duble the real one, see man 7 socket + printf("rx buffer size %d\n", bsize / 2); // the value returned is double the real one, see man 7 socket } // send monitoring message @@ -301,7 +301,9 @@ static void __attribute__((noreturn)) procevent_monitor(const int sock, pid_t my proc_ev = (struct proc_event *)cn_msg->data; pid_t pid = 0; pid_t child = 0; + char *new_comm = NULL; int remove_pid = 0; + int nodisplay = 0; switch (proc_ev->what) { case PROC_EVENT_FORK: #ifdef DEBUG_PRCTL @@ -322,6 +324,7 @@ static void __attribute__((noreturn)) procevent_monitor(const int sock, pid_t my pids[child].parent = pid; } sprintf(lineptr, " fork"); + nodisplay = 1; break; case PROC_EVENT_EXEC: pid = proc_ev->event_data.exec.process_tgid; @@ -363,6 +366,7 @@ static void __attribute__((noreturn)) procevent_monitor(const int sock, pid_t my sprintf(lineptr, " uid (%d:%d)", proc_ev->event_data.id.r.ruid, proc_ev->event_data.id.e.euid); + nodisplay = 1; break; case PROC_EVENT_GID: @@ -379,6 +383,7 @@ static void __attribute__((noreturn)) procevent_monitor(const int sock, pid_t my sprintf(lineptr, " gid (%d:%d)", proc_ev->event_data.id.r.rgid, proc_ev->event_data.id.e.egid); + nodisplay = 1; break; @@ -391,6 +396,44 @@ static void __attribute__((noreturn)) procevent_monitor(const int sock, pid_t my sprintf(lineptr, " sid "); break; +// Note: PROC_EVENT_COREDUMP only exists since Linux 3.10 (see #6414). +#ifdef PROC_EVENT_COREDUMP + case PROC_EVENT_COREDUMP: + pid = proc_ev->event_data.coredump.process_tgid; +#ifdef DEBUG_PRCTL + printf("%s: %d, event coredump, pid %d\n", __FUNCTION__, __LINE__, pid); +#endif + sprintf(lineptr, " coredump "); + break; +#endif /* PROC_EVENT_COREDUMP */ + + case PROC_EVENT_COMM: + pid = proc_ev->event_data.comm.process_tgid; +#ifdef DEBUG_PRCTL + printf("%s: %d, event comm, pid %d\n", __FUNCTION__, __LINE__, pid); +#endif + if (proc_ev->event_data.comm.process_pid != + proc_ev->event_data.comm.process_tgid) + continue; // this is a thread, not a process + + if (pids[pid].level == 1 || + pids[pids[pid].parent].level == 1) { + sprintf(lineptr, "\n"); + continue; + } + else + sprintf(lineptr, " comm %s", proc_ev->event_data.comm.comm); + nodisplay = 1; + break; + + case PROC_EVENT_PTRACE: + pid = proc_ev->event_data.ptrace.process_tgid; +#ifdef DEBUG_PRCTL + printf("%s: %d, event ptrace, pid %d\n", __FUNCTION__, __LINE__, pid); +#endif + sprintf(lineptr, " ptrace "); + break; + default: #ifdef DEBUG_PRCTL printf("%s: %d, event unknown\n", __FUNCTION__, __LINE__); @@ -449,7 +492,7 @@ static void __attribute__((noreturn)) procevent_monitor(const int sock, pid_t my if (!cmd) { cmd = pid_proc_cmdline(pid); } - if (cmd == NULL) + if (cmd == NULL || nodisplay) sprintf(lineptr, "\n"); else { sprintf(lineptr, " %s\n", cmd); @@ -473,15 +516,12 @@ static void __attribute__((noreturn)) procevent_monitor(const int sock, pid_t my } // print forked child - if (child) { - cmd = pid_proc_cmdline(child); - if (cmd) { - printf("\tchild %u %s\n", child, cmd); - free(cmd); - } - else - printf("\tchild %u\n", child); - } + if (child) + printf("\tchild %u\n", child); + + // print new comm + if (new_comm) + printf("\tnew comm %s\n", new_comm); // on uid events the uid is changing if (proc_ev->what == PROC_EVENT_UID) { diff --git a/src/firemon/route.c b/src/firemon/route.c index a8415616e..cb809c69e 100644 --- a/src/firemon/route.c +++ b/src/firemon/route.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/seccomp.c b/src/firemon/seccomp.c index 865ed138e..ae0cd941a 100644 --- a/src/firemon/seccomp.c +++ b/src/firemon/seccomp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/top.c b/src/firemon/top.c index c70bc9424..912de795e 100644 --- a/src/firemon/top.c +++ b/src/firemon/top.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/tree.c b/src/firemon/tree.c index 85e8d591a..e5e67bccb 100644 --- a/src/firemon/tree.c +++ b/src/firemon/tree.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/usage.c b/src/firemon/usage.c index afd2b552a..a212cca10 100644 --- a/src/firemon/usage.c +++ b/src/firemon/usage.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/firemon/x11.c b/src/firemon/x11.c index 01a26bb8a..42f192db2 100644 --- a/src/firemon/x11.c +++ b/src/firemon/x11.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fldd/Makefile b/src/fldd/Makefile index 00173d18e..3e48b43ab 100644 --- a/src/fldd/Makefile +++ b/src/fldd/Makefile @@ -2,11 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fldd -PROG = fldd +MOD = fldd +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/syscall.h ../include/ldd_utils.h EXTRA_OBJS = ../lib/common.o ../lib/ldd_utils.o include $(ROOT)/src/prog.mk diff --git a/src/fldd/main.c b/src/fldd/main.c index c28cad72e..64af11788 100644 --- a/src/fldd/main.c +++ b/src/fldd/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnet/Makefile b/src/fnet/Makefile index 04a200951..dfeefdc47 100644 --- a/src/fnet/Makefile +++ b/src/fnet/Makefile @@ -2,11 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fnet -PROG = fnet +MOD = fnet +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/libnetlink.h EXTRA_OBJS = ../lib/common.o ../lib/libnetlink.o include $(ROOT)/src/prog.mk diff --git a/src/fnet/arp.c b/src/fnet/arp.c index 1e90dafa3..79ab36cc9 100644 --- a/src/fnet/arp.c +++ b/src/fnet/arp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnet/fnet.h b/src/fnet/fnet.h index f9b09d7ea..6a25efe16 100644 --- a/src/fnet/fnet.h +++ b/src/fnet/fnet.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnet/interface.c b/src/fnet/interface.c index 50e1beaa0..2dec874a6 100644 --- a/src/fnet/interface.c +++ b/src/fnet/interface.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnet/main.c b/src/fnet/main.c index d1c8170ca..dee30219c 100644 --- a/src/fnet/main.c +++ b/src/fnet/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnet/veth.c b/src/fnet/veth.c index 2111cfa56..fc5a0f16e 100644 --- a/src/fnet/veth.c +++ b/src/fnet/veth.c @@ -26,7 +26,7 @@ * */ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnetfilter/Makefile b/src/fnetfilter/Makefile index d38185fb1..778de3a8b 100644 --- a/src/fnetfilter/Makefile +++ b/src/fnetfilter/Makefile @@ -2,11 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fnetfilter -PROG = fnetfilter +MOD = fnetfilter +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/syscall.h EXTRA_OBJS = ../lib/common.o include $(ROOT)/src/prog.mk diff --git a/src/fnetfilter/main.c b/src/fnetfilter/main.c index 1b0335d68..459c01960 100644 --- a/src/fnetfilter/main.c +++ b/src/fnetfilter/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnetlock/Makefile b/src/fnetlock/Makefile new file mode 100644 index 000000000..386b32082 --- /dev/null +++ b/src/fnetlock/Makefile @@ -0,0 +1,10 @@ +.SUFFIXES: +ROOT = ../.. +-include $(ROOT)/config.mk + +MOD = fnetlock +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) +TARGET = $(PROG) + +include $(ROOT)/src/prog.mk diff --git a/src/fnetlock/fnetlock.h b/src/fnetlock/fnetlock.h new file mode 100644 index 000000000..ce8fe96f5 --- /dev/null +++ b/src/fnetlock/fnetlock.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2014-2024 Firejail Authors + * + * This file is part of firejail project + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#ifndef FNETLOCK_H +#define FNETLOCK_H + +#include "../include/common.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +//#define DEBUG 1 + +#define NETLOCK_INTERVAL 60 // seconds + +static inline uint8_t hash(uint32_t ip) { + uint8_t *ptr = (uint8_t *) &ip; + // simple byte xor + return *ptr ^ *(ptr + 1) ^ *(ptr + 2) ^ *(ptr + 3); +} + +// main.c +void logprintf(char* fmt, ...); + +// tail.c +void tail(const char *logfile); + +#endif diff --git a/src/fnetlock/main.c b/src/fnetlock/main.c new file mode 100644 index 000000000..f2a0c33d9 --- /dev/null +++ b/src/fnetlock/main.c @@ -0,0 +1,394 @@ +/* + * Copyright (C) 2014-2024 Firejail Authors + * + * This file is part of firejail project + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#include "fnetlock.h" +#include +#include +#include +#include +#define MAX_BUF_SIZE (64 * 1024) + +static int arg_tail = 0; +static char *arg_log = NULL; + +//***************************************************************** +// traffic trace storage - hash table for fast access + linked list for display purposes +//***************************************************************** +typedef struct hnode_t { + struct hnode_t *hnext; // used for hash table and unused linked list + struct hnode_t *dnext; // used to display streams on the screen + uint32_t ip_src; + uint16_t port_src; + uint8_t protocol; + + // the firewall is build based on source address, and in the linked list + // we could have elements with the same address but different ports + uint8_t ip_instance; +} HNode; + +// hash table +#define HMAX 256 +HNode *htable[HMAX] = {NULL}; +static int have_traffic = 0; + +// using protocol 0 and port 0 for ICMP +static void hnode_add(uint32_t ip_src, uint8_t protocol, uint16_t port_src) { + uint8_t h = hash(ip_src); + int ip_instance = 0; + HNode *ptr = htable[h]; + while (ptr) { + if (ptr->ip_src == ip_src) { + ip_instance++; + if (ptr->port_src == port_src && ptr->protocol == protocol) + return; + } + ptr = ptr->hnext; + } + + logprintf("netlock: adding %d.%d.%d.%d\n", PRINT_IP(ip_src)); + have_traffic = 1; + HNode *hnew = malloc(sizeof(HNode)); + assert(hnew); + hnew->ip_src = ip_src; + hnew->port_src = port_src; + hnew->protocol = protocol; + hnew->hnext = NULL; + hnew->ip_instance = ip_instance + 1; + if (htable[h] == NULL) + htable[h] = hnew; + else { + hnew->hnext = htable[h]; + htable[h] = hnew; + } +} + + + + +// trace rx traffic coming in +static void run_trace(void) { + logprintf("netlock: accumulating traffic for %d seconds\n", NETLOCK_INTERVAL); + + // trace only rx ipv4 tcp and upd + int s1 = socket(AF_INET, SOCK_RAW, IPPROTO_TCP); + int s2 = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); + if (s1 < 0 || s2 < 0) + errExit("socket"); + + + unsigned start = time(NULL); + unsigned char buf[MAX_BUF_SIZE]; + // FIXME: error: variable 'bw' set but not used [-Werror,-Wunused-but-set-variable] + //unsigned bw = 0; // bandwidth calculations + + int printed = 0; + while (1) { + unsigned runtime = time(NULL) - start; + if ( runtime >= NETLOCK_INTERVAL) + break; + if (runtime % 10 == 0) { + if (!printed) + logprintf("netlock: %u seconds remaining\n", NETLOCK_INTERVAL - runtime); + printed = 1; + } + else + printed = 0; + + fd_set rfds; + FD_ZERO(&rfds); + FD_SET(s1, &rfds); + FD_SET(s2, &rfds); + int maxfd = (s1 > s2) ? s1 : s2; + maxfd++; + + struct timeval tv; + tv.tv_sec = 1; + tv.tv_usec = 0; + + int rv = select(maxfd, &rfds, NULL, NULL, &tv); + if (rv < 0) + errExit("select"); + else if (rv == 0) + continue; + + + // rx tcp traffic by default + int sock = s1; + + if (FD_ISSET(s2, &rfds)) + sock = s2; + + unsigned bytes = recvfrom(sock, buf, MAX_BUF_SIZE, 0, NULL, NULL); + if (bytes >= 20) { // size of IP header +#ifdef DEBUG + { + uint32_t ip_src; + memcpy(&ip_src, buf + 12, 4); + ip_src = ntohl(ip_src); + + uint32_t ip_dst; + memcpy(&ip_dst, buf + 16, 4); + ip_dst = ntohl(ip_dst); + printf("%d.%d.%d.%d -> %d.%d.%d.%d, %u bytes\n", PRINT_IP(ip_src), PRINT_IP(ip_dst), bytes); + } +#endif + // filter out loopback traffic + if (buf[12] != 127 && buf[16] != 127) { + // FIXME: error: variable 'bw' set but not used [-Werror,-Wunused-but-set-variable] + //bw += bytes + 14; // assume a 14 byte Ethernet layer + + uint32_t ip_src; + memcpy(&ip_src, buf + 12, 4); + ip_src = ntohl(ip_src); + + uint8_t hlen = (buf[0] & 0x0f) * 4; + uint16_t port_src = 0; + memcpy(&port_src, buf + hlen, 2); + port_src = ntohs(port_src); + + uint8_t protocol = buf[9]; + hnode_add(ip_src, protocol, port_src); + } + } + } + + close(s1); + close(s2); +} + +static char *filter_start = + "*filter\n" + ":INPUT DROP [0:0]\n" + ":FORWARD DROP [0:0]\n" + ":OUTPUT DROP [0:0]\n"; + +// return 1 if error +static int print_filter(FILE *fp) { + fprintf(fp, "%s\n", filter_start); + fprintf(fp, "-A INPUT -s 127.0.0.0/8 -j ACCEPT\n"); + fprintf(fp, "-A OUTPUT -d 127.0.0.0/8 -j ACCEPT\n"); + fprintf(fp, "\n"); + + int i; + for (i = 0; i < HMAX; i++) { + HNode *ptr = htable[i]; + while (ptr) { + // filter rules are targeting ip address, the port number is disregarded, + // so we look only at the first instance of an address + if (ptr->ip_instance == 1) { + char *protocol = (ptr->protocol == 6) ? "tcp" : "udp"; + fprintf(fp, "-A INPUT -s %d.%d.%d.%d -p %s -j ACCEPT\n", + PRINT_IP(ptr->ip_src), + protocol); + fprintf(fp, "-A OUTPUT -d %d.%d.%d.%d -p %s -j ACCEPT\n", + PRINT_IP(ptr->ip_src), + protocol); + fprintf(fp, "\n"); + } + ptr = ptr->hnext; + } + } + fprintf(fp, "COMMIT\n"); + + return 0; +} + +static char *flush_rules[] = { + "-P INPUT ACCEPT", +// "-P FORWARD DENY", + "-P OUTPUT ACCEPT", + "-F", + "-X", +// "-t nat -F", +// "-t nat -X", +// "-t mangle -F", +// "-t mangle -X", +// "iptables -t raw -F", +// "-t raw -X", + NULL +}; + +static void deploy_netfilter(void) { + int rv; + char *cmd; + int i; + + if (have_traffic == 0) { + logprintf("Sorry, no network traffic was detected. The firewall was not configured.\n"); + return; + } + // find iptables command + char *iptables = NULL; + char *iptables_restore = NULL; + if (access("/sbin/iptables", X_OK) == 0) { + iptables = "/sbin/iptables"; + iptables_restore = "/sbin/iptables-restore"; + } + else if (access("/usr/sbin/iptables", X_OK) == 0) { + iptables = "/usr/sbin/iptables"; + iptables_restore = "/usr/sbin/iptables-restore"; + } + if (iptables == NULL || iptables_restore == NULL) { + fprintf(stderr, "Error: iptables command not found, netfilter not configured\n"); + exit(1); + } + + // flush all netfilter rules + i = 0; + while (flush_rules[i]) { + char *cmd; + if (asprintf(&cmd, "%s %s", iptables, flush_rules[i]) == -1) + errExit("asprintf"); + int rv = system(cmd); + (void) rv; + free(cmd); + i++; + } + + // create temporary file + char fname[] = "/tmp/firejail-XXXXXX"; + int fd = mkstemp(fname); + if (fd == -1) { + fprintf(stderr, "Error: cannot create temporary configuration file\n"); + exit(1); + } + + FILE *fp = fdopen(fd, "w"); + if (!fp) { + rv = unlink(fname); + (void) rv; + fprintf(stderr, "Error: cannot create temporary configuration file\n"); + exit(1); + } + print_filter(fp); + fclose(fp); + + logprintf("\n\n"); + logprintf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); + if (asprintf(&cmd, "cat %s >> %s", fname, arg_log) == -1) + errExit("asprintf"); + rv = system(cmd); + (void) rv; + free(cmd); + + if (asprintf(&cmd, "cat %s", fname) == -1) + errExit("asprintf"); + rv = system(cmd); + (void) rv; + free(cmd); + logprintf("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); + + + // configuring + if (asprintf(&cmd, "%s %s", iptables_restore, fname) == -1) + errExit("asprintf"); + rv = system(cmd); + if (rv) + fprintf(stdout, "Warning: possible netfilter problem!"); + free(cmd); + + rv = unlink(fname); + (void) rv; + logprintf("\nnetlock: firewall deployed\n"); +} + +void logprintf(char *fmt, ...) { + if (!arg_log) + return; + + FILE *fp = fopen(arg_log, "a"); + if (fp) { // disregard if error + va_list args; + va_start(args, fmt); + vfprintf(fp, fmt, args); + va_end(args); + fclose(fp); + } + + va_list args; + va_start(args, fmt); + vfprintf(stdout, fmt, args); + va_end(args); +} + +static const char *const usage_str = + "Usage: fnettrace [OPTIONS]\n" + "Options:\n" + " --help, -? - this help screen\n" + " --log=filename - netlocker logfile\n" + " --tail - \"tail -f\" functionality\n"; + +static void usage(void) { + puts(usage_str); +} + +int main(int argc, char **argv) { + int i; + + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-?") == 0) { + usage(); + return 0; + } + else if (strcmp(argv[i], "--tail") == 0) + arg_tail = 1; + else if (strncmp(argv[i], "--log=", 6) == 0) + arg_log = argv[i] + 6; + else { + fprintf(stderr, "Error: invalid argument\n"); + return 1; + } + } + + // tail + if (arg_tail) { + if (!arg_log) { + fprintf(stderr, "Error: no log file\n"); + usage(); + exit(1); + } + + tail(arg_log); + sleep(5); + exit(0); + } + + if (getuid() != 0) { + fprintf(stderr, "Error: you need to be root to run this program\n"); + return 1; + } + + // kill the process if the parent died + prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); + + logprintf("netlock: starting network lockdown\n"); + run_trace(); + + // TCP path MTU discovery will not work properly since the firewall drops all ICMP packets + // Instead, we use iPacketization Layer PMTUD (RFC 4821) support in Linux kernel + int rv = system("echo 1 > /proc/sys/net/ipv4/tcp_mtu_probing"); + (void) rv; + + deploy_netfilter(); + sleep(3); + if (arg_log) + unlink(arg_log); + + return 0; +} diff --git a/src/fnettrace/tail.c b/src/fnetlock/tail.c similarity index 95% rename from src/fnettrace/tail.c rename to src/fnetlock/tail.c index 3b1b274f8..38686ca9e 100644 --- a/src/fnettrace/tail.c +++ b/src/fnetlock/tail.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -17,7 +17,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "fnettrace.h" +#include "fnetlock.h" void tail(const char *logfile) { assert(logfile); diff --git a/src/fnettrace-dns/Makefile b/src/fnettrace-dns/Makefile index fb1054261..e7180de3f 100644 --- a/src/fnettrace-dns/Makefile +++ b/src/fnettrace-dns/Makefile @@ -2,8 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fnettrace-dns -PROG = fnettrace-dns +MOD = fnettrace-dns +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) include $(ROOT)/src/prog.mk diff --git a/src/fnettrace-dns/fnettrace_dns.h b/src/fnettrace-dns/fnettrace_dns.h index b8f69e9d7..e8ad1cb9f 100644 --- a/src/fnettrace-dns/fnettrace_dns.h +++ b/src/fnettrace-dns/fnettrace_dns.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnettrace-dns/main.c b/src/fnettrace-dns/main.c index 1cde1942c..4d6e48dd8 100644 --- a/src/fnettrace-dns/main.c +++ b/src/fnettrace-dns/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -26,6 +26,7 @@ #include #define MAX_BUF_SIZE (64 * 1024) +static int arg_nolocal = 0; static char last[512] = {'\0'}; // pkt - start of DNS layer @@ -65,7 +66,7 @@ void print_dns(uint32_t ip_src, unsigned char *pkt) { // filter output char tmp[sizeof(last)]; - snprintf(tmp, sizeof(last), "%02d:%02d:%02d %-15s %s (type %u)%s", + snprintf(tmp, sizeof(last), "%02d:%02d:%02d %-15s DNS %s (type %u)%s", t->tm_hour, t->tm_min, t->tm_sec, ip, pkt + 12 + 1, type, (nxdomain)? " NXDOMAIN": ""); if (strcmp(tmp, last)) { @@ -116,7 +117,7 @@ static void print_date(void) { struct tm *t = localtime(&now); if (day != t->tm_yday) { - printf("\nDNS trace for %s", ctime(&now)); + printf("DNS trace for %s", ctime(&now)); day = t->tm_yday; } fflush(0); @@ -159,6 +160,14 @@ static void run_trace(void) { memcpy(&ip_src, buf + 14 + 12, 4); ip_src = ntohl(ip_src); + if (arg_nolocal) { + if ((ip_src & 0xff000000) == 0x7f000000 || // 127.0.0.0/8 + (ip_src & 0xff000000) == 0x0a000000 || // 10.0.0.0/8 + (ip_src & 0xffff0000) == 0xc0a80000 || // 192.168.0.0/16 + (ip_src & 0xfff00000) == 0xac100000) // 172.16.0.0/12 + continue; + } + // if DNS packet, extract the query if (port_src == 53 && protocol == 0x11) // UDP protocol print_dns(ip_src, buf + 14 + ip_hlen + 8); // IP and UDP header len @@ -170,7 +179,8 @@ static void run_trace(void) { static const char *const usage_str = "Usage: fnettrace-dns [OPTIONS]\n" "Options:\n" - " --help, -? - this help screen\n"; + " --help, -? - this help screen\n" + " --nolocal\n"; static void usage(void) { puts(usage_str); @@ -184,6 +194,8 @@ int main(int argc, char **argv) { usage(); return 0; } + else if (strcmp(argv[i], "--nolocal") == 0) + arg_nolocal = 1; else { fprintf(stderr, "Error: invalid argument\n"); return 1; diff --git a/src/fnettrace-icmp/Makefile b/src/fnettrace-icmp/Makefile index 4791e0b9f..d449fbe76 100644 --- a/src/fnettrace-icmp/Makefile +++ b/src/fnettrace-icmp/Makefile @@ -2,8 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fnettrace-icmp -PROG = fnettrace-icmp +MOD = fnettrace-icmp +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) include $(ROOT)/src/prog.mk diff --git a/src/fnettrace-icmp/fnettrace_icmp.h b/src/fnettrace-icmp/fnettrace_icmp.h index 04c449ff2..c18da1c9e 100644 --- a/src/fnettrace-icmp/fnettrace_icmp.h +++ b/src/fnettrace-icmp/fnettrace_icmp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnettrace-icmp/main.c b/src/fnettrace-icmp/main.c index 516a9fc5b..9a4c6bf13 100644 --- a/src/fnettrace-icmp/main.c +++ b/src/fnettrace-icmp/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnettrace-sni/Makefile b/src/fnettrace-sni/Makefile index 09a444db0..80af5e914 100644 --- a/src/fnettrace-sni/Makefile +++ b/src/fnettrace-sni/Makefile @@ -2,8 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fnettrace-sni -PROG = fnettrace-sni +MOD = fnettrace-sni +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) include $(ROOT)/src/prog.mk diff --git a/src/fnettrace-sni/fnettrace_sni.h b/src/fnettrace-sni/fnettrace_sni.h index 04c449ff2..c18da1c9e 100644 --- a/src/fnettrace-sni/fnettrace_sni.h +++ b/src/fnettrace-sni/fnettrace_sni.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fnettrace-sni/main.c b/src/fnettrace-sni/main.c index e7782d656..36a6d5f3b 100644 --- a/src/fnettrace-sni/main.c +++ b/src/fnettrace-sni/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -32,16 +32,15 @@ static char last[512] = {'\0'}; static void print_tls(uint32_t ip_dest, unsigned char *pkt, unsigned len) { assert(pkt); + // expecting a handshake packet and client hello + if (pkt[0] != 0x16 || pkt[5] != 0x01) + return; + char ip[30]; sprintf(ip, "%d.%d.%d.%d", PRINT_IP(ip_dest)); time_t seconds = time(NULL); struct tm *t = localtime(&seconds); - // expecting a handshake packet and client hello - if (pkt[0] != 0x16 || pkt[5] != 0x01) - goto errout; - - // look for server name indication unsigned char *ptr = pkt; unsigned int i = 0; @@ -74,7 +73,7 @@ static void print_tls(uint32_t ip_dest, unsigned char *pkt, unsigned len) { if (name) { // filter output char tmp[sizeof(last)]; - snprintf(tmp, sizeof(last), "%02d:%02d:%02d %-15s %s", t->tm_hour, t->tm_min, t->tm_sec, ip, name); + snprintf(tmp, sizeof(last), "%02d:%02d:%02d %-15s SNI %s", t->tm_hour, t->tm_min, t->tm_sec, ip, name); if (strcmp(tmp, last)) { printf("%s\n", tmp); fflush(0); @@ -85,11 +84,6 @@ static void print_tls(uint32_t ip_dest, unsigned char *pkt, unsigned len) { goto nosni; return; -errout: - printf("%02d:%02d:%02d %-15s Error: invalid TLS packet\n", t->tm_hour, t->tm_min, t->tm_sec, ip); - fflush(0); - return; - nosni: printf("%02d:%02d:%02d %-15s no SNI\n", t->tm_hour, t->tm_min, t->tm_sec, ip); return; @@ -152,7 +146,7 @@ static void print_date(void) { struct tm *t = localtime(&now); if (day != t->tm_yday) { - printf("\nSNI trace for %s", ctime(&now)); + printf("SNI trace for %s", ctime(&now)); day = t->tm_yday; } diff --git a/src/fnettrace/Makefile b/src/fnettrace/Makefile index 68a4cbdc0..1c62f43bc 100644 --- a/src/fnettrace/Makefile +++ b/src/fnettrace/Makefile @@ -2,12 +2,15 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fnettrace -PROG = fnettrace +MOD = fnettrace +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) +CLEANFILES += static-ip-map + include $(ROOT)/src/prog.mk all: $(TARGET) static-ip-map -static-ip-map: static-ip-map.txt fnettrace - ./fnettrace --squash-map=static-ip-map.txt > static-ip-map +static-ip-map: static-ip-map.txt $(PROG) + ./$(PROG) --squash-map=static-ip-map.txt 2>&1 >static-ip-map diff --git a/src/fnettrace/event.c b/src/fnettrace/event.c new file mode 100644 index 000000000..bae3ba80d --- /dev/null +++ b/src/fnettrace/event.c @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2014-2024 Firejail Authors + * + * This file is part of firejail project + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#include "fnettrace.h" + +typedef struct event_t { + struct event_t *next; + char *record; +} Event; + +static Event *event = NULL; +static Event *last_event = NULL; +int ev_cnt = 0; + +void ev_clear(void) { + ev_cnt = 0; + Event *ev = event; + while (ev) { + Event *next = ev->next; + free(ev->record); + free(ev); + ev = next; + } + event = NULL; +} + +void ev_add(char *record) { + assert(record); + + // braking recursivity + if (*record == '\0') + return; + + char *ptr = strchr(record, '\n'); + if (ptr) + *ptr = '\0'; + + // filter out duplicates + if (event && strcmp(event->record, record) == 0) + return; + + Event *ev = malloc(sizeof(Event)); + if (!ev) + errExit("malloc"); + memset(ev, 0, sizeof(Event)); + + ev->record = strdup(record); + if (!ev->record) + errExit("strdup"); + + if (event == NULL) { + event = ev; + last_event = ev; + } + else { + last_event->next = ev; + last_event = ev; + } + ev_cnt++; + + // recursivity + if (ptr) + ev_add(++ptr); +} + +void ev_print(FILE *fp) { + assert(fp); + + Event *ev = event; + while (ev) { + fprintf(fp, " "); + if (strstr(ev->record, "NXDOMAIN")) { + if (fp == stdout) + ansi_red(ev->record); + else + fprintf(fp, "%s", ev->record); + } + else if (strstr(ev->record, "SSH connection")) { + if (fp == stdout) + ansi_red(ev->record); + else + fprintf(fp, "%s", ev->record); + } + else + fprintf(fp, "%s", ev->record); + fprintf(fp, "\n"); + ev = ev->next; + } +} diff --git a/src/fnettrace/fnettrace.h b/src/fnettrace/fnettrace.h index b1a2f5b6c..c0604d904 100644 --- a/src/fnettrace/fnettrace.h +++ b/src/fnettrace/fnettrace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -53,6 +53,27 @@ static inline void ansi_clrscr(void) { fflush(0); } +static inline void ansi_bold(const char *str) { + char str1[] = {0x1b, '[', '1', 'm', '\0'}; + char str2[] = {0x1b, '[', '0', 'm', '\0'}; + printf("%s%s%s", str1, str, str2); + fflush(0); +} + +static inline void ansi_faint(const char *str) { + char str1[] = {0x1b, '[', '2', 'm', '\0'}; + char str2[] = {0x1b, '[', '0', 'm', '\0'}; + printf("%s%s%s", str1, str, str2); + fflush(0); +} + +static inline void ansi_red(const char *str) { + char str1[] = {0x1b, '[', '9', '1', 'm', '\0'}; + char str2[] = {0x1b, '[', '0', 'm', '\0'}; + printf("%s%s%s", str1, str, str2); + fflush(0); +} + static inline uint8_t hash(uint32_t ip) { uint8_t *ptr = (uint8_t *) &ip; // simple byte xor @@ -75,4 +96,14 @@ void terminal_handler(int s); void terminal_set(void); void terminal_restore(void); +// runprog.c +int runprog(const char *program); + +// event.c +extern int ev_cnt; +void ev_clear(void); +void ev_add(char *record); +void ev_print(FILE *fp); + + #endif diff --git a/src/fnettrace/hostnames.c b/src/fnettrace/hostnames.c index 7cb34e2c4..450ce587b 100644 --- a/src/fnettrace/hostnames.c +++ b/src/fnettrace/hostnames.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -40,30 +40,32 @@ char *retrieve_hostname(uint32_t ip) { errExit("asprintf"); FILE *fp = popen(cmd, "r"); - if (fp) { - char *ptr; - if (fgets(buf, MAXBUF, fp)) { - ptr = strchr(buf, '\n'); - if (ptr) - *ptr = '\0'; - if (strncmp(buf, "GeoIP Country Edition:", 22) == 0) { - ptr = buf + 22; - if (*ptr == ' ' && *(ptr + 3) == ',' && *(ptr + 4) == ' ') { - rv = ptr + 5; - if (strcmp(rv, "United States") == 0) - rv = "US"; - } + if (!fp) { + geoip_not_found = 1; + goto out; + } + + char *ptr; + if (fgets(buf, MAXBUF, fp)) { + ptr = strchr(buf, '\n'); + if (ptr) + *ptr = '\0'; + if (strncmp(buf, "GeoIP Country Edition:", 22) == 0) { + ptr = buf + 22; + if (*ptr == ' ' && *(ptr + 3) == ',' && *(ptr + 4) == ' ') { + rv = ptr + 5; + if (strcmp(rv, "United States") == 0) + rv = "US"; } } - pclose(fp); - return strdup(rv); } - else - geoip_not_found = 1; + pclose(fp); + if (rv) + rv = strdup(rv); +out: free(cmd); - - return NULL; + return rv; } void load_hostnames(const char *fname) { diff --git a/src/fnettrace/main.c b/src/fnettrace/main.c index 932afff61..f1ad71820 100644 --- a/src/fnettrace/main.c +++ b/src/fnettrace/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -25,15 +25,46 @@ #include #define MAX_BUF_SIZE (64 * 1024) -static int arg_netfilter = 0; -static int arg_tail = 0; static char *arg_log = NULL; +// only 0 or negative values; positive values as defined in RFC +#define PROTOCOL_ICMP 0 +#define PROTOCOL_SSH -1 + + + +//***************************************************************** +// packet stats +//***************************************************************** uint32_t stats_pkts = 0; -uint32_t stats_icmp = 0; +uint32_t stats_icmp_echo = 0; uint32_t stats_dns = 0; +uint32_t stats_dns_dot = 0; +uint32_t stats_dns_doh = 0; +uint32_t stats_dns_doq = 0; +uint32_t stats_tls = 0; +uint32_t stats_quic = 0; +uint32_t stats_tor = 0; +uint32_t stats_http = 0; +uint32_t stats_ssh = 0; +static void clear_stats(void) { + stats_pkts = 0; + stats_icmp_echo = 0; + stats_dns = 0; + stats_dns_dot = 0; + stats_dns_doh = 0; + stats_dns_doq = 0; + stats_tls = 0; + stats_quic = 0; + stats_tor = 0; + stats_http = 0; + stats_ssh = 0; +} +//***************************************************************** +// traffic trace storage - hash table for fast access + linked list for display purposes +//***************************************************************** typedef struct hnode_t { struct hnode_t *hnext; // used for hash table and unused linked list struct hnode_t *dnext; // used to display streams on the screen @@ -42,8 +73,9 @@ typedef struct hnode_t { // stats uint32_t bytes; // number of bytes received in the last display interval + uint32_t pkts; // number of packets received in the last display interval uint16_t port_src; - uint8_t protocol; + int protocol; // the firewall is build based on source address, and in the linked list // we could have elements with the same address but different ports @@ -86,7 +118,7 @@ void hfree(HNode *ptr) { } // using protocol 0 and port 0 for ICMP -static void hnode_add(uint32_t ip_src, uint8_t protocol, uint16_t port_src, uint32_t bytes) { +static void hnode_add(uint32_t ip_src, int protocol, uint16_t port_src, uint32_t bytes) { uint8_t h = hash(ip_src); // find @@ -97,6 +129,7 @@ static void hnode_add(uint32_t ip_src, uint8_t protocol, uint16_t port_src, uint ip_instance++; if (ptr->port_src == port_src && ptr->protocol == protocol) { ptr->bytes += bytes; + ptr->pkts++; assert(ptr->rnode); ptr->rnode->pkts++; return; @@ -115,6 +148,7 @@ static void hnode_add(uint32_t ip_src, uint8_t protocol, uint16_t port_src, uint hnew->protocol = protocol; hnew->hnext = NULL; hnew->bytes = bytes; + hnew->pkts = 1; hnew->ip_instance = ip_instance + 1; hnew->ttl = DISPLAY_TTL; if (htable[h] == NULL) @@ -139,9 +173,6 @@ static void hnode_add(uint32_t ip_src, uint8_t protocol, uint16_t port_src, uint if (!hnew->rnode) hnew->rnode = radix_add(hnew->ip_src, 0xffffffff, NULL); hnew->rnode->pkts++; - - if (arg_netfilter) - logprintf(" %d.%d.%d.%d ", PRINT_IP(hnew->ip_src)); } static void hnode_free(HNode *elem) { @@ -242,23 +273,23 @@ typedef struct port_type_t { char *service; } PortType; static PortType ports[] = { - {20, "(FTP)"}, - {21, "(FTP)"}, - {22, "(SSH)"}, - {23, "(telnet)"}, - {25, "(SMTP)"}, - {43, "(WHOIS)"}, - {67, "(DHCP)"}, - {68, "(DHCP)"}, - {69, "(TFTP)"}, - {80, "(HTTP)"}, - {109, "(POP2)"}, - {110, "(POP3)"}, - {113, "(IRC)"}, - {123, "(NTP)"}, - {161, "(SNMP)"}, - {162, "(SNMP)"}, - {194, "(IRC)"}, + {20, "FTP"}, + {21, "FTP"}, + {22, "SSH"}, + {23, "telnet"}, + {25, "SMTP"}, + {43, "WHOIS"}, + {67, "DHCP"}, + {68, "DHCP"}, + {69, "TFTP"}, + {80, "HTTP"}, + {109, "POP2"}, + {110, "POP3"}, + {113, "IRC"}, + {123, "NTP"}, + {161, "SNMP"}, + {162, "SNMP"}, + {194, "IRC"}, {0, NULL}, }; @@ -266,32 +297,34 @@ static PortType ports[] = { static inline const char *common_port(uint16_t port) { if (port >= 6660 && port <= 10162) { if (port >= 6660 && port <= 6669) - return "(IRC)"; + return "IRC"; else if (port == 6679) - return "(IRC)"; + return "IRC"; else if (port == 6771) - return "(BitTorrent)"; + return "BitTorrent"; else if (port >= 6881 && port <= 6999) - return "(BitTorrent)"; + return "BitTorrent"; else if (port == 9001) - return "(Tor)"; + return "Tor"; else if (port == 9030) - return "(Tor)"; + return "Tor"; + else if (port == 9040) + return "Tor"; else if (port == 9050) - return "(Tor)"; + return "Tor"; else if (port == 9051) - return "(Tor)"; + return "Tor"; else if (port == 9150) - return "(Tor)"; + return "Tor"; else if (port == 10161) - return "(secure SNMP)"; + return "secure SNMP"; else if (port == 10162) - return "(secure SNMP)"; + return "secure SNMP"; return NULL; } if (port <= 194) { - PortType *ptr =&ports[0]; + PortType *ptr = &ports[0]; while(ptr->service != NULL) { if (ptr->port == port) return ptr->service; @@ -305,7 +338,6 @@ static inline const char *common_port(uint16_t port) { static void hnode_print(unsigned bw) { - assert(!arg_netfilter); bw = (bw < 1024 * DISPLAY_INTERVAL) ? 1024 * DISPLAY_INTERVAL : bw; #ifdef DEBUG printf("*********************\n"); @@ -336,7 +368,9 @@ static void hnode_print(unsigned bw) { else sprintf(stats, "%u KB/s ", bw / (1024 * DISPLAY_INTERVAL)); // int len = snprintf(line, LINE_MAX, "%32s geoip %d, IP database %d\n", stats, geoip_calls, radix_nodes); - int len = snprintf(line, LINE_MAX, "%32s address:port (protocol) network (packets)\n", stats); + char faint1[] = {0x1b, '[', '2', 'm', '\0'}; + char faint2[] = {0x1b, '[', '0', 'm', '\0'}; + int len = snprintf(line, LINE_MAX, "%32s %saddress:port (protocol) network%s\n", stats, faint1, faint2); adjust_line(line, len, cols); printf("%s", line); @@ -369,47 +403,71 @@ static void hnode_print(unsigned bw) { bwline = print_bw(ptr->bytes / bwunit); const char *protocol = NULL; - if (ptr->port_src == 443 && ptr->protocol == 0x06) // TCP - protocol = "(TLS)"; - else if (ptr->port_src == 443 && ptr->protocol == 0x11) // UDP - protocol = "(QUIC)"; - else if (ptr->port_src == 53) - protocol = "(DNS)"; + if (ptr->port_src == 443 && ptr->protocol == 0x06) { // TCP + protocol = "TLS"; + stats_tls += ptr->pkts; + if (strstr(ptr->rnode->name, "DNS")) { + protocol = "DoH"; + stats_dns_doh += ptr->pkts; + } + + } + else if (ptr->port_src == 443 && ptr->protocol == 0x11) { // UDP + protocol = "QUIC"; + stats_quic += ptr->pkts; + if (strstr(ptr->rnode->name, "DNS")) { + protocol = "DoQ"; + stats_dns_doq += ptr->pkts; + } + } + else if (ptr->port_src == 53) { + protocol = "DNS"; + stats_dns += ptr->pkts; + } else if (ptr->port_src == 853) { - if (ptr->protocol == 0x06) - protocol = "(DoT)"; - else if (ptr->protocol == 0x11) - protocol = "(DoQ)"; + if (ptr->protocol == 0x06) { + protocol = "DoT"; + stats_dns_dot += ptr->pkts; + } + else if (ptr->protocol == 0x11) { + protocol = "DoQ"; + stats_dns_doq += ptr->pkts; + } else protocol = NULL; } - else if ((protocol = common_port(ptr->port_src)) != NULL) - ; + else if ((protocol = common_port(ptr->port_src)) != NULL) { + if (strcmp(protocol, "HTTP") == 0) + stats_http += ptr->pkts; + else if (strcmp(protocol, "Tor") == 0) + stats_tor += ptr->pkts; + else if (strcmp(protocol, "SSH") == 0) + stats_ssh += ptr->pkts; + } else if (ptr->protocol == 0x11) - protocol = "(UDP)"; + protocol = "UDP"; else if (ptr->protocol == 0x06) - protocol = "(TCP)"; + protocol = "TCP"; + else if (ptr->protocol == PROTOCOL_SSH) { + protocol = "SSH"; + stats_ssh += ptr->pkts; + } if (protocol == NULL) protocol = ""; - if (ptr->port_src == 0) + if (ptr->port_src == PROTOCOL_ICMP) len = snprintf(line, LINE_MAX, "%10s %s %d.%d.%d.%d (ICMP) %s\n", bytes, bwline, PRINT_IP(ptr->ip_src), ptr->rnode->name); - else if (ptr->rnode->pkts > 1000000) - len = snprintf(line, LINE_MAX, "%10s %s %d.%d.%d.%d:%u%s %s (%.01fM)\n", - bytes, bwline, PRINT_IP(ptr->ip_src), ptr->port_src, protocol, ptr->rnode->name, ((double) ptr->rnode->pkts) / 1000000); - else if (ptr->rnode->pkts > 1000) - len = snprintf(line, LINE_MAX, "%10s %s %d.%d.%d.%d:%u%s %s (%.01fK)\n", - bytes, bwline, PRINT_IP(ptr->ip_src), ptr->port_src, protocol, ptr->rnode->name, ((double) ptr->rnode->pkts) / 1000); else - len = snprintf(line, LINE_MAX, "%10s %s %d.%d.%d.%d:%u%s %s (%u)\n", - bytes, bwline, PRINT_IP(ptr->ip_src), ptr->port_src, protocol, ptr->rnode->name, ptr->rnode->pkts); + len = snprintf(line, LINE_MAX, "%10s %s %d.%d.%d.%d:%u (%s) %s\n", + bytes, bwline, PRINT_IP(ptr->ip_src), ptr->port_src, protocol, ptr->rnode->name); adjust_line(line, len, cols); printf("%s", line); if (ptr->bytes) ptr->ttl = DISPLAY_TTL; ptr->bytes = 0; + ptr->pkts = 0; prev = ptr; } else { @@ -423,7 +481,7 @@ static void hnode_print(unsigned bw) { ptr = next; } - printf("press any key to access stats\n"); + ansi_faint("(D)isplay, (S)ave, (C)lear, e(X)it\n"); #ifdef DEBUG { @@ -438,19 +496,36 @@ static void hnode_print(unsigned bw) { #endif } +static void print_stats(FILE *fp) { + assert(fp); + + fprintf(fp, "Stats: %u packets\n", stats_pkts); + fprintf(fp, " encrypted: TLS %u, QUIC %u, Tor %u\n", + stats_tls, stats_quic, stats_tor); + fprintf(fp, " unencrypted: HTTP %u\n", stats_http); + fprintf(fp, " C&C backchannel: SSH %u, PING %u, DNS %u, DoH %u, DoT %u, DoQ %u\n", + stats_ssh, stats_icmp_echo, stats_dns, stats_dns_doh, stats_dns_dot, stats_dns_doq); + + fprintf(fp, "\n\nIP map"); + if (fp == stdout) + ansi_faint(" - network (packets)\n"); + else + fprintf(fp, " - network (packets)\n"); + radix_print(fp, 1); + + fprintf(fp, "\n\nEvents %d", ev_cnt); + if (fp == stdout) + ansi_faint(" - time address data\n"); + else + fprintf(fp, " - time address data\n"); + ev_print(fp); -void print_stats(void) { - printf("\nIP table: %d entries, %d unknown\n", radix_nodes, geoip_calls); - printf(" address network (packets)\n"); - radix_print(1); - printf("Packets: %u total, ICMP %u, DNS %u\n", stats_pkts, stats_icmp, stats_dns); } + + // trace rx traffic coming in static void run_trace(void) { - if (arg_netfilter) - logprintf("accumulating traffic for %d seconds\n", NETLOCK_INTERVAL); - // trace only rx ipv4 tcp and upd int s1 = socket(AF_INET, SOCK_RAW, IPPROTO_TCP); int s2 = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); @@ -458,37 +533,45 @@ static void run_trace(void) { if (s1 < 0 || s2 < 0 || s3 < 0) errExit("socket"); - unsigned start = time(NULL); + + int p1 = runprog(LIBDIR "/firejail/fnettrace-sni"); + if (p1 != -1) + printf("loading snitrace..."); + + int p2 = runprog(LIBDIR "/firejail/fnettrace-dns"); + if (p2 != -1) + printf("loading dnstrace..."); unsigned last_print_traces = 0; - unsigned last_print_remaining = 0; unsigned char buf[MAX_BUF_SIZE]; unsigned bw = 0; // bandwidth calculations while (1) { unsigned end = time(NULL); - if (arg_netfilter && end - start >= NETLOCK_INTERVAL) - break; if (end % DISPLAY_INTERVAL == 1 && last_print_traces != end) { // first print after 1 second - if (!arg_netfilter) - hnode_print(bw); + hnode_print(bw); last_print_traces = end; bw = 0; } - if (arg_netfilter && last_print_remaining != end) { - logprintf("."); - fflush(0); - last_print_remaining = end; - } fd_set rfds; FD_ZERO(&rfds); + FD_SET(0, &rfds); + FD_SET(s1, &rfds); FD_SET(s2, &rfds); FD_SET(s3, &rfds); - if (!arg_netfilter) - FD_SET(0, &rfds); int maxfd = (s1 > s2) ? s1 : s2; maxfd = (s3 > maxfd) ? s3 : maxfd; + + if (p1 != -1) { + FD_SET(p1, &rfds); + maxfd = (p1 > maxfd) ? p1 : maxfd; + } + + if (p2 != -1) { + FD_SET(p2, &rfds); + maxfd = (p2 > maxfd) ? p2 : maxfd; + } maxfd++; struct timeval tv; @@ -507,13 +590,97 @@ static void run_trace(void) { int icmp = 0; if (FD_ISSET(0, &rfds)) { - getchar(); - print_stats(); - printf("press any key to continue..."); - fflush(0); - getchar(); + int c = getchar(); + if (c == 'c' || c == 'C') { + clear_stats(); + ev_clear(); + radix_clear_data(); + continue; + } + else if (c == 'd' || c == 'D') { + printf("\n\n"); + ansi_bold("__________________________________________________________________________\n"); + print_stats(stdout); + ansi_bold("__________________________________________________________________________\n"); + ansi_faint("press any key to continue..."); + fflush(0); + + getchar(); + continue; + } + if (c == 's' || c == 'S') { + printf("The file is saved in /tmp directory. Please enter the file name: "); + fflush(0); + + char buf[LINE_MAX + 5]; // eave some room to add /tmp/ + strcpy(buf, "/tmp/"); + terminal_restore(); + if (fgets(buf + 5, LINE_MAX, stdin) == NULL) + errExit("fgets"); + terminal_set(); + + // remove '\n' and open the file + char *ptr = strchr(buf, '\n'); + if (!ptr) { // we should have a '\n' + printf("Error: invalid file name\n"); + sleep(5); + continue; + } + *ptr = '\0'; + + FILE *fp = fopen(buf, "w"); + if (!fp) { + printf("Error: cannot open file %s\n", buf); + perror("fopen"); + sleep(5); + continue; + } + + printf("Saving stats in %s file...\n", buf); + print_stats(fp); + fclose(fp); + int rv = chmod(buf, 0600); + (void) rv; + sleep(1); + continue; + } + else if (c == 'x' || c == 'X') + break; continue; } + else if (FD_ISSET(p1, &rfds)) { + char buf[LINE_MAX]; + ssize_t sz = read(p1, buf, LINE_MAX - 1); + if (sz == -1) + errExit("error reading snitrace"); + if (sz == 0) { + fprintf(stderr, "Error: snitrace EOF!!!\n"); + p1 = -1; + } + if (strncmp(buf, "SNI trace", 9) == 0) + continue; + + buf[sz] = '\0'; + ev_add(buf); + continue; + } + else if (FD_ISSET(p2, &rfds)) { + char buf[LINE_MAX]; + ssize_t sz = read(p2, buf, LINE_MAX - 1); + if (sz == -1) + errExit("error reading dnstrace"); + if (sz == 0) { + fprintf(stderr, "Error: dnstrace EOF!!!\n"); + p2 = -1; + } + if (strncmp(buf, "DNS trace", 9) == 0) + continue; + + buf[sz] = '\0'; + ev_add(buf); + continue; + } + // by default we assume TCP else if (FD_ISSET(s2, &rfds)) sock = s2; else if (FD_ISSET(s3, &rfds)) { @@ -522,7 +689,7 @@ static void run_trace(void) { } unsigned bytes = recvfrom(sock, buf, MAX_BUF_SIZE, 0, NULL, NULL); - if (bytes >= 20) { // size of IP header + if (bytes >= 20) { // minimum size of IP packet #ifdef DEBUG { uint32_t ip_src; @@ -546,21 +713,39 @@ static void run_trace(void) { uint8_t hlen = (buf[0] & 0x0f) * 4; uint16_t port_src = 0; if (icmp) - hnode_add(ip_src, 0, 0, bytes + 14); - else { + hnode_add(ip_src, PROTOCOL_ICMP, 0, bytes + 14); + else { // itcp or udp memcpy(&port_src, buf + hlen, 2); port_src = ntohs(port_src); + int protocol = (int) buf[9]; - uint8_t protocol = buf[9]; + // detect ssh on a standard or not so standard port (22) + if (protocol == 6) { // tcp + uint8_t dataoffset = *(buf + hlen + 12); + uint8_t tcphlen = (dataoffset >> 2); + if (memcmp(buf + hlen + tcphlen, "SSH-", 4) == 0) { + time_t seconds = time(NULL); + struct tm *t = localtime(&seconds); + char ip[30]; + sprintf(ip, "%d.%d.%d.%d", PRINT_IP(ip_src)); + char *msg; + if (asprintf(&msg, "%02d:%02d:%02d %-15s SSH connection", + t->tm_hour, t->tm_min, t->tm_sec, ip) == -1) + errExit("asprintf"); + ev_add(msg); + free(msg); + protocol = PROTOCOL_SSH; + } + } hnode_add(ip_src, protocol, port_src, bytes + 14); } // stats stats_pkts++; - if (icmp) - stats_icmp++; - if (port_src == 53) - stats_dns++; + if (icmp) { + if (*(buf + hlen) == 0 || *(buf + hlen) == 8) + stats_icmp_echo++; + } } } @@ -569,145 +754,12 @@ static void run_trace(void) { close(s1); close(s2); close(s3); - print_stats(); + if (p1 != -1) + close(p1); + if (p2 != -1) + close(p2); } -static char *filter_start = - "*filter\n" - ":INPUT DROP [0:0]\n" - ":FORWARD DROP [0:0]\n" - ":OUTPUT DROP [0:0]\n"; - -// return 1 if error -static int print_filter(FILE *fp) { - if (dlist == NULL) - return 1; - fprintf(fp, "%s\n", filter_start); - fprintf(fp, "-A INPUT -s 127.0.0.0/8 -j ACCEPT\n"); - fprintf(fp, "-A OUTPUT -d 127.0.0.0/8 -j ACCEPT\n"); - fprintf(fp, "\n"); - - int i; - for (i = 0; i < HMAX; i++) { - HNode *ptr = htable[i]; - while (ptr) { - // filter rules are targeting ip address, the port number is disregarded, - // so we look only at the first instance of an address - if (ptr->ip_instance == 1) { - char *protocol = (ptr->protocol == 6) ? "tcp" : "udp"; - fprintf(fp, "-A INPUT -s %d.%d.%d.%d -p %s -j ACCEPT\n", - PRINT_IP(ptr->ip_src), - protocol); - fprintf(fp, "-A OUTPUT -d %d.%d.%d.%d -p %s -j ACCEPT\n", - PRINT_IP(ptr->ip_src), - protocol); - fprintf(fp, "\n"); - } - ptr = ptr->hnext; - } - } - fprintf(fp, "COMMIT\n"); - - return 0; -} - -static char *flush_rules[] = { - "-P INPUT ACCEPT", -// "-P FORWARD DENY", - "-P OUTPUT ACCEPT", - "-F", - "-X", -// "-t nat -F", -// "-t nat -X", -// "-t mangle -F", -// "-t mangle -X", -// "iptables -t raw -F", -// "-t raw -X", - NULL -}; - -static void deploy_netfilter(void) { - int rv; - char *cmd; - int i; - - if (dlist == NULL) { - logprintf("Sorry, no network traffic was detected. The firewall was not configured.\n"); - return; - } - // find iptables command - char *iptables = NULL; - char *iptables_restore = NULL; - if (access("/sbin/iptables", X_OK) == 0) { - iptables = "/sbin/iptables"; - iptables_restore = "/sbin/iptables-restore"; - } - else if (access("/usr/sbin/iptables", X_OK) == 0) { - iptables = "/usr/sbin/iptables"; - iptables_restore = "/usr/sbin/iptables-restore"; - } - if (iptables == NULL || iptables_restore == NULL) { - fprintf(stderr, "Error: iptables command not found, netfilter not configured\n"); - exit(1); - } - - // flush all netfilter rules - i = 0; - while (flush_rules[i]) { - char *cmd; - if (asprintf(&cmd, "%s %s", iptables, flush_rules[i]) == -1) - errExit("asprintf"); - int rv = system(cmd); - (void) rv; - free(cmd); - i++; - } - - // create temporary file - char fname[] = "/tmp/firejail-XXXXXX"; - int fd = mkstemp(fname); - if (fd == -1) { - fprintf(stderr, "Error: cannot create temporary configuration file\n"); - exit(1); - } - - FILE *fp = fdopen(fd, "w"); - if (!fp) { - rv = unlink(fname); - (void) rv; - fprintf(stderr, "Error: cannot create temporary configuration file\n"); - exit(1); - } - print_filter(fp); - fclose(fp); - - logprintf("\n\n"); - logprintf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); - if (asprintf(&cmd, "cat %s >> %s", fname, arg_log) == -1) - errExit("asprintf"); - rv = system(cmd); - (void) rv; - free(cmd); - - if (asprintf(&cmd, "cat %s", fname) == -1) - errExit("asprintf"); - rv = system(cmd); - (void) rv; - free(cmd); - logprintf("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); - - // configuring - if (asprintf(&cmd, "%s %s", iptables_restore, fname) == -1) - errExit("asprintf"); - rv = system(cmd); - if (rv) - fprintf(stdout, "Warning: possible netfilter problem!"); - free(cmd); - - rv = unlink(fname); - (void) rv; - logprintf("\nfirewall deployed\n"); -} void logprintf(char *fmt, ...) { if (!arg_log) @@ -733,14 +785,8 @@ static const char *const usage_str = "Options:\n" " --help, -? - this help screen\n" " --log=filename - netlocker logfile\n" - " --netfilter - build the firewall rules and commit them\n" " --print-map - print IP map\n" - " --squash-map - compress IP map\n" - " --tail - \"tail -f\" functionality\n" - "Examples:\n" - " # fnettrace - traffic trace\n" - " # fnettrace --netfilter --log=logfile - netlocker, dump output in logfile\n" - " # fnettrace --tail --log=logifile - similar to \"tail -f logfile\"\n"; + " --squash-map - compress IP map\n"; static void usage(void) { puts(usage_str); @@ -771,11 +817,11 @@ int main(int argc, char **argv) { else if (strcmp(argv[i], "--print-map") == 0) { char *fname = "static-ip-map.txt"; load_hostnames(fname); - radix_print(0); + radix_print(stdout, 0); return 0; } else if (strncmp(argv[i], "--squash-map=", 13) == 0) { - if (i !=(argc - 1)) { + if (i != (argc - 1)) { fprintf(stderr, "Error: please provide a map file\n"); return 1; } @@ -793,15 +839,11 @@ int main(int argc, char **argv) { printf("# License GPLv2\n"); printf("#\n"); - radix_print(0); + radix_print(stdout, 0); printf("\n#\n#\n# input %d, output %d\n#\n#\n", in, radix_nodes); fprintf(stderr, "static ip map: input %d, output %d\n", in, radix_nodes); return 0; } - else if (strcmp(argv[i], "--netfilter") == 0) - arg_netfilter = 1; - else if (strcmp(argv[i], "--tail") == 0) - arg_tail = 1; else if (strncmp(argv[i], "--log=", 6) == 0) arg_log = argv[i] + 6; else { @@ -810,19 +852,6 @@ int main(int argc, char **argv) { } } - // tail - if (arg_tail) { - if (!arg_log) { - fprintf(stderr, "Error: no log file\n"); - usage(); - exit(1); - } - - tail(arg_log); - sleep(5); - exit(0); - } - if (getuid() != 0) { fprintf(stderr, "Error: you need to be root to run this program\n"); return 1; @@ -838,25 +867,10 @@ int main(int argc, char **argv) { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); ansi_clrscr(); - if (arg_netfilter) - logprintf("starting network lockdown\n"); - else { - char *fname = LIBDIR "/firejail/static-ip-map"; - load_hostnames(fname); - } + char *fname = LIBDIR "/firejail/static-ip-map"; + load_hostnames(fname); run_trace(); - if (arg_netfilter) { - // TCP path MTU discovery will not work properly since the firewall drops all ICMP packets - // Instead, we use iPacketization Layer PMTUD (RFC 4821) support in Linux kernel - int rv = system("echo 1 > /proc/sys/net/ipv4/tcp_mtu_probing"); - (void) rv; - - deploy_netfilter(); - sleep(3); - if (arg_log) - unlink(arg_log); - } return 0; } diff --git a/src/fnettrace/radix.c b/src/fnettrace/radix.c index 322ee2643..7062ae810 100644 --- a/src/fnettrace/radix.c +++ b/src/fnettrace/radix.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -151,21 +151,22 @@ RNode *radix_longest_prefix_match(uint32_t ip) { } static uint32_t sum; -static void print(RNode *ptr, int level, int pkts) { +static void print(FILE *fp, RNode *ptr, int level, int pkts) { + assert(fp); if (!ptr) return; if (ptr->name) { if (pkts) { if (ptr->pkts) { - printf(" %d.%d.%d.%d/%d ", PRINT_IP(sum << (32 - level)), level); - printf("%s", ptr->name); - printf(" (%u)\n", ptr->pkts); + fprintf(fp, " %d.%d.%d.%d/%d ", PRINT_IP(sum << (32 - level)), level); + fprintf(fp, "%s", ptr->name); + fprintf(fp, " (%u)\n", ptr->pkts); } } else { - printf("%d.%d.%d.%d/%d ", PRINT_IP(sum << (32 - level)), level); - printf("%s", ptr->name); - printf("\n"); + fprintf(fp, "%d.%d.%d.%d/%d ", PRINT_IP(sum << (32 - level)), level); + fprintf(fp, "%s", ptr->name); + fprintf(fp, "\n"); } } @@ -174,21 +175,21 @@ static void print(RNode *ptr, int level, int pkts) { level++; sum <<= 1; - print(ptr->zero, level, pkts); + print(fp, ptr->zero, level, pkts); sum++; - print(ptr->one, level, pkts); + print(fp, ptr->one, level, pkts); sum--; sum >>= 1; } -void radix_print(int pkts) { +void radix_print(FILE *fp, int pkts) { if (!head) return; sum = 0; - print(head->zero, 1, pkts); + print(fp, head->zero, 1, pkts); assert(sum == 0); sum = 1; - print(head->one, 1, pkts); + print(fp, head->one, 1, pkts); assert(sum == 1); } @@ -241,3 +242,18 @@ void radix_squash(void) { assert(sum == 1); } + +static void clear_data(RNode *ptr) { + if (!ptr) + return; + ptr->pkts = 0; + clear_data(ptr->zero); + clear_data(ptr->one); +} + +void radix_clear_data(void) { + if (!head) + return; + clear_data(head->zero); + clear_data(head->one); +} diff --git a/src/fnettrace/radix.h b/src/fnettrace/radix.h index 358524723..ce1b5a520 100644 --- a/src/fnettrace/radix.h +++ b/src/fnettrace/radix.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -30,7 +30,8 @@ typedef struct rnode_t { extern int radix_nodes; RNode *radix_longest_prefix_match(uint32_t ip); RNode*radix_add(uint32_t ip, uint32_t mask, char *name); -void radix_print(int pkts); +void radix_print(FILE *fp, int pkts); void radix_squash(void); +void radix_clear_data(void); #endif diff --git a/src/fnettrace/runprog.c b/src/fnettrace/runprog.c new file mode 100644 index 000000000..b6678229a --- /dev/null +++ b/src/fnettrace/runprog.c @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2014-2024 Firejail Authors + * + * This file is part of firejail project + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#include "fnettrace.h" + +int runprog(const char *program) { + assert(program); + FILE *fp = popen(program, "r"); + if (!fp) { + fprintf(stderr, "Error: cannot run %s\n", program); + return -1; + } + + return fileno(fp); +} diff --git a/src/fnettrace/static-ip-map.txt b/src/fnettrace/static-ip-map.txt index 756658562..f0427ab0c 100644 --- a/src/fnettrace/static-ip-map.txt +++ b/src/fnettrace/static-ip-map.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # # This file is part of firejail project # @@ -38,14 +38,24 @@ # -# local network addresses -192.168.0.0/16 local network -10.0.0.0/8 local network -172.16.0.0/16 local network -169.254.0.0/16 local link +# local network addresses (based on https://en.wikipedia.org/wiki/Reserved_IP_addresses) +10.0.0.0/8 Local network +100.64.0.0/10 Carrier-grade NAT +127.0.0.0/8 Local host +169.254.0.0/16 Local link +172.16.0.0/12 Local network +192.0.0.0/24 DS-Lite +192.0.2.0/24 Documentation +192.168.0.0/16 Local network +198.18.0.0/15 Testing +198.51.100.0/24 Documentation +192.88.99.0/24 Reserved +203.0.113.0/24 Documentation +233.252.0.0/24 Documentation +240.0.0.0/4 Reserved # multicast -224.0.0.0/4 multicast +224.0.0.0/4 Multicast 224.0.0.9/32 RIPv2 224.0.0.5/32 OSPF 224.0.0.6/32 OSPF @@ -86,17 +96,41 @@ 4.2.2.4/32 Level3 DNS 8.8.4.0/24 Google DNS 8.8.8.0/24 Google DNS +8.20.247.20/32 Comodo DNS +8.26.56.0/24 Comodo DNS 9.9.9.0/24 Quad9 DNS 45.90.28.0/22 NextDNS +45.11.45.0/24 DNS-SB +64.6.64.6/32 Neustar DNS +64.6.65.6/32 Neustar DNS +74.82.42.42/32 Hurricane Electric DNS +76.76.2.0/24 ControlD DNS +76.76.10.0/24 ControlD DNS +76.76.19.0/24 Alternate DNS +76.223.122.150/32 Alternate DNS +77.88.8.0/24 Yandex DNS +80.80.80.0/24 Freenom DNS Cloud +80.80.81.0/24 Freenom DNS Cloud +84.200.69.80/32 DSN Watch +84.200.70.40/32 DNS Watch 94.140.14.0/23 Adguard DNS 149.112.112.0/24 Quad9 DNS 149.112.120.0/21 CIRA DNS Canada -146.255.56.96/29 Applied Privacy +146.255.56.96/29 Applied Privacy DNS 176.103.128.0/19 Adguard DNS +185.222.222.0/24 DNS-SB 185.228.168.0/24 Cleanbrowsing DNS +185.236.104.0/24 FlashStart DNS +185.236.105.0/24 FlashStart DNS +185.253.5.0/24 NextDNS +193.110.81.0/24 NextDNS +205.171.3.66/32 CentyrLink DNS +205.171.202.166/32 CentyrLink DNS 208.67.216.0/21 OpenDNS +216.146.32.0/20 Dyn DNS # whois +45.88.202.0/24 Anonymize Inc WHOIS Privacy Service 192.0.32.0/20 ICANN 193.0.0.0/21 whois.ripe.net Netherlands 199.5.26.0/24 whois.arin.net US @@ -106,13 +140,15 @@ 199.212.0.0/24 whois.arin.net US 200.3.12.0/22 whois.lacnic.net Uruguay 201.159.220.0/22 whois.lacnic.net Ecuador +203.119.100.0/22 apnic.net Australia # some popular websites 5.255.255.0/24 Yandex 23.160.0.0/24 Twitch +23.229.128.0/17 GoDaddy 23.246.0.0/18 Netflix 31.13.24.0/21 Facebook -31.13.64.0/18 Facebook +31.13.64.0/17 Facebook 37.77.184.0/21 Netflix 45.57.0.0/17 Netflix 45.58.64.0/20 Dropbox @@ -132,9 +168,11 @@ 66.211.168.0/22 PayPal 66.211.172.0/22 eBay 66.211.176.0/20 eBay +66.218.64.0/19 Yahoo 66.220.144.0/20 Facebook 69.53.224.0/19 Netflix 69.171.224.0/19 Facebook +74.6.0.0/16 Yahoo 87.250.254.0/24 Yandex 91.105.192.0/23 Telegram 91.108.4.0/22 Telegram @@ -147,15 +185,16 @@ 91.189.94.0/24 Ubuntu One 95.161.64.0/20 Telegram 99.181.64.0/18 Twitch -103.53.48.0/23 Twitch -104.244.40.0/21 Twitter 103.10.124.0/23 Steam 103.28.54.0/24 Steam +103.53.48.0/23 Twitch +104.244.40.0/21 Twitter 108.160.160.0/20 Dropbox 108.175.32.0/20 Netflix +129.144.0.0/12 Oracle 129.134.0.0/16 Facebook 140.82.112.0/20 GitHub -143.55.64.0/20 Github +143.55.64.0/20 GitHub 146.66.152.0/24 Steam 146.66.155.0/24 Steam 149.154.160.0/20 Telegram @@ -186,7 +225,6 @@ 185.125.188.0/22 Ubuntu One 185.199.108.0/22 GitHub 185.205.69.0/24 Tutanota -185.238.113.0/24 Bitchute 188.64.224.0/21 Twitter 190.217.33.0/24 Steam 192.0.64.0/18 Wordpress @@ -199,20 +237,96 @@ 194.169.254.0/24 Ubuntu One 198.38.96.0/19 Netflix 198.45.48.0/20 Netflix +198.252.206.0/24 Stack Exchange 199.9.248.0/21 Twitch 199.16.156.0/22 Twitter 199.59.148.0/22 Twitter -199.168.96.24/29 BitChute 205.185.194.0/24 Steam 205.196.6.0/24 Steam 207.45.72.0/22 Netflix 207.241.224.0/20 Internet Archive +207.5.192.0/19 Rumble +208.82.236.0/22 Creiglist 208.64.200.0/22 Steam 208.75.76.0/22 Netflix 208.78.164.0/22 Steam 208.80.152.0/22 Wikipedia 209.140.128.0/18 eBay +# BitChute +63.141.247.168/29 BitChute +63.141.247.240/29 BitChute +69.30.200.200/29 BitChute +69.30.230.64/29 BitChute +69.30.230.96/29 BitChute +69.30.241.40/29 BitChute +69.30.241.48/29 BitChute +69.30.243.152/29 BitChute +69.30.243.168/29 BitChute +69.30.245.232/29 BitChute +69.30.253.16/29 BitChute +69.197.182.184/29 BitChute +74.91.28.208/29 BitChute +74.91.29.208/29 BitChute +69.197.138.24/29 BitChute +107.150.32.0/19 BitChute +107.150.35.192/29 BitChute +107.150.45.120/29 BitChute +142.54.180.104/29 BitChute +142.54.181.184/29 BitChute +142.54.188.112/29 BitChute +142.54.189.192/29 BitChute +173.208.154.8/29 BitChute +173.208.154.160/29 BitChute +173.208.176.128/29 BitChute +173.208.185.200/29 BitChute +173.208.203.224/29 BitChute +173.208.203.248/29 BitChute +173.208.211.224/29 BitChute +173.208.216.40/29 BitChute +173.208.219.112/29 BitChute +173.208.246.160/29 BitChute +185.238.113.0/24 BitChute +192.151.147.16/29 BitChute +192.151.158.136/29 BitChute +192.187.97.88/29 BitChute +192.187.97.232/29 BitChute +192.187.114.16/29 BitChute +192.187.114.96/29 BitChute +192.187.118.168/29 BitChute +192.187.121.208/29 BitChute +192.187.122.72/29 BitChute +192.187.123.112/29 BitChute +192.187.126.0/29 BitChute +198.204.226.120/29 BitChute +198.204.228.48/29 BitChute +198.204.235.88/29 BitChute +198.204.235.216/29 BitChute +198.204.244.112/29 BitChute +198.204.245.32/29 BitChute +198.204.245.88/29 BitChute +198.204.250.208/29 BitChute +198.204.251.24/29 BitChute +198.204.253.64/29 BitChute +198.204.253.184/29 BitChute +199.168.96.24/29 BitChute +199.168.96.64/29 BitChute +204.12.220.136/29 BitChute +204.12.194.176/29 BitChute +204.12.194.248/29 BitChute +204.12.220.232/29 BitChute +208.110.68.56/29 BitChute + +# WholeSale Internet +69.30.192.0/18 WholeSale Internet +69.197.128.0/18 WholeSale Internet +142.54.160.0/19 WholeSale Internet +173.208.128.0/17 WholeSale Internet +204.12.192.0/18 WholeSale Internet +208.67.0.0/21 WholeSale Internet +208.110.64.0/19 WholeSale Internet +208.110.91.0/24 WholeSale Internet + # Imperva 199.83.128.0/21 Imperva 198.143.32.0/19 Imperva @@ -237,6 +351,7 @@ 66.243.0.0/17 Level 3 66.243.128.0/18 Level 3 66.251.192.0/19 Level 3 +74.202.0.0/15 Level 3 205.128.0.0/14 Level 3 205.180.0.0/14 Level 3 205.184.0.0/19 Level 3 @@ -261,24 +376,17 @@ 205.224.0.0/14 Level 3 209.244.0.0/14 Level 3 -# WholeSale Internet -69.30.192.0/18 WholeSale Internet -69.197.128.0/18 WholeSale Internet -173.208.128.0/17 WholeSale Internet -204.12.192.0/18 WholeSale Internet -208.67.0.0/21 WholeSale Internet -208.110.64.0/19 WholeSale Internet -208.110.91.0/24 WholeSale Internet - # StackPath 69.16.173.0/24 StackPath 69.16.174.0/23 StackPath 69.16.176.0/20 StackPath +74.209.128.0/20 StackPath 151.139.0.0/16 StackPath 205.185.194.0/23 StackPath 205.185.196.0/23 StackPath 205.185.198.0/24 StackPath 205.185.200.0/21 StackPath +205.185.208.0/24 StackPath 205.185.212.0/23 StackPath 205.185.215.0/24 StackPath 205.185.216.0/23 StackPath @@ -299,7 +407,10 @@ 205.185.220.0/24 StackPath # Linode +45.79.0.0/16 Linode +50.116.0.0/18 Linode 66.175.208.0/20 Linode +74.207.224.0/19 Linode 103.29.68.0/22 Linode 104.200.16.0/21 Linode 104.200.24.0/22 Linode @@ -397,6 +508,7 @@ 172.105.0.0/19 Linode 172.105.112.0/20 Linode 172.105.128.0/23 Linode +173.255.192.0/18 Linode # Akamai 2.16.0.0/13 Akamai @@ -406,6 +518,8 @@ 23.72.0.0/13 Akamai 23.192.0.0/11 Akamai 72.246.0.0/15 Akamai +74.121.124.0/22 Akamai +92.122.160.0/20 Akamai 96.6.0.0/15 Akamai 96.16.0.0/15 Akamai 104.64.0.0/10 Akamai @@ -464,6 +578,8 @@ 108.44.64.0/18 MCI 108.45.0.0/16 MCI 108.46.0.0/16 MCI +152.176.0.0/12 MCI +152.192.0.0/13 MCI 192.229.128.0/17 MCI # Microsoft @@ -478,6 +594,7 @@ 20.48.0.0/12 Microsoft 20.128.0.0/16 Microsoft 20.192.0.0/10 Microsoft +23.96.0.0/13 Microsoft 40.76.0.0/14 Microsoft 40.96.0.0/12 Microsoft 40.112.0.0/13 Microsoft @@ -486,11 +603,40 @@ 40.80.0.0/12 Microsoft 40.120.0.0/14 Microsoft 40.125.0.0/17 Microsoft +51.4.0.0/15 Microsoft +51.8.0.0/16 Microsoft +51.10.0.0/14 Microsoft +51.51.0.0/16 Microsoft +51.53.0.0/16 Microsoft +51.103.0.0/16 Microsoft +51.107.0.0/16 Microsoft +51.116.0.0/16 Microsoft +51.120.0.0/16 Microsoft +51.124.0.0/16 Microsoft +51.132.0.0/16 Microsoft +51.136.0.0/16 Microsoft +51.140.0.0/15 Microsoft +52.96.0.0/12 Microsoft +52.112.0.0/14 Microsoft +52.120.0.0/14 Microsoft +52.125.0.0/16 Microsoft +52.126.0.0/15 Microsoft +52.132.0.0/14 Microsoft +52.136.0.0/13 Microsoft 52.145.0.0/16 Microsoft +52.146.0.0/15 Microsoft 52.148.0.0/14 Microsoft 52.152.0.0/13 Microsoft -52.146.0.0/15 Microsoft 52.160.0.0/11 Microsoft +52.224.0.0/11 Microsoft +74.160.0.0/14 Microsoft +74.176.0.0/14 Microsoft +74.224.0.0/14 Microsoft +74.234.0.0/15 Microsoft +74.240.0.0/14 Microsoft +74.248.0.0/15 Microsoft +168.61.0.0/16 Microsoft +168.62.0.0/15 Microsoft # Yahoo 63.250.192.0/19 Yahoo @@ -504,6 +650,7 @@ 206.190.32.0/19 Yahoo 209.73.160.0/19 Yahoo 209.191.64.0/18 Yahoo +212.82.100.0/22 Yahoo 216.115.96.0/20 Yahoo # Google @@ -513,10 +660,22 @@ 8.35.192.0/20 Google 23.236.48.0/20 Google 23.251.128.0/19 Google +34.4.16.0/20 Google +34.4.64.0/18 Google +34.4.6.0/23 Google +34.16.0.0/12 Google +34.32.0.0/11 Google +34.4.128.0/17 Google +34.8.0.0/13 Google +34.4.8.0/21 Google +34.5.0.0/16 Google +34.6.0.0/15 Google +34.4.32.0/19 Google +34.4.5.0/24 Google 34.64.0.0/10 Google 34.128.0.0/10 Google 35.184.0.0/13 Google -35.192.0.0/14 Google +35.192.0.0/12 Google 35.196.0.0/15 Google 35.198.0.0/16 Google 35.199.0.0/17 Google @@ -576,7 +735,7 @@ 103.21.244.0/22 Cloudflare 103.22.200.0/22 Cloudflare 103.31.4.0/22 Cloudflare -104.16.0.0/13 Cloudflare +104.16.0.0/12 Cloudflare 104.24.0.0/14 Cloudflare 108.162.192.0/18 Cloudflare 131.0.72.0/22 Cloudflare @@ -684,6 +843,7 @@ 3.136.0.0/13 Amazon 3.144.0.0/13 Amazon 3.152.0.0/13 Amazon +3.160.0.0/14 Amazon 3.208.0.0/12 Amazon 3.224.0.0/12 Amazon 3.240.0.0/13 Amazon @@ -1762,6 +1922,7 @@ 34.192.0.0/12 Amazon 34.208.0.0/12 Amazon 34.224.0.0/12 Amazon +34.225.127.72/10 Amazon 34.240.0.0/13 Amazon 34.248.0.0/13 Amazon 35.71.64.0/22 Amazon @@ -3310,7 +3471,7 @@ 54.93.0.0/16 Amazon 54.94.0.0/16 Amazon 54.95.0.0/16 Amazon -54.144.0.0/14 Amazon +54.144.0.0/12 Amazon 54.148.0.0/15 Amazon 54.150.0.0/16 Amazon 54.151.0.0/17 Amazon @@ -3321,7 +3482,7 @@ 54.154.0.0/16 Amazon 54.155.0.0/16 Amazon 54.156.0.0/14 Amazon -54.160.0.0/13 Amazon +54.160.0.0/11 Amazon 54.168.0.0/16 Amazon 54.169.0.0/16 Amazon 54.170.0.0/15 Amazon @@ -3334,7 +3495,7 @@ 54.182.0.0/16 Amazon 54.183.0.0/16 Amazon 54.184.0.0/13 Amazon -54.192.0.0/16 Amazon +54.192.0.0/12 Amazon 54.193.0.0/16 Amazon 54.194.0.0/15 Amazon 54.196.0.0/15 Amazon @@ -3345,12 +3506,12 @@ 54.204.0.0/15 Amazon 54.206.0.0/16 Amazon 54.207.0.0/16 Amazon -54.208.0.0/15 Amazon +54.208.0.0/13 Amazon 54.210.0.0/15 Amazon 54.212.0.0/15 Amazon 54.214.0.0/16 Amazon 54.215.0.0/16 Amazon -54.216.0.0/15 Amazon +54.216.0.0/14 Amazon 54.218.0.0/16 Amazon 54.219.0.0/16 Amazon 54.220.0.0/16 Amazon @@ -3610,6 +3771,10 @@ 72.21.192.0/19 Amazon 72.41.0.0/20 Amazon 72.44.32.0/19 Amazon +74.127.0.0/18 Amazon +74.190.0.0/16 Amazon +74.230.0.0/16 Amazon +74.250.0.0/16 Amazon 75.2.0.0/17 Amazon 75.101.128.0/17 Amazon 76.223.0.0/17 Amazon @@ -5014,22 +5179,7 @@ 164.92.208.0/20 Digital Ocean 164.92.224.0/20 Digital Ocean 164.92.240.0/20 Digital Ocean -165.22.0.0/20 Digital Ocean -165.22.16.0/20 Digital Ocean -165.22.32.0/20 Digital Ocean -165.22.48.0/20 Digital Ocean -165.22.64.0/20 Digital Ocean -165.22.80.0/20 Digital Ocean -165.22.96.0/20 Digital Ocean -165.22.112.0/20 Digital Ocean -165.22.128.0/20 Digital Ocean -165.22.144.0/20 Digital Ocean -165.22.160.0/20 Digital Ocean -165.22.176.0/20 Digital Ocean -165.22.192.0/20 Digital Ocean -165.22.208.0/20 Digital Ocean -165.22.224.0/20 Digital Ocean -165.22.240.0/20 Digital Ocean +165.22.0.0/16 Digital Ocean 165.227.0.0/20 Digital Ocean 165.227.16.0/20 Digital Ocean 165.227.32.0/20 Digital Ocean @@ -5591,3 +5741,375 @@ 64.120.69.0/24 Leaseweb 69.147.236.0/24 Leaseweb 70.32.34.0/24 Leaseweb + + + +# GoDaddy +103.1.172.0/22 GoDaddy +103.1.172.0/24 GoDaddy +103.1.174.0/24 GoDaddy +103.1.175.0/24 GoDaddy +104.238.64.0/18 GoDaddy +104.238.64.0/19 GoDaddy +104.238.64.0/22 GoDaddy +104.238.64.0/24 GoDaddy +107.180.0.0/17 GoDaddy +107.180.0.0/18 GoDaddy +107.180.100.0/22 GoDaddy +107.180.104.0/22 GoDaddy +107.180.108.0/22 GoDaddy +107.180.120.0/22 GoDaddy +107.180.64.0/19 GoDaddy +118.139.160.0/19 GoDaddy +118.139.160.0/21 GoDaddy +132.148.0.0/16 GoDaddy +132.148.16.0/20 GoDaddy +132.148.16.0/22 GoDaddy +132.148.164.0/22 GoDaddy +132.148.184.0/21 GoDaddy +132.148.192.0/20 GoDaddy +132.148.20.0/22 GoDaddy +132.148.24.0/22 GoDaddy +132.148.32.0/21 GoDaddy +148.66.128.0/19 GoDaddy +148.66.128.0/22 GoDaddy +148.66.136.0/22 GoDaddy +148.66.140.0/22 GoDaddy +148.66.144.0/21 GoDaddy +148.72.0.0/17 GoDaddy +148.72.16.0/22 GoDaddy +148.72.204.0/22 GoDaddy +148.72.204.0/24 GoDaddy +148.72.206.0/23 GoDaddy +148.72.208.0/21 GoDaddy +148.72.220.0/22 GoDaddy +148.72.224.0/19 GoDaddy +148.72.224.0/20 GoDaddy +148.72.240.0/22 GoDaddy +148.72.244.0/22 GoDaddy +148.72.32.0/21 GoDaddy +148.72.32.0/23 GoDaddy +148.72.34.0/24 GoDaddy +148.72.36.0/24 GoDaddy +148.72.4.0/22 GoDaddy +148.72.44.0/22 GoDaddy +148.72.88.0/22 GoDaddy +160.153.32.0/19 GoDaddy +160.153.64.0/18 GoDaddy +160.153.64.0/19 GoDaddy +160.153.96.0/19 GoDaddy +166.62.0.0/19 GoDaddy +166.62.0.0/22 GoDaddy +166.62.0.0/24 GoDaddy +166.62.100.0/22 GoDaddy +166.62.10.0/23 GoDaddy +166.62.1.0/24 GoDaddy +166.62.112.0/20 GoDaddy +166.62.116.0/22 GoDaddy +166.62.120.0/22 GoDaddy +166.62.12.0/22 GoDaddy +166.62.12.0/24 GoDaddy +166.62.13.0/24 GoDaddy +166.62.15.0/24 GoDaddy +166.62.16.0/22 GoDaddy +166.62.17.0/24 GoDaddy +166.62.20.0/22 GoDaddy +166.62.2.0/24 GoDaddy +166.62.23.0/24 GoDaddy +166.62.24.0/22 GoDaddy +166.62.24.0/24 GoDaddy +166.62.25.0/24 GoDaddy +166.62.26.0/23 GoDaddy +166.62.28.0/22 GoDaddy +166.62.3.0/24 GoDaddy +166.62.32.0/19 GoDaddy +166.62.32.0/22 GoDaddy +166.62.36.0/22 GoDaddy +166.62.40.0/22 GoDaddy +166.62.4.0/22 GoDaddy +166.62.4.0/24 GoDaddy +166.62.44.0/22 GoDaddy +166.62.5.0/24 GoDaddy +166.62.52.0/22 GoDaddy +166.62.56.0/22 GoDaddy +166.62.60.0/22 GoDaddy +166.62.6.0/23 GoDaddy +166.62.64.0/18 GoDaddy +166.62.64.0/19 GoDaddy +166.62.80.0/22 GoDaddy +166.62.8.0/22 GoDaddy +166.62.8.0/24 GoDaddy +166.62.84.0/22 GoDaddy +166.62.88.0/22 GoDaddy +166.62.9.0/24 GoDaddy + +# IBM cloud service +# https://cloud.ibm.com/docs/cloud-infrastructure?topic=cloud-infrastructure-ibm-cloud-ip-ranges +# last update Aug 2023 +159.8.198.0/23 IBM +169.38.118.0/23 IBM +173.192.118.0/23 IBM +192.255.18.0/24 IBM +198.23.118.0/23 IBM +169.46.118.0/23 IBM +169.47.118.0/23 IBM +169.48.118.0/24 IBM +159.122.118.0/23 IBM +161.156.118.0/24 IBM +149.81.118.0/23 IBM +5.10.118.0/23 IBM +158.175.127.0/24 IBM +141.125.118.0/23 IBM +158.176.118.0/23 IBM +159.122.138.0/23 IBM +169.54.118.0/23 IBM +163.68.118.0/24 IBM +163.69.118.0/24 IBM +163.73.118.0/24 IBM +159.8.118.0/23 IBM +169.57.138.0/23 IBM +50.23.118.0/23 IBM +169.45.118.0/23 IBM +169.62.118.0/24 IBM +174.133.118.0/23 IBM +168.1.18.0/23 IBM +130.198.118.0/23 IBM +135.90.118.0/23 IBM +161.202.118.0/23 IBM +128.168.118.0/23 IBM +165.192.118.0/23 IBM +158.85.118.0/23 IBM +163.74.118.0/23 IBM +163.75.118.0/23 IBM +208.43.118.0/23 IBM +192.255.38.0/24 IBM +169.55.118.0/23 IBM +169.60.118.0/23 IBM +169.61.118.0/23 IBM +159.8.197.0/24 IBM +169.38.117.0/24 IBM +50.23.203.0/24 IBM +108.168.157.0/24 IBM +173.192.117.0/24 IBM +192.155.205.0/24 IBM +169.46.187.0/24 IBM +198.23.117.0/24 IBM +169.46.117.0/24 IBM +169.47.117.0/24 IBM +169.48.117.0/24 IBM +159.122.117.0/24 IBM +161.156.117.0/24 IBM +149.81.117.0/24 IBM +5.10.117.0/24 IBM +158.175.117.0/24 IBM +141.125.117.0/24 IBM +158.176.117.0/24 IBM +159.122.137.0/24 IBM +169.54.117.0/24 IBM +159.8.117.0/24 IBM +169.57.137.0/24 IBM +50.23.117.0/24 IBM +169.45.117.0/24 IBM +174.133.117.0/24 IBM +168.1.17.0/24 IBM +130.198.117.0/24 IBM +135.90.117.0/24 IBM +161.202.117.0/24 IBM +128.168.117.0/24 IBM +165.192.117.0/24 IBM +158.85.117.0/24 IBM +50.22.248.0/25 IBM +169.54.27.0/24 IBM +198.11.250.0/24 IBM +208.43.117.0/24 IBM +169.55.117.0/24 IBM +169.60.117.0/24 IBM +169.61.117.0/24 IBM +12.96.160.0/24 IBM +66.98.240.192/26 IBM +67.18.139.0/24 IBM +67.19.0.0/24 IBM +70.84.160.0/24 IBM +70.85.125.0/24 IBM +75.125.126.8/32 IBM +209.85.4.0/26 IBM +216.12.193.9/32 IBM +216.40.193.0/24 IBM +216.234.234.0/24 IBM + +# Hetzner +116.202.0.0/16 Hetzner +116.203.0.0/16 Hetzner +128.140.0.0/17 Hetzner +135.181.0.0/16 Hetzner +142.132.128.0/17 Hetzner +157.90.0.0/16 Hetzner +159.69.0.0/16 Hetzner +162.55.0.0/16 Hetzner +167.233.0.0/16 Hetzner +167.235.0.0/16 Hetzner +168.119.0.0/16 Hetzner +176.9.0.0/16 Hetzner +178.63.0.0/16 Hetzner +188.34.128.0/17 Hetzner +188.40.0.0/16 Hetzner +195.201.0.0/16 Hetzner +213.239.192.0/18 Hetzner +23.88.0.0/17 Hetzner +37.27.0.0/16 Hetzner +46.4.0.0/16 Hetzner +49.12.0.0/16 Hetzner +49.13.0.0/16 Hetzner +5.75.128.0/17 Hetzner +5.9.0.0/16 Hetzner +65.108.0.0/16 Hetzner +65.109.0.0/16 Hetzner +65.21.0.0/16 Hetzner +78.46.0.0/15 Hetzner +85.10.192.0/18 Hetzner +88.198.0.0/16 Hetzner +88.99.0.0/16 Hetzner +91.107.128.0/17 Hetzner +94.130.0.0/16 Hetzner +95.216.0.0/16 Hetzner +95.217.0.0/16 Hetzner + +# Liquid Web +159.135.48.0/20 Liquid Web +162.212.134.0/24 Liquid Web +162.252.104.0/22 Liquid Web +172.255.59.0/24 Liquid Web +173.199.128.0/18 Liquid Web +184.106.55.0/24 Liquid Web +192.126.88.0/22 Liquid Web +192.133.82.0/24 Liquid Web +192.138.16.0/21 Liquid Web +192.190.220.0/22 Liquid Web +192.251.32.0/24 Liquid Web +199.189.224.0/22 Liquid Web +199.195.118.0/24 Liquid Web +205.174.24.0/22 Liquid Web +207.246.248.0/21 Liquid Web +208.75.148.0/22 Liquid Web +208.79.232.0/21 Liquid Web +208.86.152.0/21 Liquid Web +209.124.89.0/24 Liquid Web +209.188.80.0/20 Liquid Web +209.59.128.0/18 Liquid Web +50.28.0.0/18 Liquid Web +50.28.5.0/24 Liquid Web +50.28.64.0/19 Liquid Web +50.57.240.0/20 Liquid Web +64.50.144.0/20 Liquid Web +64.50.144.0/23 Liquid Web +64.50.148.0/22 Liquid Web +64.50.152.0/21 Liquid Web +64.91.224.0/19 Liquid Web +67.225.128.0/17 Liquid Web +67.227.128.0/17 Liquid Web +67.43.0.0/20 Liquid Web +68.66.211.0/24 Liquid Web +69.160.56.0/24 Liquid Web +69.16.192.0/18 Liquid Web +69.16.222.0/23 Liquid Web +69.167.128.0/18 Liquid Web +72.52.128.0/17 Liquid Web +96.30.0.0/18 Liquid Web + +# OVH +15.204.0.0/17 OVH +15.204.128.0/17 OVH +15.235.0.0/17 OVH +15.235.128.0/17 OVH +23.92.224.0/19 OVH +37.187.0.0/16 OVH +37.59.0.0/16 OVH +40.160.0.0/17 OVH +46.105.0.0/16 OVH +46.105.198.0/24 OVH +46.105.199.0/24 OVH +46.105.200.0/24 OVH +46.105.201.0/24 OVH +46.105.202.0/24 OVH +46.105.203.0/24 OVH +46.105.204.0/24 OVH +46.105.206.0/24 OVH +46.105.207.0/24 OVH +46.244.32.0/20 OVH +51.161.0.0/17 OVH +51.161.128.0/17 OVH +51.210.0.0/24 OVH +107.189.64.0/18 OVH +135.125.0.0/17 OVH +135.125.128.0/17 OVH +135.148.0.0/17 OVH +135.148.128.0/17 OVH +137.74.0.0/16 OVH +139.99.0.0/17 OVH +139.99.128.0/17 OVH +141.94.0.0/16 OVH +141.95.0.0/17 OVH +141.95.128.0/17 OVH +142.4.192.0/19 OVH +142.44.128.0/17 OVH +144.217.0.0/16 OVH +145.239.0.0/16 OVH +146.59.0.0/16 OVH +146.59.0.0/17 OVH +147.135.0.0/17 OVH +147.135.128.0/17 OVH +148.113.0.0/18 OVH +148.113.128.0/17 OVH +149.202.0.0/16 OVH +149.56.0.0/16 OVH +151.80.0.0/16 OVH +152.228.128.0/17 OVH +158.69.0.0/16 OVH +162.19.0.0/17 OVH +162.19.128.0/17 OVH +164.132.0.0/16 OVH +167.114.0.0/17 OVH +167.114.128.0/18 OVH +167.114.192.0/19 OVH +176.31.0.0/16 OVH +178.32.0.0/15 OVH +185.15.68.0/22 OVH +185.45.160.0/22 OVH +188.165.0.0/16 OVH +192.240.152.0/21 OVH +192.95.0.0/18 OVH +192.99.0.0/16 OVH +193.70.0.0/17 OVH +198.100.144.0/20 OVH +198.244.128.0/17 OVH +198.245.48.0/20 OVH +198.27.64.0/18 OVH +198.27.92.0/24 OVH +198.50.128.0/17 OVH +213.186.32.0/19 OVH +213.251.128.0/18 OVH +213.32.0.0/17 OVH +217.182.0.0/16 OVH + +# Ionos +74.208.0.0/16 Ionos + +# WPEngine +141.193.213.0/24 WPEngine + +# Dreamhost +208.113.128.0/17 Dreamhost + +# Shopify +23.227.32.0/19 Shopify + +# Sucuri +66.248.200.0/22 Sucuri +185.93.228.0/22 Sucuri +192.88.134.0/23 Sucuri +192.124.249.0/24 Sucuri +192.161.0.0/24 Sucuri + +# HostGator +# Bluehost +# Squarespace diff --git a/src/fnettrace/terminal.c b/src/fnettrace/terminal.c index 0ca307bad..c9f73ee8c 100644 --- a/src/fnettrace/terminal.c +++ b/src/fnettrace/terminal.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fsec-optimize/Makefile b/src/fsec-optimize/Makefile index 12ac5f1a9..babed1fdb 100644 --- a/src/fsec-optimize/Makefile +++ b/src/fsec-optimize/Makefile @@ -2,11 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fsec-optimize -PROG = fsec-optimize +MOD = fsec-optimize +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/seccomp.h ../include/syscall.h EXTRA_OBJS = ../lib/common.o ../lib/errno.o include $(ROOT)/src/prog.mk diff --git a/src/fsec-optimize/fsec_optimize.h b/src/fsec-optimize/fsec_optimize.h index f26f26907..0038d6ef3 100644 --- a/src/fsec-optimize/fsec_optimize.h +++ b/src/fsec-optimize/fsec_optimize.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fsec-optimize/main.c b/src/fsec-optimize/main.c index 38ba7c697..97dd9b65d 100644 --- a/src/fsec-optimize/main.c +++ b/src/fsec-optimize/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fsec-optimize/optimizer.c b/src/fsec-optimize/optimizer.c index c9b82b1a2..5f05faa5a 100644 --- a/src/fsec-optimize/optimizer.c +++ b/src/fsec-optimize/optimizer.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fsec-print/Makefile b/src/fsec-print/Makefile index a506c1106..bf383d2d0 100644 --- a/src/fsec-print/Makefile +++ b/src/fsec-print/Makefile @@ -2,11 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fsec-print -PROG = fsec-print +MOD = fsec-print +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/seccomp.h ../include/syscall.h EXTRA_OBJS = ../lib/common.o ../lib/errno.o ../lib/syscall.o include $(ROOT)/src/prog.mk diff --git a/src/fsec-print/fsec_print.h b/src/fsec-print/fsec_print.h index 48cdcac7d..6a5d8d575 100644 --- a/src/fsec-print/fsec_print.h +++ b/src/fsec-print/fsec_print.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fsec-print/main.c b/src/fsec-print/main.c index 4d3e38648..e24145cd5 100644 --- a/src/fsec-print/main.c +++ b/src/fsec-print/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fsec-print/print.c b/src/fsec-print/print.c index 2f3b6f935..da4211423 100644 --- a/src/fsec-print/print.c +++ b/src/fsec-print/print.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fseccomp/Makefile b/src/fseccomp/Makefile index a7d88eb83..66bb58444 100644 --- a/src/fseccomp/Makefile +++ b/src/fseccomp/Makefile @@ -2,11 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fseccomp -PROG = fseccomp +MOD = fseccomp +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/syscall.h EXTRA_OBJS = ../lib/common.o ../lib/errno.o ../lib/syscall.o include $(ROOT)/src/prog.mk diff --git a/src/fseccomp/fseccomp.h b/src/fseccomp/fseccomp.h index df971d2d9..a60f64672 100644 --- a/src/fseccomp/fseccomp.h +++ b/src/fseccomp/fseccomp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fseccomp/main.c b/src/fseccomp/main.c index e7823d3c5..9430e12f7 100644 --- a/src/fseccomp/main.c +++ b/src/fseccomp/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fseccomp/namespaces.c b/src/fseccomp/namespaces.c index e6c63219f..f9d1d7b98 100644 --- a/src/fseccomp/namespaces.c +++ b/src/fseccomp/namespaces.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fseccomp/protocol.c b/src/fseccomp/protocol.c index 7c1c99df1..b798faa67 100644 --- a/src/fseccomp/protocol.c +++ b/src/fseccomp/protocol.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fseccomp/seccomp.c b/src/fseccomp/seccomp.c index 9941b9ccd..9553361d1 100644 --- a/src/fseccomp/seccomp.c +++ b/src/fseccomp/seccomp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fseccomp/seccomp_file.c b/src/fseccomp/seccomp_file.c index b44672d46..8bc1d6e03 100644 --- a/src/fseccomp/seccomp_file.c +++ b/src/fseccomp/seccomp_file.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fseccomp/seccomp_secondary.c b/src/fseccomp/seccomp_secondary.c index a90544c81..d5ca896a7 100644 --- a/src/fseccomp/seccomp_secondary.c +++ b/src/fseccomp/seccomp_secondary.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fshaper/fshaper.sh b/src/fshaper/fshaper.sh index 451cae644..16a2485bf 100755 --- a/src/fshaper/fshaper.sh +++ b/src/fshaper/fshaper.sh @@ -1,15 +1,11 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 -TCFILE="" -if [ -x "/usr/sbin/tc" ]; then - TCFILE="/usr/sbin/tc" -elif [ -x "/sbin/tc" ]; then - TCFILE="/sbin/tc"; -else - echo "Error: traffic control utility (tc) not found"; +TCFILE="$(PATH=/usr/sbin:/sbin:/run/current-system/sw/bin command -v tc)" +if [ -z "$TCFILE" ]; then + echo "Error: traffic control utility (tc) not found" exit 1 fi diff --git a/src/ftee/Makefile b/src/ftee/Makefile index 1b1cdec43..f4d95de4a 100644 --- a/src/ftee/Makefile +++ b/src/ftee/Makefile @@ -2,8 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/ftee -PROG = ftee +MOD = ftee +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) include $(ROOT)/src/prog.mk diff --git a/src/ftee/ftee.h b/src/ftee/ftee.h index d8cb4ae84..72bc8aed3 100644 --- a/src/ftee/ftee.h +++ b/src/ftee/ftee.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/ftee/main.c b/src/ftee/main.c index 20e25c202..00bcd6d5c 100644 --- a/src/ftee/main.c +++ b/src/ftee/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/fzenity/Makefile b/src/fzenity/Makefile index cb80ec0bc..4cebe7ac5 100644 --- a/src/fzenity/Makefile +++ b/src/fzenity/Makefile @@ -2,10 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/fzenity -PROG = fzenity +MOD = fzenity +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h - include $(ROOT)/src/prog.mk diff --git a/src/include/common.h b/src/include/common.h index 4a2b8c1bf..61a27ded9 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -39,13 +39,15 @@ // dbus proxy path used by firejail and firemon #define XDG_DBUS_PROXY_PATH "/usr/bin/xdg-dbus-proxy" -#define errExit(msg) do { \ - char msgout[500]; \ - snprintf(msgout, 500, "Error %s/%s:%d %s(): %s", \ - MOD_DIR, __FILE__, __LINE__, __func__, msg); \ - perror(msgout); \ - exit(1); \ -} while (0) +#define errExit(msg) _errExit(__FILE__, __LINE__, __func__, msg) + +static inline void __attribute__((noreturn)) +_errExit(const char *fname, int lineno, const char *func, const char *msg) { + char msgout[500]; + snprintf(msgout, 500, "Error %s:%d: %s: %s", fname, lineno, func, msg); + perror(msgout); + exit(1); +} // macro to print ip addresses in a printf statement #define PRINT_IP(A) \ diff --git a/src/include/etc_groups.h b/src/include/etc_groups.h index 9e24256c0..c0a6b289f 100644 --- a/src/include/etc_groups.h +++ b/src/include/etc_groups.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -70,6 +70,7 @@ static char *etc_group_sound[] = { "alsa", "asound.conf", "machine-id", // required by PulseAudio + "pipewire", "pulse", NULL }; @@ -78,6 +79,7 @@ static char *etc_group_sound[] = { static char *etc_group_tls_ca[] = { "ca-certificates", "crypto-policies", + "gnutls", "pki", "ssl", NULL diff --git a/src/include/euid_common.h b/src/include/euid_common.h index 0c7e9d24e..4f9146530 100644 --- a/src/include/euid_common.h +++ b/src/include/euid_common.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/include/firejail_user.h b/src/include/firejail_user.h index 9198ce216..72e7f5dcf 100644 --- a/src/include/firejail_user.h +++ b/src/include/firejail_user.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/include/gcov_wrapper.h b/src/include/gcov_wrapper.h index 7c8f89d59..e467a1c32 100644 --- a/src/include/gcov_wrapper.h +++ b/src/include/gcov_wrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/include/ldd_utils.h b/src/include/ldd_utils.h index 00151afab..38f2db136 100644 --- a/src/include/ldd_utils.h +++ b/src/include/ldd_utils.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/include/pid.h b/src/include/pid.h index 80aa9f240..1c3409a7a 100644 --- a/src/include/pid.h +++ b/src/include/pid.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/include/rundefs.h b/src/include/rundefs.h index d36851a4e..00eaa47c6 100644 --- a/src/include/rundefs.h +++ b/src/include/rundefs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/include/seccomp.h b/src/include/seccomp.h index fc07b75ce..089b8e2ff 100644 --- a/src/include/seccomp.h +++ b/src/include/seccomp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/include/syscall.h b/src/include/syscall.h index c9fa0c68f..00157965d 100644 --- a/src/include/syscall.h +++ b/src/include/syscall.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/jailcheck/Makefile b/src/jailcheck/Makefile index 0b57861c6..431a21c8e 100644 --- a/src/jailcheck/Makefile +++ b/src/jailcheck/Makefile @@ -2,11 +2,11 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/jailcheck -PROG = jailcheck +MOD = jailcheck +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h ../include/pid.h EXTRA_OBJS = ../lib/common.o ../lib/pid.o include $(ROOT)/src/prog.mk diff --git a/src/jailcheck/access.c b/src/jailcheck/access.c index 08c3a51a1..5fbcb5a15 100644 --- a/src/jailcheck/access.c +++ b/src/jailcheck/access.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -80,10 +80,13 @@ void access_setup(const char *directory) { FILE *fp = fopen(test_file, "w"); if (!fp) { printf("Warning: I cannot create test file in directory %s, skipping...\n", directory); + free(test_file); + free(path); return; } fprintf(fp, "this file was created by firetest utility, you can safely delete it\n"); fclose(fp); + free(path); int rv = chown(test_file, user_uid, user_gid); if (rv) errExit("chown"); diff --git a/src/jailcheck/apparmor.c b/src/jailcheck/apparmor.c index 658928ed5..cbd1ad506 100644 --- a/src/jailcheck/apparmor.c +++ b/src/jailcheck/apparmor.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/jailcheck/jailcheck.h b/src/jailcheck/jailcheck.h index f6bee9436..0e011c4a4 100644 --- a/src/jailcheck/jailcheck.h +++ b/src/jailcheck/jailcheck.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/jailcheck/main.c b/src/jailcheck/main.c index 6cc5cf904..597767cb5 100644 --- a/src/jailcheck/main.c +++ b/src/jailcheck/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/jailcheck/network.c b/src/jailcheck/network.c index a4d5eeec1..469621ea2 100644 --- a/src/jailcheck/network.c +++ b/src/jailcheck/network.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/jailcheck/noexec.c b/src/jailcheck/noexec.c index bfeff9c7f..e5657135d 100644 --- a/src/jailcheck/noexec.c +++ b/src/jailcheck/noexec.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -55,6 +55,7 @@ void noexec_setup(void) { execfile_len = s.st_size; close(fd); } + free(self); } } @@ -110,4 +111,5 @@ void noexec_test(const char *path) { wait(&status); int rv = unlink(fname); (void) rv; + free(fname); } diff --git a/src/jailcheck/seccomp.c b/src/jailcheck/seccomp.c index 6cc13c5e7..e299be3f0 100644 --- a/src/jailcheck/seccomp.c +++ b/src/jailcheck/seccomp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/jailcheck/sysfiles.c b/src/jailcheck/sysfiles.c index f8094c5be..f4e19b49a 100644 --- a/src/jailcheck/sysfiles.c +++ b/src/jailcheck/sysfiles.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/jailcheck/utils.c b/src/jailcheck/utils.c index 930820604..3fb330b91 100644 --- a/src/jailcheck/utils.c +++ b/src/jailcheck/utils.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/jailcheck/virtual.c b/src/jailcheck/virtual.c index 9cc714529..348efc784 100644 --- a/src/jailcheck/virtual.c +++ b/src/jailcheck/virtual.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -49,6 +49,7 @@ void virtual_setup(const char *directory) { FILE *fp = fopen(test_file, "w"); if (!fp) { printf("Warning: I cannot create test file in directory %s, skipping...\n", directory); + free(test_file); return; } fprintf(fp, "this file was created by firetest utility, you can safely delete it\n"); diff --git a/src/lib/Makefile b/src/lib/Makefile index 9cf8abe36..4b2303e52 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -2,7 +2,8 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/lib +MOD = lib +MOD_DIR = $(ROOT)/src/$(MOD) TARGET = lib include $(ROOT)/src/prog.mk diff --git a/src/lib/common.c b/src/lib/common.c index eee19c731..7706077ec 100644 --- a/src/lib/common.c +++ b/src/lib/common.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/lib/errno.c b/src/lib/errno.c index 8103dec3b..9ef96a4af 100644 --- a/src/lib/errno.c +++ b/src/lib/errno.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/lib/firejail_user.c b/src/lib/firejail_user.c index a924f26cf..711cb4516 100644 --- a/src/lib/firejail_user.c +++ b/src/lib/firejail_user.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/lib/ldd_utils.c b/src/lib/ldd_utils.c index 80e3b92d7..fb36c0b28 100644 --- a/src/lib/ldd_utils.c +++ b/src/lib/ldd_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/lib/pid.c b/src/lib/pid.c index e76f66910..3f40ecdf3 100644 --- a/src/lib/pid.c +++ b/src/lib/pid.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/lib/syscall.c b/src/lib/syscall.c index ca7c61c8e..bc9956e90 100644 --- a/src/lib/syscall.c +++ b/src/lib/syscall.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -1104,13 +1104,13 @@ static const SyscallGroupList sysgroups[] = { #ifdef SYS_pciconfig_write "pciconfig_write," #endif -#ifdef SYS_s390_mmio_read - "s390_mmio_read," +#ifdef SYS_s390_pci_mmio_read + "s390_pci_mmio_read," #endif -#ifdef SYS_s390_mmio_write - "s390_mmio_write" +#ifdef SYS_s390_pci_mmio_write + "s390_pci_mmio_write" #endif -#if !defined(SYS_ioperm) && !defined(SYS_iopl) && !defined(SYS_pciconfig_iobase) && !defined(SYS_pciconfig_read) && !defined(SYS_pciconfig_write) && !defined(SYS_s390_mmio_read) && !defined(SYS_s390_mmio_write) +#if !defined(SYS_ioperm) && !defined(SYS_iopl) && !defined(SYS_pciconfig_iobase) && !defined(SYS_pciconfig_read) && !defined(SYS_pciconfig_write) && !defined(SYS_s390_pci_mmio_read) && !defined(SYS_s390_pci_mmio_write) "__dummy_syscall__" // workaround for s390x which doesn't have any of above defined and empty syscall lists are not allowed #endif }, diff --git a/src/libpostexecseccomp/Makefile b/src/libpostexecseccomp/Makefile index c9e25d066..a8d3fd8b7 100644 --- a/src/libpostexecseccomp/Makefile +++ b/src/libpostexecseccomp/Makefile @@ -2,10 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/libpostexecseccomp -SO = libpostexecseccomp.so +MOD = libpostexecseccomp +MOD_DIR = $(ROOT)/src/$(MOD) +SO = $(MOD_DIR)/$(MOD).so TARGET = $(SO) -EXTRA_HDRS = ../include/seccomp.h ../include/rundefs.h - include $(ROOT)/src/so.mk diff --git a/src/libpostexecseccomp/libpostexecseccomp.c b/src/libpostexecseccomp/libpostexecseccomp.c index 3a9ef9855..7f9123267 100644 --- a/src/libpostexecseccomp/libpostexecseccomp.c +++ b/src/libpostexecseccomp/libpostexecseccomp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/libtrace/Makefile b/src/libtrace/Makefile index 337529361..3493d1786 100644 --- a/src/libtrace/Makefile +++ b/src/libtrace/Makefile @@ -2,8 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/libtrace -SO = libtrace.so +MOD = libtrace +MOD_DIR = $(ROOT)/src/$(MOD) +SO = $(MOD_DIR)/$(MOD).so TARGET = $(SO) include $(ROOT)/src/so.mk diff --git a/src/libtrace/libtrace.c b/src/libtrace/libtrace.c index 25f0cc12e..ea9d922b6 100644 --- a/src/libtrace/libtrace.c +++ b/src/libtrace/libtrace.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/libtracelog/Makefile b/src/libtracelog/Makefile index 3e9d9e3e3..e9330236c 100644 --- a/src/libtracelog/Makefile +++ b/src/libtracelog/Makefile @@ -2,10 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/libtracelog -SO = libtracelog.so +MOD = libtracelog +MOD_DIR = $(ROOT)/src/$(MOD) +SO = $(MOD_DIR)/$(MOD).so TARGET = $(SO) -EXTRA_HDRS = ../include/rundefs.h - include $(ROOT)/src/so.mk diff --git a/src/libtracelog/libtracelog.c b/src/libtracelog/libtracelog.c index 0cb13d2a8..6f95c9b32 100644 --- a/src/libtracelog/libtracelog.c +++ b/src/libtracelog/libtracelog.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/man/Makefile b/src/man/Makefile index 526ed7fcb..767920e2b 100644 --- a/src/man/Makefile +++ b/src/man/Makefile @@ -2,6 +2,10 @@ ROOT = ../.. -include $(ROOT)/config.mk +GAWK ?= gawk +GZIP ?= gzip +RM ?= rm -f + MOD_DIR := $(ROOT)/src/man MANPAGES_IN := $(sort $(wildcard $(MOD_DIR)/*.in)) MANPAGES_GZ := $(MANPAGES_IN:.in=.gz) @@ -13,14 +17,14 @@ all: $(TARGET) # foo.1: foo.1.in $(MOD_DIR)/%: $(MOD_DIR)/%.in $(ROOT)/config.mk @printf 'Generating %s from %s\n' $@ $< - @gawk -f $(MOD_DIR)/preproc.awk -- $(MANFLAGS) <$< | \ + @$(GAWK) -f $(MOD_DIR)/preproc.awk -- $(MANFLAGS) <$< | \ $(MOD_DIR)/mkman.sh $(VERSION) >$@ # foo.1.gz: foo.1 $(MOD_DIR)/%.gz: $(MOD_DIR)/% @printf 'Generating %s from %s\n' $@ $< - @rm -f $@ - @gzip -n9 $< + @$(RM) $@ + @$(GZIP) -n9 $< .PHONY: clean -clean:; rm -f *.1 *.5 *.gz +clean:; $(RM) *.1 *.5 *.gz diff --git a/src/man/firecfg.1.in b/src/man/firecfg.1.in index a85fbc5da..e47014702 100644 --- a/src/man/firecfg.1.in +++ b/src/man/firecfg.1.in @@ -29,9 +29,13 @@ Note: The examples use \fBsudo\fR, but \fBdoas\fR is also supported. To set it up, run "sudo firecfg" after installing Firejail software. The same command should also be run after installing new programs. If the program is supported by Firejail, the symbolic link in /usr/local/bin -will be created. For a full list of programs supported by default run "cat /etc/firejail/firecfg.config". - -For user-driven manual integration, see \fBDESKTOP INTEGRATION\fR section in \fBman 1 firejail\fR. +will be created. +.PP +To configure the list of programs used by firecfg when creating symlinks, see +\fBFILES\fR and \fBSYNTAX\fR. +.PP +For user-driven manual integration, see \fBDESKTOP INTEGRATION\fR section in +\fBman 1 firejail\fR. .SH DEFAULT ACTIONS The following actions are implemented by default by running sudo firecfg: @@ -135,8 +139,67 @@ $ sudo firecfg --clean /usr/local/bin/vlc removed .br [...] +.SH SYNTAX +Configuration file syntax: +.PP +A line that starts with \fB#\fR is considered a comment. +.br +A line that starts with \fB!PROGRAM\fR means to ignore "PROGRAM" when creating +symlinks and fixing .desktop files. +.br +A line that starts with anything else is considered to be the name of an +executable and firecfg will attempt to create a symlink for it. +.PP +For example, to prevent firecfg from creating symlinks for "firefox" and +"patch" while attempting to create a symlink for "myprog", the following lines +could be added to /etc/firejail/firecfg.d/10-my.conf: +.PP +.RS +!firefox +.br +!patch +.br - +.br +myprog +.RE +.PP +Note that certain programs may use different naming schemes for their .desktop +file compared to the main executable. +To ensure that both files are handled in the same manner, it is recommended to +list both names in the configuration. +For example, if Spectacle has its main executable at /usr/bin/spectacle and its +\&.desktop file at /usr/share/applications/org.kde.spectacle.desktop, then the +following lines can to be used to ignore both: +.PP +.RS +!org.kde.spectacle +.br +!spectacle +.RE +.SH FILES +.PP +Configuration files are searched for and parsed in the following paths: +.PP +.RS +1. /etc/firejail/firecfg.d/*.conf (in alphabetical order) +.br +2. /etc/firejail/firecfg.config +.RE +.PP +The programs that are supported by default are listed in +/etc/firejail/firecfg.config. +It is recommended to leave it as is and put all customizations inside +/etc/firejail/firecfg.d/. +.PP +Profile files are also searched in the user configuration directory: +.PP +.RS +3. ~/.config/firejail/*.profile +.RE +.PP +For every \fBPROGRAM.profile\fR file found, firecfg attempts to create a +symlink for "PROGRAM", as if "PROGRAM" was listed in a configuration file. .SH LICENSE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP diff --git a/src/man/firejail-profile.5.in b/src/man/firejail-profile.5.in index fa294d888..a6856212e 100644 --- a/src/man/firejail-profile.5.in +++ b/src/man/firejail-profile.5.in @@ -243,7 +243,7 @@ host filesystem. Each line describes a file/directory that is inaccessible a tmpfs mounted on top of an existing directory (\fBtmpfs\fR), or mount-bind a directory or file on top of another directory or file (\fBbind\fR). Use \fBprivate\fR to set private mode. File globbing is supported, and PATH and -HOME directories are searched, see the \fBfirejail\f(1) \fBFILE GLOBBING\fR section +HOME directories are searched, see the \fBfirejail\fR(1) \fBFILE GLOBBING\fR section for more details. Examples: .TP @@ -382,9 +382,11 @@ Set working directory inside jail to the home directory, and failing that, the r Set working directory inside the jail. Full directory path is required. Symbolic links are not allowed. .TP \fBprivate-dev -Create a new /dev directory. Only disc, dri, dvb, hidraw, null, full, zero, tty, pts, ptmx, -random, snd, urandom, video, log, shm and usb devices are available. -Use the options no3d, nodvd, nosound, notv, nou2f and novideo for additional restrictions. +Create a new /dev directory. +Only disc, dri, dvb, full, hidraw, log, null, ptmx, pts, random, shm, snd, tpm, +tty, urandom, usb, video and zero devices are available. +Use the options no3d, nodvd, nosound, notpm, notv, nou2f and novideo for +additional restrictions. .TP \fBprivate-etc file,directory @@ -507,6 +509,35 @@ Blacklist all Linux capabilities. .TP \fBcaps.keep capability,capability,capability Whitelist given Linux capabilities. +#ifdef HAVE_LANDLOCK +.TP +\fBlandlock.enforce\fR (experimental) +Enforce the Landlock ruleset. +.PP +Without it, the other Landlock commands have no effect. +.TP +\fBlandlock.fs.read path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add a read access +rule for path. +.TP +\fBlandlock.fs.write path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add a write access +rule for path. +.TP +\fBlandlock.fs.makeipc path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add a rule that +allows the creation of named pipes (FIFOs) and Unix domain sockets beneath +the given path. +.TP +\fBlandlock.fs.makedev path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add a rule that +allows the creation of block devices and character devices beneath the given +path. +.TP +\fBlandlock.fs.execute path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add an execution +permission rule for path. +#endif .TP \fBmemory-deny-write-execute Install a seccomp filter to block attempts to create memory mappings @@ -637,20 +668,20 @@ Enable filtered access to the system DBus. Filters can be specified with the dbu \fBdbus-system none Disable access to the system DBus. Once access is disabled, it cannot be relaxed to filtering. .TP -\fBdbus-system.own org.gnome.ghex.* -Allow the application to own the name org.gnome.ghex and all names underneath in on the system DBus. -.TP -\fBdbus-system.talk org.freedesktop.Notifications -Allow the application to talk to the name org.freedesktop.Notifications on the system DBus. -.TP -\fBdbus-system.see org.freedesktop.Notifications -Allow the application to see but not talk to the name org.freedesktop.Notifications on the system DBus. +\fBdbus-system.broadcast org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications +Allow the application to receive broadcast signals from the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the system DBus. .TP \fBdbus-system.call org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications Allow the application to call methods of the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the system DBus. .TP -\fBdbus-system.broadcast org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications -Allow the application to receive broadcast signals from the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the system DBus. +\fBdbus-system.own org.gnome.ghex.* +Allow the application to own the name org.gnome.ghex and all names underneath in on the system DBus. +.TP +\fBdbus-system.see org.freedesktop.Notifications +Allow the application to see but not talk to the name org.freedesktop.Notifications on the system DBus. +.TP +\fBdbus-system.talk org.freedesktop.Notifications +Allow the application to talk to the name org.freedesktop.Notifications on the system DBus. .TP \fBdbus-user filter Enable filtered access to the session DBus. Filters can be specified with the dbus-user.talk and dbus-user.own commands. @@ -658,22 +689,22 @@ Enable filtered access to the session DBus. Filters can be specified with the db \fBdbus-user none Disable access to the session DBus. Once access is disabled, it cannot be relaxed to filtering. .TP -\fBdbus-user.own org.gnome.ghex.* -Allow the application to own the name org.gnome.ghex and all names underneath in on the session DBus. -.TP -\fBdbus-user.talk org.freedesktop.Notifications -Allow the application to talk to the name org.freedesktop.Notifications on the session DBus. -.TP -\fBdbus-user.see org.freedesktop.Notifications -Allow the application to see but not talk to the name org.freedesktop.Notifications on the session DBus. +\fBdbus-user.broadcast org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications +Allow the application to receive broadcast signals from the the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the session DBus. .TP \fBdbus-user.call org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications Allow the application to call methods of the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the session DBus. .TP -\fBdbus-user.broadcast org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications -Allow the application to receive broadcast signals from the the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the session DBus. +\fBdbus-user.own org.gnome.ghex.* +Allow the application to own the name org.gnome.ghex and all names underneath in on the session DBus. .TP -\fBnodbus \fR(deprecated) +\fBdbus-user.see org.freedesktop.Notifications +Allow the application to see but not talk to the name org.freedesktop.Notifications on the session DBus. +.TP +\fBdbus-user.talk org.freedesktop.Notifications +Allow the application to talk to the name org.freedesktop.Notifications on the session DBus. +.TP +\fBnodbus\fR (deprecated) Disable D-Bus access (both system and session buses). Equivalent to dbus-system none and dbus-user none. .TP .br @@ -773,7 +804,7 @@ name browser \fBno3d Disable 3D hardware acceleration. .TP -\fBnoautopulse \fR(deprecated) +\fBnoautopulse\fR (deprecated) See keep-config-pulse. .TP \fBnodvd @@ -788,6 +819,9 @@ Disable input devices. \fBnosound Disable sound system. .TP +\fBnotpm +Disable Trusted Platform Module (TPM) devices. +.TP \fBnotv Disable DVB (Digital Video Broadcasting) TV devices. .TP @@ -799,11 +833,6 @@ Disable video capture devices. .TP \fBmachine-id Spoof id number in /etc/machine-id file - a new random id is generated inside the sandbox. -.TP -\fBshell none -Run the program directly, without a shell. - - #ifdef HAVE_NETWORK .SH Networking Networking features available in profile files. @@ -837,20 +866,6 @@ net eth0 .br ip 10.10.20.56 -.TP -\fBip none -No IP address and no default gateway are configured for the last interface -defined by a net command. Use this option -in case you intend to start an external DHCP client in the sandbox. -.br - -.br -Example: -.br -net eth0 -.br -ip none - .TP \fBip dhcp Acquire an IP address and default gateway for the last interface defined by a @@ -878,6 +893,20 @@ If your DHCP server requires leases to be explicitly released, consider running a DHCP client and releasing the lease manually in conjunction with the net none command. +.TP +\fBip none +No IP address and no default gateway are configured for the last interface +defined by a net command. Use this option +in case you intend to start an external DHCP client in the sandbox. +.br + +.br +Example: +.br +net eth0 +.br +ip none + .TP \fBip6 address Assign IPv6 addresses to the last network interface defined by a net command. diff --git a/src/man/firejail.1.in b/src/man/firejail.1.in index 19fc94ebd..47cb7ccde 100644 --- a/src/man/firejail.1.in +++ b/src/man/firejail.1.in @@ -42,15 +42,6 @@ Miscellaneous: firejail {\-? | \-\-debug-caps | \-\-debug-errnos | \-\-debug-syscalls | \-\-debug-syscalls32 | \-\-debug-protocols | \-\-help | \-\-version} .RE .SH DESCRIPTION -#ifdef HAVE_LTS -This is Firejail long-term support (LTS), an enterprise focused version of the software, -LTS is usually supported for two or three years. -During this time only bugs and the occasional documentation problems are fixed. -The attack surface of the SUID executable was greatly reduced by removing some of the features. -.br - -.br -#endif Firejail is a SUID sandbox program that reduces the risk of security breaches by restricting the running environment of untrusted applications using Linux namespaces, seccomp-bpf and Linux capabilities. @@ -104,7 +95,12 @@ $ firejail [OPTIONS] # starting the program specified in $SHELL, $ firejail [OPTIONS] firefox # starting Mozilla Firefox .PP # sudo firejail [OPTIONS] /etc/init.d/nginx start - +.PP +When an option is specified multiple times (whether in a profile, on the +command line, or both) or conflicts with a related option, the +precedence/behavior is option-specific and usually documented in the +\fBOPTIONS\fR section below. Note that an option specified in a profile can +generally be disabled on the command line using \fB--ignore\fR. .SH OPTIONS .TP \fB\-\- @@ -211,7 +207,7 @@ $ firejail \-\-blacklist=/sbin \-\-blacklist=/usr/sbin .br $ firejail \-\-blacklist=~/.mozilla .br -$ firejail "\-\-blacklist=/home/username/My Virtual Machines" +$ firejail \-\-blacklist="/home/username/My Virtual Machines" .br $ firejail \-\-blacklist=/home/username/My\\ Virtual\\ Machines .TP @@ -614,21 +610,6 @@ Example: .br $ firejail --dbus-user=filter --dbus-user.own=org.gnome.ghex.* -.TP -\fB\-\-dbus-user.talk=name -Allows the application to talk to the specified well-known name on the session DBus. -The name may have a .* suffix to match all names underneath it, including itself -(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but -not "foobar"). -.br - -.br -Example: -.br -$ firejail --dbus-user=filter --dbus-user.talk=\\ -.br -org.freedesktop.Notifications - .TP \fB\-\-dbus-user.see=name Allows the application to see, but not talk to the specified well-known name on @@ -644,6 +625,21 @@ Example: $ firejail --dbus-user=filter --dbus-user.see=\\ .br org.freedesktop.Notifications + +.TP +\fB\-\-dbus-user.talk=name +Allows the application to talk to the specified well-known name on the session DBus. +The name may have a .* suffix to match all names underneath it, including itself +(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but +not "foobar"). +.br + +.br +Example: +.br +$ firejail --dbus-user=filter --dbus-user.talk=\\ +.br +org.freedesktop.Notifications #endif .TP \fB\-\-debug\fR @@ -788,7 +784,6 @@ $ firejail \-\-list .br $ firejail \-\-dns.print=3272 -#ifdef HAVE_NETWORK .TP \fB\-\-dnstrace[=name|pid] Monitor DNS queries. The sandbox can be specified by name or pid. Only networked sandboxes @@ -828,7 +823,6 @@ $ sudo firejail --dnstrace .br 11:32:08 9.9.9.9 www.youtube.com (type 1) .br -#endif .TP \fB\-\-env=name=value @@ -894,6 +888,32 @@ Example: .br $ firejail \-\-hosts-file=~/myhosts firefox +.TP +\fB\-\-icmptrace[=name|pid] +Monitor ICMP traffic. The sandbox can be specified by name or pid. Only networked sandboxes +created with \-\-net are supported. This option is only available when running the sandbox as root. +.br + +.br +Without a name/pid, Firejail will monitor the main system network namespace. +.br + +.br +Example +.br +$ sudo firejail --icmptrace +.br +20:53:54 192.168.1.60 -> 142.250.65.174 - 98 bytes - Echo request/0 +.br +20:53:54 142.250.65.174 -> 192.168.1.60 - 98 bytes - Echo reply/0 +.br +20:53:55 192.168.1.60 -> 142.250.65.174 - 98 bytes - Echo request/0 +.br +20:53:55 142.250.65.174 -> 192.168.1.60 - 98 bytes - Echo reply/0 +.br +20:53:55 192.168.1.60 -> 1.1.1.1 - 154 bytes - Destination unreachable/Port unreachable +.br + #ifdef HAVE_IDS .TP \fB\-\-ids-check @@ -930,36 +950,8 @@ $ firejail --ignore=seccomp --ignore=caps firefox $ firejail \-\-ignore="net eth0" firefox #endif -#ifdef HAVE_NETWORK .TP -\fB\-\-icmptrace[=name|pid] -Monitor ICMP traffic. The sandbox can be specified by name or pid. Only networked sandboxes -created with \-\-net are supported. This option is only available when running the sandbox as root. -.br - -.br -Without a name/pid, Firejail will monitor the main system network namespace. -.br - -.br -Example -.br -$ sudo firejail --icmptrace -.br -20:53:54 192.168.1.60 -> 142.250.65.174 - 98 bytes - Echo request/0 -.br -20:53:54 142.250.65.174 -> 192.168.1.60 - 98 bytes - Echo reply/0 -.br -20:53:55 192.168.1.60 -> 142.250.65.174 - 98 bytes - Echo request/0 -.br -20:53:55 142.250.65.174 -> 192.168.1.60 - 98 bytes - Echo reply/0 -.br -20:53:55 192.168.1.60 -> 1.1.1.1 - 154 bytes - Destination unreachable/Port unreachable -.br -#endif - -.TP -\fB\-\-\include=file.profile +\fB\-\-include=file.profile Include a profile file before the regular profiles are used. .br @@ -991,23 +983,6 @@ Example: .br $ firejail \-\-net=eth0 \-\-ip=10.10.20.56 firefox -.TP -\fB\-\-ip=none -No IP address and no default gateway are configured for the last interface -defined by a \-\-net option. Use this option -in case you intend to start an external DHCP client in the sandbox. -.br - -.br -Example: -.br -$ firejail \-\-net=eth0 \-\-\ip=none -.br - -.br -If the corresponding interface doesn't have an IP address configured, this -option is enabled by default. - .TP \fB\-\-ip=dhcp Acquire an IP address and default gateway for the last interface defined by a @@ -1033,6 +1008,23 @@ If your DHCP server requires leases to be explicitly released, consider running a DHCP client and releasing the lease manually in conjunction with the \-\-net=none option. +.TP +\fB\-\-ip=none +No IP address and no default gateway are configured for the last interface +defined by a \-\-net option. Use this option +in case you intend to start an external DHCP client in the sandbox. +.br + +.br +Example: +.br +$ firejail \-\-net=eth0 \-\-ip=none +.br + +.br +If the corresponding interface doesn't have an IP address configured, this +option is enabled by default. + .TP \fB\-\-ip6=address Assign IPv6 addresses to the last network interface defined by a \-\-net option. @@ -1078,7 +1070,7 @@ default gateway is assigned by default. .br Example: .br -$ firejail \-\-net=eth0 \-\-\iprange=192.168.1.100,192.168.1.150 +$ firejail \-\-net=eth0 \-\-iprange=192.168.1.100,192.168.1.150 .TP \fB\-\-ipc-namespace @@ -1247,6 +1239,42 @@ Example: .br $ firejail --keep-var-tmp +#ifdef HAVE_LANDLOCK +.TP +\fB\-\-landlock.enforce\fR (experimental) +Enforce the Landlock ruleset. +Without it, the other Landlock commands have no effect. +See the \fBLANDLOCK\fR section for more information. +.TP +\fB\-\-landlock.fs.read=path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add a read access +rule for path. +.TP +\fB\-\-landlock.fs.write=path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add a write access +rule for path. +.TP +\fB\-\-landlock.fs.makeipc=path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add a rule that +allows the creation of named pipes (FIFOs) and Unix domain sockets beneath +the given path. +.TP +\fB\-\-landlock.fs.makedev=path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add a rule that +allows the creation of block devices and character devices beneath the given +path. +.TP +\fB\-\-landlock.fs.execute=path\fR (experimental) +Create a Landlock ruleset (if it doesn't already exist) and add an execution +permission rule for path. +.br + +.br +Example: +.br +$ firejail \-\-landlock.fs.read=/ \-\-landlock.fs.write=/home +\-\-landlock.fs.execute=/usr \-\-landlock.enforce +#endif .TP \fB\-\-list List all sandboxes, see \fBMONITORING\fR section for more details. @@ -1295,6 +1323,21 @@ Example: .br $ firejail \-\-machine-id +.TP +\fB\-\-memory-deny-write-execute +Install a seccomp filter to block attempts to create memory mappings +that are both writable and executable, to change mappings to be +executable, or to create executable shared memory. The filter examines +the arguments of mmap, mmap2, mprotect, pkey_mprotect, memfd_create +and shmat system calls and returns error EPERM to the process (or +kills it or log the attempt, see \-\-seccomp-error-action below) if necessary. +.br + +.br +Note: shmat is not implemented +as a system call on some platforms including i386, and it cannot be +handled by seccomp-bpf. + .TP \fB\-\-mkdir=dirname Create a directory in user home. Parent directories are created as needed. @@ -1315,20 +1358,6 @@ Example: .br $ firejail --mkfile=~/work/project/readme -.TP -\fB\-\-memory-deny-write-execute -Install a seccomp filter to block attempts to create memory mappings -that are both writable and executable, to change mappings to be -executable, or to create executable shared memory. The filter examines -the arguments of mmap, mmap2, mprotect, pkey_mprotect, memfd_create -and shmat system calls and returns error EPERM to the process (or -kills it or log the attempt, see \-\-seccomp-error-action below) if necessary. -.br - -.br -Note: shmat is not implemented -as a system call on some platforms including i386, and it cannot be -handled by seccomp-bpf. #ifdef HAVE_NETWORK .TP \fB\-\-mtu=number @@ -1643,6 +1672,7 @@ PID User RX(KB/s) TX(KB/s) Command 1294 netblue 53.355 1.473 firejail \-\-net=eth0 firefox .br 7383 netblue 9.045 0.112 firejail \-\-net=eth0 transmission +#endif .TP \fB\-\-nettrace[=name|pid] Monitor received TCP. UDP, and ICMP traffic. The sandbox can be specified by name or pid. Only networked sandboxes @@ -1658,17 +1688,15 @@ Example: .br $ sudo firejail --nettrace .br - 95 KB/s geoip 457, IP database 4436 + 93 KB/s address:port (protocol) network .br - 52 KB/s *********** 64.222.84.207:443 United States + 14 B/s ** 104.24.8.4:443(QUIC) Cloudflare .br - 33 KB/s ******* 89.147.74.105:63930 Hungary + 80 KB/s ***************** 192.187.97.90:443(TLS) BitChute .br - 0 B/s 45.90.28.0:443 NextDNS + 1 B/s 149.56.228.45:443(DoH) Canada .br - 0 B/s 94.70.122.176:52309(UDP) Greece -.br - 339 B/s 104.26.7.35:443 Cloudflare +(D)isplay, (S)ave, (C)lear, e(X)it .br .br @@ -1677,7 +1705,6 @@ the country the traffic originates from is added to the trace. We also use the static IP map in /usr/lib/firejail/static-ip-map to print the domain names for some of the more common websites and cloud platforms. No external services are contacted for reverse IP lookup. -#endif .TP \fB\-\-nice=value Set nice value for all processes running inside the sandbox. @@ -1700,7 +1727,7 @@ Example: $ firejail --no3d firefox .TP -\fB\-\-noautopulse \fR(deprecated) +\fB\-\-noautopulse\fR (deprecated) See --keep-config-pulse. .TP @@ -1708,6 +1735,16 @@ See --keep-config-pulse. Disable blacklist for this directory or file. .br +Note that blacklist entries containing ${PATH} can not currently be partially +disabled for individual expanded paths. Only the whole unexpanded path +including ${PATH} can be disabled, which then applies to all expansions. +This limitation does not apply to expansions of other variables or wildcards. +For details, see +.UR https://github.com/netblue30/firejail/issues/6360 +#6360 +.UE +.br + .br Example: .br @@ -1723,12 +1760,20 @@ $ exit .br $ firejail --noblacklist=/bin/nc .br +bash: /bin/nc: Permission denied +.br +$ exit +.br + +.br +$ firejail --noblacklist='${PATH}/nc' +.br $ nc dict.org 2628 .br 220 pan.alephnull.com dictd 1.12.1/rf on Linux 3.14-1-amd64 .br .TP -\fB\-\-nodbus \fR(deprecated) +\fB\-\-nodbus\fR (deprecated) #ifdef HAVE_DBUSPROXY Disable D-Bus access (both system and session buses). Equivalent to --dbus-system=none --dbus-user=none. .br @@ -1748,15 +1793,6 @@ Example: .br $ firejail \-\-nodvd .TP -\fB\-\-noinput -Disable input devices. -.br - -.br -Example: -.br -$ firejail \-\-noinput -.TP \fB\-\-noexec=dirname_or_filename Remount directory or file noexec, nodev and nosuid. File globbing is supported, see \fBFILE GLOBBING\fR section for more details. .br @@ -1800,6 +1836,16 @@ uid=1000(netblue) gid=1000(netblue) groups=1000(netblue) .br $ +.TP +\fB\-\-noinput +Disable input devices. +.br + +.br +Example: +.br +$ firejail \-\-noinput + .TP \fB\-\-nonewprivs Sets the NO_NEW_PRIVS prctl. This ensures that child processes @@ -1874,6 +1920,16 @@ Example: .br $ firejail \-\-nosound firefox +.TP +\fB\-\-notpm +Disable Trusted Platform Module (TPM) devices. +.br + +.br +Example: +.br +$ firejail \-\-notpm + .TP \fB\-\-notv Disable DVB (Digital Video Broadcasting) TV devices. @@ -2064,7 +2120,7 @@ File globbing is supported, see \fBFILE GLOBBING\fR section for more details. .br Example: .br -$ firejail \-\-private-bin=bash,sed,ls,cat +$ firejail \-\-private-bin=bash,cat,ls,sed .br Parent pid 20841, child pid 20842 .br @@ -2128,8 +2184,11 @@ $ pwd .TP \fB\-\-private-dev -Create a new /dev directory. Only disc, dri, dvb, hidraw, null, full, zero, tty, pts, ptmx, random, snd, urandom, video, log, shm and usb devices are available. -Use the options --no3d, --nodvd, --nosound, --notv, --nou2f and --novideo for additional restrictions. +Create a new /dev directory. +Only disc, dri, dvb, full, hidraw, log, null, ptmx, pts, random, shm, snd, tpm, +tty, urandom, usb, video and zero devices are available. +Use the options \-\-no3d, \-\-nodvd, \-\-nosound, \-\-notpm, \-\-notv, +\-\-nou2f and \-\-novideo for additional restrictions. .br .br @@ -2147,7 +2206,7 @@ cdrom cdrw dri dvd dvdrw full log null ptmx pts random shm snd sr0 .br $ .TP -\fB\-\-private-etc, \-\-private-etc=file,directory,@group +\fB\-\-private-etc, \-\-private-etc=@group,file,directory The files installed by \-\-private-etc are copies of the original system files from /etc directory. By default, the command brings in a skeleton of files and directories used by most console tools: @@ -2263,6 +2322,18 @@ All modifications are discarded when the sandbox is closed. Example: .br $ firejail --private-opt=firefox /opt/firefox/firefox +.br + +.br +Note: Program installations in /opt tend to be relatively large and private-opt +copies the entire path(s) into RAM, which may significantly increase RAM usage +and break \fBfile-copy-limit\fR in firejail.config. +Therefore, in general it is recommended to use "whitelist /opt/PATH" instead of +"private-opt PATH". +For details, see +.UR https://github.com/netblue30/firejail/discussions/5307 +#5307 +.UE .TP \fB\-\-private-srv=file,directory @@ -2850,7 +2921,6 @@ $ firejail \-\-list .br $ firejail \-\-shutdown=3272 -#ifdef HAVE_NETWORK .TP \fB\-\-snitrace[=name|pid] Monitor Server Name Indication (TLS/SNI). The sandbox can be specified by name or pid. Only networked sandboxes @@ -2892,7 +2962,6 @@ $ sudo firejail --snitrace .br 07:53:11 192.0.73.2 1.gravatar.com .br -#endif .TP \fB\-\-tab @@ -3007,28 +3076,6 @@ $ firejail \-\-tree .br 11970:netblue:transmission-gtk -#ifdef HAVE_FIRETUNNEL -.TP -\fB\-\-tunnel[=devname] -Connect the sandbox to a network overlay/VPN tunnel created by firetunnel utility. This options -tries first the client side of the tunnel. If this fails, it tries the server side. If multiple tunnels are active, -please specify the tunnel device using \-\-tunnel=devname. -.br - -.br -The available tunnel devices are listed in /etc/firetunnel directory, one file for each device. -The files are regular firejail profile files containing the network configuration, -and are created and managed by firetunnel utility. -By default ftc is the client-side device and fts is the server-side device. For more information -please see man 1 firetunnel. -.br - -.br -Example: -.br -$ firejail --tunnel firefox -.br -#endif .TP \fB\-\-version Print program version/compile time support and exit. @@ -3098,7 +3145,9 @@ $ firejail \-\-noprofile \-\-whitelist=~/.mozilla .br $ firejail \-\-whitelist=/tmp/.X11-unix \-\-whitelist=/dev/null .br -$ firejail "\-\-whitelist=/home/username/My Virtual Machines" +$ firejail \-\-whitelist="/home/username/My Virtual Machines" +.br +$ firejail \-\-whitelist=/home/username/My\\ Virtual\\ Machines .br $ firejail \-\-whitelist=~/work* \-\-whitelist=/var/backups* @@ -3306,16 +3355,6 @@ $ firejail --net=eth0 --x11=xephyr --xephyr-screen=640x480 firefox .br #endif .\" Note: Keep this in sync with invalid_name() in src/firejail/util.c. -.SH NAME VALIDATION -For simplicity, the same name validation is used for multiple options. -Rules: -.PP -The name must be 1-253 characters long. -The name can only contain ASCII letters, digits and the special characters -"-._" (that is, the name cannot contain spaces or control characters). -The name cannot contain only digits. -The first and last characters must be an ASCII letter or digit and the name -may contain special characters in the middle. #ifdef HAVE_APPARMOR .SH APPARMOR .TP @@ -3414,37 +3453,37 @@ $ firejail --tree 1221:netblue:/usr/lib/firefox/firefox .RE -We provide a tool that automates all this integration, please see \&\flfirecfg\fR\|(1) for more details. +We provide a tool that automates all this integration, please see \fBfirecfg\fR(1) for more details. .SH EXAMPLES .TP -\f\firejail +\fBfirejail Sandbox a regular shell session. .TP -\f\firejail firefox +\fBfirejail firefox Start Mozilla Firefox. .TP -\f\firejail \-\-debug firefox +\fBfirejail \-\-debug firefox Debug Firefox sandbox. .TP -\f\firejail \-\-private firefox +\fBfirejail \-\-private firefox Start Firefox with a new, empty home directory. .TP -\f\firejail --net=none vlc +\fBfirejail --net=none vlc Start VLC in an unconnected network namespace. #ifdef HAVE_NETWORK .TP -\f\firejail \-\-net=eth0 firefox +\fBfirejail \-\-net=eth0 firefox Start Firefox in a new network namespace. An IP address is assigned automatically. .TP -\f\firejail \-\-net=br0 \-\-ip=10.10.20.5 \-\-net=br1 \-\-net=br2 +\fBfirejail \-\-net=br0 \-\-ip=10.10.20.5 \-\-net=br1 \-\-net=br2 Start a shell session in a new network namespace and connect it to br0, br1, and br2 host bridge devices. IP addresses are assigned automatically for the interfaces connected to br1 and b2 #endif .TP -\f\firejail \-\-list +\fBfirejail \-\-list List all sandboxed processes. .SH FILE GLOBBING @@ -3608,6 +3647,65 @@ Currently while scanning the file system, symbolic links are not followed, and f The program can also be run as root (sudo firejail --ids-init/--ids-check). #endif +#ifdef HAVE_LANDLOCK +.SH LANDLOCK +Warning: Landlock support in firejail is considered experimental and unstable. +The contents of landlock-common.inc are likely to change and the feature is +still being expanded upon in the Linux kernel. +Also, note that its functionality overlaps with existing firejail features, +such as the \fBblacklist\fR, \fBread-only\fR and \fBread-write\fR commands. +Its filesystem access rules can currently only restrict direct access to paths; +it is not able to make only select paths appear in the sandbox such as with the +\fBwhitelist\fR and \fBprivate-etc\fR commands (see also unveil(2) on OpenBSD). +Lastly, note that depending on the Linux kernel version, Landlock may not +protect all of the relevant syscalls (see the kernel's Landlock documentation +for details). +Therefore, it is recommended to treat Landlock as an extra layer of protection, +to be used together with other firejail features (rather than as a bulletproof +mechanism by itself). +.PP +Landlock is a Linux security module first introduced in version 5.13 of the +Linux kernel. +It allows unprivileged processes to restrict their access to the filesystem. +Once imposed, these restrictions can never be removed, and all child processes +created by a Landlock-restricted processes inherit these restrictions. +Firejail supports Landlock as an additional sandboxing feature. +It can be used to ensure that a sandboxed application can only access files and +directories that it was explicitly allowed to access. +Firejail supports populating the ruleset with both a basic set of rules (see +landlock-common.inc) and with a custom set of rules. +.TP +Important notes: +.PP +.RS +- Currently only Landlock ABI version 1 is supported. +.PP +- If "lsm=" is used in the kernel command line, it should contain "landlock" +(such as "lsm=apparmor,landlock"), or else it will be disabled. +.PP +- A process can install a Landlock ruleset only if it has either +\fBCAP_SYS_ADMIN\fR in its effective capability set, or the "No New +Privileges" restriction enabled. +Because of this, enabling the Landlock feature will also cause Firejail to +enable the "No New Privileges" restriction, regardless of the profile or the +\fB\-\-nonewprivs\fR command line option. +.PP +- Access to the /etc directory is automatically allowed. +To override this, use the \fB\-\-writable\-etc\fR command line option. +You can also use the \fB\-\-private\-etc\fR option to restrict access to the +/etc directory. +.RE +.PP +To enable Landlock self-restriction on top of your current Firejail security +features, pass \fB\-\-landlock.enforce\fR flag to Firejail command line. +Without it, the other Landlock commands have no effect. +Example: +.PP +$ firejail \-\-landlock.enforce \-\-landlock.fs.read=/media mc +.PP +To disable Landlock self-restriction, use \fB\-\-ignore=landlock.enforce\fR. +#endif + .SH MONITORING Option \-\-list prints a list of all sandboxes. The format for each process entry is as follows: @@ -3665,6 +3763,17 @@ Sandbox running time in hours:minutes:seconds format. USER The owner of the sandbox. +.SH NAME VALIDATION +For simplicity, the same name validation is used for multiple options. +Rules: +.PP +The name must be 1-253 characters long. +The name can only contain ASCII letters, digits and the special characters +"-._" (that is, the name cannot contain spaces or control characters). +The name cannot contain only digits. +The first and last characters must be an ASCII letter or digit and the name +may contain special characters in the middle. + .SH RESTRICTED SHELL To configure a restricted shell, replace /bin/bash with /usr/bin/firejail in /etc/passwd file for each user that needs to be restricted. Alternatively, diff --git a/src/man/mkman.sh b/src/man/mkman.sh index 0302e0778..d854b6537 100755 --- a/src/man/mkman.sh +++ b/src/man/mkman.sh @@ -1,12 +1,19 @@ #!/bin/sh # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set -e -MONTH="$(LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%b)" -YEAR="$(LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y)" +test -z "$SOURCE_DATE_EPOCH" && SOURCE_DATE_EPOCH="$(date +%s)" + +format='+%b %Y' +date="$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "$format" 2>/dev/null || + LC_ALL=C date -u -r "$SOURCE_DATE_EPOCH" "$format" 2>/dev/null || + LC_ALL=C date -u "$format")" + +MONTH="$(printf '%s\n' "$date" | cut -f 1 -d ' ')" +YEAR="$(printf '%s\n' "$date" | cut -f 2 -d ' ')" sed \ -e "s/VERSION/$1/g" \ diff --git a/src/man/preproc.awk b/src/man/preproc.awk index 57424b3aa..b9d78e276 100755 --- a/src/man/preproc.awk +++ b/src/man/preproc.awk @@ -1,6 +1,6 @@ #!/usr/bin/gawk -E -# Copyright (c) 2019-2023 rusty-snake +# Copyright (c) 2019-2024 rusty-snake # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/src/profstats/Makefile b/src/profstats/Makefile index aa947401e..213b1476d 100644 --- a/src/profstats/Makefile +++ b/src/profstats/Makefile @@ -2,10 +2,9 @@ ROOT = ../.. -include $(ROOT)/config.mk -MOD_DIR = src/profstats -PROG = profstats +MOD = profstats +MOD_DIR = $(ROOT)/src/$(MOD) +PROG = $(MOD_DIR)/$(MOD) TARGET = $(PROG) -EXTRA_HDRS = ../include/common.h - include $(ROOT)/src/prog.mk diff --git a/src/profstats/main.c b/src/profstats/main.c index 49ed1637a..10eee3c4b 100644 --- a/src/profstats/main.c +++ b/src/profstats/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * @@ -344,7 +344,7 @@ int main(int argc, char **argv) { if (cnt_seccomp > (seccomp + 1)) cnt_seccomp = seccomp + 1; if (cnt_restrict_namespaces > (restrict_namespaces + 1)) - cnt_seccomp = restrict_namespaces + 1; + cnt_restrict_namespaces = restrict_namespaces + 1; if (cnt_dbus_user_none > (dbususernone + 1)) cnt_dbus_user_none = dbususernone + 1; if (cnt_dbus_user_filter > (dbususerfilter + 1)) diff --git a/src/prog.mk b/src/prog.mk index 70b3629b2..3e89a6ba8 100644 --- a/src/prog.mk +++ b/src/prog.mk @@ -3,23 +3,29 @@ # Note: $(ROOT)/config.mk must be included before this file. # # The includer should probably define PROG and TARGET and may also want to -# define EXTRA_HDRS and EXTRA_OBJS and extend CLEANFILES. +# define EXTRA_OBJS and extend CLEANFILES. -HDRS := $(sort $(wildcard *.h)) $(EXTRA_HDRS) -SRCS := $(sort $(wildcard *.c)) -OBJS := $(SRCS:.c=.o) $(EXTRA_OBJS) +CC ?= cc +RM ?= rm -f + +HDRS := +SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) +OBJS := $(SRCS:.c=.o) +DEPS := $(sort $(wildcard $(OBJS:.o=.d))) + +ifeq ($(DEPS),) +HDRS := $(sort $(wildcard $(MOD_DIR)/*.h $(ROOT)/src/include/*.h)) +endif .PHONY: all all: $(TARGET) +-include $(DEPS) %.o : %.c $(HDRS) $(ROOT)/config.mk - $(CC) $(PROG_CFLAGS) $(CFLAGS) $(INCLUDE) -c $< -o $@ + $(CC) $(PROG_CFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ -$(PROG): $(OBJS) $(ROOT)/config.mk - $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) +$(PROG): $(OBJS) $(EXTRA_OBJS) $(ROOT)/config.mk + $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) $(LIBS) .PHONY: clean -clean:; rm -fr $(PROG) $(CLEANFILES) - -.PHONY: distclean -distclean: clean +clean:; $(RM) -r $(PROG) $(CLEANFILES) diff --git a/src/so.mk b/src/so.mk index dadffc52f..63a0da7ce 100644 --- a/src/so.mk +++ b/src/so.mk @@ -3,23 +3,29 @@ # Note: $(ROOT)/config.mk must be included before this file. # # The includer should probably define SO and TARGET and may also want to define -# EXTRA_HDRS and EXTRA_OBJS and extend CLEANFILES. +# EXTRA_OBJS and extend CLEANFILES. -HDRS := $(sort $(wildcard *.h)) $(EXTRA_HDRS) -SRCS := $(sort $(wildcard *.c)) -OBJS := $(SRCS:.c=.o) $(EXTRA_OBJS) +CC ?= cc +RM ?= rm -f + +HDRS := +SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) +OBJS := $(SRCS:.c=.o) +DEPS := $(sort $(wildcard $(OBJS:.o=.d))) + +ifeq ($(DEPS),) +HDRS := $(sort $(wildcard $(MOD_DIR)/*.h $(ROOT)/src/include/*.h)) +endif .PHONY: all all: $(TARGET) +-include $(DEPS) %.o : %.c $(HDRS) $(ROOT)/config.mk - $(CC) $(SO_CFLAGS) $(CFLAGS) $(INCLUDE) -c $< -o $@ + $(CC) $(SO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ -$(SO): $(OBJS) $(ROOT)/config.mk - $(CC) $(SO_LDFLAGS) -shared $(LDFLAGS) -o $@ $(OBJS) -ldl +$(SO): $(OBJS) $(EXTRA_OBJS) $(ROOT)/config.mk + $(CC) $(SO_LDFLAGS) -shared $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) -ldl .PHONY: clean -clean:; rm -fr $(SO) $(CLEANFILES) - -.PHONY: distclean -distclean: clean +clean:; $(RM) -r $(SO) $(CLEANFILES) diff --git a/src/tools/check-caps.sh b/src/tools/check-caps.sh index b2cdd08e0..b28885d8d 100755 --- a/src/tools/check-caps.sh +++ b/src/tools/check-caps.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 if [ $# -eq 0 ] diff --git a/src/tools/extract_caps.c b/src/tools/extract_caps.c index fd3cb236d..f61293781 100644 --- a/src/tools/extract_caps.c +++ b/src/tools/extract_caps.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/tools/extract_errnos.sh b/src/tools/extract_errnos.sh index c134db8f6..eb1ab46a4 100755 --- a/src/tools/extract_errnos.sh +++ b/src/tools/extract_errnos.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 echo -e "#include \n#include " | \ diff --git a/src/tools/extract_seccomp.c b/src/tools/extract_seccomp.c index 69e20317a..ddf76f848 100644 --- a/src/tools/extract_seccomp.c +++ b/src/tools/extract_seccomp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/tools/extract_syscalls.c b/src/tools/extract_syscalls.c index 20f100572..a7d54119d 100644 --- a/src/tools/extract_syscalls.c +++ b/src/tools/extract_syscalls.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/tools/mkcoverit.sh b/src/tools/mkcoverit.sh index a82bf4fbc..2b1c0a9d8 100755 --- a/src/tools/mkcoverit.sh +++ b/src/tools/mkcoverit.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # unpack firejail archive @@ -44,5 +44,5 @@ mv $DIRFIRETOOLS $DIRFIREJAIL/extras/firetools # build cd $DIRFIREJAIL -cov-build --dir cov-int make -j 4 extras +cov-build --dir cov-int make -j "$(nproc)" extras tar czvf myproject.tgz cov-int diff --git a/src/tools/testuid.c b/src/tools/testuid.c index 86eae4ba3..603842932 100644 --- a/src/tools/testuid.c +++ b/src/tools/testuid.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/tools/ttytest.c b/src/tools/ttytest.c index 3dcb5a06b..65a65e587 100644 --- a/src/tools/ttytest.c +++ b/src/tools/ttytest.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/tools/unixsocket.c b/src/tools/unixsocket.c index 304c5d34d..6ffb6debf 100644 --- a/src/tools/unixsocket.c +++ b/src/tools/unixsocket.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2023 Firejail Authors + * Copyright (C) 2014-2024 Firejail Authors * * This file is part of firejail project * diff --git a/src/zsh_completion/Makefile b/src/zsh_completion/Makefile index cc811ae99..cbc476a73 100644 --- a/src/zsh_completion/Makefile +++ b/src/zsh_completion/Makefile @@ -2,17 +2,17 @@ ROOT = ../.. -include $(ROOT)/config.mk +GAWK ?= gawk +RM ?= rm -f + .PHONY: all all: _firejail _firejail: _firejail.in $(ROOT)/config.mk - gawk -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp + $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@ - rm $@.tmp + $(RM) $@.tmp .PHONY: clean clean: - rm -fr _firejail - -.PHONY: distclean -distclean: clean + $(RM) -r _firejail diff --git a/src/zsh_completion/_firejail.in b/src/zsh_completion/_firejail.in index 37ce7055b..ecfe2ffdf 100644 --- a/src/zsh_completion/_firejail.in +++ b/src/zsh_completion/_firejail.in @@ -106,6 +106,14 @@ _firejail_args=( '--keep-fd[inherit open file descriptors to sandbox]: :' '--keep-shell-rc[do not copy shell rc files from /etc/skel]' '--keep-var-tmp[/var/tmp directory is untouched]' +#ifdef HAVE_LANDLOCK + '--landlock.enforce[enforce the Landlock ruleset]' + '--landlock.fs.read=-[add a read access rule for the path to the Landlock ruleset]: :_files' + '--landlock.fs.write=-[add a write access rule for the path to the Landlock ruleset]: :_files' + '--landlock.fs.makeipc=-[add an access rule for the path to the Landlock ruleset for creating named pipes and sockets]: :_files' + '--landlock.fs.makedev=-[add an access rule for the path to the Landlock ruleset for creating block/char devices]: :_files' + '--landlock.fs.execute=-[add an execute access rule for the path to the Landlock ruleset]: :_files' +#endif '--machine-id[spoof /etc/machine-id with a random id]' '--memory-deny-write-execute[seccomp filter to block attempts to create memory mappings that are both writable and executable]' '*--mkdir=-[create a directory]:' @@ -116,7 +124,6 @@ _firejail_args=( # many would enjoy getting a list from -20..20 '--nice=-[set nice value]: :(1 10 15 20)' '--no3d[disable 3D hardware acceleration]' - '--noautopulse[disable automatic ~/.config/pulse init]' '--noblacklist=-[disable blacklist for file or directory]: :_files' '--nodbus[disable D-Bus access]' '--nodvd[disable DVD and audio CD devices]' @@ -126,6 +133,7 @@ _firejail_args=( '--nonewprivs[sets the NO_NEW_PRIVS prctl]' '--noprinters[disable printers]' '--nosound[disable sound system]' + '--notpm[disable TPM devices]' '--nou2f[disable U2F devices]' '--novideo[disable video devices]' '--private[temporary home directory]' @@ -160,13 +168,12 @@ _firejail_args=( '*--seccomp.32.keep=-[enable seccomp filter, and whitelist the 32 bit syscalls specified by the command]: :' # FIXME: Add errnos '--seccomp-error-action=-[change error code, kill process or log the attempt]: :(kill log)' - '--shell=none[run the program directly without a user shell]' - '--shell=-[set default user shell]: :_values $(cat /etc/shells)' '--timeout=-[kill the sandbox automatically after the time has elapsed]: :' #'(--tracelog)--trace[trace open, access and connect system calls]' '(--tracelog)--trace=-[trace open, access and connect system calls]: :_files' '(--trace)--tracelog[add a syslog message for every access to files or directories blacklisted by the security profile]' '(--private-etc)--writable-etc[/etc directory is mounted read-write]' + '--tab[enable shell tab completion in sandboxes using private or whitelisted home directories]' '--writable-run-user[allow access to /run/user/$UID/systemd and /run/user/$UID/gnupg]' '--writable-var[/var directory is mounted read-write]' '--writable-var-log[use the real /var/log directory, not a clone]' @@ -207,10 +214,6 @@ _firejail_args=( '--ls=-[list files in sandbox container name|pid]: :_all_firejails' #endif -#ifdef HAVE_FIRETUNNEL - '--tunnel=-[connect the sandbox to a tunnel created by firetunnel utility]: :' -#endif - #ifdef HAVE_NETWORK '--bandwidth=-[set bandwidth limits name|pid]: :_all_firejails' '--defaultgw=[configure default gateway]: :' diff --git a/test/Makefile b/test/Makefile index 08462c09b..89855d082 100644 --- a/test/Makefile +++ b/test/Makefile @@ -2,6 +2,8 @@ ROOT = .. -include $(ROOT)/config.mk +RM ?= rm -f + TESTS=$(patsubst %/,%,$(wildcard */)) .PHONY: $(TESTS) @@ -11,7 +13,14 @@ $(TESTS): .PHONY: clean clean: - for test in $(TESTS); do rm -f "$$test/$$test.log"; done - -.PHONY: distclean -distclean: clean + for test in $(TESTS); do $(RM) "$$test/$$test.log"; done + $(RM) -r environment/-testdir + $(RM) environment/index.html* + $(RM) environment/logfile* + $(RM) environment/wget-log* + $(RM) sysutils/firejail_t* + $(RM) utils/firejail-test-file* + $(RM) utils/index.html* + $(RM) utils/lstesting + $(RM) utils/wget-log + cd compile && (./compile.sh --clean || true) diff --git a/test/apparmor/apparmor-norun.exp b/test/apparmor/apparmor-norun.exp index 625d4b4e0..e27d609b9 100755 --- a/test/apparmor/apparmor-norun.exp +++ b/test/apparmor/apparmor-norun.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apparmor/apparmor-run.exp b/test/apparmor/apparmor-run.exp index c11b50151..3c5e6d0db 100755 --- a/test/apparmor/apparmor-run.exp +++ b/test/apparmor/apparmor-run.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apparmor/apparmor.exp b/test/apparmor/apparmor.exp index 4498fadd9..f48f6ff33 100755 --- a/test/apparmor/apparmor.exp +++ b/test/apparmor/apparmor.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apparmor/apparmor.sh b/test/apparmor/apparmor.sh index 84076fc96..5924ad6bb 100755 --- a/test/apparmor/apparmor.sh +++ b/test/apparmor/apparmor.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/appimage/appimage-args.exp b/test/appimage/appimage-args.exp index ef64e862f..a572216e6 100755 --- a/test/appimage/appimage-args.exp +++ b/test/appimage/appimage-args.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/appimage/appimage-trace.exp b/test/appimage/appimage-trace.exp index b6eafd77a..d16f2c84d 100755 --- a/test/appimage/appimage-trace.exp +++ b/test/appimage/appimage-trace.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/appimage/appimage-v2.exp b/test/appimage/appimage-v2.exp index 8d4ef9f7d..ea9a386a1 100755 --- a/test/appimage/appimage-v2.exp +++ b/test/appimage/appimage-v2.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/appimage/appimage.sh b/test/appimage/appimage.sh index 57e389249..fcb1fefaf 100755 --- a/test/appimage/appimage.sh +++ b/test/appimage/appimage.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/appimage/filename.exp b/test/appimage/filename.exp index f2b827bb6..d67543137 100755 --- a/test/appimage/filename.exp +++ b/test/appimage/filename.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11-xorg/apps-x11-xorg.sh b/test/apps-x11-xorg/apps-x11-xorg.sh index 44f3fd677..91cc58db3 100755 --- a/test/apps-x11-xorg/apps-x11-xorg.sh +++ b/test/apps-x11-xorg/apps-x11-xorg.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/apps-x11-xorg/firefox.exp b/test/apps-x11-xorg/firefox.exp index 7f7269c61..ea7818843 100755 --- a/test/apps-x11-xorg/firefox.exp +++ b/test/apps-x11-xorg/firefox.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11-xorg/thunderbird.exp b/test/apps-x11-xorg/thunderbird.exp index 491c13825..4bdccabfc 100755 --- a/test/apps-x11-xorg/thunderbird.exp +++ b/test/apps-x11-xorg/thunderbird.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11-xorg/transmission-gtk.exp b/test/apps-x11-xorg/transmission-gtk.exp index 558468bd5..6f1dc8728 100755 --- a/test/apps-x11-xorg/transmission-gtk.exp +++ b/test/apps-x11-xorg/transmission-gtk.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11-xorg/transmission-qt.exp b/test/apps-x11-xorg/transmission-qt.exp index f76c260d5..4c9725dbe 100755 --- a/test/apps-x11-xorg/transmission-qt.exp +++ b/test/apps-x11-xorg/transmission-qt.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11/apps-x11.sh b/test/apps-x11/apps-x11.sh index 81916685a..e6654acc3 100755 --- a/test/apps-x11/apps-x11.sh +++ b/test/apps-x11/apps-x11.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/apps-x11/chromium.exp b/test/apps-x11/chromium.exp index b654dc5d4..bc0d2b24f 100755 --- a/test/apps-x11/chromium.exp +++ b/test/apps-x11/chromium.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11/firefox.exp b/test/apps-x11/firefox.exp index fe6d036d1..88e85a836 100755 --- a/test/apps-x11/firefox.exp +++ b/test/apps-x11/firefox.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11/thunderbird.exp b/test/apps-x11/thunderbird.exp index aa697a7c1..75e984de3 100755 --- a/test/apps-x11/thunderbird.exp +++ b/test/apps-x11/thunderbird.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11/transmission-gtk.exp b/test/apps-x11/transmission-gtk.exp index 32c88250c..caa2743b6 100755 --- a/test/apps-x11/transmission-gtk.exp +++ b/test/apps-x11/transmission-gtk.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11/x11-none.exp b/test/apps-x11/x11-none.exp index 3a2fcca7c..a8b0f7318 100755 --- a/test/apps-x11/x11-none.exp +++ b/test/apps-x11/x11-none.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11/x11-xephyr.exp b/test/apps-x11/x11-xephyr.exp index 5f9212d80..683cd8702 100755 --- a/test/apps-x11/x11-xephyr.exp +++ b/test/apps-x11/x11-xephyr.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11/xterm-xephyr.exp b/test/apps-x11/xterm-xephyr.exp index af69dd003..83ed9dc31 100755 --- a/test/apps-x11/xterm-xephyr.exp +++ b/test/apps-x11/xterm-xephyr.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11/xterm-xorg.exp b/test/apps-x11/xterm-xorg.exp index b0c501b00..d897471ce 100755 --- a/test/apps-x11/xterm-xorg.exp +++ b/test/apps-x11/xterm-xorg.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps-x11/xterm-xpra.exp b/test/apps-x11/xterm-xpra.exp index 80cc6a618..b69015229 100755 --- a/test/apps-x11/xterm-xpra.exp +++ b/test/apps-x11/xterm-xpra.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/apps.sh b/test/apps/apps.sh index fc053a30d..25e0e13e6 100755 --- a/test/apps/apps.sh +++ b/test/apps/apps.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/apps/chromium.exp b/test/apps/chromium.exp index aef1a93f4..1813b63c4 100755 --- a/test/apps/chromium.exp +++ b/test/apps/chromium.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/deluge.exp b/test/apps/deluge.exp index 21b1b7d4c..ab23b4d95 100755 --- a/test/apps/deluge.exp +++ b/test/apps/deluge.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/fbreader.exp b/test/apps/fbreader.exp index 7bcefda13..3fc266be7 100755 --- a/test/apps/fbreader.exp +++ b/test/apps/fbreader.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/filezilla.exp b/test/apps/filezilla.exp index 34fe257eb..297fdf79a 100755 --- a/test/apps/filezilla.exp +++ b/test/apps/filezilla.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/firefox.exp b/test/apps/firefox.exp index 29e03028a..85c8da8d6 100755 --- a/test/apps/firefox.exp +++ b/test/apps/firefox.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/gnome-mplayer.exp b/test/apps/gnome-mplayer.exp index 6491a5343..f615ce738 100755 --- a/test/apps/gnome-mplayer.exp +++ b/test/apps/gnome-mplayer.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/gthumb.exp b/test/apps/gthumb.exp index 585d8d7d7..035c66fc3 100755 --- a/test/apps/gthumb.exp +++ b/test/apps/gthumb.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/hexchat.exp b/test/apps/hexchat.exp index 0429dbec5..072cac09e 100755 --- a/test/apps/hexchat.exp +++ b/test/apps/hexchat.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/kcalc.exp b/test/apps/kcalc.exp index 4d00d3cc4..04bfdb6ab 100755 --- a/test/apps/kcalc.exp +++ b/test/apps/kcalc.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/ktorrent.exp b/test/apps/ktorrent.exp index 58f875077..7e3149820 100755 --- a/test/apps/ktorrent.exp +++ b/test/apps/ktorrent.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/midori.exp b/test/apps/midori.exp index 3ab67e7d0..aa61c529a 100755 --- a/test/apps/midori.exp +++ b/test/apps/midori.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/opera.exp b/test/apps/opera.exp index 665c5b672..9a20a71a7 100755 --- a/test/apps/opera.exp +++ b/test/apps/opera.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/qbittorrent.exp b/test/apps/qbittorrent.exp index 0d482c1d8..5ffbd08a4 100755 --- a/test/apps/qbittorrent.exp +++ b/test/apps/qbittorrent.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/thunderbird.exp b/test/apps/thunderbird.exp index 632df93b0..b17401aac 100755 --- a/test/apps/thunderbird.exp +++ b/test/apps/thunderbird.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/transmission-qt.exp b/test/apps/transmission-qt.exp index 212423035..07301a357 100755 --- a/test/apps/transmission-qt.exp +++ b/test/apps/transmission-qt.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/uget-gtk.exp b/test/apps/uget-gtk.exp index 96c9c598b..07c30ca96 100755 --- a/test/apps/uget-gtk.exp +++ b/test/apps/uget-gtk.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/vlc.exp b/test/apps/vlc.exp index 671758077..a016f3b36 100755 --- a/test/apps/vlc.exp +++ b/test/apps/vlc.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/wine.exp b/test/apps/wine.exp index 4536c353c..cb41f868d 100755 --- a/test/apps/wine.exp +++ b/test/apps/wine.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/apps/xchat.exp b/test/apps/xchat.exp index add6fbb91..3c7b44b6f 100755 --- a/test/apps/xchat.exp +++ b/test/apps/xchat.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/capabilities/capabilities.sh b/test/capabilities/capabilities.sh index 2d345025a..e0b3b6744 100755 --- a/test/capabilities/capabilities.sh +++ b/test/capabilities/capabilities.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/capabilities/caps-join.exp b/test/capabilities/caps-join.exp index ecb43d943..7df2cd2e7 100755 --- a/test/capabilities/caps-join.exp +++ b/test/capabilities/caps-join.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/capabilities/caps-print.exp b/test/capabilities/caps-print.exp index 66a7e093b..9b155e2d7 100755 --- a/test/capabilities/caps-print.exp +++ b/test/capabilities/caps-print.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/capabilities/caps.exp b/test/capabilities/caps.exp index bd7ab04eb..38a28e730 100755 --- a/test/capabilities/caps.exp +++ b/test/capabilities/caps.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/capabilities/firemon-caps.exp b/test/capabilities/firemon-caps.exp index 905c8cba9..fd43ce0c0 100755 --- a/test/capabilities/firemon-caps.exp +++ b/test/capabilities/firemon-caps.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/chroot/chroot.sh b/test/chroot/chroot.sh index 3b10cbc59..e49a6bcc4 100755 --- a/test/chroot/chroot.sh +++ b/test/chroot/chroot.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/chroot/configure b/test/chroot/configure index f7bfedf10..fe1c1cf23 100755 --- a/test/chroot/configure +++ b/test/chroot/configure @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # build a very small chroot diff --git a/test/chroot/fs_chroot.exp b/test/chroot/fs_chroot.exp index 8bdaa507c..28771ffc2 100755 --- a/test/chroot/fs_chroot.exp +++ b/test/chroot/fs_chroot.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/chroot/fs_chroot_disabled.exp b/test/chroot/fs_chroot_disabled.exp index e6cfe85f3..78c51e800 100755 --- a/test/chroot/fs_chroot_disabled.exp +++ b/test/chroot/fs_chroot_disabled.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/chroot/unchroot-as-root.exp b/test/chroot/unchroot-as-root.exp index 7614ed406..73a4e9f19 100755 --- a/test/chroot/unchroot-as-root.exp +++ b/test/chroot/unchroot-as-root.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/chroot/unchroot.c b/test/chroot/unchroot.c index 408e4eedf..c1f00da81 100644 --- a/test/chroot/unchroot.c +++ b/test/chroot/unchroot.c @@ -1,5 +1,5 @@ // This file is part of Firejail project -// Copyright (C) 2014-2023 Firejail Authors +// Copyright (C) 2014-2024 Firejail Authors // License GPL v2 // simple unchroot example from http://linux-vserver.org/Secure_chroot_Barrier diff --git a/test/compile/compile.sh b/test/compile/compile.sh index da6e43a5a..f3e5c4f33 100755 --- a/test/compile/compile.sh +++ b/test/compile/compile.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # not currently covered @@ -11,7 +11,8 @@ # install contrib scripts # --enable-analyzer enable GCC 10 static analyzer - +# shellcheck source=config.sh +. "$(dirname "$0")/../../config.sh" || exit 1 arr[1]="TEST 1: standard compilation" arr[2]="TEST 2: compile dbus proxy disabled" @@ -51,7 +52,7 @@ print_title() { echo "**************************************************" } -DIST="$1" +DIST="$TARNAME-$VERSION" while [[ $# -gt 0 ]]; do # Until you run out of parameters . . . case "$1" in --clean) @@ -79,9 +80,11 @@ echo "$DIST" tar -xJvf ../../"$DIST.tar.xz" mv "$DIST" firejail -cd firejail -./configure --prefix=/usr --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +cd firejail || exit 1 +./configure --prefix=/usr --enable-fatal-warnings \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test1 grep Error output-configure output-make >> ./report-test1 @@ -95,10 +98,13 @@ rm output-configure output-make # - disable dbus proxy configuration #***************************************************************** print_title "${arr[2]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-dbusproxy --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-dbusproxy \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test2 grep Error output-configure output-make >> ./report-test2 @@ -112,10 +118,13 @@ rm output-configure output-make # - disable chroot configuration #***************************************************************** print_title "${arr[3]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-chroot \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test3 grep Error output-configure output-make >> ./report-test3 @@ -129,10 +138,13 @@ rm output-configure output-make # - disable firetunnel configuration #***************************************************************** print_title "${arr[4]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-firetunnel --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-firetunnel \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test4 grep Error output-configure output-make >> ./report-test4 @@ -146,10 +158,13 @@ rm output-configure output-make # - disable user namespace configuration #***************************************************************** print_title "${arr[5]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-userns \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test5 grep Error output-configure output-make >> ./report-test5 @@ -164,10 +179,13 @@ rm output-configure output-make # - check compilation #***************************************************************** print_title "${arr[6]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-network \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test6 grep Error output-configure output-make >> ./report-test6 @@ -181,10 +199,13 @@ rm output-configure output-make # - disable X11 support #***************************************************************** print_title "${arr[7]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-x11 \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test7 grep Error output-configure output-make >> ./report-test7 @@ -198,10 +219,13 @@ rm output-configure output-make # - enable selinux #***************************************************************** print_title "${arr[8]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --enable-selinux --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --enable-selinux \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test8 grep Error output-configure output-make >> ./report-test8 @@ -215,10 +239,13 @@ rm output-configure output-make # - disable file transfer #***************************************************************** print_title "${arr[9]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-file-transfer \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test9 grep Error output-configure output-make >> ./report-test9 @@ -232,10 +259,13 @@ rm output-configure output-make # - disable whitelist #***************************************************************** print_title "${arr[10]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-whitelist \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test10 grep Error output-configure output-make >> ./report-test10 @@ -249,10 +279,13 @@ rm output-configure output-make # - disable global config #***************************************************************** print_title "${arr[11]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-globalcfg \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test11 grep Error output-configure output-make >> ./report-test11 @@ -266,10 +299,13 @@ rm output-configure output-make # - enable apparmor #***************************************************************** print_title "${arr[12]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --enable-apparmor \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test12 grep Error output-configure output-make >> ./report-test12 @@ -283,10 +319,13 @@ rm output-configure output-make # - enable busybox workaround #***************************************************************** print_title "${arr[13]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --enable-busybox-workaround --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --enable-busybox-workaround \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test13 grep Error output-configure output-make >> ./report-test13 @@ -300,10 +339,13 @@ rm output-configure output-make # - disable overlayfs #***************************************************************** print_title "${arr[14]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-overlayfs --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-overlayfs \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test14 grep Error output-configure output-make >> ./report-test14 @@ -317,10 +359,13 @@ rm output-configure output-make # - disable private home #***************************************************************** print_title "${arr[15]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-private-home \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test15 grep Error output-configure output-make >> ./report-test15 @@ -334,10 +379,13 @@ rm output-configure output-make # - disable manpages #***************************************************************** print_title "${arr[16]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-man --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-man \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test16 grep Error output-configure output-make >> ./report-test16 @@ -351,10 +399,13 @@ rm output-configure output-make # - disable tmpfs as regular user" #***************************************************************** print_title "${arr[17]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-usertmpfs --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-usertmpfs \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test17 grep Error output-configure output-make >> ./report-test17 @@ -368,10 +419,13 @@ rm output-configure output-make # - disable private home feature #***************************************************************** print_title "${arr[18]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --disable-private-home \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test18 grep Error output-configure output-make >> ./report-test18 @@ -385,10 +439,13 @@ rm output-configure output-make # - enable ids #***************************************************************** print_title "${arr[19]}" -cd firejail +cd firejail || exit 1 make distclean -./configure --prefix=/usr --enable-ids --enable-fatal-warnings 2>&1 | tee ../output-configure -make -j4 2>&1 | tee ../output-make +./configure --prefix=/usr --enable-fatal-warnings \ + --enable-ids \ + 2>&1 | tee ../output-configure + +make -j "$(nproc)" 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test19 grep Error output-configure output-make >> ./report-test19 diff --git a/test/environment/allow-debuggers.exp b/test/environment/allow-debuggers.exp index 00cb9fc53..9c7762f5e 100755 --- a/test/environment/allow-debuggers.exp +++ b/test/environment/allow-debuggers.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/deterministic-exit-code.exp b/test/environment/deterministic-exit-code.exp index bc177ee7e..985f297eb 100755 --- a/test/environment/deterministic-exit-code.exp +++ b/test/environment/deterministic-exit-code.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 4 diff --git a/test/environment/deterministic-shutdown.exp b/test/environment/deterministic-shutdown.exp index 2fa454795..265d49699 100755 --- a/test/environment/deterministic-shutdown.exp +++ b/test/environment/deterministic-shutdown.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/dns.exp b/test/environment/dns.exp index 373d50999..1ff235bb2 100755 --- a/test/environment/dns.exp +++ b/test/environment/dns.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/doubledash.exp b/test/environment/doubledash.exp index 4ea23a8f6..2ca20dcff 100755 --- a/test/environment/doubledash.exp +++ b/test/environment/doubledash.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/env.exp b/test/environment/env.exp index 343b42f75..857f1e78d 100755 --- a/test/environment/env.exp +++ b/test/environment/env.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/environment.sh b/test/environment/environment.sh index 0250836df..cfa6a8a60 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/environment/extract_command.exp b/test/environment/extract_command.exp index 0e6b2aa0a..435af432b 100755 --- a/test/environment/extract_command.exp +++ b/test/environment/extract_command.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/firejail-in-firejail.exp b/test/environment/firejail-in-firejail.exp index 1229ec982..1540598b5 100755 --- a/test/environment/firejail-in-firejail.exp +++ b/test/environment/firejail-in-firejail.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/hostfile.exp b/test/environment/hostfile.exp index f909b2827..ba2484964 100755 --- a/test/environment/hostfile.exp +++ b/test/environment/hostfile.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 diff --git a/test/environment/ibus.exp b/test/environment/ibus.exp index ebdfbb14c..f3892104f 100755 --- a/test/environment/ibus.exp +++ b/test/environment/ibus.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/keep-fd-bad.exp b/test/environment/keep-fd-bad.exp index 1a4e89cf9..1c8328b86 100755 --- a/test/environment/keep-fd-bad.exp +++ b/test/environment/keep-fd-bad.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/keep-fd.exp b/test/environment/keep-fd.exp index c144046ca..715981aed 100755 --- a/test/environment/keep-fd.exp +++ b/test/environment/keep-fd.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/machineid.exp b/test/environment/machineid.exp index acee1ccbe..2baf4bf12 100755 --- a/test/environment/machineid.exp +++ b/test/environment/machineid.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 diff --git a/test/environment/nice.exp b/test/environment/nice.exp index 7cc8619ae..efdcb736c 100755 --- a/test/environment/nice.exp +++ b/test/environment/nice.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/output.exp b/test/environment/output.exp index ec66a0196..34b827713 100755 --- a/test/environment/output.exp +++ b/test/environment/output.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/output.sh b/test/environment/output.sh index b8f27ad65..f68b02847 100755 --- a/test/environment/output.sh +++ b/test/environment/output.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 i="0" diff --git a/test/environment/quiet.exp b/test/environment/quiet.exp index 6dd552845..02d7a441c 100755 --- a/test/environment/quiet.exp +++ b/test/environment/quiet.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 4 diff --git a/test/environment/rlimit-bad-profile.exp b/test/environment/rlimit-bad-profile.exp index f2e9bebcf..df8ee4865 100755 --- a/test/environment/rlimit-bad-profile.exp +++ b/test/environment/rlimit-bad-profile.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/rlimit-bad.exp b/test/environment/rlimit-bad.exp index 47c004716..74a2566f9 100755 --- a/test/environment/rlimit-bad.exp +++ b/test/environment/rlimit-bad.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/rlimit-join.exp b/test/environment/rlimit-join.exp index c71dad27e..8e84c10c0 100755 --- a/test/environment/rlimit-join.exp +++ b/test/environment/rlimit-join.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/rlimit-profile.exp b/test/environment/rlimit-profile.exp index f7d486603..2989f597a 100755 --- a/test/environment/rlimit-profile.exp +++ b/test/environment/rlimit-profile.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/rlimit.exp b/test/environment/rlimit.exp index 180010c4f..f2d868174 100755 --- a/test/environment/rlimit.exp +++ b/test/environment/rlimit.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/shell-none.profile b/test/environment/shell-none.profile deleted file mode 100644 index f16ebe3a0..000000000 --- a/test/environment/shell-none.profile +++ /dev/null @@ -1 +0,0 @@ -shell none diff --git a/test/environment/sound.exp b/test/environment/sound.exp index 5582d1bbe..c80d77188 100755 --- a/test/environment/sound.exp +++ b/test/environment/sound.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 diff --git a/test/environment/timeout.exp b/test/environment/timeout.exp index 23853deb1..56fb2f065 100755 --- a/test/environment/timeout.exp +++ b/test/environment/timeout.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/environment/umask.exp b/test/environment/umask.exp index 3c1365693..12753eb50 100755 --- a/test/environment/umask.exp +++ b/test/environment/umask.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fcopy/cmdline.exp b/test/fcopy/cmdline.exp index 2cd5b2d89..3aedbe643 100755 --- a/test/fcopy/cmdline.exp +++ b/test/fcopy/cmdline.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fcopy/dircopy.exp b/test/fcopy/dircopy.exp index 6c3501597..a0eac536f 100755 --- a/test/fcopy/dircopy.exp +++ b/test/fcopy/dircopy.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # diff --git a/test/fcopy/fcopy.sh b/test/fcopy/fcopy.sh index f842cdc4a..32a2541f6 100755 --- a/test/fcopy/fcopy.sh +++ b/test/fcopy/fcopy.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/fcopy/filecopy.exp b/test/fcopy/filecopy.exp index 3c15efaf1..5d50f467c 100755 --- a/test/fcopy/filecopy.exp +++ b/test/fcopy/filecopy.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # diff --git a/test/fcopy/linkcopy.exp b/test/fcopy/linkcopy.exp index 8bcb2d25a..acf5058d4 100755 --- a/test/fcopy/linkcopy.exp +++ b/test/fcopy/linkcopy.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 # diff --git a/test/filters/debug.exp b/test/filters/debug.exp index daf1fe2f2..4c86bcde2 100755 --- a/test/filters/debug.exp +++ b/test/filters/debug.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/filters.sh b/test/filters/filters.sh index 56c97482e..d69d9bcff 100755 --- a/test/filters/filters.sh +++ b/test/filters/filters.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/filters/fseccomp.exp b/test/filters/fseccomp.exp index 7f22b7247..a92510539 100755 --- a/test/filters/fseccomp.exp +++ b/test/filters/fseccomp.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/memwrexe-32.exp b/test/filters/memwrexe-32.exp index 966ade4f2..0eaaaf6c6 100755 --- a/test/filters/memwrexe-32.exp +++ b/test/filters/memwrexe-32.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/namespaces-32.exp b/test/filters/namespaces-32.exp index f2310db3b..9b95372fa 100755 --- a/test/filters/namespaces-32.exp +++ b/test/filters/namespaces-32.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/namespaces.exp b/test/filters/namespaces.exp index 394826de7..4f550189e 100755 --- a/test/filters/namespaces.exp +++ b/test/filters/namespaces.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-bad-empty.exp b/test/filters/seccomp-bad-empty.exp index 293750cf9..50aeda11e 100755 --- a/test/filters/seccomp-bad-empty.exp +++ b/test/filters/seccomp-bad-empty.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-chmod-profile.exp b/test/filters/seccomp-chmod-profile.exp index 2939cf7aa..c0949ec60 100755 --- a/test/filters/seccomp-chmod-profile.exp +++ b/test/filters/seccomp-chmod-profile.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-chmod.exp b/test/filters/seccomp-chmod.exp index 6e6436f97..1d8302fd3 100755 --- a/test/filters/seccomp-chmod.exp +++ b/test/filters/seccomp-chmod.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-chown.exp b/test/filters/seccomp-chown.exp index f1324678e..a6e1bf7fd 100755 --- a/test/filters/seccomp-chown.exp +++ b/test/filters/seccomp-chown.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-debug-32.exp b/test/filters/seccomp-debug-32.exp index f129e26b8..d68eb1bc8 100755 --- a/test/filters/seccomp-debug-32.exp +++ b/test/filters/seccomp-debug-32.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-debug.exp b/test/filters/seccomp-debug.exp index 33a992a93..a5bfe6a87 100755 --- a/test/filters/seccomp-debug.exp +++ b/test/filters/seccomp-debug.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-empty.exp b/test/filters/seccomp-empty.exp index 247cabcd4..e5a7e8fd4 100755 --- a/test/filters/seccomp-empty.exp +++ b/test/filters/seccomp-empty.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-errno.exp b/test/filters/seccomp-errno.exp index 46c691a36..baa0a7bd0 100755 --- a/test/filters/seccomp-errno.exp +++ b/test/filters/seccomp-errno.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-join.exp b/test/filters/seccomp-join.exp index 305b12bd3..d0db49bfc 100755 --- a/test/filters/seccomp-join.exp +++ b/test/filters/seccomp-join.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-numeric.exp b/test/filters/seccomp-numeric.exp index 7203dc7f7..7bd7ca8b9 100755 --- a/test/filters/seccomp-numeric.exp +++ b/test/filters/seccomp-numeric.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-postexec.exp b/test/filters/seccomp-postexec.exp index 9a86651d6..496a6273c 100755 --- a/test/filters/seccomp-postexec.exp +++ b/test/filters/seccomp-postexec.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-ptrace.exp b/test/filters/seccomp-ptrace.exp index b65f8670e..0f96f558e 100755 --- a/test/filters/seccomp-ptrace.exp +++ b/test/filters/seccomp-ptrace.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-run-files.exp b/test/filters/seccomp-run-files.exp index 16bfa9066..db53beb83 100755 --- a/test/filters/seccomp-run-files.exp +++ b/test/filters/seccomp-run-files.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/filters/seccomp-su.exp b/test/filters/seccomp-su.exp index c4dd25ed6..0f324a337 100755 --- a/test/filters/seccomp-su.exp +++ b/test/filters/seccomp-su.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/firecfg/firecfg.exp b/test/firecfg/firecfg.exp index 755eea3a1..da677710c 100755 --- a/test/firecfg/firecfg.exp +++ b/test/firecfg/firecfg.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/firecfg/firecfg.sh b/test/firecfg/firecfg.sh index 6f2bb5244..1a662d014 100755 --- a/test/firecfg/firecfg.sh +++ b/test/firecfg/firecfg.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/fnetfilter/cmdline.exp b/test/fnetfilter/cmdline.exp index fe24dfbd6..1742112e8 100755 --- a/test/fnetfilter/cmdline.exp +++ b/test/fnetfilter/cmdline.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fnetfilter/copy.exp b/test/fnetfilter/copy.exp index 29d5cdb93..3ba0c7904 100755 --- a/test/fnetfilter/copy.exp +++ b/test/fnetfilter/copy.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fnetfilter/default.exp b/test/fnetfilter/default.exp index 19327a60b..49462d1d0 100755 --- a/test/fnetfilter/default.exp +++ b/test/fnetfilter/default.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fnetfilter/fnetfilter.sh b/test/fnetfilter/fnetfilter.sh index 4e08b45b5..166a6c1c0 100755 --- a/test/fnetfilter/fnetfilter.sh +++ b/test/fnetfilter/fnetfilter.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/fnetfilter/template.exp b/test/fnetfilter/template.exp index 94b23c644..58dbb507b 100755 --- a/test/fnetfilter/template.exp +++ b/test/fnetfilter/template.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/fs.sh b/test/fs/fs.sh index a4fab6bc4..7f2442ba4 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/fs/fs_dev_shm.exp b/test/fs/fs_dev_shm.exp index 4d8c63577..b3c937135 100755 --- a/test/fs/fs_dev_shm.exp +++ b/test/fs/fs_dev_shm.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/fs_var_lock.exp b/test/fs/fs_var_lock.exp index 58554f737..7a5047189 100755 --- a/test/fs/fs_var_lock.exp +++ b/test/fs/fs_var_lock.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/fs_var_tmp.exp b/test/fs/fs_var_tmp.exp index eac724d77..73bf71f83 100755 --- a/test/fs/fs_var_tmp.exp +++ b/test/fs/fs_var_tmp.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/fscheck-bindnoroot.exp b/test/fs/fscheck-bindnoroot.exp index f169f0f5e..b2ec84b4f 100755 --- a/test/fs/fscheck-bindnoroot.exp +++ b/test/fs/fscheck-bindnoroot.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/fscheck-private.exp b/test/fs/fscheck-private.exp index c4d1bccf7..4286a43a8 100755 --- a/test/fs/fscheck-private.exp +++ b/test/fs/fscheck-private.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/fscheck-readonly.exp b/test/fs/fscheck-readonly.exp index a04e3185f..990d9995e 100755 --- a/test/fs/fscheck-readonly.exp +++ b/test/fs/fscheck-readonly.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/fscheck-tmpfs.exp b/test/fs/fscheck-tmpfs.exp index 96d7458e8..c80d3d5ec 100755 --- a/test/fs/fscheck-tmpfs.exp +++ b/test/fs/fscheck-tmpfs.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/invalid_filename.exp b/test/fs/invalid_filename.exp index 3519059c6..fc9a7d1bf 100755 --- a/test/fs/invalid_filename.exp +++ b/test/fs/invalid_filename.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/kmsg.exp b/test/fs/kmsg.exp index 3f952a4d4..cd933c324 100755 --- a/test/fs/kmsg.exp +++ b/test/fs/kmsg.exp @@ -1,13 +1,13 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "firejail\r" +send -- "firejail --ignore=private-dev\r" expect { timeout {puts "TESTING ERROR 1\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" diff --git a/test/fs/macro.exp b/test/fs/macro.exp index 8a0d8932d..b8f8ef297 100755 --- a/test/fs/macro.exp +++ b/test/fs/macro.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/mkdir.exp b/test/fs/mkdir.exp index 6494c8f0a..4f967b513 100755 --- a/test/fs/mkdir.exp +++ b/test/fs/mkdir.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 3 diff --git a/test/fs/mkdir_mkfile.exp b/test/fs/mkdir_mkfile.exp index e77fc8a82..bf113224d 100755 --- a/test/fs/mkdir_mkfile.exp +++ b/test/fs/mkdir_mkfile.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/noblacklist-blacklist-noexec.exp b/test/fs/noblacklist-blacklist-noexec.exp index 33a927dd0..2d6120021 100755 --- a/test/fs/noblacklist-blacklist-noexec.exp +++ b/test/fs/noblacklist-blacklist-noexec.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/noblacklist-blacklist-readonly.exp b/test/fs/noblacklist-blacklist-readonly.exp index 46341306c..bab9ceb76 100755 --- a/test/fs/noblacklist-blacklist-readonly.exp +++ b/test/fs/noblacklist-blacklist-readonly.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/option_bind_user.exp b/test/fs/option_bind_user.exp index aac23497e..a5f931fd0 100755 --- a/test/fs/option_bind_user.exp +++ b/test/fs/option_bind_user.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/option_blacklist.exp b/test/fs/option_blacklist.exp index cecf79f2e..408c0c537 100755 --- a/test/fs/option_blacklist.exp +++ b/test/fs/option_blacklist.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/option_blacklist_file.exp b/test/fs/option_blacklist_file.exp index 0ab61fea5..3557bc960 100755 --- a/test/fs/option_blacklist_file.exp +++ b/test/fs/option_blacklist_file.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/option_blacklist_glob.exp b/test/fs/option_blacklist_glob.exp index 5dff6e8a0..b91816f14 100755 --- a/test/fs/option_blacklist_glob.exp +++ b/test/fs/option_blacklist_glob.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/private-bin.exp b/test/fs/private-bin.exp index 8d02ec0ed..9095a6e20 100755 --- a/test/fs/private-bin.exp +++ b/test/fs/private-bin.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/private-cache.exp b/test/fs/private-cache.exp index 375b37577..7c7e72043 100755 --- a/test/fs/private-cache.exp +++ b/test/fs/private-cache.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/private-cwd.exp b/test/fs/private-cwd.exp index 85dfe7e73..9d32824f1 100755 --- a/test/fs/private-cwd.exp +++ b/test/fs/private-cwd.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/private-home-dir.exp b/test/fs/private-home-dir.exp index 6b13c9d16..3b86caf57 100755 --- a/test/fs/private-home-dir.exp +++ b/test/fs/private-home-dir.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/private-home.exp b/test/fs/private-home.exp index a180bf1a8..1c7efc948 100755 --- a/test/fs/private-home.exp +++ b/test/fs/private-home.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 @@ -30,20 +30,21 @@ expect { } after 100 -send -- "find ~\r" -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "_firejail_test_file3" -} -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "_firejail_test_file2" -} -expect { - timeout {puts "TESTING ERROR 4\n";exit} - "_firejail_test_file1" -} -after 100 +# FIXME: Prints "TESTING ERROR 3" in CI since 2024-09-19. +#send -- "find ~\r" +#expect { +# timeout {puts "TESTING ERROR 2\n";exit} +# "_firejail_test_file3" +#} +#expect { +# timeout {puts "TESTING ERROR 3\n";exit} +# "_firejail_test_file2" +#} +#expect { +# timeout {puts "TESTING ERROR 4\n";exit} +# "_firejail_test_file1" +#} +#after 100 send -- "exit\r" sleep 1 diff --git a/test/fs/private-homedir.exp b/test/fs/private-homedir.exp index 3a134aed9..8ae8415a4 100755 --- a/test/fs/private-homedir.exp +++ b/test/fs/private-homedir.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/private-whitelist.exp b/test/fs/private-whitelist.exp index bf95e40dd..406e8ab0c 100755 --- a/test/fs/private-whitelist.exp +++ b/test/fs/private-whitelist.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/private.exp b/test/fs/private.exp index 29ba5b53b..522335628 100755 --- a/test/fs/private.exp +++ b/test/fs/private.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/read-write.exp b/test/fs/read-write.exp index 01c729597..5c1f519ae 100755 --- a/test/fs/read-write.exp +++ b/test/fs/read-write.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/sys_fs.exp b/test/fs/sys_fs.exp index cbd5ecdb4..58860d573 100755 --- a/test/fs/sys_fs.exp +++ b/test/fs/sys_fs.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/tab.exp b/test/fs/tab.exp index 1488d91fb..562a04082 100755 --- a/test/fs/tab.exp +++ b/test/fs/tab.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/whitelist-dev.exp b/test/fs/whitelist-dev.exp index 6236a8060..8491077c7 100755 --- a/test/fs/whitelist-dev.exp +++ b/test/fs/whitelist-dev.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/whitelist-double.exp b/test/fs/whitelist-double.exp index 36b0ba7d9..ea3f03097 100755 --- a/test/fs/whitelist-double.exp +++ b/test/fs/whitelist-double.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/whitelist-empty.exp b/test/fs/whitelist-empty.exp index c26423f1d..7896bccb4 100755 --- a/test/fs/whitelist-empty.exp +++ b/test/fs/whitelist-empty.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 30 diff --git a/test/fs/whitelist-noexec.exp b/test/fs/whitelist-noexec.exp index 3f0314e9e..3ed1c60dc 100755 --- a/test/fs/whitelist-noexec.exp +++ b/test/fs/whitelist-noexec.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/whitelist-readonly.exp b/test/fs/whitelist-readonly.exp index e87e21a97..fa995ee40 100755 --- a/test/fs/whitelist-readonly.exp +++ b/test/fs/whitelist-readonly.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/whitelist-whitespace.exp b/test/fs/whitelist-whitespace.exp index 2133fe33b..1237a0925 100755 --- a/test/fs/whitelist-whitespace.exp +++ b/test/fs/whitelist-whitespace.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/fs/whitelist.exp b/test/fs/whitelist.exp index f44844d8a..f2b0fac65 100755 --- a/test/fs/whitelist.exp +++ b/test/fs/whitelist.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/dns-print.exp b/test/network/dns-print.exp index 7d3da8ace..0c728a90b 100755 --- a/test/network/dns-print.exp +++ b/test/network/dns-print.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/firemon-arp.exp b/test/network/firemon-arp.exp index 87f0ddf4e..037a43192 100755 --- a/test/network/firemon-arp.exp +++ b/test/network/firemon-arp.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/firemon-route.exp b/test/network/firemon-route.exp index 2ca6f2fca..0f426a5cf 100755 --- a/test/network/firemon-route.exp +++ b/test/network/firemon-route.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/ip6_netfilter.exp b/test/network/ip6_netfilter.exp index 6c478d9e7..976741c7b 100755 --- a/test/network/ip6_netfilter.exp +++ b/test/network/ip6_netfilter.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/net-print.exp b/test/network/net-print.exp index 691114cf4..6e3760d9d 100755 --- a/test/network/net-print.exp +++ b/test/network/net-print.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/net_bandwidth.exp b/test/network/net_bandwidth.exp index 0ec3b59ef..e3782cc54 100755 --- a/test/network/net_bandwidth.exp +++ b/test/network/net_bandwidth.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/net_ip.exp b/test/network/net_ip.exp index 0cccf93a0..65065e4d6 100755 --- a/test/network/net_ip.exp +++ b/test/network/net_ip.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/net_mac.exp b/test/network/net_mac.exp index 481e452af..084e11326 100755 --- a/test/network/net_mac.exp +++ b/test/network/net_mac.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/net_netfilter.exp b/test/network/net_netfilter.exp index ac144e19d..2b6a77192 100755 --- a/test/network/net_netfilter.exp +++ b/test/network/net_netfilter.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/net_none.exp b/test/network/net_none.exp index 24d11d383..c88f874a1 100755 --- a/test/network/net_none.exp +++ b/test/network/net_none.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/net_scan.exp b/test/network/net_scan.exp index 0369ab9aa..1ad6e461a 100755 --- a/test/network/net_scan.exp +++ b/test/network/net_scan.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/netfilter-template.exp b/test/network/netfilter-template.exp index 2dc50cef7..cda7631e0 100755 --- a/test/network/netfilter-template.exp +++ b/test/network/netfilter-template.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/netstats.exp b/test/network/netstats.exp index d9da9cb75..45b2bb856 100755 --- a/test/network/netstats.exp +++ b/test/network/netstats.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/network/network.sh b/test/network/network.sh index 6d26e967f..45cea7867 100755 --- a/test/network/network.sh +++ b/test/network/network.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/private-etc/etc-cleanup.exp b/test/private-etc/etc-cleanup.exp index 0c1218829..4e773a9c1 100755 --- a/test/private-etc/etc-cleanup.exp +++ b/test/private-etc/etc-cleanup.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-etc/groups.exp b/test/private-etc/groups.exp index 822845d11..0a6221fa1 100755 --- a/test/private-etc/groups.exp +++ b/test/private-etc/groups.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-etc/hostname.exp b/test/private-etc/hostname.exp index 791445d49..29b04c440 100755 --- a/test/private-etc/hostname.exp +++ b/test/private-etc/hostname.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-etc/private-etc.exp b/test/private-etc/private-etc.exp index 2e3c06dc1..39060c259 100755 --- a/test/private-etc/private-etc.exp +++ b/test/private-etc/private-etc.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-etc/private-etc.sh b/test/private-etc/private-etc.sh index 0dd61cb82..83b03e1ab 100755 --- a/test/private-etc/private-etc.sh +++ b/test/private-etc/private-etc.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/private-etc/profile.exp b/test/private-etc/profile.exp index 7920b0c05..9c039d95c 100755 --- a/test/private-etc/profile.exp +++ b/test/private-etc/profile.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/atril.exp b/test/private-lib/atril.exp index 7f59e32ec..1de4743c0 100755 --- a/test/private-lib/atril.exp +++ b/test/private-lib/atril.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/dig.exp b/test/private-lib/dig.exp index dbe16c68a..87acca39f 100755 --- a/test/private-lib/dig.exp +++ b/test/private-lib/dig.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/eog.exp b/test/private-lib/eog.exp index bcab65df3..50de93df8 100755 --- a/test/private-lib/eog.exp +++ b/test/private-lib/eog.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/eom.exp b/test/private-lib/eom.exp index b6b410e41..1bb4783cc 100755 --- a/test/private-lib/eom.exp +++ b/test/private-lib/eom.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/evince.exp b/test/private-lib/evince.exp index 689934d33..4e2097d3c 100755 --- a/test/private-lib/evince.exp +++ b/test/private-lib/evince.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/galculator.exp b/test/private-lib/galculator.exp index 8be64f391..694252efe 100755 --- a/test/private-lib/galculator.exp +++ b/test/private-lib/galculator.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/gedit.exp b/test/private-lib/gedit.exp index 30d3988f1..93eb9f43f 100755 --- a/test/private-lib/gedit.exp +++ b/test/private-lib/gedit.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/gnome-calculator.exp b/test/private-lib/gnome-calculator.exp index 20f91d03e..b65edf0cf 100755 --- a/test/private-lib/gnome-calculator.exp +++ b/test/private-lib/gnome-calculator.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/gnome-logs.exp b/test/private-lib/gnome-logs.exp index d6dce771f..99dd7fd4a 100755 --- a/test/private-lib/gnome-logs.exp +++ b/test/private-lib/gnome-logs.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/gnome-nettool.exp b/test/private-lib/gnome-nettool.exp index a71db729b..e4256d8e8 100755 --- a/test/private-lib/gnome-nettool.exp +++ b/test/private-lib/gnome-nettool.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/gnome-system-log.exp b/test/private-lib/gnome-system-log.exp index 886cd0e87..3c8fe3bc3 100755 --- a/test/private-lib/gnome-system-log.exp +++ b/test/private-lib/gnome-system-log.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/gpicview.exp b/test/private-lib/gpicview.exp index 6a1467ca4..3b55212f5 100755 --- a/test/private-lib/gpicview.exp +++ b/test/private-lib/gpicview.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/leafpad.exp b/test/private-lib/leafpad.exp index 4df68f74e..f34b77bcc 100755 --- a/test/private-lib/leafpad.exp +++ b/test/private-lib/leafpad.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/mousepad.exp b/test/private-lib/mousepad.exp index d0ffce97e..c26abeaf8 100755 --- a/test/private-lib/mousepad.exp +++ b/test/private-lib/mousepad.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/pavucontrol.exp b/test/private-lib/pavucontrol.exp index 5634b1b1e..6d5745196 100755 --- a/test/private-lib/pavucontrol.exp +++ b/test/private-lib/pavucontrol.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/pluma.exp b/test/private-lib/pluma.exp index 3f88bfcb7..9a3847f49 100755 --- a/test/private-lib/pluma.exp +++ b/test/private-lib/pluma.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/private-lib.exp b/test/private-lib/private-lib.exp index 54b50561f..4cc8f9bbf 100755 --- a/test/private-lib/private-lib.exp +++ b/test/private-lib/private-lib.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 diff --git a/test/private-lib/private-lib.sh b/test/private-lib/private-lib.sh index 5c67b16c5..599a6add4 100755 --- a/test/private-lib/private-lib.sh +++ b/test/private-lib/private-lib.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3g diff --git a/test/private-lib/transmission-gtk.exp b/test/private-lib/transmission-gtk.exp index 4f5b8094c..400bb168e 100755 --- a/test/private-lib/transmission-gtk.exp +++ b/test/private-lib/transmission-gtk.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/private-lib/xcalc.exp b/test/private-lib/xcalc.exp index 196d3481a..2a7cf5a19 100755 --- a/test/private-lib/xcalc.exp +++ b/test/private-lib/xcalc.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/all-profiles.sh b/test/profiles/all-profiles.sh index 6f814a160..55bd2bc99 100755 --- a/test/profiles/all-profiles.sh +++ b/test/profiles/all-profiles.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/profiles/conditional.exp b/test/profiles/conditional.exp index 189cd6320..fd93c3f5c 100755 --- a/test/profiles/conditional.exp +++ b/test/profiles/conditional.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/ignore.exp b/test/profiles/ignore.exp index 450d271c1..97d8aa9f6 100755 --- a/test/profiles/ignore.exp +++ b/test/profiles/ignore.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 @@ -23,7 +23,7 @@ after 100 send -- "exit\r" sleep 1 -send -- "firejail --ignore=seccomp --ignore=shell --profile=ignore.profile \r" +send -- "firejail --ignore=seccomp --ignore=name --profile=ignore.profile \r" expect { timeout {puts "TESTING ERROR 3\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" @@ -39,7 +39,7 @@ after 100 send -- "exit\r" sleep 1 -send -- "firejail --ignore=private --ignore=shell --profile=ignore.profile \r" +send -- "firejail --ignore=private --ignore=name --profile=ignore.profile \r" expect { timeout {puts "TESTING ERROR 5\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" @@ -66,7 +66,7 @@ after 100 send -- "exit\r" sleep 1 -send -- "firejail --ignore=quiet --ignore=shell --profile=ignore.profile \r" +send -- "firejail --ignore=quiet --ignore=name --profile=ignore.profile \r" expect { timeout {puts "TESTING ERROR 9\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" diff --git a/test/profiles/ignore.profile b/test/profiles/ignore.profile index aec231ad2..dec4a5db7 100644 --- a/test/profiles/ignore.profile +++ b/test/profiles/ignore.profile @@ -1,3 +1,3 @@ private seccomp -shell none +name test diff --git a/test/profiles/ignore2.profile b/test/profiles/ignore2.profile index c85cd9544..9d7362599 100644 --- a/test/profiles/ignore2.profile +++ b/test/profiles/ignore2.profile @@ -1,5 +1,5 @@ ignore seccomp -ignore shell +ignore name private seccomp -shell none +name test diff --git a/test/profiles/ignore3.profile b/test/profiles/ignore3.profile index f0c9699e1..4ad474851 100644 --- a/test/profiles/ignore3.profile +++ b/test/profiles/ignore3.profile @@ -1,4 +1,4 @@ quiet private seccomp -shell none +name test diff --git a/test/profiles/profile_appname.exp b/test/profiles/profile_appname.exp index deb375f39..6f53bb39f 100755 --- a/test/profiles/profile_appname.exp +++ b/test/profiles/profile_appname.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/profile_comment.exp b/test/profiles/profile_comment.exp index 56cf9e034..84bc828ff 100755 --- a/test/profiles/profile_comment.exp +++ b/test/profiles/profile_comment.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/profile_followlnk.exp b/test/profiles/profile_followlnk.exp index 39ea8bb43..b2463ed1b 100755 --- a/test/profiles/profile_followlnk.exp +++ b/test/profiles/profile_followlnk.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/profile_noperm.exp b/test/profiles/profile_noperm.exp index 51eb0023f..3ceced38f 100755 --- a/test/profiles/profile_noperm.exp +++ b/test/profiles/profile_noperm.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/profile_readonly.exp b/test/profiles/profile_readonly.exp index 5cd2c3d3b..4abf1470e 100755 --- a/test/profiles/profile_readonly.exp +++ b/test/profiles/profile_readonly.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/profile_recursivity.exp b/test/profiles/profile_recursivity.exp index be2c7d4dd..51e88afab 100755 --- a/test/profiles/profile_recursivity.exp +++ b/test/profiles/profile_recursivity.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/profile_syntax.exp b/test/profiles/profile_syntax.exp index 803b23a8c..1ad55dae3 100755 --- a/test/profiles/profile_syntax.exp +++ b/test/profiles/profile_syntax.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/profile_syntax2.exp b/test/profiles/profile_syntax2.exp index 6568fa88c..ec390e3ce 100755 --- a/test/profiles/profile_syntax2.exp +++ b/test/profiles/profile_syntax2.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/profiles/profiles.sh b/test/profiles/profiles.sh index d49f26b92..fd3596ca5 100755 --- a/test/profiles/profiles.sh +++ b/test/profiles/profiles.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/profiles/test-profile.exp b/test/profiles/test-profile.exp index 085411f36..53cfb4a84 100755 --- a/test/profiles/test-profile.exp +++ b/test/profiles/test-profile.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/seccomp-extra/block-secondary.exp b/test/seccomp-extra/block-secondary.exp index 1db512126..147c3ffa8 100755 --- a/test/seccomp-extra/block-secondary.exp +++ b/test/seccomp-extra/block-secondary.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/seccomp-extra/memwrexe.c b/test/seccomp-extra/memwrexe.c index 548320df9..10cc92099 100644 --- a/test/seccomp-extra/memwrexe.c +++ b/test/seccomp-extra/memwrexe.c @@ -1,5 +1,5 @@ // This file is part of Firejail project -// Copyright (C) 2014-2023 Firejail Authors +// Copyright (C) 2014-2024 Firejail Authors // License GPL v2 #include diff --git a/test/seccomp-extra/mrwx.exp b/test/seccomp-extra/mrwx.exp index 403bc852f..c28b01bbd 100755 --- a/test/seccomp-extra/mrwx.exp +++ b/test/seccomp-extra/mrwx.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/seccomp-extra/mrwx2.exp b/test/seccomp-extra/mrwx2.exp index 4703a4014..080dcfe0c 100755 --- a/test/seccomp-extra/mrwx2.exp +++ b/test/seccomp-extra/mrwx2.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/seccomp-extra/noroot.exp b/test/seccomp-extra/noroot.exp index eeb82833e..9442bd9fe 100755 --- a/test/seccomp-extra/noroot.exp +++ b/test/seccomp-extra/noroot.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/seccomp-extra/protocol-print.exp b/test/seccomp-extra/protocol-print.exp index 7e76e6ff6..1170dab00 100755 --- a/test/seccomp-extra/protocol-print.exp +++ b/test/seccomp-extra/protocol-print.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/seccomp-extra/protocol.exp b/test/seccomp-extra/protocol.exp index 5844e1de3..381c52f9b 100755 --- a/test/seccomp-extra/protocol.exp +++ b/test/seccomp-extra/protocol.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/seccomp-extra/seccomp-extra.sh b/test/seccomp-extra/seccomp-extra.sh index 50852f7e0..1b6f5eb54 100755 --- a/test/seccomp-extra/seccomp-extra.sh +++ b/test/seccomp-extra/seccomp-extra.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/sysutils/cpio.exp b/test/sysutils/cpio.exp index f1ae1f83d..2b6a10224 100755 --- a/test/sysutils/cpio.exp +++ b/test/sysutils/cpio.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/curl.exp b/test/sysutils/curl.exp index 31f44bf54..640abd41d 100755 --- a/test/sysutils/curl.exp +++ b/test/sysutils/curl.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/dig.exp b/test/sysutils/dig.exp index 38acabeed..0b4728ecf 100755 --- a/test/sysutils/dig.exp +++ b/test/sysutils/dig.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/file.exp b/test/sysutils/file.exp index b302c8be2..26e36128a 100755 --- a/test/sysutils/file.exp +++ b/test/sysutils/file.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/gzip.exp b/test/sysutils/gzip.exp index 1588262e2..8d69087f8 100755 --- a/test/sysutils/gzip.exp +++ b/test/sysutils/gzip.exp @@ -1,15 +1,12 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "rm index.html*\r" -after 500 - send -- "firejail gzip -c ../../mkdeb.sh | firejail gunzip -c\r" expect { timeout {puts "TESTING ERROR 1\n";exit} diff --git a/test/sysutils/host.exp b/test/sysutils/host.exp index 5c7d3f062..022b45b4a 100755 --- a/test/sysutils/host.exp +++ b/test/sysutils/host.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/less.exp b/test/sysutils/less.exp index 182e259e1..16df306b0 100755 --- a/test/sysutils/less.exp +++ b/test/sysutils/less.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/man.exp b/test/sysutils/man.exp index 0386b2e92..65d5afdbb 100755 --- a/test/sysutils/man.exp +++ b/test/sysutils/man.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/md5sum.exp b/test/sysutils/md5sum.exp index 24567ee36..859a77608 100755 --- a/test/sysutils/md5sum.exp +++ b/test/sysutils/md5sum.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/nslookup.exp b/test/sysutils/nslookup.exp index 249cfe565..02a5e33f1 100755 --- a/test/sysutils/nslookup.exp +++ b/test/sysutils/nslookup.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/ping.exp b/test/sysutils/ping.exp index dc50af38e..8c45874be 100755 --- a/test/sysutils/ping.exp +++ b/test/sysutils/ping.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/sha512sum.exp b/test/sysutils/sha512sum.exp index 8c1f81417..0d09ef914 100755 --- a/test/sysutils/sha512sum.exp +++ b/test/sysutils/sha512sum.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/strings.exp b/test/sysutils/strings.exp index f440a7674..7c6771a50 100755 --- a/test/sysutils/strings.exp +++ b/test/sysutils/strings.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 @@ -13,7 +13,7 @@ sleep 1 send -- "firejail /usr/bin/strings /usr/bin/firejail > firejail_t2\r" sleep 1 -send -- "diff -s firejail_t1 firejail_t2\r" +send -- "diff -s firejail_t1 firejail_t2 | head\r" expect { timeout {puts "TESTING ERROR 1\n";exit} "firejail_t1 and firejail_t2 are identical" diff --git a/test/sysutils/sysutils.sh b/test/sysutils/sysutils.sh index f5567ff02..66cf41dc0 100755 --- a/test/sysutils/sysutils.sh +++ b/test/sysutils/sysutils.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 @@ -121,8 +121,8 @@ fi if command -v wget then - echo "TESTING: wget" - ./wget.exp + echo "TESTING: FIXME: wget" + #./wget.exp # FIXME: Broken in CI else echo "TESTING SKIP: wget not found" fi @@ -137,8 +137,8 @@ fi if command -v strings then - echo "TESTING: strings" - ./strings.exp + echo "TESTING: FIXME: strings" + #./strings.exp # FIXME: Broken since commit 3077b2d1f else echo "TESTING SKIP: strings not found" fi diff --git a/test/sysutils/tar.exp b/test/sysutils/tar.exp index 8f4c9f565..d638ba0ed 100755 --- a/test/sysutils/tar.exp +++ b/test/sysutils/tar.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/wget.exp b/test/sysutils/wget.exp index 7f994ff81..4e57af6b9 100755 --- a/test/sysutils/wget.exp +++ b/test/sysutils/wget.exp @@ -1,9 +1,9 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 -set timeout 10 +set timeout 30 spawn $env(SHELL) match_max 100000 diff --git a/test/sysutils/whois.exp b/test/sysutils/whois.exp index 932a46282..ed44ea632 100755 --- a/test/sysutils/whois.exp +++ b/test/sysutils/whois.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/sysutils/xz.exp b/test/sysutils/xz.exp index bbe05ea19..38dc0b88a 100755 --- a/test/sysutils/xz.exp +++ b/test/sysutils/xz.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 60 diff --git a/test/utils/build.exp b/test/utils/build.exp index 3f42a74be..816dab24c 100755 --- a/test/utils/build.exp +++ b/test/utils/build.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 @@ -55,10 +55,6 @@ expect { timeout {puts "TESTING ERROR 10\n";exit} "seccomp" } -expect { - timeout {puts "TESTING ERROR 11\n";exit} - "shell none" -} expect { timeout {puts "TESTING ERROR 11\n";exit} "private-bin cat," @@ -98,15 +94,19 @@ expect { } after 100 -send -- "firejail --build wget --output-document=~ debian.org\r" -expect { - timeout {puts "TESTING ERROR 13\n";exit} - "protocol" -} -expect { - timeout {puts "TESTING ERROR 13.1\n";exit} - "inet" -} -after 100 +# increase the timeout for remote services +set timeout 30 + +# FIXME: Broken in CI +#send -- "firejail --build wget --output-document=~ debian.org\r" +#expect { +# timeout {puts "TESTING ERROR 13\n";exit} +# "protocol" +#} +#expect { +# timeout {puts "TESTING ERROR 13.1\n";exit} +# "inet" +#} +#after 100 puts "all done\n" diff --git a/test/utils/catchsignal-master.sh b/test/utils/catchsignal-master.sh index dd5fd0c7b..e4a575436 100755 --- a/test/utils/catchsignal-master.sh +++ b/test/utils/catchsignal-master.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 ./catchsignal.sh & diff --git a/test/utils/catchsignal.sh b/test/utils/catchsignal.sh index 99be6d196..84f0a593c 100755 --- a/test/utils/catchsignal.sh +++ b/test/utils/catchsignal.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 _term() { diff --git a/test/utils/catchsignal2.sh b/test/utils/catchsignal2.sh index 024f297b3..5982a7e9e 100755 --- a/test/utils/catchsignal2.sh +++ b/test/utils/catchsignal2.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 _term() { diff --git a/test/utils/command.exp b/test/utils/command.exp index 87742c40b..2795b5600 100755 --- a/test/utils/command.exp +++ b/test/utils/command.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/cpu-print.exp b/test/utils/cpu-print.exp index 6a05e4139..135bca494 100755 --- a/test/utils/cpu-print.exp +++ b/test/utils/cpu-print.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/dns-print.exp b/test/utils/dns-print.exp index 7766e0629..7a3f4f63c 100755 --- a/test/utils/dns-print.exp +++ b/test/utils/dns-print.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/firemon-cpu.exp b/test/utils/firemon-cpu.exp index 40ac958ea..7e1cef6ca 100755 --- a/test/utils/firemon-cpu.exp +++ b/test/utils/firemon-cpu.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/firemon-name.exp b/test/utils/firemon-name.exp index 873814d0f..d8659cf97 100755 --- a/test/utils/firemon-name.exp +++ b/test/utils/firemon-name.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/firemon-seccomp.exp b/test/utils/firemon-seccomp.exp index 9e95366e7..bbfac9763 100755 --- a/test/utils/firemon-seccomp.exp +++ b/test/utils/firemon-seccomp.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/firemon-version.exp b/test/utils/firemon-version.exp index ce4d3bed1..0f976faf7 100755 --- a/test/utils/firemon-version.exp +++ b/test/utils/firemon-version.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/fs-print.exp b/test/utils/fs-print.exp index d0d62c82f..0cb9f0a12 100755 --- a/test/utils/fs-print.exp +++ b/test/utils/fs-print.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/help.exp b/test/utils/help.exp index 805efd1fd..8d7f5ac49 100755 --- a/test/utils/help.exp +++ b/test/utils/help.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/join-profile.exp b/test/utils/join-profile.exp index 3c065df24..f2f4df0c1 100755 --- a/test/utils/join-profile.exp +++ b/test/utils/join-profile.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/join.exp b/test/utils/join.exp index ba0bc5838..1ebeba1a7 100755 --- a/test/utils/join.exp +++ b/test/utils/join.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/join4.exp b/test/utils/join4.exp index 97e862c58..11687bcc3 100755 --- a/test/utils/join4.exp +++ b/test/utils/join4.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/join5.exp b/test/utils/join5.exp index b42f94530..3268fc751 100755 --- a/test/utils/join5.exp +++ b/test/utils/join5.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/list.exp b/test/utils/list.exp index 369e50693..53b6d7720 100755 --- a/test/utils/list.exp +++ b/test/utils/list.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/ls.exp b/test/utils/ls.exp index 3d8399947..2b51a2c23 100755 --- a/test/utils/ls.exp +++ b/test/utils/ls.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/man.exp b/test/utils/man.exp index ba351981f..fd75f58d6 100755 --- a/test/utils/man.exp +++ b/test/utils/man.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/name.exp b/test/utils/name.exp index 0431dadb1..892ebe248 100755 --- a/test/utils/name.exp +++ b/test/utils/name.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/profile_print.exp b/test/utils/profile_print.exp index 4ec101f07..b13e27977 100755 --- a/test/utils/profile_print.exp +++ b/test/utils/profile_print.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/seccomp-print.exp b/test/utils/seccomp-print.exp index a78501582..f55583ccd 100755 --- a/test/utils/seccomp-print.exp +++ b/test/utils/seccomp-print.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/shutdown.exp b/test/utils/shutdown.exp index 514029964..3b9e810a8 100755 --- a/test/utils/shutdown.exp +++ b/test/utils/shutdown.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 15 diff --git a/test/utils/shutdown2.exp b/test/utils/shutdown2.exp index a0a976667..4de9c5c9c 100755 --- a/test/utils/shutdown2.exp +++ b/test/utils/shutdown2.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/shutdown3.exp b/test/utils/shutdown3.exp index 89994faec..eaaa9deb7 100755 --- a/test/utils/shutdown3.exp +++ b/test/utils/shutdown3.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/shutdown4.exp b/test/utils/shutdown4.exp index 3fbe75c97..cf4cf6a95 100755 --- a/test/utils/shutdown4.exp +++ b/test/utils/shutdown4.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/top.exp b/test/utils/top.exp index 9f4a34640..2e76a80f3 100755 --- a/test/utils/top.exp +++ b/test/utils/top.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/trace.exp b/test/utils/trace.exp index 3805955d7..0c80f89fb 100755 --- a/test/utils/trace.exp +++ b/test/utils/trace.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 30 @@ -52,7 +52,8 @@ expect { } sleep 1 -send -- "firejail --trace wget -q debian.org\r" +# FIXME: Broken in CI +#send -- "firejail --trace wget -q debian.org\r" #expect { # timeout {puts "TESTING ERROR 8.1\n";exit} # -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" @@ -62,22 +63,23 @@ send -- "firejail --trace wget -q debian.org\r" # "bash:open /dev/tty" {puts "OK\n";} # "bash:open64 /dev/tty" {puts "OK\n";} #} -expect { - timeout {puts "TESTING ERROR 8.3\n";exit} - "wget:fopen64 /etc/wgetrc" {puts "OK\n";} - "wget:fopen /etc/wgetrc" {puts "OK\n";} -} -expect { - timeout {puts "TESTING ERROR 8.5\n";exit} - "wget:connect" -} -expect { - timeout {puts "TESTING ERROR 8.6\n";exit} - "wget:fopen64 index.html" {puts "OK\n";} - "wget:fopen index.html" {puts "OK\n";} - "Parent is shutting down" {puts "OK\n";} -} -sleep 1 +#expect { +# timeout {puts "TESTING ERROR 8.3\n";exit} +# "wget:fopen64 /etc/wgetrc" {puts "OK\n";} +# "wget:fopen /etc/wgetrc" {puts "OK\n";} +#} +#expect { +# timeout {puts "TESTING ERROR 8.5\n";exit} +# "wget:connect" +#} +#expect { +# timeout {puts "TESTING ERROR 8.6\n";exit} +# "wget:stat64 index.html" {puts "OK\n";} +# "wget:fopen64 index.html" {puts "OK\n";} +# "wget:fopen index.html" {puts "OK\n";} +# "Parent is shutting down" {puts "OK\n";} +#} +#sleep 1 send -- "firejail --trace rm index.html\r" expect { diff --git a/test/utils/tree.exp b/test/utils/tree.exp index c5047763a..245b57d1d 100755 --- a/test/utils/tree.exp +++ b/test/utils/tree.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10 diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 9ff4048ef..d8c0e8983 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh @@ -1,6 +1,6 @@ #!/bin/bash # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 export MALLOC_CHECK_=3 diff --git a/test/utils/version.exp b/test/utils/version.exp index d5cf311d7..0f9237828 100755 --- a/test/utils/version.exp +++ b/test/utils/version.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f # This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors +# Copyright (C) 2014-2024 Firejail Authors # License GPL v2 set timeout 10