Commits
- Commit:
eac23c306591c21ddaa23930159d302f668ae34c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
update client state tracking in the gotd parent process
The session process takes over the old state definitions under
a new name ("session state"). The parent only needs to keep
track of whether a client has been granted access, so it only
uses two states: NEW, and ACCCESS_GRANTED which is set as soon
as the auth process has granted repository access and before
the session and repo_read/repo_write children are started.
Because 'gotctl info' can no longer observe the session state
remove support code for printing it.
ok op@
- Commit:
ee0b2e502f3be1d01835e96bdcd38afed67429f7
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove support for showing client capabilities in 'gotctl info'
The gotd parent process has lost access to client capabilities.
Take the easy way out and remove related code. If needed, client
capabilities can still be found in the debug log with 'gotd -v'.
ok op, jamsek
- Commit:
ae7c1b785440d9b4e2289d935ca85725f45680f1
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add a gotd session process, split off from the parent process
The new session process is able to manipulate files in the repository
and keeps track of the read/write client session state.
The parent process now restricts its view of the filesystem to the
absolute path stored in argv[0], and combines this with unveil "x"
on this path. As a result the parent process can only re-exec itself.
small tweaks + ok op@
- Commit:
6f854dde056f82d0c757c720beed863fc557a1ca
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove the gotsh group requirement from gotd; any user can now connect
Repository access is now controlled by access rules in gotd.conf,
and concurrent connections to the gotd socket by local users are
limited by the listen process. We should keep refining our anti-DoS
measures in the future, but at least we have something in place now.
ok jamsek, op
- Commit:
40b85cca5d86ebef3a353efd464af989c3ebf18b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
introduce connection options to gotd.conf
Allow administrators to tweak the default authentication and request
timeouts if needed, and to tweak the limit of concurrent connections
for specific user accounts.
with several tweaks from and ok op@
- Commit:
7a0564e3ba8d55d4f066d3ba0f35ff64fd6a8d60
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
enforce a per-uid connection limit in the gotd listen process
For now the limit is set at compile-time. It will become configurable
via gotd.conf soon.
ok op@
- Commit:
365cf0f34d08316d433e730a8663283029f729b3
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
move "unix" pledge promise from gotd parent to auth process
The listen process now communicates the client UID/GID to the parent,
and the auth process verifies this on behalf of the parent.
This allows us to remove the "unix" pledge promise from the parent,
removing parent access to syscalls such as listen() and accept() in
the AF_UNIX domain.
ok tracey@ op@
- Commit:
5e25db14db9eb20ee11b68048b45b3e0f54d50eb
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
run gotd authentication in a separate child process
ok op@
- Commit:
b50a2b4639132c68255480f1c5c8785fd7cd8094
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fork gotd repo_read/repo_write children on demand
ok op, jamsek
- Commit:
eec68231a79adb345b1a6a3194e5ddb353570356
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
switch gotd from chroot(2) to unveil(2)
In the future, gotd will fork+exec new processes for each client connection.
Using unveil instead of chroot avoids having to start such processes as root.
The -portable version could use chroot(2) where no equivalent to unveil(2)
exists. A future component which starts new processes will be isolated as
a separate process, which could run as root in the -portable version.
ok op@
- Commit:
d93ecf7dc6dd75bc506128cc5666c1b76761e0a0
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add a gotd "listen" process which watches the unix socket
ok op@
- Commit:
8c6fc1468a57de4851e137b55bda5cd838e2f759
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
rename GOTD_SOCK_FILENO to GOTD_FILENO_MSG_PIPE for clarity (it's not a socket)
- Commit:
ddbe612c691511246aacb15046c1a202d0efcf75
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix group membership check in gotd auth
ok op@
- Commit:
0ccf3acb6c3004ac41b46ad931024da1f4ea0e3e
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement per-repository read/write authorization rules in gotd
ok op@
- Commit:
f1752522ac2fd00af85111c530b80ef1187a07f7
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add gotctl(8); initially supported commands are 'info' and 'stop'
This will be used by an upcoming regress test suite for gotd(8).
ok tracey
- Commit:
13b2bc374c1870ec27b2eeb40efe68fd465f64bb
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
introduce gotd(8), a Git repository server reachable via ssh(1)
This is an initial barebones implementation which provides the absolute
minimum of functionality required to serve got(1) and git(1) clients.
Basic fetch/send functionality has been tested and seems to work here,
but this server is not yet expected to be stable.
More testing is welcome. See the man pages for setup instructions.
The current design uses one reader and one writer process per repository,
which will have to be extended to N readers and N writers in the future.
At startup, each process will chroot(2) into its assigned repository.
This works because gotd(8) can only be started as root, and will then
fork+exec, chroot, and privdrop.
At present the parent process runs with the following pledge(2) promises:
"stdio rpath wpath cpath proc getpw sendfd recvfd fattr flock unix unveil"
The parent is the only process able to modify the repository in a way
that becomes visible to Git clients. The parent uses unveil(2) to
restrict its view of the filesystem to /tmp and the repositories
listed in the configuration file gotd.conf(5).
Per-repository chroot(2) processes use "stdio rpath sendfd recvfd".
The writer defers to the parent for modifying references in the
repository to point at newly uploaded commits. The reader is fine
without such help, because Git repositories can be read without
having to create any lock-files.
gotd(8) requires a dedicated user ID, which should own repositories
on the filesystem, and a separate secondary group, which should not
have filesystem-level repository access, and must be allowed access
to the gotd(8) socket.
To obtain Git repository access, users must be members of this
secondary group, and must have their login shell set to gotsh(1).
gotsh(1) connects to the gotd(8) socket and speaks Git-protocol
towards the client on the other end of the SSH connection.
gotsh(1) is not an interactive command shell.
At present, authenticated clients are granted read/write access to
all repositories and all references (except for the "refs/got/" and
the "refs/remotes/" namespaces, which are already being protected
from modification).
While complicated access control mechanism are not a design goal,
making it possible to safely offer anonymous Git repository access
over ssh(1) is on the road map.