-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-32847 Require WsLogAccess to include logs in ZAP #19389
base: candidate-9.8.x
Are you sure you want to change the base?
HPCC-32847 Require WsLogAccess to include logs in ZAP #19389
Conversation
Require the same WsLogAccess:READ permission to include log files in a ZAP as would be required to view them. When log files are excluded from the ZAP due to lack of permission, the ZAP info file (<wuid>.txt) includes a line explaining their absence. Signed-off-by: Terrence Asselin <[email protected]>
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32847 Jirabot Action Result: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asselitx seems fine, left a couple of comments.
writeZAPWUInfoToIOStream(outFile, "Timing: ", request.whereSlow); | ||
if (request.logsExcludedDueToNoAccess()) | ||
{ | ||
writeZAPWUInfoToIOStream(outFile, "Logs: ", "Excluded due to no access, need WsLogAccess:Read"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor, but potentially very helpful would be to add "user lacks 'WsLogAccess:Read' feature access, please contact admin" or something to that affect.
@@ -4563,6 +4573,9 @@ void CWsWuFileHelper::createZAPWUQueryAssociatedFiles(IConstWorkUnit* cwu, const | |||
cur.getName(name); | |||
cur.getIp(ip); | |||
|
|||
if (!hasLogsAccess && endsWith(name.str(), ".eclcc.log")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow what's special about *.eclcc.log files, this might need a code comment
@@ -381,6 +382,17 @@ struct CWsWuZAPInfoReq | |||
{ | |||
logFilter.populateLogFilter(wuid.str(), httpRequest); | |||
} | |||
|
|||
// True when logs _would have been included_ if the user had access | |||
bool logsExcludedDueToNoAccess() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor, but for some reason the current method name misleads me into thinking the logs have already been excluded, but I think the method is determining if the logs should be excluded, does it make sense to rename to excludeLogsDueToNoAccess()?
Require the same WsLogAccess:READ permission to include log files in a ZAP as would be required to view them. When log files are excluded from the ZAP due to lack of permission, the ZAP info file (.txt) includes a line explaining their absence.
Type of change:
Checklist:
Smoketest:
Testing:
Tested manually on laptop both bare metal and containerized deployments. Checked cases with and without access both requesting and not requesting logs.