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

Completes core feature binaries #1

Merged
merged 7 commits into from
Oct 28, 2019
Merged

Completes core feature binaries #1

merged 7 commits into from
Oct 28, 2019

Conversation

kanav99
Copy link
Member

@kanav99 kanav99 commented Oct 15, 2019

Includes source for the binaries -

  1. pam_su - Log su activity on slack
  2. pam_sudo - Log sudo activity on slack
  3. pam_ssh - Log successful ssh on slack
  4. auth_keys_cmd - Verify keys of the ssh user, and log unsuccessful attempt.

@fristonio Reviews

Copy link
Member

@fristonio fristonio left a comment

Choose a reason for hiding this comment

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

Initial Review
A few more things I would like to have -

  • Currently there is no code documentation whatsoever, it would be really great to document the functions we are implementing as we go.
  • There is the hardcoded path in config.rs which reads the config file, make it configurable or atleast some generalized global path like /opt/watchdog/config.toml

@@ -1,15 +1,21 @@
use crate::config;
extern crate reqwest;
use log::info;
Copy link
Member

Choose a reason for hiding this comment

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

Since we are planning to open-source watchdog it is better to have a general notification trait, which can be satisfied by the notification provider. Initially, we can target - slack and discord.

Copy link
Member Author

Choose a reason for hiding this comment

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

To be fixed in #3

use simplelog::*;
use std::fs::OpenOptions;

pub fn init(config: &config::Config) {
Copy link
Member

Choose a reason for hiding this comment

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

Is there any further implementation we are basing on this? If not I would prefer to name it as logger.rs instead of init.rs

Copy link
Member Author

Choose a reason for hiding this comment

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

It would include all the initialization of databases if we include it in the future. But for now, its just for initialization of logger.

let env: TempEnvirontment = toml::from_str(&toml_str).unwrap();
return env;
}

pub fn clear_temp_env(path: &String) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't see how this is related to the environment? We can have a module utils and can have functions like this there.

Copy link
Member Author

Choose a reason for hiding this comment

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

We are placing some variables in a file so that the binary pam_ssh can later access this to know the variables which are not passed. What do you suggest naming to?

@fristonio fristonio merged commit b0ff2a2 into master Oct 28, 2019
@fristonio fristonio deleted the logger branch October 28, 2019 20:32
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.

2 participants