<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>MIVEHIND</title>
    <description>MIVEHIND/out.log - Philosophy and systems in linear combination</description>
    <link>https://mivehind.net/</link>
    <atom:link href="https://mivehind.net/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Wed, 18 Sep 2024 18:36:58 -0400</pubDate>
    <lastBuildDate>Wed, 18 Sep 2024 18:36:58 -0400</lastBuildDate>
    <generator>Jekyll v4.3.1</generator>
    
      <item>
        <title>Notes From The Field 3</title>
        <description>&lt;p&gt;&lt;em&gt;(This piece originally ran in Notes from the Field, a weekly column part of
the main newsletter sent to Waltham Fields Community Farm CSA-holders.  I was
once again working in the fields.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It is wonderful to be back on the farm.  It feels both comforting and
expansive: there is familiarity, but also new facets to learn, from meeting
the new (awesome) folks in this year’s crew to learning the names of the
fields which were in cover crop all last year.  As we built up to the first
harvests, it felt to me like the whole place was waking up.  Plants becoming
lush, and growing so large that covering them is a challenge.  Warm (very
warm) days, though I think we all could do without the heat of last week. 
Innumerable rabbits, and even a baby groundhog.  And the birds.&lt;/p&gt;

&lt;p&gt;Oh, the birds!  The hawks have acquired enemies, small and agile, which
harangue them in the skies.  Beautiful yellow birds that we didn’t manage to
identify.  And the killdeer, perpetually hop-scurry away on their spindly
legs.  We have most contact with them, as they like to nest in empty beds,
and produce a flurry of indignant chirping when we work nearby.  In the
peppers, ones nest contained four perfect speckled off-blue eggs - more field
companions for the coming weeks.  And today, while we staked tomatoes, the
heron made a rare landing, huge and graceful.  I get most excited, though,
when the raven drops by.  Huge and glossy, they radiate poise, fearlessness,
and a fierce intelligence.&lt;/p&gt;

&lt;p&gt;I’m write this while making dinner, and I’d be remiss not to mention that it
contains two of my favorite farm-grown vegetables: kale and green garlic. 
The kale in particular is lush from the cover-cropping; it is neat to see
such a strong difference result,  To round out the top three, we harvested
the last of the Napa cabbage for a while, which I will turn into sauerkraut. 
(For the curious, after cabbage the rest of my top ten is the various kinds
of radishes we grow.)&lt;/p&gt;
</description>
        <pubDate>Tue, 25 Jun 2024 00:00:00 -0400</pubDate>
        <link>https://mivehind.net/2024/06/25/notes-from-the-field-3/</link>
        <guid isPermaLink="true">https://mivehind.net/2024/06/25/notes-from-the-field-3/</guid>
        
        <category>farm</category>
        
        
      </item>
    
      <item>
        <title>On The Lineageos User Exposure Window</title>
        <description>&lt;p&gt;Unfortunate scheduling means that LineageOS users are exposed to publicly
disclosed vulnerabilities for typically nine days per month.  Here’s why, and
what I (a user who is otherwise uninvolved in the project) think could be done
to improve the situation.&lt;/p&gt;

&lt;p&gt;Per &lt;a href=&quot;https://source.android.com/docs/security/bulletin/asb-overview&quot;&gt;official Android
documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: The Android Security Bulletins are published on the first
Monday of each month unless that Monday falls on a holiday. If the first
Monday of the month is a holiday the bulletins will be published on the
following work day.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Holiday time off makes sense for human reasons, though it makes release days
inconsistent.  (And I assume we’re talking US holidays because Google, though
this isn’t stated.)  Adherence to this isn’t great - most egregiously,
something happened that resulted in a March 13, 2023 release which is probably
the largest slip since August 13, 2015 (which is far back as the table goes).
But I’ve worked in security engineering long enough to know that sometimes
dates will slip, and I’m sure it’s not intentional.  Clerical errors like the
November 2023 bulletin date are also inevitable.&lt;/p&gt;

&lt;p&gt;But let’s assume for the sake of simplicity that disclosure happens as
written: on the first Monday of the month (or the following day) a bulletin is
published listing the CVEs included, their type/severity, and which Android
(i.e., AOSP) versions are affected.  Importantly absent here are the patches
for these vulnerabilities, which per the bulletin boilerplate take 2 days to
appear.  So what’s the point of the bulletin?&lt;/p&gt;

&lt;p&gt;In any case, this means that patches won’t be available until Wednesday or
Thursday.  Lineage posts updates on Friday; per datestamps, these updates are
built on Thursdays.  This means that in order to have the security fixes (and
security string) in the next Lineage update, there is less than a day’s window
to gather patches, backport them, post pull requests, run CI, get code review,
etc., before the weekly build is made - a seemingly herculean feat.  And
sometime months, it won’t be technically possible at all.&lt;/p&gt;

&lt;p&gt;So since patches will not land in the next release, all users of official
builds are exposed to publicly disclosed vulnerabilities for typically nine
days.  (I think it’s 8-10, but I don’t discount off-by-one, and that also
relies on Lineage not slipping further; everyone’s human and it does happen,
especially on volunteer projects.)&lt;/p&gt;

&lt;p&gt;Clearly, the schedule is a problem.  Here are my initial thoughts on how this
might be addressed:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Release Lineage updates on a different day.&lt;/strong&gt;  If it takes four days to
run through the backport+review+build pipelines, then plan to release on
Monday.  Users will still be exposed for the length of time it takes to
backport+review+build.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Add Lineage to the embargo list.&lt;/strong&gt;  This would mean that backport and
review could take place prior to public disclosure, and so including the
security fixes in the upcoming Friday update becomes doable.  Users are
still exposed for 2 days, but that’s way better than 9.  (I am not involved
in the Lineage project so it’s possible they already are included, but that
seems unlikely given security update PRs are not usually sent on the day
code becomes publicly available.)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Stop the bulletin/patch desync.&lt;/strong&gt; I cannot come up with a good reason why
the security bulletin and patches are released at different times, let
alone releasing the bulletin before the patches.  This makes reasoning
about fix availability unnecessarily complicated.  However, it would
probably require Google to care.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Update Lineage less frequently.&lt;/strong&gt;  It seems like the least amount of
work, but if, e.g., Lineage released once per month, then the day of the
release could be whenever the security fixes for the month land.  This is
also helpful beccause it minimizes the number of times that flashing needs
to occur.  (But that may be a larger discussion for a different post.)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are not mutually exclusive, either.&lt;/p&gt;

&lt;p&gt;To close out, I need to head off something that I am quite sure will come up.
Yes, I am capable of running my own custom Android builds and kernel trees.  I
do not want to do this, and more importantly, users who are not developers by
definition cannot do it.  That is to say: OTA updates and official builds are
the most important versions of the project, not whatever custom stuff we make.
(After all, if that weren’t the case, there wouldn’t be &lt;a href=&quot;https://en.wikipedia.org/wiki/LineageOS#Forks&quot;&gt;five major
forks&lt;/a&gt; over &lt;a href=&quot;https://review.lineageos.org/c/LineageOS/android_frameworks_base/+/195284&quot;&gt;the signature
spoofing
decision&lt;/a&gt;.)&lt;/p&gt;
</description>
        <pubDate>Sun, 07 Jan 2024 00:00:00 -0500</pubDate>
        <link>https://mivehind.net/2024/01/07/on-the-lineageos-user-exposure-window/</link>
        <guid isPermaLink="true">https://mivehind.net/2024/01/07/on-the-lineageos-user-exposure-window/</guid>
        
        <category>tech</category>
        
        <category>security</category>
        
        
      </item>
    
      <item>
        <title>Sourdough Boule</title>
        <description>&lt;p&gt;This is my weekly bread loaf that has evolved since mid-2018.  Since I make it
so regularly, its creation and general culture upkeep are intertwined.  On an
average week, it produces something like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/sourdough-sourdough.png&quot; alt=&quot;A round loaf of bread on a wire rack&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I keep the culture at 100% hydration (i.e., equal mixture of flour and water
by weight) solely because it simplifies the arithmetic of feeding.  For
similar reasons, I typically double the total size every feeding.  Flour for
most feedings is equal parts white and whole wheat, as it is more difficult
for me to determine culture health when fed entirely whole wheat.&lt;/p&gt;

&lt;p&gt;So, to start with, I remove ~110g of unfed culture from its home in the
refrigerator.  The remainder is fed, and placed back in the refrigerator.  (If
there is less than 100g remaining after feeding, it is instead kept warm and
re-fed at 8-12 hour intervals until there is enough again.).&lt;/p&gt;

&lt;p&gt;The 110g of culture is doubled: add 55g of water and 55g roughly equal parts
white and whole wheat flour for a total of ~220g of goo (after mixing).  At
this point I cover it and go to work, so it won’t be touched for 10-12 hours.&lt;/p&gt;

&lt;p&gt;Then, to the bubbly goo, I add 16g of salt, ~380g water, ~600g flour, and
(depending on how things are feeling) 7g carraway seeds.  I will regularly go
up to 300g of the flour being whole wheat here: the more whole wheat used, the
sooner the bread seems to become crumbly.  It also affects how easy the dough
is to work with, but not anywhere near as much as rye (which probably deserves
its own post that it may or may not receive).&lt;/p&gt;

&lt;p&gt;I mix that with a spoon until there are no dry flour clumps.  Then, three
times the dough sits for an hour and is folded.  To fold, I first gather the
dough in the bowl and flip it over, keeping it in the bowl.  Then I grab an
edge, stretch it as far as it will go without tearing, fold it back over the
dough, and rotate 90°.  I repeat the folding until it is no longer possible
(except on the first attempt, where I usually get bored after 12 or so folds).
Once done folding, I flip the dough ball back over, cover, and go back to
waiting.&lt;/p&gt;

&lt;p&gt;Once the three wait-and-fold cycles are done, the covered ball goes into the
refrigerator for 24-48 hours and I go to bed.&lt;/p&gt;

&lt;p&gt;When it is time to begin the baking process, first the ball is removed onto
the counter for about 15 minutes in order to warm up.  Typically I try to
remove the larger air pockets here, but most shaping happens after it is
warm.  While waiting I dust the bottom of the dutch oven with cornmeal.&lt;/p&gt;

&lt;p&gt;To shape, from the bottom, I push the edges of the ball inside itself.  The
goal is a taut but unbroken exterior surface, but it tastes just as good even
if it rips.  The ball goes seam side down into the dutch oven, which I cover
and then let sit 2.5-3 hours.&lt;/p&gt;

&lt;p&gt;After that, I set the oven to preheat at 475°F.  While it does that, I lightly
score the top of the ball (an X, unless creativity strikes) about 5mm deep.
Scoring the is the step I am most likely to forget - the result is by no means
ruined, but I find the texture less appealing.&lt;/p&gt;

&lt;p&gt;Once preheated, I insert the covered dutch oven, and immediately drop the oven
temperature setting to 425°F.  It bakes like this for 45 minutes.  Then I
remove the cover and bake 10-15 minutes until it reaches the target color.&lt;/p&gt;

&lt;p&gt;Then the bread is removed (hopefully easily) from the dutch oven onto a wire
rack to cool “completely” (i.e., until I get bored of waiting and slice it).
I have seen others recommend placing the loaf back on the oven rack itself to
crisp, but I cannot recommend doing so here as that resulted in cornmeal on
the bottom of the oven, which burned.&lt;/p&gt;

&lt;p&gt;My personal preference is for day-old bread, so ideally I cover the cooled
loaf with a towel and let it sit overnight before slicing.  I have also
determined that roommates are much more likely to eat bread that has been
sliced rather than that which they need to slice for themselves.  Letting it
sit also makes it easier to create thinner slices - I target about 1cm.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;
</description>
        <pubDate>Mon, 24 Jul 2023 00:00:00 -0400</pubDate>
        <link>https://mivehind.net/2023/07/24/sourdough-boule/</link>
        <guid isPermaLink="true">https://mivehind.net/2023/07/24/sourdough-boule/</guid>
        
        <category>cooking</category>
        
        
      </item>
    
      <item>
        <title>Notes From The Field 2</title>
        <description>&lt;p&gt;&lt;em&gt;(This piece originally ran in Notes from the Field, a weekly column part of
the main newsletter sent to Waltham Fields Community Farm CSA-holders.  By
this time I was working for the farm.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Weeding is a funny thing. Fields are not cleanrooms, and no matter how many
plants one pulls, there will always be more. There would be no harvest if it
required growing only the desired plants and no others. Fortunately, such is
not the goal: we need only encourage our chosen plants to outcompete.&lt;/p&gt;

&lt;p&gt;From the perspective of a plant, to farm is to curate its surroundings until
harvest. Plants are not machines, but we rely on them for transformation
nonetheless: seed into leaves, dirt into vegetable. For me, there remains a
sense of awe on seeing the seeds we planted become plants poking through the
soil.&lt;/p&gt;

&lt;p&gt;I have been thinking this week about the radishes. Planted at two different
times, the younger has reached maturity first. Both are and will be
delicious, of course - just not in the order they were planted. What made the
difference between them? Was it different weeds, temperatures, location in
the field? We can only speculate, and ask though I may, the radishes do not
answer.&lt;/p&gt;
</description>
        <pubDate>Tue, 20 Jun 2023 00:00:00 -0400</pubDate>
        <link>https://mivehind.net/2023/06/20/notes-from-the-field-2/</link>
        <guid isPermaLink="true">https://mivehind.net/2023/06/20/notes-from-the-field-2/</guid>
        
        <category>farm</category>
        
        
      </item>
    
      <item>
        <title>Notes From The Field 1</title>
        <description>&lt;p&gt;&lt;em&gt;(This piece originally ran in Notes from the Field, a weekly column part of
the main newsletter sent to Waltham Fields Community Farm CSA-holders.  At the
time, I was a volunteer and not employed as a farmer.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This week, one of the crops we harvested was radishes.  The process for
harvesting radishes resembles that of many other crops: find and pull up a
plant, check for quality, prune the foliage, gather the right number into a
bundle, tie them off, and repeat.  But when held by the stems, a bundle of
radishes is floppy, making banding difficult.  We chatted about technique
while harvesting, and everyone has their own: for instance, some people hold
the stems radish-down, perpendicular to the ground, while I have more success
with a 45-degree angle.  But then, we all make different tiny movements to
complete a bundle, like catching the rubber band with the offhand thumb.  When
we become comfortable with an activity, the distance between the tool and our
body vanishes, and instead of moving our hands to move objects, we move the
objects directly.  The tool, the radishes, the rubber bands: all become an
extension of ourselves.  And this complexity of action creates a banded bundle
of beautiful vegetables, ready to be washed.&lt;/p&gt;

&lt;p&gt;Against complacency, I have learned, is the phenomenon of “harvest creep”.
When we as harvesters become comfortable with gathering bunches, the sizing of
a bunch can almost be done by feel.  This feel can be quite precise: I hear
legend of folks able to pick up not only bundles of vegetables but even rubber
bands and immediately know whether they are of the wrong size.  And yet, the
key is the “almost”, since as one harvests, the size of gathered bundles tends
to “creep” up in size.  In a way, I find harvest creep reassuring: avoiding it
means our attention is a necessary part of the process.  We are not rote
actors, but rather overseers, active gatherers for this part of the cycle.&lt;/p&gt;

&lt;p&gt;So in the field on Friday, we enjoyed perhaps one of the last warm days of the
year.  And we counted the radishes, just to be sure.&lt;/p&gt;
</description>
        <pubDate>Tue, 11 Oct 2022 00:00:00 -0400</pubDate>
        <link>https://mivehind.net/2022/10/11/notes-from-the-field-1/</link>
        <guid isPermaLink="true">https://mivehind.net/2022/10/11/notes-from-the-field-1/</guid>
        
        <category>farm</category>
        
        
      </item>
    
      <item>
        <title>Shim Ab Booting Poc</title>
        <description>&lt;p&gt;I’ve implemented a proof-of-concept for “A/B booting” of shim itself.
Concretely, this means that when a shim fails to boot, an older version will
be tried as a fallback.  This aims to increase the stability and reliability
of shim updates.  Booting the older shim is a stop-gap and not something we
want systems to be regularly doing, so the situation is detected and reported
for admin attention.&lt;/p&gt;

&lt;p&gt;This is a proof-of-concept, and additional features/changes are not only
possible but likely.&lt;/p&gt;

&lt;p&gt;(“fallback” is a term with many meanings in this context, so we attempt to
avoid its use.)&lt;/p&gt;

&lt;h2 id=&quot;trying-it-out&quot;&gt;Trying it out&lt;/h2&gt;

&lt;p&gt;On Fedora rawhide, install this COPR:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dnf copr enable rharwood/shim-ab-enable
dnf update
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This updates the shim packaging to be wired up with the A/B logic.&lt;/p&gt;

&lt;p&gt;However, it doesn’t actually provide a second shim (the “B” part of “A/B”).
Once the system is updated with the shim from the first COPR, install the
second COPR:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dnf copr enable rharwood/shim-ab-second
dnf update
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now there are two versions of shim installed on the system.&lt;/p&gt;

&lt;h2 id=&quot;boot-counting&quot;&gt;Boot counting&lt;/h2&gt;

&lt;p&gt;Firmwares don’t operate on BLS entries, and so this looks different than boot
counting at that level of the stack.  However, in all cases the operation of
recording when a boot succeeds lives in userspace (since the system must have
booted).  It is also possible to detect failures of the “A” loader that fall
through to booting the “B” loader.  In this proof-of-concept, the decision on
what action to take is left to the admin, though it would be easy to script
additional behavior.&lt;/p&gt;

&lt;p&gt;This proof-of-concept implements both detections, logging results and a
warning when the “A” loader has failed.&lt;/p&gt;

&lt;p&gt;(To simulate “A” loader failure: remove or rename the shimx64.efi/shimaa64.efi
files in the ESP and the latest /usr/lib/shim*, then reboot the system.
Alternately, use efibootmgr to switch the order of primary and fallback.)&lt;/p&gt;

&lt;h2 id=&quot;technical-details&quot;&gt;Technical details&lt;/h2&gt;

&lt;p&gt;The “A” shim uses the existing location in the ESP (e.g.,
\EFI\fedora\shimaa64.efi) and UEFI boot entry.&lt;/p&gt;

&lt;p&gt;The “B” shim also lives in the ESP, and its name ends with _b (e.g.,
&lt;code&gt;\EFI\fedora\shimaa64_b.efi&lt;/code&gt;).  We do not think 8.3 names are required for
these files.  A new UEFI boot entry is created for it, currently called
“Fedora fallback”, and placed immediately after the “A” entry (“Fedora”) in
the boot order.  This could be renamed to something else if that’s preferred.&lt;/p&gt;

&lt;p&gt;On system update, the shims are rotated - that is, the old “A” shimx64.efi
becomes the “B” shimx64_b.efi, and the new shimx64.efi is dropped into place.
Because the same filenames are used, boot entries are not typically modified
on update.  It is therefore technically possible (though discouraged) to make
an older shim the primary “A” boot target.&lt;/p&gt;

&lt;p&gt;The shim files themselves are stored in /usr/lib/shim-ARCH-VERSION-RELEASE
(where ARCH is the UEFI architecture name, like x64 or aa64).  This allows
userspace boot logging to determine which version of shim was booted, not just
whether it was “A” or “B”.  (It also allows reuse of these files without
granting read access to the ESP or unpacking RPMs, which is a feature that has
been requested elsewhere.)&lt;/p&gt;

&lt;p&gt;Boot logging is kicked off by shim-booted.service, which is currently a
requirement of multi-user.target.  This runs a python script (shimctl) which
logs to /var/log/shim_boots.  The same script is also used for updating shims.&lt;/p&gt;
</description>
        <pubDate>Wed, 17 Aug 2022 00:00:00 -0400</pubDate>
        <link>https://mivehind.net/2022/08/17/shim-ab-booting-poc/</link>
        <guid isPermaLink="true">https://mivehind.net/2022/08/17/shim-ab-booting-poc/</guid>
        
        <category>tech</category>
        
        <category>security</category>
        
        
      </item>
    
      <item>
        <title>Secureboot Signing With Your Own Key</title>
        <description>&lt;h2 id=&quot;create-and-enroll-a-key&quot;&gt;Create and enroll a key&lt;/h2&gt;

&lt;p&gt;First, we’ll need some packages:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dnf install pesign mokutil keyutils
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(Package names are the same on most major distros, though of course your
package manager won’t be the same.)&lt;/p&gt;

&lt;p&gt;Next, we create a key for signing.  This uses efikeygen, from the pesign
project; I prefer efikeygen because it also creates an NSS database that will
be useful for pesign later.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;efikeygen -d /etc/pki/pesign -S -TYPE -c &apos;CN=Your Name Key&apos; -n &apos;Custom Secureboot&apos;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Replace Your Name Key with your name, and Custom Secureboot with a name for
the key that you’ll remember for later steps.  For -TYPE, replace with -m if
you only plan to sign custom kernel modules, and -k otherwise.&lt;/p&gt;

&lt;p&gt;(Note that this will set up the key for use in /etc/pki/pesign, which is
convenient for pesign later, but it can also be placed elsewhere, like on a
hardware token - see efikeygen(1) for more options.)&lt;/p&gt;

&lt;p&gt;Next, export the public key and import it into the MOK (the Machine Owner
Keystore - the list of keys trusted for signing):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;certutil -d /etc/pki/pesign -n &apos;Custom Secureboot&apos; -Lr &amp;gt; sb_cert.cer
mokutil --import sb_cert.cer
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Again, replace Custom Secureboot the chosen name.  mokutil will prompt you for
a password - this will be used in a moment to import the key.&lt;/p&gt;

&lt;p&gt;Reboot, and press any key to enter the mok manager.  Use the up/down arow keys
and enter to select “enroll mok”, then “view key”.  If it’s the same key you
generated earlier, continue, then “yes” to enroll.  The mok manager will
prompt you for the password from before - note that it will not be echoed (no
dots, either).  When finished, select reboot.&lt;/p&gt;

&lt;p&gt;To check the key imported okay, we can use keyctl.  Output could look
something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;~# keyctl show %:.platform
Keyring
1072527305 ---lswrv      0     0  keyring: .platform
1013423757 ---lswrv      0     0   \_ asymmetric: Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e4f9ae17c55af53
 246036308 ---lswrv      0     0   \_ asymmetric: Your Name Key: 31fe6684706ff53faf26cec7e700f84aa0fd22ae
 919193603 ---lswrv      0     0   \_ asymmetric: Red Hat Secure Boot CA 5: cc6fa5e72868ba494e939bbd680b9144769a9f8f
 341707055 ---lswrv      0     0   \_ asymmetric: Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;where the important part is that your key is among those listed.  (The
Microsoft keys are the “normal” anchors for secureboot, and the Red Hat one is
present because this is a RHEL machine.)&lt;/p&gt;

&lt;h3 id=&quot;unenroll-a-key&quot;&gt;Unenroll a key&lt;/h3&gt;

&lt;p&gt;If you want to unenroll a key you added, just do&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mokutil --delete sb_cert.cer
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will prompt for the password, and reboot through mok manager as before,
except this time select the option to delete the key.&lt;/p&gt;

&lt;h2 id=&quot;sign-a-kernel&quot;&gt;Sign a kernel&lt;/h2&gt;

&lt;p&gt;Kernel signatures are part of the vmlinuz file.  Unfortunately, the process
differs between x64 (or amd64, or x86_64, or whatever you want to call it)
and aarch64.  First, x64 because it’s simpler:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pesign -c &apos;Custom Secureboot&apos; -i vmlinuz-VERSION -s -o vmlinuz-VERSION.signed
pesign -S -i vmlinuz-VERSION.signed # check the signatures
mv vmlinuz-VERSION.signed vmlinuz-VERSION
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Replace VERSION with whatever suffix your vmlinuz has, and Custom Secureboot
with whatever name you chose earlier.&lt;/p&gt;

&lt;p&gt;On aarch64/aa64, things are slightly more involved because the signature is
pre-compression.  Not to worry, though:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;zcat vmlnuz-VERSION &amp;gt; vmlinux-VERSION
pesign -c &apos;Custom Secureboot -i vmlinux-VERSION -s -o vmlinux-VERSION.signed
pesign -S -i vmlinux-VERSION.signed # check signature
gzip -c vmlinux-VERSION.signed &amp;gt; vmlinuz-VERSION
rm vmlinux-VERSION*
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;sign-a-kernel-module&quot;&gt;Sign a kernel module&lt;/h2&gt;

&lt;p&gt;First, prerequisites - the signing tool.  On Fedora/RHEL-likes:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dnf install kernel-devel
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;while on Debian-likes I believe this is part of linux-kbuild, and therefore
pulled in by linux-headers.&lt;/p&gt;

&lt;p&gt;The sigining tool uses openssl, so we need to extract the key from the NSS
database:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pk12util -o sb_cert.p12 -n &apos;Custom Secureboot&apos; -d /etc/pki/pesign
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Replacing Custom Secureboot as before.  This will prompt for a password, which
will encrypt the private key - we’ll need this for the next step:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;opensl pkcs12 -in sb_cert.p12 -out sb_cert.priv -nocerts -noenc
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is exporting an unencrypted private key, so of course handle with care :)&lt;/p&gt;

&lt;p&gt;Signing will be something like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/usr/src/kernels/$(uname -r)/scripts/sign-file sha256 sb_cert.priv sb_cert.cer my_module.ko
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;where my_module.ko is of course the module to be signed.  Debian users will
I think want a path more like /usr/lib/linux-kbuild-5.17/scripts/sign-file.&lt;/p&gt;

&lt;p&gt;To inspect:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;~# modinfo my_modile.ko | grep signer
  signer:         Your Name Key
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;where Your Name Key will be your name as entered during generation.&lt;/p&gt;

&lt;p&gt;To test, &lt;code&gt;insmod my_module.ko&lt;/code&gt; and to remove &lt;code&gt;rmmod my_module&lt;/code&gt;.&lt;/p&gt;

&lt;h1 id=&quot;sign-a-grub-build&quot;&gt;Sign a grub build&lt;/h1&gt;

&lt;p&gt;This is fairly straightforward - the signatures live in the .efi files, which
are just PE binaries, which live in /boot/efi/EFI/distro_name (e.g.,
/boot/efi/EFI/redhat).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pesign -i grubx64.efi -o grubx64.efi.signed -c &apos;Custom Secureboot&apos; -s
pesign -i grubx64.efi.signed -S # check signatures
mv grubx64.efi.signed grubx64.efi
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;where Custom Secureboot is once again the name you picked above.  Note that
x64 is the architecture name in EFI - so if you’re on aarch64, it’d be aa64,
etc..&lt;/p&gt;
</description>
        <pubDate>Thu, 12 May 2022 00:00:00 -0400</pubDate>
        <link>https://mivehind.net/2022/05/12/secureboot-signing-with-your-own-key/</link>
        <guid isPermaLink="true">https://mivehind.net/2022/05/12/secureboot-signing-with-your-own-key/</guid>
        
        <category>tech</category>
        
        <category>security</category>
        
        
      </item>
    
      <item>
        <title>Secure Boot Statements</title>
        <description>&lt;p&gt;I have said some things about secure boot and my involvement
&lt;a href=&quot;https://rharwood.fedorapeople.org/secureboot/2022-03-09.asc&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I will try to say the same things monthly from here on out.  The current plan
is for them to appear dated in &lt;a href=&quot;https://rharwood.fedorapeople.org/secureboot/&quot;&gt;this
folder&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That said, I am human and will probably forget sometimes.  So while I
encourage keeping an eye out for them, it’s probably best to reach out if I
miss one and not worry too much unless several get missed.&lt;/p&gt;

&lt;p&gt;Please remember that this only relates to what I do and what I know: it
doesn’t include other distros, other parts of the supply chain, etc..  Other
maintainers are encouraged to offer similar statements for their respective
involvement.&lt;/p&gt;

&lt;p&gt;(This statement, this post, and especially the encouragement for other
maintainers to do the same originate from my co-worker &lt;a href=&quot;https://blog.uncooperative.org/uefi/secure%20boot/linux/shim/2014/06/05/shim-info.html&quot;&gt;pjones’s
statement&lt;/a&gt;.)&lt;/p&gt;
</description>
        <pubDate>Wed, 09 Mar 2022 00:00:00 -0500</pubDate>
        <link>https://mivehind.net/2022/03/09/secure-boot-statements/</link>
        <guid isPermaLink="true">https://mivehind.net/2022/03/09/secure-boot-statements/</guid>
        
        <category>tech</category>
        
        <category>security</category>
        
        
      </item>
    
      <item>
        <title>Apple Extended Keyboard (m0115) Repair Teardown</title>
        <description>&lt;p&gt;I recently repaired an Apple Extended Keyboard (M0115).  I took some
pictures.  This post is an excuse to show them.  Repairs were successful, and
I’m typing this post on it.&lt;/p&gt;

&lt;p&gt;First, here’s the completed job:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-assembled.jpg&quot; alt=&quot;Clean, assembled keyboard&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This picture doesn’t capture the pronounced S-curve top-to-bottom that the
keys are laid out on, nor how loud and pleasant it is to type on.  It’s quite
nice… once it works.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-damage.jpg&quot; alt=&quot;Smashed, grungy keyboard&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This will cause it not to work.  I didn’t get from the previous owner what
actually happened here, but my best guess from damage and residues (look at
the ‘D’ keycap) is that a bottle of barbecue sauce fell on it from a great
height.  It takes quite a lot of force to snap the keycaps like that, and one
of the internal struts as damaged too.  It’s also positively filthy, but that
might just be due to not being cleaned in 35 years.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-label.jpg&quot; alt=&quot;Part label on bottom&quot; /&gt;&lt;/p&gt;

&lt;p&gt;What we’re working with.  I needed to disassemble it for cleaning and repair,
so let’s walk through that quickly.  Reassembly is of course the reverse, and
I’m going to use photos from that because no one needs to see the filth that
was in here.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-bottom.jpg&quot; alt=&quot;Underside of keyboard&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Four Philips screws on the bottom.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-upper.jpg&quot; alt=&quot;Upper partially removed&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The case is additionally secured with clips.  Some caution here is warranted -
the case plastic is old and brittle.  I release the top and two sides, then
tip the whole thing forward, up, and out.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-guts.jpg&quot; alt=&quot;Keyboard minus upper case&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That exposes the inside.  Two ADB connector boards on the top - careful when
lifting these out.  Set on a towel or some such, unless you hate your table.&lt;/p&gt;

&lt;p&gt;To remove keycaps, we need to apply even upward force, distributed around the
key.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-keypull.jpg&quot; alt=&quot;Pulling off a keycap&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That keypuller is two bent paperclips, because I hate my hands:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-paperclips.jpg&quot; alt=&quot;Two bent and twisted paperclips&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That takes care of the normal-width keys.  The wider (or taller, in the case
of keypad enter) keys have an additional stabilizer:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-stabilizer.jpg&quot; alt=&quot;Stabilizer on left shift&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The metal slides into two brown U-shaped plastic pieces on the keycap, and
there are two clips on the mounting board.  For removal, I use a screwdriver
to separate the metal from the board clips first to try to keep them attached
to the mounting board - but if you’ve bought an “AS-IS” ebay item that the
previous owner spilled soda on, they may come detached regardless.&lt;/p&gt;

&lt;p&gt;This picture is the broken left shift key, hence the broken post.  As a side
note, the only difference I’ve seen between these keycaps and those of the
Apple Extended II (M3501) is that the M3501 uses black clips, while these are
brown.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-switches.jpg&quot; alt=&quot;Exposed Apls Orange switches&quot; /&gt;&lt;/p&gt;

&lt;p&gt;All keycaps removed, post-cleaning.  The caps lock keyswitch is locking, so
it’s a different color.  As you can see, I’ve removed the broken bits by this
point, so here’s a close-up of while that was happening (pre-cleaning, so with
filth):&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-snappage.jpg&quot; alt=&quot;Posts from broken keycaps&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Due to what broken when, you can see the stabilizer attachment for left shift
in this picture too.  All keyswitches survived undamaged, fortunately.&lt;/p&gt;

&lt;p&gt;For cleaning, the keycaps were soaked overnight in soapy water.  That actually
takes care of most filth, but since I was there already (and it didn’t quite
get everything), I did a toothbrush pass as well.  One consequence of this is
that the labels which had been added to various keys did not survive, so
here’s a picture of them from before:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/M0115-labels.jpg&quot; alt=&quot;Various labels from keys&quot; /&gt;&lt;/p&gt;

&lt;p&gt;“PRINT Window / Screen” and “PAINT screen” eventually became Mac screen
capture.  On the numpad, these shortcuts are probably from Microsoft Word
v1.06.  The “Cut” / “Copy” / “Paste” on x, c, and v are interesting because
they predate the ubiquity they now enjoy - the Apple Extended Keyboard’s upper
case even preprints “undo cut copy paste” under F1 through F4.  Finally, the
Command key (which happens to be the one from the right) appears to say
“MFinder” with a slash through it, which probably was to indicate that that
the Mac OS 5-era &lt;a href=&quot;https://en.wikipedia.org/wiki/Multifinder&quot;&gt;MultiFinder&lt;/a&gt;
multitasking was to be disabled on start.  (“Switch screen” on 9 would be
related to this as well.)&lt;/p&gt;

</description>
        <pubDate>Sun, 27 Feb 2022 00:00:00 -0500</pubDate>
        <link>https://mivehind.net/2022/02/27/Apple-Extended-Keyboard-(M0115)-repair-teardown/</link>
        <guid isPermaLink="true">https://mivehind.net/2022/02/27/Apple-Extended-Keyboard-(M0115)-repair-teardown/</guid>
        
        <category>tech</category>
        
        
      </item>
    
      <item>
        <title>Fedora Has Too Many Security Bugs 3</title>
        <description>&lt;p&gt;(Previously &lt;a href=&quot;/2021/05/10/Fedora-has-too-many-security-bugs-2&quot;&gt;part 2&lt;/a&gt; and
&lt;a href=&quot;/2020/01/28/Fedora-has-too-many-security-bugs/&quot;&gt;part 1&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Right now, there are 1917 open CVE bugs against Fedora.  This is a decrease
of 172 from last year - so again, we report good news.  Gratitude toward
maintainers who have been reducing their backlog.&lt;/p&gt;

&lt;p&gt;Year breakdown:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;2005: 1
2011: 1
2012: 4
2013: 4
2014: 5
2015: 17
2016: 71
2017: 227
2018: 341
2019: 225
2020: 311
2021: 710
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;While the bug that was last year’s tail (a 2009 bug) has disappeared, the tail
is now much longer with the addition of the 2005 bug.  The per-year deltas
are:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;2005: +1
2006: N/A
2007: N/A
2008: N/A
2009: -1
2010: N/A
2011: -1
2012: -5
2013: -1
2014: ±0
2015: ±0
2016: -1
2017: -25
2018: -26
2019: -35
2020: -390
2021: +302
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(N/A is reported where neither last year’s run nor this year’s run had bugs in
that year bucket, while ±0 indicates no change in the number year to year.
The 2021 change is somewhat expected since there’s a lag between CVEs being
assigned numbers and being disclosed.)&lt;/p&gt;

&lt;p&gt;Unfortunately, the balance has shifted back toward EPEL: EPEL has 1035 of the
1917 total, a change of +77.  This has outsized impact because EPEL is much
smaller than non-EPEL Fedora.&lt;/p&gt;

&lt;p&gt;For ecosystems, the largest ones I see are:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mingw: 99 (-41)
python: 95 (-14)
nodejs: 85 (-14)
rubygem: 20 (-7)
php: 13 (-6)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and it’s nice to see a reduction on all of them.&lt;/p&gt;

&lt;p&gt;Finally, to close as before, there have been no changes to Fedora policy
around security handling, nor is there a functioning Security Team at this
time.  Obviously no one should be forced into that role, but if anyone wants a
pet project: the incentive structure here is still wrong.&lt;/p&gt;

&lt;p&gt;For completeness, since bugzilla has changed a bit, here’s my script operating
on the CSV file:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;#!/usr/bin/python3

import csv
import re

from collections import defaultdict

with open(&quot;Bug List 2.csv&quot;, &quot;r&quot;) as f:
    db = list(csv.DictReader(f))

print(f&quot;total bugs: {len(db)}&quot;)

years = defaultdict(int)
r = re.compile(r&quot;CVE-(\d{4})-&quot;)
for bug in db:
    match = r.search(bug[&quot;Summary  &quot;])
    if match is None:
        continue
    year = match.group(1)
    years[year] += 1

for key in sorted(years.keys()):
    print(f&quot;    {key}: {years[key]}&quot;)

epel = [bug for bug in db if bug[&quot;Product  &quot;] == &quot;Fedora EPEL&quot;]

print(f&quot;epel #: {len(epel)}&quot;)

components = defaultdict(int)
for bug in db:
    components[bug[&quot;Component  &quot;]] += 1

# This spews - but uncomment to identify groups visually
# for c in sorted(components.keys()):
#     print(f&quot;{c}: {components[c]}&quot;)

def ecosystem(e: str) -&amp;gt; int:
    count = 0
    for c in components:
        if c.startswith(f&quot;{e}-&quot;):
            count += components[c]
    return count

print(f&quot;mingw ecosystem: {ecosystem(&apos;mingw&apos;)}&quot;)
print(f&quot;python ecosystem: {ecosystem(&apos;python&apos;)}&quot;)
print(f&quot;nodejs ecosystem: {ecosystem(&apos;nodejs&apos;)}&quot;)
print(f&quot;rubygem ecosystem: {ecosystem(&apos;rubygem&apos;)}&quot;)
print(f&quot;php ecosystem: {ecosystem(&apos;php&apos;)}&quot;)
&lt;/code&gt;&lt;/pre&gt;
</description>
        <pubDate>Tue, 04 Jan 2022 00:00:00 -0500</pubDate>
        <link>https://mivehind.net/2022/01/04/Fedora-has-too-many-security-bugs-3/</link>
        <guid isPermaLink="true">https://mivehind.net/2022/01/04/Fedora-has-too-many-security-bugs-3/</guid>
        
        <category>tech</category>
        
        <category>security</category>
        
        
      </item>
    
  </channel>
</rss>
