From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5A6793858D20; Wed, 2 Aug 2023 16:37:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A6793858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690994272; bh=/HYun512rCqyD1rXWc2BIAcnzANw0c97QKD4TVJWRKg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fbvb9UKQVkAkO7v+mBE/n1Dw4zQv2jk41YN5xkgK7injY1sNpb1gK3ruqrJ8FJd6H GdOz+wvwuce1xRon4SUZzdh2SwyODHQIXqDS1fpnWAeuNhlmCVhGvWCla/pNcha5hf PfrfXmm1lh+/uimnDDHTicM6dvC+Gm5d+J8dZtwg= From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug debuginfod/28204] extend webapi / verification with forthcoming signed-contents archives Date: Wed, 02 Aug 2023 16:37:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: debuginfod X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rgoldber at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28204 --- Comment #17 from Mark Wielaard --- (In reply to Ryan Goldberg from comment #16) > (In reply to Mark Wielaard from comment #12) > > In config/profile.csh.in and config/profile.sh.in the prefix variable is > > explicitly set and no longer unset. Is that deliberate? > Taking a look at both files they seem to still contain `unset prefix` as > their last lines. Would that not do the trick? Yes it would. I was just confused why it was needed. But I now see that @sysconfdir@ is used and that uses $prefix. So that explains why you need it defined. > > In debuginfod_validate_imasig the file_data =3D malloc(data_len); depen= ds on > > the (externally) given file size. It is then read in one pread call. An= d the > > whole buffer is then given to EVP_DigestUpdate. Note that this might cr= eate > > a giant malloc buffer, which might trigger OOM. pread might succeed with > > fewer bytes than given. It needs to be called in a loop. But it would be > > better if we could read it and feed it to EVP_DigestUpdate in (small) c= hunks. > Sure, just looked at the docs for EVP_DigestUpdate and seems like this > change should be pretty straightforward. >=20 > > Is EACCESS the right error code to return when the signature couldn't be > > checked/is invalid? That is the same as when we get > > CURLE_REMOTE_ACCESS_DENIED. It might be good if it was an unique error = code > > so users can know that the file was not trusted. > How do you feel about EPERM? Not exactly its usage but we've used up a go= od > number of the more applicable ones with the CURL errors (EACCESS, EINVAL) Yes, EPERM sounds like a good pick. It is unlikely to be produced by any ot= her operation (unless there are file seals in play). > (In reply to Mark Wielaard from comment #14) > > I think it is the user/distro packager who should decide which ima-cert= s to > > ship. I don't think elfutils should come with ima-certs itself. > From what I've seen finding the correct certificates for IMA verification > has been pretty tricky, so distributing a copy of these (at least early > certificates) might be a good idea. Eventually the intention is for these > certs to be shipped in a known location which we can easily add to the > search path, but until then having a copy seems like the best bet imho. >=20 > > Why is there a "permissive" policy? What is the use case for this? > It might be that a user wants to be aware of what's going on but does not > need to be quite so strict on rejection. Permissive won't allow incorrect > signatures but will allow say an unsigned file whereas an enforcing client > will reject anything that does not come with a valid signature Doesn't that give a false sense of "security"? It still rejects some stuff, but doesn't really protect against "falsifying" files, all a server has to do is not provide an IMA=20 If it is just to see what would happen if enabling ima file checking, then = it probably shouldn't reject anything. In that case it should warn for both missing and invalid signatures, but still accept them. But in general I like less "modes". > > Should the policy be per debuginfod url? So you can point to an official > > distro debuginfod which must be in enforcing mode, but can add a local = one > > with an "ignore" policy. > I was thinking of keeping things simple, but don't have anything against > moving to a per URL sort of approach. What kind of format would you want = for > such a thing? For urls foo:bar:baz would we want something like > ignore::enforcing where blanks are the default? Don't love this structure > since it seems a little unwieldy. I'll think on a better format for it. Maybe prefixing or postfixing URLS with + or adding the name of the cert? DEBUGINFOD_URLS=3D"https://debuginfod.fedoraproject.org/+FEDORACERTNAME" ? Yeah, gets ugly quick :{ But I think a common use case will be having the main distro debuginfod ser= ver in enforcing mode and your local/org debuginfod server in trusting mode. --=20 You are receiving this mail because: You are on the CC list for the bug.=