Skip to content
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

sshkeys: send structured info to journald #397

Merged
merged 2 commits into from
Apr 23, 2020

Conversation

sohankunkerkar
Copy link
Member

@sohankunkerkar sohankunkerkar commented Apr 20, 2020

Fixes: #395
Until lucab/libsystemd-rs#44 gets merged, I'll be using the feature-branch to update the libsystemd package.
coreos/fedora-coreos-config#344

@sohankunkerkar sohankunkerkar force-pushed the send_ssh_keys_info branch 9 times, most recently from 966f4fb to f0d262f Compare April 20, 2020 21:29
src/providers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
@sohankunkerkar sohankunkerkar force-pushed the send_ssh_keys_info branch 3 times, most recently from 381c2df to 2693dc3 Compare April 21, 2020 15:08
@sohankunkerkar sohankunkerkar marked this pull request as ready for review April 21, 2020 15:09
@cgwalters
Copy link
Member

Ah, this project uses conditional compilation; see the
#[cfg(not(feature = "cl-legacy"))]. So you're getting "unused code" errors when building with cl-legacy. Basically you need to move the imports inside the function; see what is there now like:

#[cfg(not(feature = "cl-legacy"))]
fn write_ssh_keys(user: User, ssh_keys: Vec<PublicKey>) -> Result<()> {
    use std::io::ErrorKind::NotFound;
    use users::os::unix::UserExt;

@sohankunkerkar sohankunkerkar force-pushed the send_ssh_keys_info branch 3 times, most recently from 4d2d3dc to 31cc83f Compare April 21, 2020 18:20
src/providers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
@sohankunkerkar sohankunkerkar force-pushed the send_ssh_keys_info branch 2 times, most recently from a6eea1f to 84bd447 Compare April 22, 2020 17:01
@sohankunkerkar sohankunkerkar changed the title WIP: Sending structured ssh_authorized_keys info into the journald log Sending structured ssh_authorized_keys info into the journald log Apr 22, 2020
src/providers/mod.rs Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
@sohankunkerkar sohankunkerkar force-pushed the send_ssh_keys_info branch 7 times, most recently from e59a6ca to 5471f6b Compare April 22, 2020 21:10
src/providers/mod.rs Outdated Show resolved Hide resolved
@sohankunkerkar sohankunkerkar force-pushed the send_ssh_keys_info branch 2 times, most recently from f388d51 to fb4fa7e Compare April 22, 2020 21:22
src/providers/mod.rs Outdated Show resolved Hide resolved
@lucab lucab changed the title Sending structured ssh_authorized_keys info into the journald log sshkeys: send structured info to the journald Apr 23, 2020
@lucab lucab changed the title sshkeys: send structured info to the journald sshkeys: send structured info to journald Apr 23, 2020
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nits, but LGTM overall!

Cargo.toml Outdated Show resolved Hide resolved
src/providers/mod.rs Outdated Show resolved Hide resolved
@sohankunkerkar sohankunkerkar force-pushed the send_ssh_keys_info branch 4 times, most recently from da04ea4 to 0e0b899 Compare April 23, 2020 14:20
@sohankunkerkar sohankunkerkar merged commit ba4b76e into coreos:master Apr 23, 2020
@sohankunkerkar sohankunkerkar deleted the send_ssh_keys_info branch April 23, 2020 15:03
dustymabe pushed a commit to coreos/fedora-coreos-config that referenced this pull request May 22, 2020
…rized keys

This PR addresses the concern raised in coreos/fedora-coreos-tracker#279
which talks about systems behavior when no igntion is provided. Currently, we're tracking ignitionConfig
messages(coreos/fedora-coreos-tracker#279) and ssh-authorized keys info
(coreos/afterburn#397) by sending the structured entry into journald log. Here,
the systemd units are written to scrape through that information to display meaningful data to users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for sending ssh_authorized_keys info into the journald log
4 participants