-
Notifications
You must be signed in to change notification settings - Fork 6
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
SPIKE audit logs shall include user information. #36
Comments
@v0lkan !assign |
This has changed a bit (since we don’t use JWT but we use SVIDs instead); I'll update the description and then reassign. |
I think we should be using both? x509 svids for machines, jwt's for users. For cases where we're using spire svid as the user auth mechanism for bootstrapping / recovery, we still could use both. Then, for auditing, can log the jwt info. |
Yes, for named admins we'd need JWT and along with an IDM integration (like Keycloak)
Need to think about that. But the uber-super initial admin uses (or "issues" to be more specific) an x509 SVID for the We can make the client issue a JWT SVID and consumers (SPIKE Nexus) validate that JWT SVID, but that will complicate things since we already know that the x509 svid with that specific spiffeid can only belong to the uber-super nameless admin. So for the sake of this task (I think) we can look at the x509 SVID (if there is one) and log the SPIFFEID into the audit log. When we deploy keycloak and start playing with named admins the audit entrypoint will probably need to intercept JWT in the header too; and if it detects it, it can log it too. |
@sahinakyol I'm a bit swamped but I'll add some details to this ticket this weekend hopefully. -- I also want to ensure that the current SPIKE and SDK is in a good shape. ^ after that, I'll assign it to you. |
Okay; some more details ( for @sahinakyol ) The func HandleRoute(h Handler) {
http.HandleFunc("/", func(
writer http.ResponseWriter, request *http.Request,
) {
now := time.Now()
entry := log.AuditEntry{
TrailId: crypto.Id(),
Timestamp: now,
UserId: "",
Action: log.AuditEnter,
Path: request.URL.Path,
Resource: "",
SessionID: "",
State: log.AuditCreated,
}
log.Audit(entry)
err := h(writer, request, &entry)
if err == nil {
entry.State = log.AuditSuccess
} else {
entry.State = log.AuditErrored
entry.Err = err.Error()
}
entry.Duration = time.Since(now)
log.Audit(entry)
})
} Here's the audit entry: entry := log.AuditEntry{
TrailId: crypto.Id(),
Timestamp: now,
UserId: "",
Action: log.AuditEnter,
Path: request.URL.Path,
Resource: "",
SessionID: "",
State: log.AuditCreated,
} Firstly, I think the audit object needs some cleanup (for example, At this interception point we can do two things:
you can assume that the payload will at least have these standard fields:
we can upate the code if we feel wee need to track any additional field in the audit logs.
The SPIKE Go SDK has a we should add that ID to the audit log too. -- That's about it for now, I think. I'm assigning the issue. It's all yours @sahinakyol :) |
Right now SPIKE audit logs pass empty string as the user name; however, we can get those details from the JWT and add it to the audit logs.
Here is a sample JWT payload that's sent with every authenticated API requeset:
The text was updated successfully, but these errors were encountered: