-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add client operation logs for cockpit-machines #1781
Conversation
Hello @ohruka , thanks for the PR! There are a lot of technical details to change, including the rpm build failure:
But I'd like to discuss the high-level strategy first. They were already discussed in https://issues.redhat.com/browse/RHEL-22717 , not sure if you followed that? If that suits your specific use case, that certainly works, and you are welcome to use it in your deployment. Especially if you drop the extra shell script and call I have a lot of reservations about this approach; it's not something which we'd put into the default package, as there are too many conceptual problems with it as a generic solution:
My proposal is to replace this with a README update that explains how to debug/follow what c-machines is doing. That can explain There is also |
Hello @martinpitt , Thank you for your reply and the many comments and suggestions. This PR is related to RHEL-22717. I have made the following changes based on the comments in the Jira ticket to enable this feature to be included in the package.
I have not added this because it can be checked with existing logs.
It is true that both useful and useless information is output.
This is as you pointed out. Creating a new operation log function for the entire cockpit would be a huge undertaking, so I am only creating it for the cockpit-machines part to satisfy the function that was in virt-manager. Currently, I believe that cockpit itself does not have logs that record "when and what operations were performed".
Thank you for the suggestion. Is there a possibility that this patch will be incorporated as a default feature by making these corrections? |
Some services do, many in the form of "audit" logs, others in the normal journal. For example, when you stop a service on the "Services" page, that gets an entry in the journal. Same for logging in and out of cockpit (that's the normal PAM logs for starting/stopping a user session. Or if you e.g. stop/start/change a network interface, you get NetworkManger journal logs. Creating a new user also gets logged, but e.g. deleting a Linux user doesn't. But we consider that a bug in PAM or
I'm afraid no, for the reasons above. Doing things in Cockpit, Terminal, Ansible etc. should all be interchangeable and be possible to do side by side. Logging such actions from Cockpit is simply the wrong layer. Logging actions needs to be done by the API we talk to (D-Bus service, Linux subsystem, administrative CLI program, etc.). This is why I am very concerned about adding this to c-machines: It sets a bad example and raises expectations which we have to refuse in other places. It needs to be absolutely crystal clear that such a log is neither a security proof nor reliable -- it is a debugging tool, nothing else.
Yes, that's a given, but my "firehose" comment really applied to that restriction. It has all the read operations such as That's why I'm not a fan of a plain |
Thank you for your comments. |
This feature provides cockpit-machines to output client-side operation logs.
What it does
This feature enables logging of guest operations performed using libvirt-dbus.
This log entry will contain information about the operation, including the date, guest uuid, and operation.
Example:
When this feature is enabled, shutting down a guest via cockpit-machines will generate a log entry in the journal, regardless of whether the guest actually shut down.
Default behavior:
This feature is disabled by default. Users needing logging can enable it by manually enabling the service (cockpit-machines-logging.service):