Minimal finger service that responds with mock finger lookup results sourced from a runtime-provided JSON file.
- Build-time usage is optional; the image only requires the file at runtime.
- Required top-level key:
users, an array of user records. - A record supports the following fields:
username: unique identifier exposed in lookups.gecos: optional finger display name.shell: optional string describing the preferred shell.home: optional home-directory display value. See behavior rules below.plan: optional multi-line string rendered when allowed.
homeandplaninteraction rules:- When
homehas a non-empty string (other than the literalempty), the plan text is suppressed. - When
homeis empty (""), the plan text is shown in the response. - When
homeequals the literal"empty", the home is hidden in the response and the plan remains hidden as well.
- When
Example:
{
"users": [
{
"username": "jdoe",
"gecos": "Jane Doe",
"shell": "bash",
"home": "",
"plan": "Finish onboarding\nUpdate keys"
}
]
}
- Ensure the Dockerfile and application sources are present.
- Build the image:
docker build -t finger-server:latest .
- The container expects
users.jsonat/users.jsonwhen it starts. Mount it explicitly:docker run --rm -p 79:79 -v "$PWD/users.json":/users.json:ro finger-server:latest
- Without the volume, the entrypoint exits immediately.
- The process starts as root, but the entrypoint immediately prunes all interactive shells, reducing the attack surface even if a shell binary is present.
- For additional isolation, enable Docker user remapping (
--userns-remap) so host users map to non-root IDs inside the container. - The final structure of the filesystem looks like this:
/dev
/etc
/fingerd
/home
/lib
/proc
/run
/sys
/users.json