Hi all!
I have an issue when using a token for authenticating to the REST API. I try to get information from /api/cluster and follow the documentation on Graylog REST API - Configuring Graylog
This command works just fine and I get information about all nodes in the cluster.
I’ve also tried getting a session token for the same user and use the session token for authentication. It works just fine. The command returns information about all servers in the cluster.
curl -u adminuser:p4ssw0rd 'http://172.17.11.9:9000/api/cluster?pretty=true'
But when creating a token (for the same “adminuser”) in the web UI and then trying the same command, I only get status information from the master server:
curl -u 9fav[...]h148:token 'http://172.17.11.9:9000/api/cluster?pretty=true'
{
"c317593f-[...]-b0b5b57da06b" : {
"facility" : "graylog-server",
"codename" : "Noir",
"node_id" : "c317593f-[...]-b0b5b57da06b",
"cluster_id" : "cac50c4a-[...]-8f8d64d831dd",
"version" : "4.1.10+9bc6267",
"started_at" : "2022-02-01T15:30:28.670Z",
"hostname" : "ulm-graylog-master",
"lifecycle" : "running",
"lb_status" : "alive",
"timezone" : "Etc/UTC",
"operating_system" : "Linux 3.10.0-1160.49.1.el7.x86_64",
"is_processing" : true
},
"ff94b945-[...]-2aca679115f5" : null,
"101c03c9-[...]-9026c41bb5d2" : null
}
We use Graylog 4.1.10 but I’ve seen the same problem in Graylog 3.3.16. Graylog is installed in a K8S cluster running on RedHat 7.9, using stock docker images (graylog/graylog:4.1.10).
Isn’t the token supposed to work properly in cluster setups? Why don’t the REST API return information about the other servers when using a session token?
All the best, John