Allowing external feeds into the server

Open
#1,668 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active

Research direction

Start with config.repository_allow_list in asu.toml and trace how owut's feed and keys request reaches the build container's apk add step. Review the security boundary and the external-feed scenarios described in the issue; done requires an agreed policy for non-official feeds and corresponding implementation and validation.

Written by the indexing model from the issue text.

Description

With @a-gave 's recent additions to owut (https://github.com/efahl/owut/commit/2fab581877f3c17542b1836e2df8933554063ace), we are almost in position to do transparent ASU upgrades using "foreign" feeds. The one blocker is ASU's allowlist in config.repository_allow_list, which does an extra check to only allow repos in that we deem proper.

Here's an example scenario. User wants to use AmnezaWG, so they add the entry to customfeeds.dist, download the keys, etc. Basically, go through the instructions at:

https://slava-shchipunov.github.io/awg-openwrt/25.12.5/x86/64/

They can then use apk to transparently install the packages from that feed:

$ apk update
 [https://slava-shchipunov.github.io/awg-openwrt/25.12.5/x86/64/packages.adb]
...

$ apk query --format yaml --fields name --match origin '*amneziawg*'
# 4 items
- name: amneziawg-tools
- name: kmod-amneziawg
- name: luci-i18n-amneziawg-ru
- name: luci-proto-amneziawg

$ apk add luci-proto-amneziawg
... it just works ...

But, then when the user tries to upgrade, they are blocked by the server, even though they've given the server everything it needs (feed+keys) in the request, and it is apparent the user already trusts the feed.

$ owut upgrade
...
Request:
  Version 25.12.5 r33051-f5dae5ece4 (kernel 6.12.94)
--
Status:   Repository not allowed: https://slava-shchipunov.github.io/awg-openwrt/25.12.5/x86/64/packages.adb
Progress:   0s total =   0s in queue +   0s in build

Build failed in   0s total =   0s in queue +   0s to build:
ERROR: Build failed with status 400 (--version-to 25.12.5 --device x86/64:generic:squashfs)

So...

  • What are the risks of allowing non-official feeds?
  • Malicious package init scripts might run in the build container from the apk add step; I'm not clear on what the attack surface is here.
  • Are the build containers sufficiently jailed that we could just get rid of the allow list, let everything through?
  • What else could go wrong?
  • Do we want to let users request adding certain feeds, and after review, manually add them to the asu.toml in the repository_allow_list? (That seems like a lot of extra work and not particularly scalable.)
  • Or do we want to just say, "this is your problem, set up your own ASU server configured as you like"?

Note that this ties into https://github.com/openwrt/packages/issues/30356, if we want to start pointing people to external package feeds.

Dominant language
Python
Stars
461
Forks
116
Avg merge
8d 30m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openwrt/asu

All issues in openwrt/asu

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.