You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to access the Container Logs via "UI -> Jobname -> Taskgroup -> Allocation -> Task -> Logs" we get a "permission denied" error.
But the current policy should allow access because of "namespace:write" policy:
namespace "playground" {
policy = "write"
variables {
# give read access to all job templates related to this namespace
path "nomad/job-templates/*" {
capabilities = ["read","list"]
}
}
}
node {
policy = "deny"
}
agent {
policy = "deny"
}
We can prove this because log access via "UI -> Job -> View Logs (of the task)" is working as expected and if we change the policy to
accecss to logs is working also as expected. So it looks like the UI-Button is not checking correctly for the "namespace:read-logs" capability, but instead for a "node:read" policy.
Reproduction steps
Using Policy like:
namespace "playground" {
policy = "write"
variables {
# give read access to all job templates related to this namespace
path "nomad/job-templates/*" {
capabilities = ["read","list"]
}
}
}
# used for UI Access - nicht wirklich ?
node {
policy = "deny"
}
agent {
policy = "deny"
}
trying to access logs of running container via "Jobs -> -> View Logs (in recent allocations tab)"
trying to access logs of running container via "Jobs -> -> TaskGroup -> Allocation -> Task -> Logs (on top menu line)"
Expected Result
Access to logs is possible (depending on namespace:read-logs capability)
Access to logs is possible (depending on namespace:read-logs capability)
Actual Result
Access works as expected
Access is denied due to node-policy=deny
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
thanks
Mac
The text was updated successfully, but these errors were encountered:
Hi @Mac2! Sometimes the UI needs a bit more permissions than the CLI does because it enriches the view from other sources. But I just checked myself and the only API request being sent is /v1/client/fs/logs/$alloc_id?follow=true&offset=50000&origin=end&task=task&type=stdout. But if I send that API request with a token that has a policy without node = "read" I do get the logs. So it looks like this issue is at the UI layer. I'll bring this to the attention of the folks focused on that.
Nomad version
Nomad v1.8.2
BuildDate 2024-07-16T08:50:09Z
Revision 7f0822c
Operating system and Environment details
RHEL 8.6 - RHEL 8.8
Issue
When trying to access the Container Logs via "UI -> Jobname -> Taskgroup -> Allocation -> Task -> Logs" we get a "permission denied" error.
But the current policy should allow access because of "namespace:write" policy:
We can prove this because log access via "UI -> Job -> View Logs (of the task)" is working as expected and if we change the policy to
accecss to logs is working also as expected. So it looks like the UI-Button is not checking correctly for the "namespace:read-logs" capability, but instead for a "node:read" policy.
Reproduction steps
Using Policy like:
trying to access logs of running container via "Jobs -> -> View Logs (in recent allocations tab)"
trying to access logs of running container via "Jobs -> -> TaskGroup -> Allocation -> Task -> Logs (on top menu line)"
Expected Result
Actual Result
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
thanks
Mac
The text was updated successfully, but these errors were encountered: