Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9d4b869
chore: update dependencies
bobhageman Oct 11, 2023
bdd928e
feat: option to disable default signing algorithm
bobhageman Oct 12, 2023
bc4a775
chore: fix typo
bobhageman Oct 19, 2023
fef1bc8
feat: add docker support
bobhageman Oct 19, 2023
bfbab04
improve: make build static
bobhageman Oct 25, 2023
9e38615
improve: use non-root user and configurable locations
bobhageman Oct 30, 2023
46c1c2a
s/secrests/secrets/
sanderhollaar Oct 30, 2023
612e0f1
improve: simplify secrets location
bobhageman Oct 30, 2023
7594cbe
Merge pull request #5 from privacybydesign/disable-algorithm
bobhageman Nov 1, 2023
d53a271
feat: build and publish container to ghcr workflow
bobhageman Nov 1, 2023
335da4f
chore: add newline to end of file
bobhageman Nov 1, 2023
757ff9c
Merge pull request #6 from privacybydesign/dockerize
bobhageman Nov 7, 2023
174f11a
relax file permission check on Ed25519KeyPath
sanderhollaar Dec 4, 2023
d5a2f5e
remove Ed25519KeyPath permission check
sanderhollaar Dec 4, 2023
fb5f005
Merge pull request #7 from privacybydesign/relax-file-permission-chec…
sanderhollaar Dec 4, 2023
808d59a
fileInfo declared and not used
sanderhollaar Dec 4, 2023
7520baa
Merge pull request #8 from privacybydesign/relax-file-permission-chec…
sanderhollaar Dec 4, 2023
d7f6468
liveness check added
vpderp Feb 11, 2025
dfb9f1b
Merge pull request #10 from privacybydesign/feature/liveness
saravahdatipour Feb 11, 2025
67fc038
fix: Scan image and unify image tagging
Feb 28, 2025
e5df2f5
chore: Match casing
Mar 3, 2025
d927edb
chore: Upgrade packages to mitigate critical vulnerability
Mar 3, 2025
9c34796
chore(fix): Allow writing security events
Mar 7, 2025
23dd498
chore: Match casing
Mar 3, 2025
ef9e258
chore: Upgrade packages to mitigate critical vulnerability
Mar 3, 2025
776694f
Revert "chore: Upgrade packages to mitigate critical vulnerability"
Mar 14, 2025
0f33cb0
chore: Set security cutoff to ciritical
Mar 14, 2025
a1b77b9
Merge pull request #12 from privacybydesign/chore/update-packages
coffeebrick Mar 14, 2025
46c8912
chore: Manually dispatch builds with branch tags
Mar 14, 2025
8f0e237
chore: Prevent pushing on schedule and pull request
May 16, 2025
1845d0b
Merge pull request #11 from privacybydesign/chore/scan-and-versioning
coffeebrick Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Delivery

on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [master]
release:
# Note: a current limitation is that when a release is edited after publication, then the Docker tags are not automatically updated.
types: [published]
schedule:
# Run every monday on 9:00 in the morning (UTC).
- cron: "0 9 * * 1"
workflow_dispatch:

permissions:
contents: write
packages: write
security-events: write

