fix: sanitize container log output and fix lint issues
- Update nolint comment on log streaming to accurately describe why gosec is suppressed (text/plain Content-Type, not HTML) - Replace <script type="text/plain"> with data attribute for initial logs to prevent </script> breakout from attacker-controlled log data - Move RemoveImage before unexported methods (funcorder) - Fix file permissions in test (gosec G306) - Rename unused parameters in export_test.go (revive) - Add required blank line before assignment (wsl)
This commit is contained in:
@@ -499,7 +499,7 @@ func (h *Handlers) HandleAppLogs() http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
_, _ = writer.Write([]byte(logs)) //nolint:gosec // logs are from trusted container output, not user input
|
||||
_, _ = writer.Write([]byte(logs)) //nolint:gosec // response Content-Type is text/plain, not rendered as HTML
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user