// Shouldn't happen; /certs has been around forever.
ret:=Result{
Status:ResultInvalidVersion,
Endpoint:"/{{mount}}/certs",
Message:"This health check requires Vault 1.11+ but an earlier version of Vault Server was contacted, preventing this health check from running.",
}
return[]*Result{&ret},nil
}
sourceMap:=map[string][]string{
"audit_non_hmac_request_keys":VisibleReqParams,
"audit_non_hmac_response_keys":VisibleRespParams,
}
forsource,visibleList:=rangesourceMap{
actual,err:=stringList(h.TuneData[source])
iferr!=nil{
returnnil,fmt.Errorf("error parsing %v from server: %v",source,err)
}
for_,param:=rangevisibleList{
found:=false
for_,tuned:=rangeactual{
ifparam==tuned{
found=true
break
}
}
if!found{
ret:=Result{
Status:ResultInformational,
Endpoint:"/sys/mounts/{{mount}}/tune",
Message:fmt.Sprintf("Mount currently HMACs %v because it is not in %v; as this is not a sensitive security parameter, it is encouraged to disable HMACing to allow better auditing of the PKI engine.",param,source),
}
results=append(results,&ret)
}
}
}
sourceMap=map[string][]string{
"audit_non_hmac_request_keys":HiddenReqParams,
"audit_non_hmac_response_keys":HiddenRespParams,
}
forsource,hiddenList:=rangesourceMap{
actual,err:=stringList(h.TuneData[source])
iferr!=nil{
returnnil,fmt.Errorf("error parsing %v from server: %v",source,err)
}
for_,param:=rangehiddenList{
found:=false
for_,tuned:=rangeactual{
ifparam==tuned{
found=true
break
}
}
iffound{
ret:=Result{
Status:ResultWarning,
Endpoint:"/sys/mounts/{{mount}}/tune",
Message:fmt.Sprintf("Mount currently doesn't HMAC %v because it is in %v; as this is a sensitive security parameter it is encouraged to HMAC it in the Audit logs.",param,source),