Also prevent provisioning arbitrary overlays in secure mode

Signed-off-by: David McFarlane <54093156+Prepultrue@users.noreply.github.com>
This commit is contained in:
David McFarlane
2024-05-08 11:23:18 +10:00
parent 5bfaa9f025
commit 41535cb8f9
2 changed files with 2 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Systems with no SMBIOS (Raspberry Pi) will create a UUID from
`/sys/firmware/devicetree/base/serial-number`
- Replace slice in templates with sprig substr. #1093
- Block unprivileged requests for arbitrary overlays in secure mode.
## v4.5.2, unreleased

View File

@@ -47,7 +47,7 @@ func ProvisionSend(w http.ResponseWriter, req *http.Request) {
wwlog.Recv("hwaddr: %s, ipaddr: %s, stage: %s", rinfo.hwaddr, req.RemoteAddr, rinfo.stage)
if rinfo.stage == "runtime" && conf.Warewulf.Secure {
if (rinfo.stage == "runtime" || len(rinfo.overlay) > 0) && conf.Warewulf.Secure {
if rinfo.remoteport >= 1024 {
wwlog.Denied("Non-privileged port: %s", req.RemoteAddr)
w.WriteHeader(http.StatusUnauthorized)