jobs:
publish-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check whether this event is the HEAD of main
continue-on-error: true
id: is-head-main
run: git rev-parse HEAD | grep -x ${{ github.sha }}
shell: bash

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=edge,enable=${{ steps.is-head-main.outcome == 'success' }}
type=ref,event=branch,enable=${{ github.event_name == 'workflow_dispatch' }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build container and export to local Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: local/atumd:scan
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Scan Image
uses: anchore/scan-action@v3
id: scan
with:
image: local/atumd:scan
only-fixed: true
fail-build: true
severity-cutoff: critical
output-format: sarif

- name: Upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v3
if: ${{ !cancelled() }}
with:
sarif_file: ${{ steps.scan.outputs.sarif }}

- name: Push image to GitHub Container Registry
uses: docker/build-push-action@v5
if: ${{ ! contains(fromJSON('["schedule", "pull_request"]'), github.event_name) }}
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1-alpine AS build

# Build binary
COPY . /atumd
WORKDIR /atumd
RUN go build -a -ldflags '-extldflags "-static"' -o "/bin/atumd" .

# Create application user
RUN adduser -D -u 1000 -g atumd atumd

# Start building the final image
FROM scratch

# Ensure the application user and group is set
COPY --from=build /etc/passwd /etc/passwd
COPY --from=build /etc/group /etc/group

# Copy binary from build stage
COPY --from=build --chown=atumd:atumd /bin/atumd /bin/atumd

# Switch to application user
USER atumd

ENTRYPOINT ["atumd"]
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
atumd
=====

Post-quantum trusted time-stamping service.
See [go-atum](https://github.com/bwesterb/go-atum) for more information
on the protocol.
Post-quantum trusted time-stamping service.
See [go-atum](https://github.com/bwesterb/go-atum) for more information on the protocol.

Setup
-----
To install `atumd`, run

```
go get github.com/bwesterb/atumd
```

Then create a `config.yaml`:
Create a `config.yaml` file:

```yaml
bindAddr: :8080
canonicalUrl: http://localhost:8080
```
For all configuration options, see [config.yaml.example](config.yaml.example)

**Run using Docker**
The easiest way to run `atumd` for development purposes is using Docker.

````
docker-compose up
````

**Run using GO**
To install `atumd`, run

```
go install github.com/bwesterb/atumd
```

and run

Expand All @@ -29,12 +38,10 @@ atumd
You probably want to configure a proper webserver like `nginx` to act
as proxy and set a corresponding sane `canonicalUrl` with HTTPS.

For more configuration options, see [config.yaml.example](config.yaml.example)

Warnings concerning redundancy and backups
------------------------------------------

`atumd` uses the **statefull** XMSS[MT] Siganture scheme. Each signature
`atumd` uses the **statefull** XMSS[MT] Signature scheme. Each signature
has a *sequence number* (seqno) and a sequence number
[must not](https://eprint.iacr.org/2016/1042.pdf) be reused as it
is likely to lead to signature forgery.
Expand Down
12 changes: 9 additions & 3 deletions config.yaml.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# You probably want to configure these
canonicalUrl: https://path.to/rproxy
bindAddr: localhost:8080
bindAddr: :8080

# Maximum size of nonce to sign. Best to keep above 64.
maxNonceSize: 128
Expand All @@ -12,10 +12,16 @@ acceptableLag: 60
# The default signature algorithm. Either ed25519 or xmssmt.
defaultSigAlg: xmssmt

# Whether or not other signature algorithms besides defaultSigAlg
# are disabled. This is useful if you only want to support one algorithm.
# NOTE: if true, you can still verify validity of timestamps generated with
# any other supported algorithm for the keys listed in otherTrustedPublicKeys
disableOtherSigAlg: false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This presumes that either there only will be two signature algorithms supported or that you'd only want to enable one of them. It seems more logical to me to have an option enabledSigAlgs, and then perhaps interpret the first as the default.

Why do you want to disable one of them btw?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently Yivi is creating a PoC moving the infrastructure into a cloud agnostic environment. Since we are only using ed25519 and we need atumd to be stateless, this small change is (for us) the least intrusive way to make that happen. No change in config needed to keep the current situation running while it is possible to disable all other algorithms (for now only XMSS[MT]) except the default one in our cloud setup.
Thought this could be a nice addition in functionality, hence the pr. On the other hand I also agree with you that the other way around with an option like enabledSigAlgs would be a nice approach.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm!


# Path to store private keys. Will be generated if not present.
# WARNING: do not make backups or copies of xmssmt.key. See the README.
xmssmtKeyPath: xmssmt.key
ed25519KeyPath: ed25519.key
xmssmtKeyPath: /.secrets/xmssmt.key
ed25519KeyPath: /.secrets/ed25519.key

# XMSS(MT) instance to use.
xmssmtAlg: XMSSMT-SHAKE_40/4_256
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.1'

services:

atumd:
build:
context: .
dockerfile: Dockerfile
volumes:
- "./config.yaml:/config/config.yaml"
- "./.secrets:/.secrets"
ports:
- "8080:8080"
expose:
- 8080
command:
- "-config=/config/config.yaml"
33 changes: 28 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
module github.com/bwesterb/atumd

go 1.14
go 1.23.0

toolchain go1.24.0

require (
github.com/bwesterb/go-atum v1.1.5
github.com/bwesterb/go-pow v1.0.0
github.com/bwesterb/go-xmssmt v1.5.2
github.com/go-chi/cors v1.2.1
github.com/prometheus/client_golang v1.12.2
github.com/prometheus/common v0.35.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
google.golang.org/protobuf v1.28.0 // indirect
github.com/prometheus/client_golang v1.21.0
golang.org/x/crypto v0.35.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bwesterb/byteswriter v1.0.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/edsrzf/mmap-go v1.2.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nightlyone/lockfile v1.0.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/templexxx/cpu v0.1.1 // indirect
github.com/templexxx/xorsimd v0.4.3 // indirect
github.com/timshannon/bolthold v0.0.0-20240314194003-30aac6950928 // indirect
go.etcd.io/bbolt v1.4.0 // indirect
golang.org/x/sys v0.30.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
)
Loading