Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 67308782B8A for <~alpine/devel@lists.alpinelinux.org>; Thu, 23 Jan 2020 16:49:40 +0000 (UTC) Received: by mail-lf1-f43.google.com with SMTP id c23so1945207lfi.7 for <~alpine/devel@lists.alpinelinux.org>; Thu, 23 Jan 2020 08:49:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J8Zvm9BHOrRm4teso5JDBtm3LL/snvySlmA4AiNl0RI=; b=fWs18O609BRBF8NSOfIy2TR5m2r2HQ2EAcOJV7j+bRR4wQGJDJBu9xxcScx39txlEJ gOKmx+tPVzME/xjoUB2Ao4P6osh7he1twhJbvriecKFtMaIxybMs7FoMCLtyKxNc8x8O 1TvRwJ58BLF5du4WVcWt2ORlubFZpVSlL61VpyUk/HRiBpUn2WWBCI9jEpF4CMSqhmP/ geP8u15ScjijUnnpXUhZ0iKsMKU03ZeC3lmXkhACaRzF9rP/wEIy9k0ojzKtcerbtKII 30QAezQTgyYh2tuCW1gryKdn5tIpvkDJIela3qyMYS/rcwhzvNXwSoZET1I/sdI+jTw2 C9Wg== X-Gm-Message-State: APjAAAUUMtrINy1i6JMMZY3dF3LsNThJR/rCDJXMjWIrQEn4oQyGxmBZ EA342yupo5zj1xU+edUZRaI= X-Google-Smtp-Source: APXvYqxf0KvfxJLCsUZBCyT/eYi47rAlA+nF+2Jfj+wCkLqTIa/9gvpL9I+y03UaMIDbjh0Zi7WN6A== X-Received: by 2002:ac2:4839:: with SMTP id 25mr5082680lft.192.1579798179700; Thu, 23 Jan 2020 08:49:39 -0800 (PST) Received: from vostro (87-100-234-203.bb.dnainternet.fi. [87.100.234.203]) by smtp.gmail.com with ESMTPSA id f30sm1566674ljp.31.2020.01.23.08.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 08:49:39 -0800 (PST) Date: Thu, 23 Jan 2020 18:49:34 +0200 From: Timo Teras To: "Drew DeVault" Cc: "Ariadne Conill" , <~alpine/devel@lists.alpinelinux.org> Subject: Re: Lets talk about apk-tools 3, and apk-tools in 2020 in general Message-ID: <20200123184934.0009c19a@vostro> In-Reply-To: References: <1c4796e0cda2248c2de159d4d467421c@dereferenced.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-alpine-linux-musl) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 23 Jan 2020 10:36:10 -0500 "Drew DeVault" wrote: > Thanks for writing this up, Ariadne. I agree with everything you said. > I'd like to call attention to a few points: > > On Thu Jan 23, 2020 at 3:13 PM, Ariadne Conill wrote: > > * Changing the format in such a radical way brings significant > > risk. The tar streams code has already been audited and a > > few CVEs have been fixed over the years. Throwing that out > > means we start over again, possibly reintroducing variations > > of bugs we have already fixed. Many stakeholders have said > > privately that they would rather not have exposure to this > > risk and would prefer a more conservative approach. > > We ought to be careful to avoid fixing things which aren't broken, > noting that unoptimal != broken. I do NOT see APKv3 as an opportunity > to scratch a bunch of itches. Let's keep the changes as small as > possible and avoid throwing out lots of code, or introducing lots of > new code. The current index format needs to go. It has become broken by design. Rather than add bandaid. I'd like to fix it properly at this point. It may need lot of code (and a lot of additional tests in the testsuite). That's software development. > We should structure these changes as slow, incremental improvements, > where one change can be built and shipped and then fully battle tested > before the next one lands. apk is used in many production systems > today and has production-tier expectations of stability. The > importance of a conservative approach is probably the most relevant > take-away from this discussion. One option to consider then is to add increased transition time. Perhaps building both package/index formats for a time to allow the new formats to gain time proven merits. Of course all non-Alpine users are free to make their own transition schedule, or choose to not upgrade, or to migrate something else they prefer instead. > > * Usage of a unified container format for package data and > > database data removes transparency from the current package > > format. Right now, an APK package can be manipulated with > > the tar command if a user wishes to know its contents. Using > > the package manager is not even required. > > Just to lend validation this point: I use /bin/tar to study apk files > all the time. Tar beats homegrown 10 times out of 10. We can do "apk2tar" or similar applet to give yous till tars. The benefit here is that the above would check signatures etc. Just using tar on raw .apk is not secure as it does not check the signatures. > > There are other changes that people are concerned about, such > > as being able to compose new repositories from pre-existing > > ones. While those are important discussions to have as well, > > we are not really discussing them here, as those concerns can > > easily be overcome. Overall governance of the apk-tools > > project itself is also not necessarily being discussed here, > > while we need to have that discussion as there are many > > non-Alpine stakeholders at this point, we can do that later. > > I was one of the people bringing these concerns forward. I think that > tightening the scope and focusing on reuse of existing designs and > code makes this easier - if we can avoid overhauling the container > format then we don't have to bikeshed about what goes into it. This is something we can talk about. But I'm not sure what benefit it gives. Because even if we keep TAR format, APK will not honor the tar headers anymore - it would use the database blob for all file metadata. And the metadata needs to go to the database so we can get strong secure auditing via system database. The main problem is that in TAR files the file metadata, directory structure and file checksums are scattered and not easily signable. This needs to change to support the increased security requirements we have for apk. > Finally, in terms of general principles, I want to emphasize that we > shouldn't turn ourselves into paperclip maximizers. Performance isn't > the singluar metric we need to optimize - maintainability, > reliability, and usability are all _more_ important. Any > optimizations which cannot be proven to directly improve known > bottlenecks in apk are a NACK from me. apk is already one of the > fastest, if not _the_ fastest, package managers around. We have bugs saying otherwise. And I personally think the index parsing performance is not enough on embedded. But what comes to package installation speeds it's very good currently. The suggestion to dropping TAR format is not due to performance, but due to security concerns. Timo