-
-
Notifications
You must be signed in to change notification settings - Fork 7
Added comments based on my current understanding of the orchestration code for obtaining keytabs from AD #602
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
base: main
Are you sure you want to change the base?
Conversation
// TGT that is obtained for the operation in the memory of the short lives process | ||
// spawned by `Command::new` above - this way it'll be wiped from memory once this exits | ||
// With any shared or persistent ticket cache this might stick around and potentially be | ||
// reused by later runs |
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.
// reused by later runs | |
// reused by other volumes (which could cause privilege escalations and similar fun issues) |
// Get a `ChildStdin` object for the spawned process and write the serialized request | ||
// for a Principal into it in order for the child process to deserialize it and | ||
// process the request | ||
let mut stdin = child.stdin.take().context(ChildStdinSnafu)?; |
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.
The unwrap here is intentional..ish, the stdin pipe is created by spawn()
so this should only be None if either:
- We forgot to call
.stdin(Stdio::piped())
above - We already called
.stdin.take()
- Tokio is børked for some reason
All of those are internal bugs that are probably panic-worthy IMO (though expect
would be better than unwrap
).
// This will always return Ok(...) regardless of exit code or output of the child process | ||
// Failure here means that something went wrong with connecting to the process or obtaining | ||
// exit code or output |
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.
Yeah.. we probably want to add a check for .output.status.success()
// Check for success of the operation by deserializing stdout of the process to a `Response` | ||
// struct - since `Response` is an empty struct with no fields this effectively means that | ||
// any output will fail to deserialize and cause an `Error::RunProvisioner` to be propagated | ||
// with the output of the child process |
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.
Yeah.. this is also to make sure we have the freedom to return structured values later on.
Description
I read a small part of the code that is used to generate keytabs from AD and noted down my understanding in comments.
Not sure if correct or helpful to actually merge, but by opening a PR I hope to have a place for discussion.
Definition of Done Checklist
Author