Skip to content

v0.10.1

Choose a tag to compare

@github-actions github-actions released this 14 Nov 01:21
· 2 commits to main since this release
66a830d

Security

  • A private key replaced in place in a text file is found. The secret scan reads the uncommitted diff, which
    shows only changed lines: a key whose body changed while its BEGIN line stayed the same never showed its BEGIN line,
    so it was not recognised (files git shows as binary already got this in 0.9.2). Now lanq greps the snapshot's changed
    text files for -----BEGIN (git grep --cached, only those files), and for each modified or renamed one compares its
    old and new blobs (read by object id, no filters or textconv): an unchanged BEGIN line is scanned again only for a key
    block: a line holding -----END (any case) within 8192 lines, every line strictly between them key material (after
    stripping whitespace, runs of the characters " ' + . & , ; # * > | - / at the start and " ' + . & , ; _ \ | at
    the end (quotes, concatenation, comment and quote markers, a YAML - , a \ continuation), one-letter string
    prefixes and short suffixes (b", "u8), \n and \r\n escapes and XML CR/LF character references: blank, base64 or an armor header such as Proc-Type: ...), at least one a base64 line of 16 or more
    characters with a digit, + or / (lines over 16 KB are never key material), and the new line strictly between BEGIN and END (an edit to the END line alone does not count). Code
    that handles PEM (header and footer constants, adjacent or with parser code between them) never refuses an edit; a
    key in a string concatenation, a comment or a YAML block is still found. A key with no END line, longer than 8192
    lines or written in a form not stripped (see SECURITY.md) is not found when replaced in place, and neither is a
    UTF-16 text file a diff attribute forces to text. A changed text file (modified or renamed, with added lines) whose
    path git gives in bytes that are not UTF-8 refuses the job (scan-incomplete); other files with such names pass as
    before. The finding reads private-key-block in uncommitted file <path> (key block changed in place) and never shows the key. A file lanq cannot look up or read refuses the job
    (scan-incomplete, with a git fsck hint). Such a file is read up to 32 MB per version and 256 MB in all; one over
    that is listed in scanSkipped with the new reason text_over_cap (the larger version's size) and on stderr, not
    refused. Added files are not read (every line is already in the diff), nor files without a BEGIN line.
  • Colliding file names fail closed. Two changed paths that git gives in bytes that are not UTF-8 and that decode
    to the same name now refuse the job (scan-incomplete), whatever the files are. Before, one of them could hide the
    other from the content scans, the binary scan included.
  • One rename mode for the text scan. The diff, its file list and the new comparison now always use -M,
    whatever diff.renames says, so a renamed file is compared with its old version everywhere. The pathspec variables (GIT_LITERAL_PATHSPECS,
    GIT_GLOB_PATHSPECS, GIT_NOGLOB_PATHSPECS, GIT_ICASE_PATHSPECS) are removed from lanq's local git calls. The binary scan
    keeps --no-renames (a moved binary is read whole).

Added

  • A Linux worker in Docker on your own PC. scripts/docker-linux-worker/ holds a Dockerfile, an entrypoint, an
    sshd drop-in and setup.ps1. The image is the .NET 10 SDK on Ubuntu 24.04, pinned by digest (runtime 10.0.15), plus
    sshd and git, with key-only login as lanq. setup.ps1:

    • makes the key, the host key and a private ssh config entry with an Include at the top of ~/.ssh/config;
    • runs the container on 127.0.0.1 only, with restrict on the key, 8 GB, 4 CPUs (with a matching cpuset),
      --cap-drop ALL plus the six capabilities sshd needs, --init and --restart unless-stopped;
    • mounts the host key under /root, so job code cannot read it;
    • checks the result with ssh -G and one login.

    A separate -Register step, run by the owner, adds the machine (size: medium, max_jobs: 1) to machines.yml
    and machines.smoke.yml. It keeps the change only when lanq doctor --remote passes for the machine in every
    file, and restores them all otherwise. See
    docs/WORKERS.md, "A Linux worker in Docker on your own PC", for what it proves and what it does not.

  • A test checks that the Docker worker's base image is pinned by digest.

Behaviour changes

  • Edits to sample keys kept in tracked text files are now refused: changing the body of a committed private key (a
    test fixture, a doc sample) under the same BEGIN line refuses the run like a new key. Generate test keys when the
    tests run, or keep such samples out of the files you edit.
  • A user whose diff.renames is false now gets rename-aware file lists and diffs for the scan: a renamed file's
    old name is no longer listed among the changed files (its new name is).

Documentation

  • SECURITY.md and the README now say that the uncommitted diff is scanned with its removed lines too (so removing a
    secret from a tracked file is refused until that removal is committed), and describe the text key-block comparison
    and its limits; scanSkipped documents text_over_cap.

Full changelog: https://github.com/jangolath/lanqueue/blob/main/CHANGELOG.md

What's Changed

  • v0.10.1: catch private keys replaced in place in text files; Docker Linux worker by @jangolath in #21
  • CHANGELOG: date the 0.10.1 section by @jangolath in #22

Full Changelog: v0.10.0...v0.10.1