How onelogin/onelogin_linux_pam_ssh works
Project type and purpose
• This is a containerized Linux PAM (Pluggable Authentication Module) integration for SSH that uses OneLogin’s REST API to perform role-based authorization and MFA.
• It’s not a traditional web full-stack app, but rather a security/infra tool: a PAM plugin written in Python, packaged in Docker, hooked into sshd to gate SSH logins through OneLogin.
File structure
• Top level:
• .gitignore, README.md
• docker-compose.yml → orchestrates the container
• docker/
– Dockerfile → builds the SSH + PAM + dependencies image
– dependencies/ → vendored Python libraries (requests, onelogin SDK, dateutil, etc.)
– etc/pam.d/sshd → SSH PAM config, points at our module
– etc/ssh/sshd_config → SSH daemon config, exposes port 2222
– src/onepam.py → the Python PAM module implementation
– src/template-onepam.json → template for the JSON config
– src/onepam.json → runtime config (region, client_id, secret, role IDs)
• writeup/ → documentation and images showing use-case and configuration
README for additional insights
• Describes the flow: user SSH → PAM module → prompts for OneLogin username and OTP → Python code calls OneLogin API → checks roles (admin vs. user) → grants or denies shell access.
• Explains how to provision roles in OneLogin, how to fill out onepam.json, and how to start via docker-compose up.
Final advice
• Every layer: host orchestration, container runtime, OS service (sshd), plugin (PAM), application logic (Python), external API.
• Don’t overcomplicate: break the system into these focused components and show the exact interactions.