Skip to content

content: maintain docs about yubikey situation - #31

Closed
Stensel8 wants to merge 5 commits into
mainfrom
development
Closed

content: maintain docs about yubikey situation#31
Stensel8 wants to merge 5 commits into
mainfrom
development

Conversation

@Stensel8

@Stensel8 Stensel8 commented Mar 1, 2026

Copy link
Copy Markdown
Member

Summary

Maintaining some docs, because I changed my Yubikey setup and wanted to share it.

Type of change

  • feat — new page or feature
  • fix — bug fix (broken link, incorrect command, layout issue)
  • content — update or improve existing content
  • docs — changes to CONTRIBUTING, README, or meta documentation
  • chore — maintenance (dependencies, config, CI/CD)
  • refactor — restructuring without content changes
  • style — formatting, whitespace, typos

Checklist

  • PR title follows the commit convention (e.g. fix: correct nmcli command in eduroam guide)
  • Both EN and NL versions updated (if applicable)
  • Media is in AVIF format (not PNG/JPG)
  • No broken image references (/images/*.avif all exist in static/images/)
  • Tested locally with hugo server

@Stensel8 Stensel8 self-assigned this Mar 1, 2026
Copilot AI review requested due to automatic review settings March 1, 2026 19:53
@github-actions

github-actions Bot commented Mar 1, 2026

Copy link
Copy Markdown

Hey @Stensel8, looks like you forgot something!

The following images in static/images/ are not in AVIF format:

  • static/images/yubikey-gdm-password-config.png
  • static/images/yubikey-lockscreen.png
  • static/images/yubikey-polkit.png
  • static/images/yubikey-sudo-config.png
  • static/images/yubikey-sudo-test.png

Please convert them before merging. Install avifenc first:

sudo pacman -S libavif

Then batch-convert all images in static/images/:

cd static/images
for f in *.png *.jpg *.jpeg; do
  [ -f "$f" ] && avifenc -q 80 -s 6 "$f" "${f%.*}.avif" && rm "$f"
done

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the YubiKey security documentation to reflect abandoning FIDO2 LUKS unlock on this hardware (due to a USB timing race), and documents a reliable alternative using pam-u2f for sudo and GNOME screen unlock. It also adds a GitHub Actions workflow to enforce AVIF-only image assets and introduces new screenshots for the docs.

Changes:

  • Update EN/NL YubiKey docs with new findings (systemd 259 status, FIDO_ERR_RX race) and a full pam-u2f setup guide.
  • Add new YubiKey screenshots under static/images/ to support the updated docs.
  • Replace the “auto-convert images to AVIF” workflow with a “check & comment/fail on non-AVIF” workflow; add a YubiKey entry to Known Issues.

Reviewed changes

Copilot reviewed 5 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
static/images/yubikey-sudo-test.png Adds screenshot for sudo touch prompt (currently PNG).
static/images/yubikey-sudo-config.png Adds screenshot of PAM sudo config (currently PNG).
static/images/yubikey-polkit.png Adds screenshot of GNOME polkit prompt (currently PNG).
static/images/yubikey-gdm-password-config.png Adds screenshot of PAM gdm-password config (currently PNG).
content/docs/security/yubikey.md EN doc expanded with pam-u2f setup, polkit, lock screen, boot flow, and screenshots.
content/docs/security/yubikey.nl.md NL equivalent of the expanded YubiKey doc.
content/docs/known-issues.md Adds an active issue entry documenting the FIDO2 LUKS USB timing race.
content/docs/known-issues.nl.md NL equivalent of the new known issue entry.
.github/workflows/convert-images.yml Reworked to check for non-AVIF images, comment on PRs, and fail with annotations.
Comments suppressed due to low confidence (2)

.github/workflows/convert-images.yml:38

  • count=$(... | wc -l) will include leading spaces from wc, so [ "$count" -gt 0 ] can error with “integer expression expected”. Strip whitespace (e.g. | tr -d ' ') or use count=$(...; echo $(( ... ))) / mapfile to compute the count robustly.
          count=$(find static/images -type f \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" \) | wc -l)
          if [ "$count" -gt 0 ]; then
            echo "found=true" >> "$GITHUB_OUTPUT"
          else
            echo "found=false" >> "$GITHUB_OUTPUT"
            echo "All images are AVIF."

.github/workflows/convert-images.yml:76

  • The PR comment step always creates a new comment via issues.createComment, so re-runs / pushes will spam duplicates. Consider searching existing comments for a unique marker and updating it (or deleting/replacing), or rely solely on workflow annotations to avoid noisy PR threads.
      - name: Post PR comment
        if: steps.check.outputs.found == 'true' && github.event_name == 'pull_request'
        uses: actions/github-script@v7
        env:
          FILES: ${{ steps.check.outputs.files }}
          ACTOR: ${{ github.event.pull_request.user.login }}
        with:
          script: |
            const files = process.env.FILES.trim().split('\n').map(f => `- \`${f}\``).join('\n');
            const actor = process.env.ACTOR;
            const body = [
              `Hey @${actor}, looks like you forgot something!`,
              '',
              'The following images in `static/images/` are not in AVIF format:',
              files,
              '',
              'Please convert them before merging. Install `avifenc` first:',
              '```bash',
              'sudo pacman -S libavif',
              '```',
              '',
              'Then batch-convert all images in `static/images/`:',
              '```bash',
              'cd static/images',
              'for f in *.png *.jpg *.jpeg; do',
              '  [ -f "$f" ] && avifenc -q 80 -s 6 "$f" "${f%.*}.avif" && rm "$f"',
              'done',
              '```',
            ].join('\n');

            await github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.payload.pull_request.number,
              body,
            });

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +141 to +151
![nano editing /etc/pam.d/sudo with pam_u2f.so configured](/images/yubikey-sudo-config.avif)

Test without closing the current terminal first:

```bash
sudo echo test
# "Please touch the FIDO authenticator." → touch → done
```

![sudo echo test output showing the YubiKey touch prompt](/images/yubikey-sudo-test.avif)

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These markdown image links point to .avif files, but in static/images/ the corresponding screenshots currently exist as .png (and there is no .avif variant). This will break the rendered docs and fail the image-format checks; please convert the images to AVIF (preferred) or update the references to match the committed filenames.

Copilot uses AI. Check for mistakes.
Comment on lines +141 to +151
![nano met /etc/pam.d/sudo geconfigureerd voor pam_u2f.so](/images/yubikey-sudo-config.avif)

Test eerst zonder de huidige terminal te sluiten:

```bash
sudo echo test
# "Please touch the FIDO authenticator." → aanraken → klaar
```

![sudo echo test output met de YubiKey touch-prompt](/images/yubikey-sudo-test.avif)

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deze markdown image links verwijzen naar .avif bestanden, maar in static/images/ bestaan de bijbehorende screenshots nu als .png (en er is geen .avif variant). Dit breekt de gerenderde docs en laat de image-format checks falen; converteer de images naar AVIF (voorkeur) of update de referenties zodat ze overeenkomen met de aanwezige bestandsnamen.

Copilot uses AI. Check for mistakes.

De `cue` tekstprompt verschijnt ook in de grafische dialoog. De YubiKey aanraken authenticeert zonder wachtwoord te hoeven typen. Zonder YubiKey ingeplugd valt hij terug op wachtwoord.

![GNOME polkit-dialoog met "Please touch the FIDO authenticator."](/images/yubikey-polkit.avif)

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deze afbeelding gebruikt /images/yubikey-polkit.avif, maar static/images/ bevat momenteel yubikey-polkit.png en geen .avif bestand. Converteer de screenshot naar AVIF (voorkeur) en houd de .avif link aan, of update de link zodat hij overeenkomt met de echte assetnaam.

Suggested change
![GNOME polkit-dialoog met "Please touch the FIDO authenticator."](/images/yubikey-polkit.avif)
![GNOME polkit-dialoog met "Please touch de FIDO authenticator."](/images/yubikey-polkit.png)

Copilot uses AI. Check for mistakes.
Comment on lines +188 to +192
![nano met /etc/pam.d/gdm-password geconfigureerd voor pam_u2f.so](/images/yubikey-gdm-password-config.avif)

Vergrendel het scherm met `Super+L` en raak de YubiKey aan om te ontgrendelen.

![GNOME-vergrendelscherm met "Please touch the FIDO authenticator."](/images/yubikey-lockscreen.avif)

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deze image links verwijzen naar .avif bestanden (yubikey-gdm-password-config.avif, yubikey-lockscreen.avif), maar static/images/ bevat momenteel .png varianten en geen .avif bestanden. Dit breekt de gerenderde docs en laat de image-format checks falen; converteer naar AVIF en behoud de .avif links (voorkeur) of update de links naar de bestaande assets.

Suggested change
![nano met /etc/pam.d/gdm-password geconfigureerd voor pam_u2f.so](/images/yubikey-gdm-password-config.avif)
Vergrendel het scherm met `Super+L` en raak de YubiKey aan om te ontgrendelen.
![GNOME-vergrendelscherm met "Please touch the FIDO authenticator."](/images/yubikey-lockscreen.avif)
![nano met /etc/pam.d/gdm-password geconfigureerd voor pam_u2f.so](/images/yubikey-gdm-password-config.png)
Vergrendel het scherm met `Super+L` en raak de YubiKey aan om te ontgrendelen.
![GNOME-vergrendelscherm met "Please touch de FIDO authenticator."](/images/yubikey-lockscreen.png)

Copilot uses AI. Check for mistakes.

The `cue` text prompt does appear in the graphical dialog as well. Touching the YubiKey authenticates without needing to type a password. Without the key plugged in, it falls back to password as usual.

![GNOME polkit dialog showing "Please touch the FIDO authenticator."](/images/yubikey-polkit.avif)

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This image reference uses /images/yubikey-polkit.avif, but static/images/ currently contains yubikey-polkit.png and no .avif file. Please convert the screenshot to AVIF (preferred) and keep the .avif link, or update the link to match the actual asset filename.

Suggested change
![GNOME polkit dialog showing "Please touch the FIDO authenticator."](/images/yubikey-polkit.avif)
![GNOME polkit dialog showing "Please touch the FIDO authenticator."](/images/yubikey-polkit.png)

Copilot uses AI. Check for mistakes.
Comment on lines +188 to +192
![nano editing /etc/pam.d/gdm-password with pam_u2f.so configured](/images/yubikey-gdm-password-config.avif)

Lock the screen with `Super+L` and touch the YubiKey to unlock.

![GNOME lock screen showing "Please touch the FIDO authenticator."](/images/yubikey-lockscreen.avif)

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These image references point to .avif files (yubikey-gdm-password-config.avif, yubikey-lockscreen.avif), but static/images/ currently contains .png variants and no .avif files. This will break the rendered docs and fail the image-format checks; please convert to AVIF and keep the .avif references (preferred) or update the links to match the committed assets.

Suggested change
![nano editing /etc/pam.d/gdm-password with pam_u2f.so configured](/images/yubikey-gdm-password-config.avif)
Lock the screen with `Super+L` and touch the YubiKey to unlock.
![GNOME lock screen showing "Please touch the FIDO authenticator."](/images/yubikey-lockscreen.avif)
![nano editing /etc/pam.d/gdm-password with pam_u2f.so configured](/images/yubikey-gdm-password-config.png)
Lock the screen with `Super+L` and touch the YubiKey to unlock.
![GNOME lock screen showing "Please touch the FIDO authenticator."](/images/yubikey-lockscreen.png)

Copilot uses AI. Check for mistakes.
I want to improve my PR automations. The intended goal is to notify the user if something went wrong.
Comment on lines +197 to +235
name: Update PR checklist
runs-on: ubuntu-latest
if: always()
needs: [pr-title, bilingual, image-format, link-check]
steps:
- uses: actions/github-script@v7
env:
RESULT_PR_TITLE: ${{ needs.pr-title.result }}
RESULT_BILINGUAL: ${{ needs.bilingual.result }}
RESULT_IMAGE_FORMAT: ${{ needs.image-format.result }}
RESULT_LINK_CHECK: ${{ needs.link-check.result }}
with:
script: |
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});

let body = pr.body || '';

const setCheck = (keyword, passed) => {
body = body.replace(
new RegExp(`- \\[[ xX]\\] (.*${keyword}.*)`, 'i'),
`- [${passed ? 'x' : ' '}] $1`
);
};

setCheck('PR title follows', process.env.RESULT_PR_TITLE === 'success');
setCheck('Both EN and NL', process.env.RESULT_BILINGUAL === 'success');
setCheck('Media is in AVIF', process.env.RESULT_IMAGE_FORMAT === 'success');
setCheck('No broken image', process.env.RESULT_LINK_CHECK === 'success');

await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
body,
});

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 6 months ago

In general, you fix this by adding an explicit permissions section either at the workflow root (to apply to all jobs) or per job, ensuring each job only has the minimal permissions it requires for GITHUB_TOKEN. Here, the code fragment shows several jobs: some only read code or upload/download artifacts, and the update-checklist job reads and updates the PR body. We should add a workflow-level default of contents: read (safe and commonly needed) and then override per job where necessary, notably granting pull-requests: write for the update-checklist job while leaving other jobs with read-only permissions.

Concretely, in .github/workflows/pr-checks.yml:

  • Add a top-level permissions: block after the on: section to set safe defaults, e.g.:
    • contents: read (for checking out code, etc.).
  • Leave most jobs to inherit this default, since they only read code or work with artifacts.
  • For the update-checklist job (lines 196–235), add a permissions: block under the job definition specifying:
    • pull-requests: write (to update the PR body).
    • Optionally contents: read if you want to keep consistency, though it isn’t strictly necessary for that job.

This does not change any existing functional behavior besides tightening token scope; all steps, including the PR body update, will continue to work, now with explicitly documented and minimized permissions.

Suggested changeset 1
.github/workflows/pr-checks.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml
--- a/.github/workflows/pr-checks.yml
+++ b/.github/workflows/pr-checks.yml
@@ -4,6 +4,9 @@
   pull_request:
     branches: [main, development]
 
+permissions:
+  contents: read
+
 jobs:
 
   # ── 1. PR title follows conventional commits ────────────────────────────────
@@ -198,6 +201,8 @@
     runs-on: ubuntu-latest
     if: always()
     needs: [pr-title, bilingual, image-format, link-check]
+    permissions:
+      pull-requests: write
     steps:
       - uses: actions/github-script@v7
         env:
EOF
@@ -4,6 +4,9 @@
pull_request:
branches: [main, development]

permissions:
contents: read

jobs:

# ── 1. PR title follows conventional commits ────────────────────────────────
@@ -198,6 +201,8 @@
runs-on: ubuntu-latest
if: always()
needs: [pr-title, bilingual, image-format, link-check]
permissions:
pull-requests: write
steps:
- uses: actions/github-script@v7
env:
Copilot is powered by AI and may make mistakes. Always verify output.
@Stensel8 Stensel8 closed this Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants