The REST API was introduced in Warewulf v4.6.1. It is disabled by default and must be explicitly enabled in
warewulf.conf.Enabling the API
Add anapi section to /etc/warewulf/warewulf.conf and set enabled: true:
Allowed subnets
By default, the API only accepts connections from localhost (127.0.0.0/8 for IPv4 and ::1/128 for IPv6). To allow access from additional subnets, add them to the allowed subnets list:
Base URL
The API is served on port9873, the same port used by the Warewulf provisioning server:
/api/docs on the running server.
Authentication
Authentication is configured in/etc/warewulf/auth.conf. This is a YAML file that lists users and their bcrypt2 password hashes:
Generating a password hash
Usemkpasswd to generate a bcrypt2 hash for a new password:
auth.conf under password hash.
Example request
TLS / HTTPS
To require TLS for API connections, first enable TLS forwarewulfd in warewulf.conf:
api: tls is set, the API rejects plain HTTP requests. Generate a self-signed key and certificate with:
/etc/warewulf/tls/ by default.
The kernel and system image are always transferred unencrypted, regardless of TLS configuration. TLS only applies to overlay delivery and API traffic.