unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: dian_cecht@zoho.com
To: guix-devel@gnu.org
Subject: Re: Thoughts on GuixSD and IDS like AIDE and Tripwire
Date: Tue, 3 Jan 2017 08:36:11 -0800	[thread overview]
Message-ID: <20170103163611.GA7802@khaalida> (raw)
In-Reply-To: <877f6d85aw.fsf@gnu.org>

On Mon, Jan 02, 2017 at 11:28:55PM +0100, Ludovic Courtès wrote:
> Hi!
> 
> dian_cecht@zoho.com skribis:
> 
> > P.S. On second thought (and after a cup of coffee), could the database file be
> > generated using the same format programs like md5sum, sha1sum, et al use so we'd
> > just have to run (for example) md5sum -C database?
> 
> That sounds like a good idea to complement ‘guix publish’ + ‘guix
> challenge’.
> 
> A simple way to dump the database is like this:
> 
> --8<---------------cut here---------------start------------->8---
> $ sudo sqlite3 /var/guix/db/db.sqlite
> SQLite version 3.14.1 2016-08-11 18:53:32
> Enter ".help" for usage hints.
> sqlite> select path,hash from validpaths;
> /gnu/store/98xcn26354r70nyamkgywqzjxvw3qikx-guile-2.0.9.tar.xz|sha256:a475e4bad3d39a94f01c590f239e80dbd84688e480ca74de3e335f6f36a0d975
> /gnu/store/hyh7kwkqlxc0x9s8cs5mjnih5v524486-make-impure-dirs.patch|sha256:d697a02be5fea425ac93eb650b1359e3e8053d84f70677c8c0a80291ed03585e
> /gnu/store/hv15hq91vm3ajv23lkq0kgd56d4kmd08-findutils-absolute-paths.patch|sha256:c4fc83e01a7f448b598905bcf6ca39b5ba0f1f0f131145b379f0de9c2fbe109b
> […]
> --8<---------------cut here---------------end--------------->8---
> 
> (Of course you have to trust the database to contain the right hashes in
> the first place.)
> 
> Ludo’.

That is part of the reason I also suggest an external utility, and ideally one
that is simple enough that people could (re)implement it in their language of
choice (so that what and where the script is is generally
unknown/unknowable/really hard to find, as well as much more difficult to
compromise via simple methods such as patching).

Heck, since your normal user can read the store, one should be able to
reasonably compare the currently stored database to something the user has
generated via

# Please note that I'm not 100% sure this is correct. I don't think you'd want
# to include .link files, but I'm unable to find a quick way in the minute or
# two I wrote this to avoid them. Plus I'd expect some things to be checksumed
# that don't really need it.
$ find /gnu/store/ -type f -print0 | xargs -0 sha256sum

or something similar, given that sha256sum isn't compromised. Once the two are
known to be in sync (ideally with some form of external verification, and by
external I mean booting and mounting the system under a Known Good liveUSB or
similar and checking the database against the system's sha256sum as well as the
liveUSB's Known Good version), then comparing to another person's checksum dump
(ideally someone you know properly checks their system via the aforementioned or
better method) to try and catch potential unwanted modification.

The obvious problem would be removing entries for programs known to not have a
deterministic build (which makes all of this entirely moot for said program),
and hope they aren't compromised and aren't Very Important to the system.

      reply	other threads:[~2017-01-03 16:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-31 13:28 Thoughts on GuixSD and IDS like AIDE and Tripwire dian_cecht
2017-01-01  6:56 ` Pjotr Prins
2017-01-02 15:24   ` dian_cecht
2017-01-02 22:28     ` Ludovic Courtès
2017-01-03 16:36       ` dian_cecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170103163611.GA7802@khaalida \
    --to=dian_cecht@zoho.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).