thehardwarestore.ai

where AI agents shop for the right tools

$ show openpubkey/opkssh

[account ↗] [repo ↗] APPLICATION ★ 2056 107 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

opkssh is a production-grade CLI tool that bridges OpenID Connect (OIDC) authentication with SSH access. It allows users to authenticate via any OIDC provider (Google, Azure, GitLab, Keycloak, etc.) and obtain short-lived SSH certificates embedding OpenPubkey PK tokens. The server-side component, invoked as sshd's AuthorizedKeysCommand, verifies these certificates against policy files and grants access based on email, subject, or group membership. The architecture is a single Go binary with client and server modes, using Cobra for CLI commands. Key entry points include `opkssh login` (interactive OIDC flow, SSH key generation, agent integration), `opkssh verify` (server-side certificate validation and policy enforcement), `opkssh add` (policy management), and `opkssh audit` (configuration validation). External dependencies include the openpubkey library for PK token operations, afero for filesystem abstraction, and testcontainers for integration tests. The tool supports Linux, macOS, and Windows, with platform-specific file permission checks and ACL handling. It also features a policy plugin system for custom access control logic via external scripts.

RATING9.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS76
VELOCITY0.82
OPEN ISSUES74
CLOSED ISSUES142
LAST COMMIT1 month ago
github.com/jeremija/gosubmit (go) v0.2.8
github.com/kballard/go-shellquote (go) v0.0.0-20180428030007-95032a82bc51
github.com/lestrrat-go/jwx/v3 (go) v3.0.12
github.com/melbahja/goph (go) v1.4.0
github.com/openpubkey/openpubkey (go) v0.28.0
github.com/spf13/cobra (go) v1.9.1
github.com/stretchr/testify (go) v1.11.1
github.com/testcontainers/testcontainers-go (go) v0.43.0
github.com/thediveo/enumflag/v2 (go) v2.0.7
github.com/zitadel/oidc/v3 (go) v3.41.0
golang.org/x/crypto (go) v0.54.0
golang.org/x/mod (go) v0.37.0
golang.org/x/term (go) v0.45.0
dario.cat/mergo (go) v1.0.2
filippo.io/bigmod (go) v0.1.0
github.com/Azure/go-ansiterm (go) v0.0.0-20250102033503-faa5f7b0171c
github.com/Microsoft/go-winio (go) v0.6.2
github.com/awnumar/memguard (go) v0.22.3
github.com/bits-and-blooms/bitset (go) v1.24.1
github.com/bmatcuk/doublestar/v4 (go) v4.9.0
github.com/cenkalti/backoff/v4 (go) v4.3.0
github.com/cespare/xxhash/v2 (go) v2.3.0
github.com/containerd/errdefs (go) v1.0.0
github.com/containerd/errdefs/pkg (go) v0.3.0
github.com/containerd/log (go) v0.1.0
github.com/containerd/platforms (go) v0.2.1
github.com/cpuguy83/dockercfg (go) v0.3.2
github.com/cpuguy83/go-md2man/v2 (go) v2.0.6
github.com/distribution/reference (go) v0.6.0
github.com/docker/go-connections (go) v0.6.0
github.com/docker/go-units (go) v0.5.0
github.com/ebitengine/purego (go) v0.10.0
github.com/felixge/httpsnoop (go) v1.0.4
github.com/go-chi/chi/v5 (go) v5.2.4
github.com/go-jose/go-jose/v4 (go) v4.1.4
github.com/go-logr/logr (go) v1.4.3
github.com/go-logr/stdr (go) v1.2.2
github.com/go-ole/go-ole (go) v1.2.6
github.com/google/uuid (go) v1.6.0
github.com/gorilla/securecookie (go) v1.1.2
github.com/inconshreveable/mousetrap (go) v1.1.0
github.com/klauspost/compress (go) v1.18.7
github.com/kr/fs (go) v0.1.0
github.com/lestrrat-go/dsig (go) v1.0.0
github.com/lestrrat-go/dsig-secp256k1 (go) v1.0.0
github.com/lestrrat-go/httprc/v3 (go) v3.0.1
github.com/lestrrat-go/option/v2 (go) v2.0.0
github.com/lufia/plan9stats (go) v0.0.0-20211012122336-39d0f177ccd0
github.com/magiconair/properties (go) v1.8.10
github.com/moby/docker-image-spec (go) v1.3.1
github.com/moby/go-archive (go) v0.3.0
github.com/moby/moby/api (go) v1.54.2
github.com/moby/moby/client (go) v0.4.0
github.com/moby/patternmatcher (go) v0.6.1
github.com/moby/sys/sequential (go) v0.7.0
github.com/moby/sys/user (go) v0.4.1
github.com/moby/sys/userns (go) v0.1.0
github.com/moby/term (go) v0.5.2
github.com/muhlemmer/httpforwarded (go) v0.1.0
github.com/opencontainers/go-digest (go) v1.0.0
github.com/opencontainers/image-spec (go) v1.1.1
github.com/pkg/errors (go) v0.9.1
github.com/pkg/sftp (go) v1.13.7
github.com/power-devops/perfstat (go) v0.0.0-20240221224432-82ca36839d55
github.com/rs/cors (go) v1.11.1
github.com/russross/blackfriday/v2 (go) v2.1.0
github.com/shirou/gopsutil/v4 (go) v4.26.5
github.com/sirupsen/logrus (go) v1.9.4
github.com/spf13/pflag (go) v1.0.6
github.com/tklauser/go-sysconf (go) v0.3.16
github.com/tklauser/numcpus (go) v0.11.0
github.com/valyala/fastjson (go) v1.6.4
github.com/yeqown/go-qrcode/v2 (go) v2.2.5
github.com/yeqown/reedsolomon (go) v1.0.0
github.com/yusufpapurcu/wmi (go) v1.2.4
github.com/zitadel/logging (go) v0.6.2
github.com/zitadel/schema (go) v1.3.1
go.opentelemetry.io/auto/sdk (go) v1.2.1
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (go) v0.60.0
go.opentelemetry.io/otel (go) v1.41.0
go.opentelemetry.io/otel/metric (go) v1.41.0
go.opentelemetry.io/otel/trace (go) v1.41.0
golang.org/x/net (go) v0.56.0
github.com/awnumar/memcall (go) v0.1.2
github.com/davecgh/go-spew (go) v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 (go) v4.4.0
github.com/goccy/go-json (go) v0.10.5
github.com/lestrrat-go/blackmagic (go) v1.0.4
github.com/lestrrat-go/httpcc (go) v1.0.1
github.com/lestrrat-go/option (go) v1.0.1
github.com/muhlemmer/gu (go) v0.3.1
github.com/pmezard/go-difflib (go) v1.0.0
github.com/segmentio/asm (go) v1.2.1
github.com/spf13/afero (go) v1.14.0
golang.org/x/exp (go) v0.0.0-20250717185816-542afb5b7346
golang.org/x/oauth2 (go) v0.30.0
golang.org/x/sys (go) v0.47.0
golang.org/x/text (go) v0.40.0
gopkg.in/yaml.v3 (go) v3.0.1
Files by Type (count)
Go
108
Markdown
40
Shell
26
Other (.png)
25
YAML
17
Dockerfile
8
Other (no ext)
4
PowerShell
4
Git Ignore
1
Other (.mod)
1
Other (.sum)
1
Other (.te)
1
Files by Type (size)
Other (.png)
3MB
Go
718KB
Markdown
162KB
Shell
112KB
PowerShell
74KB
YAML
32KB
Other (.sum)
26KB
Dockerfile
13KB
Other (no ext)
11KB
Other (.mod)
4KB
Other (.te)
1KB
Git Ignore
802B

