Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.39 KB

File metadata and controls

34 lines (25 loc) · 1.39 KB

Go Reference Go Report Card Build Status Built with Nix

PAM

PAM provides bindings for writing custom PAM service modules in Golang. This allows you to easily write modules that:

  • authenticate users using your desired mechanism, e.g. OIDC;
  • enforce custom account validation logic, e.g. the given user has a certain permission in a database, or the given SSH public key exists in a certain object storage bucket;
  • etc.

Getting Started

Building a custom PAM service module requires implementing the ServiceModule interface and registering the implementation with the pamc package in your main package:

package main

import "github.com/squat/pam/c"

func init() {
    pamc.Register(...)
}

func main() {}

Once implemented, the module can be built with:

go build -buildmode=c-shared -o pam_go.so

Take a look at the examples directory for reference implementations.