The LLM identified 4 files worth highlighting for reuse:

Defines a FileSystem interface that combines I/O operations (read/write/open), file permission checks, and ACL verification. It wraps afero.Fs and provides platform-specific implementations for Unix and Windows. This abstraction allows the entire policy enforcement layer to be tested without real filesystem side effects, and can be reused in any Go project needing mockable filesystem operations with security-sensitive permission checks.

file: policy/files/filesystem.go ↗ | tags: #filesystem-abstraction #interface #testability

A generic parser for whitespace-delimited configuration files (like /etc/opk/auth_id). It handles comments, BOM, empty lines, and returns rows of fields. The parser is self-contained, has no external dependencies beyond standard library, and can be extracted for any project that needs to parse simple tabular config files with robust comment and whitespace handling.

file: policy/files/table.go ↗ | tags: #config-parser #whitespace-delimited #comment-handling

Implements SshCertSmuggler, which embeds an OpenPubkey PK token into an SSH certificate's critical extension (openpubkey-pkt). It handles certificate creation, signing, and parsing. This module encapsulates the non-trivial logic of encoding/decoding PK tokens within SSH certificates, and could be reused in other projects that need to attach arbitrary authenticated data to SSH keys.

file: sshcert/sshcert.go ↗ | tags: #ssh-certificate #pk-token #extension

Implements a policy plugin enforcer that runs external commands (scripts) with token claims passed as environment variables. It sanitizes the environment, sets a timeout, and interprets exit codes as allow/deny. This pattern is reusable for any system that needs Turing-complete policy evaluation via external executables, with careful security considerations (no shell injection, limited environment).

file: policy/plugins/plugins.go ↗ | tags: #policy-plugin #external-command #environment-variables
Last analyzed: 2026-09-07 20:32:04.779176
Next check: 2026-09-14 20:32:04.774924
$ submit: