From 99a50a789464be5c1621fe944906fd83e2674a21 Mon Sep 17 00:00:00 2001 From: Alexis Mousset Date: Fri, 12 Jul 2019 11:30:38 +0200 Subject: [PATCH] Fixes #15209: Control runlog consistency before inserting it --- relay/sources/relayd/src/api.rs | 2 - relay/sources/relayd/src/data/runinfo.rs | 2 +- relay/sources/relayd/src/data/runlog.rs | 58 ++++++++++----- relay/sources/relayd/src/output/database.rs | 8 +- relay/sources/relayd/src/processing.rs | 2 +- .../tests/{api_tests.rs => relay_api.rs} | 0 .../sources/relayd/tests/reports_database.rs | 16 +++- ...@e745a140-40bc-4b86-b6dc-084488fc906b.log} | 0 ...45a140-40bc-4b86-b6dc-084488fc906b.signed} | 0 ...e745a140-40bc-4b86-b6dc-084488fc906b.json} | 0 ...@e745a140-40bc-4b86-b6dc-084488fc906b.log} | 0 ...45a140-40bc-4b86-b6dc-084488fc906b.signed} | 0 ...0@e745a140-40bc-4b86-b6dc-084488fc906c.log | 73 +++++++++++++++++++ 13 files changed, 129 insertions(+), 32 deletions(-) rename relay/sources/relayd/tests/{api_tests.rs => relay_api.rs} (100%) rename relay/sources/relayd/tests/runlogs/{normal_old.log => 2017-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log} (100%) rename relay/sources/relayd/tests/runlogs/{normal_old.signed => 2017-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.signed} (100%) rename relay/sources/relayd/tests/runlogs/{normal.json => 2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.json} (100%) rename relay/sources/relayd/tests/runlogs/{normal.log => 2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log} (100%) rename relay/sources/relayd/tests/runlogs/{normal.signed => 2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.signed} (100%) create mode 100644 relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906c.log diff --git a/relay/sources/relayd/src/api.rs b/relay/sources/relayd/src/api.rs index 1bc3e9ebdb2..4a89969e94f 100644 --- a/relay/sources/relayd/src/api.rs +++ b/relay/sources/relayd/src/api.rs @@ -37,9 +37,7 @@ use crate::{ use futures::Future; use std::{ collections::HashMap, - fs, net::SocketAddr, - str::FromStr, sync::{Arc, RwLock}, }; use tracing::info; diff --git a/relay/sources/relayd/src/data/runinfo.rs b/relay/sources/relayd/src/data/runinfo.rs index 743ee8a95ae..2c77769088b 100644 --- a/relay/sources/relayd/src/data/runinfo.rs +++ b/relay/sources/relayd/src/data/runinfo.rs @@ -44,7 +44,7 @@ use std::{ }; use tracing::debug; -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] pub struct RunInfo { pub node_id: NodeId, pub timestamp: DateTime, diff --git a/relay/sources/relayd/src/data/runlog.rs b/relay/sources/relayd/src/data/runlog.rs index 8ae1dc3ac77..aa0df7e6d39 100644 --- a/relay/sources/relayd/src/data/runlog.rs +++ b/relay/sources/relayd/src/data/runlog.rs @@ -39,6 +39,8 @@ use serde::{Deserialize, Serialize}; use std::{ convert::TryFrom, fmt::{self, Display}, + fs::read_to_string, + path::Path, str::FromStr, }; use tracing::{debug, error, warn}; @@ -59,11 +61,26 @@ impl Display for RunLog { } } -impl FromStr for RunLog { - type Err = Error; +impl RunLog { + /// Mainly used for testing + pub fn new>(path: P) -> Result { + let info = RunInfo::from_str( + path.as_ref() + .file_name() + .and_then(|r| r.to_str()) + .ok_or_else(|| { + Error::InvalidRunInfo(path.as_ref().to_str().unwrap_or("").to_string()) + })?, + )?; + RunLog::try_from((info, read_to_string(path)?.as_ref())) + } +} - fn from_str(s: &str) -> Result { - match runlog(s) { +impl TryFrom<(RunInfo, &str)> for RunLog { + type Error = Error; + + fn try_from(raw_reports: (RunInfo, &str)) -> Result { + match runlog(raw_reports.1) { Ok(raw_runlog) => { debug!("Parsed runlog {:#?}", raw_runlog.1); let (reports, failed): (Vec<_>, Vec<_>) = @@ -71,34 +88,28 @@ impl FromStr for RunLog { for invalid_report in failed.into_iter().map(Result::unwrap_err) { warn!("Invalid report: {}", invalid_report); } - // TODO: avoid collecting? + let reports: Vec = reports.into_iter().map(Result::unwrap).collect(); - RunLog::try_from(reports) + RunLog::try_from((raw_reports.0, reports)) } Err(e) => { - warn!("{:?}: could not parse '{}'", e, s); + warn!("{:?}: could not parse '{}'", e, raw_reports.0); Err(Error::InvalidRunLog) } } } } -impl TryFrom> for RunLog { +impl TryFrom<(RunInfo, Vec)> for RunLog { type Error = Error; - fn try_from(raw_reports: Vec) -> Result { + fn try_from(raw_reports: (RunInfo, Vec)) -> Result { let reports: Vec = raw_reports + .1 .into_iter() .flat_map(RawReport::into_reports) .collect(); - - let info = match reports.first() { - None => return Err(Error::EmptyRunlog), - Some(report) => RunInfo { - node_id: report.node_id.clone(), - timestamp: report.start_datetime, - }, - }; + let info = raw_reports.0; for report in &reports { if info.node_id != report.node_id { @@ -123,7 +134,7 @@ impl TryFrom> for RunLog { #[cfg(test)] mod tests { use super::*; - use std::fs::{read_dir, read_to_string}; + use std::fs::read_dir; #[test] fn it_parses_runlog() { @@ -132,8 +143,7 @@ mod tests { for entry in read_dir("tests/runlogs/").unwrap() { let path = entry.unwrap().path(); if path.extension().unwrap() == "json" { - let runlog = - RunLog::from_str(&read_to_string(path.with_extension("log")).unwrap()).unwrap(); + let runlog = RunLog::new(&path.with_extension("log")).unwrap(); //println!("{}", serde_json::to_string_pretty(&runlog).unwrap()); let reference: RunLog = serde_json::from_str(&read_to_string(path).unwrap()).unwrap(); @@ -144,4 +154,12 @@ mod tests { // check we did at least one test assert!(test_done > 0); } + + #[test] + fn it_detect_invalid_node_in_runlog() { + assert!( + RunLog::new("2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906c.log") + .is_err() + ); + } } diff --git a/relay/sources/relayd/src/output/database.rs b/relay/sources/relayd/src/output/database.rs index 7abb35eaaf0..7d0084bda1c 100644 --- a/relay/sources/relayd/src/output/database.rs +++ b/relay/sources/relayd/src/output/database.rs @@ -154,8 +154,6 @@ mod tests { use super::*; use crate::{data::report::QueryableReport, output::database::schema::ruddersysevents::dsl::*}; use diesel; - use std::fs::read_to_string; - use std::str::FromStr; pub fn db() -> PgPool { let db_config = DatabaseConfig { @@ -177,8 +175,10 @@ mod tests { .unwrap(); assert_eq!(results.len(), 0); - let runlog = - RunLog::from_str(&read_to_string("tests/runlogs/normal.log").unwrap()).unwrap(); + let runlog = RunLog::new( + "tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log", + ) + .unwrap(); // Test inserting the runlog diff --git a/relay/sources/relayd/src/processing.rs b/relay/sources/relayd/src/processing.rs index b456dae21f7..96fc54c6f0c 100644 --- a/relay/sources/relayd/src/processing.rs +++ b/relay/sources/relayd/src/processing.rs @@ -246,7 +246,7 @@ fn output_report_database_inner( .ok_or_else(|| Error::MissingCertificateForNode(run_info.node_id.clone()))?, )?; - let parsed_runlog = signed_runlog.parse::()?; + let parsed_runlog = RunLog::try_from((run_info.clone(), signed_runlog.as_ref()))?; let _inserted = insert_runlog( &job_config diff --git a/relay/sources/relayd/tests/api_tests.rs b/relay/sources/relayd/tests/relay_api.rs similarity index 100% rename from relay/sources/relayd/tests/api_tests.rs rename to relay/sources/relayd/tests/relay_api.rs diff --git a/relay/sources/relayd/tests/reports_database.rs b/relay/sources/relayd/tests/reports_database.rs index 8392560cf0c..7f3b041f1c6 100644 --- a/relay/sources/relayd/tests/reports_database.rs +++ b/relay/sources/relayd/tests/reports_database.rs @@ -46,12 +46,16 @@ fn it_reads_and_inserts_a_runlog() { create_dir_all("target/tmp/test_simple/incoming").unwrap(); let cli_cfg = CliConfiguration::new("tests/test_simple/config/", false); - let file_old = "target/tmp/test_simple/incoming/2017-01-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log"; - let file_new = "target/tmp/test_simple/incoming/2018-01-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log"; + let file_old = "target/tmp/test_simple/incoming/2017-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log"; + let file_new = "target/tmp/test_simple/incoming/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log"; let file_broken = "target/tmp/test_simple/incoming/2018-02-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log"; let file_failed = "target/tmp/test_simple/failed/2018-02-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log"; - copy("tests/runlogs/normal_old.signed", file_old).unwrap(); + copy( + "tests/runlogs/2017-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.signed", + file_old, + ) + .unwrap(); // We need to file to be old set_file_times(file_old, FileTime::zero(), FileTime::zero()).unwrap(); @@ -61,7 +65,11 @@ fn it_reads_and_inserts_a_runlog() { assert!(start_number(&db, 1).is_ok()); - copy("tests/runlogs/normal.signed", file_new).unwrap(); + copy( + "tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.signed", + file_new, + ) + .unwrap(); copy("tests/files/config/main.conf", file_broken).unwrap(); assert!(start_number(&db, 2).is_ok()); diff --git a/relay/sources/relayd/tests/runlogs/normal_old.log b/relay/sources/relayd/tests/runlogs/2017-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log similarity index 100% rename from relay/sources/relayd/tests/runlogs/normal_old.log rename to relay/sources/relayd/tests/runlogs/2017-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log diff --git a/relay/sources/relayd/tests/runlogs/normal_old.signed b/relay/sources/relayd/tests/runlogs/2017-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.signed similarity index 100% rename from relay/sources/relayd/tests/runlogs/normal_old.signed rename to relay/sources/relayd/tests/runlogs/2017-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.signed diff --git a/relay/sources/relayd/tests/runlogs/normal.json b/relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.json similarity index 100% rename from relay/sources/relayd/tests/runlogs/normal.json rename to relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.json diff --git a/relay/sources/relayd/tests/runlogs/normal.log b/relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log similarity index 100% rename from relay/sources/relayd/tests/runlogs/normal.log rename to relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.log diff --git a/relay/sources/relayd/tests/runlogs/normal.signed b/relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.signed similarity index 100% rename from relay/sources/relayd/tests/runlogs/normal.signed rename to relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906b.signed diff --git a/relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906c.log b/relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906c.log new file mode 100644 index 00000000000..ea018e6154e --- /dev/null +++ b/relay/sources/relayd/tests/runlogs/2018-08-24T15:55:01+00:00@e745a140-40bc-4b86-b6dc-084488fc906c.log @@ -0,0 +1,73 @@ +2019-05-11T12:58:13+00:00 R: @@Common@@control@@rudder@@run@@0@@start@@20180824-130007-3ad37587@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Start execution +2019-05-11T13:58:13+00:00 R: @@Common@@result_success@@hasPolicyServer-root@@common-root@@0@@ncf Initialization@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Configuration library initialization +2019-05-11T14:58:13+00:00 was correct +2019-05-11T13:58:13+00:00 R: @@Common@@ +2019-05-11T15:58:13+00:00 R: @@Common@@result_success@@hasPolicyServer-root@@common-root@@0@@Security parameters@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The internal environment security is acceptable +2019-05-11T16:58:13+00:00 R: @@Common@@result_na@@hasPolicyServer-root@@common-root@@0@@Process checking@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Rudder agent proccesses check is done by the rudder-agent cron job +2019-05-11T17:58:13+00:00 R: @@Common@@log_repaired@@hasPolicyServer-root@@common-root@@0@@CRON Daemon@@cron@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Run action restart on service cron was repaired +2019-05-11T18:58:13+00:00 R: @@Common@@log_repaired@@hasPolicyServer-root@@common-root@@0@@CRON Daemon@@cron@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Restart service cron if 'any' condition defined was repaired +2019-05-11T19:58:13+00:00 R: @@Common@@log_repaired@@hasPolicyServer-root@@common-root@@0@@CRON Daemon@@cron@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Restart service ${canonified_service_name} was repaired +2019-05-11T20:58:13+00:00 R: @@Common@@result_repaired@@hasPolicyServer-root@@common-root@@0@@CRON Daemon@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Cron daemon status was repaired +2019-05-11T21:58:13+00:00 R: message report +2019-05-11T22:58:13+00:00 R: @@Common@@log_info@@hasPolicyServer-root@@common-root@@0@@Log system for reports@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Detected running syslog as rsyslog +2019-05-11T23:58:13+00:00 R: @@Common@@result_success@@hasPolicyServer-root@@common-root@@0@@Log system for reports@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Logging system for report centralization is already correctly configured +2019-05-12T00:58:13+00:00 R: @@Common@@log_info@@hasPolicyServer-root@@common-root@@0@@CRON Daemon@@/var/rudder/tmp/rudder_monitoring.csv@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Remove file /var/rudder/tmp/rudder_monitoring.csv was correct +2019-05-12T01:58:13+00:00 R: @@Common@@result_success@@hasPolicyServer-root@@common-root@@0@@Binaries update@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The agent binaries in /var/rudder/cfengine-community/bin are up to date +2019-05-12T02:58:13+00:00 R: @@DistributePolicy@@result_success@@root-DP@@root-distributePolicy@@0@@Configure ncf@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Configure configuration library was correct +2019-05-12T03:58:13+00:00 R: @@DistributePolicy@@result_success@@root-DP@@root-distributePolicy@@0@@Synchronize resources@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#All resources have been updated +2019-05-12T04:58:13+00:00 R: @@DistributePolicy@@result_na@@root-DP@@root-distributePolicy@@0@@Synchronize policies@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Rudder server does not need to synchronize its policies +2019-05-12T05:58:13+00:00 R: @@DistributePolicy@@result_na@@root-DP@@root-distributePolicy@@0@@Synchronize files@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Rudder server does not need to synchronize its shared files +2019-05-12T06:58:13+00:00 R: @@DistributePolicy@@result_success@@root-DP@@root-distributePolicy@@0@@Send inventories to Rudder server@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#No inventory to send +2019-05-12T07:58:13+00:00 R: @@DistributePolicy@@result_success@@root-DP@@root-distributePolicy@@0@@Configure apache ACL@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Apache ACLs are correct +2019-05-12T08:58:13+00:00 R: @@Inventory@@result_success@@inventory-all@@inventory-all@@0@@inventory@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Next inventory scheduled between 00:00 and 06:00 +2019-05-12T09:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check logrotate configuration@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The logrotate configuration is correct +2019-05-12T10:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check LDAP in rudder-webapp.properties@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Web interface configuration files are correct (checked LDAP password) +2019-05-12T11:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check LDAP credentials@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#OpenLDAP configuration file is correct (checked rootdn password) +2019-05-12T12:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check rudder-passwords.conf and pgpass files@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Rudder passwords file is present and secure +2019-05-12T13:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check SQL in rudder-webapp.properties@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Web interface configuration files are OK (checked SQL password) +2019-05-12T14:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check SQL credentials@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#PostgreSQL user account's password is correct and works +2019-05-12T15:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check allowed networks configuration@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Allowed networks configuration is correct +2019-05-12T16:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check WebDAV credentials@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Apache WebDAV user and password are OK +2019-05-12T17:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check apache process@@apache2@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check if the service apache2 is started using ps was correct +2019-05-12T18:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check apache process@@apache2@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Ensure that service apache2 is running was correct +2019-05-12T19:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check apache process@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check apache process running was correct +2019-05-12T20:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check apache boot script@@apache2@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check if service apache2 is started at boot was correct +2019-05-12T21:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check apache boot script@@apache2@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Ensure service apache2 is started at boot was correct +2019-05-12T22:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check apache boot script@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check apache boot starting parameters was correct +2019-05-12T23:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check jetty process@@.*java.*/opt/rudder/jetty/start.jar@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check if the service .*java.*/opt/rudder/jetty/start.jar is started using ps was correct +2019-05-13T00:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check jetty process@@rudder-jetty@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Ensure that service rudder-jetty is running was correct +2019-05-13T01:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check jetty process@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check jetty process running was correct +2019-05-13T02:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check configuration-repository folder@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The /var/rudder/configuration-repository directory is present +2019-05-13T03:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check configuration-repository GIT lock@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The /var/rudder/configuration-repository git lock file is not present or not older than 5 minutes +2019-05-13T04:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check rudder status@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The http://localhost:8080/rudder/api/status web interface is running +2019-05-13T05:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check endpoint status@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The http://localhost:8080/endpoint/api/status web interface is running +2019-05-13T06:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check slapd process@@/opt/rudder/libexec/slapd@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check if the service /opt/rudder/libexec/slapd is started using ps was correct +2019-05-13T07:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check slapd process@@rudder-slapd@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Ensure that service rudder-slapd is running was correct +2019-05-13T08:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check slapd process@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check slapd process running was correct +2019-05-13T09:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check PostgreSQL configuration@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#There is no need of specific PostgreSQL configuration on this system +2019-05-13T10:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check postgresql process@@postgres:.* writer process@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check if the service postgres:.* writer process is started using ps was correct +2019-05-13T11:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check postgresql process@@postgresql@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Ensure that service postgresql is running was correct +2019-05-13T12:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check postgresql process@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check postgresql process running was correct +2019-05-13T13:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check postgresql boot script@@postgresql@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check if service postgresql is started at boot was correct +2019-05-13T14:58:13+00:00 R: @@server-roles@@log_info@@server-roles@@server-roles-directive@@0@@Check postgresql boot script@@postgresql@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Ensure service postgresql is started at boot was correct +2019-05-13T15:58:13+00:00 R: @@server-roles@@result_success@@server-roles@@server-roles-directive@@0@@Check postgresql boot script@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check postgresql boot starting parameters was correct +2019-05-13T16:58:13+00:00 R: @@server-roles@@result_na@@server-roles@@server-roles-directive@@0@@Send metrics to rudder-project@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Sending metrics to rudder-project.org is not enabled. Skipping. +2019-05-13T17:58:13+00:00 R: @@copyGitFile@@log_warn@@32377fd7-02fd-43d0-aab7-28460a91347b@@928d47b9-0486-4abc-8b2c-242276251975@@0@@None@@/tmp@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check if /tmp is a symlink could not be repaired +2019-05-13T18:58:13+00:00 R: @@copyFile@@result_success@@32377fd7-02fd-43d0-aab7-28460a91347b@@928d47b9-0486-4abc-8b2c-242276251975@@0@@Copy file@@/tmp/toto/@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The content of the file(s) (copied from toto) is valid +2019-05-13T19:58:13+00:00 R: @@copyFile@@result_na@@32377fd7-02fd-43d0-aab7-28460a91347b@@928d47b9-0486-4abc-8b2c-242276251975@@0@@Post-modification hook@@/tmp/toto/@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#No post-hook command for copy of toto to /tmp/toto/ was defined, not executing +2019-05-13T20:58:13+00:00 warning: Need to create user 'demo'. +2019-05-13T21:58:13+00:00 R: @@Rudder_demo_user@@audit_noncompliant@@32377fd7-02fd-43d0-aab7-28460a91347b@@08749733-d97e-4c20-b2df-3ae742bf0130@@0@@User present@@demo@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#User demo present was not correct +2019-05-13T22:58:13+00:00 error: Method 'user_present' failed in some repairs +2019-05-13T23:58:13+00:00 R: @@Rudder_demo_user@@audit_noncompliant@@32377fd7-02fd-43d0-aab7-28460a91347b@@08749733-d97e-4c20-b2df-3ae742bf0130@@0@@User fullname@@demo@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#User demo does not exist. Setting user demo fullname set to User (with for the Rudder demo was not correct +2019-05-14T00:58:13+00:00 error: Method 'Rudder_demo_user' failed in some repairs +2019-05-14T01:58:13+00:00 R: @@OpenSSH server@@result_success@@32377fd7-02fd-43d0-aab7-28460a91347b@@c844d80c-8f5d-4b93-83d6-a3a65ae8a6eb@@0@@SSH installation@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The OpenSSH server package installation was correct +2019-05-14T02:58:13+00:00 R: @@sshConfiguration@@log_info@@32377fd7-02fd-43d0-aab7-28460a91347b@@c844d80c-8f5d-4b93-83d6-a3a65ae8a6eb@@0@@None@@ssh@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check if service ssh is started at boot was correct +2019-05-14T03:58:13+00:00 R: @@sshConfiguration@@log_info@@32377fd7-02fd-43d0-aab7-28460a91347b@@c844d80c-8f5d-4b93-83d6-a3a65ae8a6eb@@0@@None@@ssh@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Ensure service ssh is started at boot was correct +2019-05-14T04:58:13+00:00 R: @@OpenSSH server@@result_success@@32377fd7-02fd-43d0-aab7-28460a91347b@@c844d80c-8f5d-4b93-83d6-a3a65ae8a6eb@@0@@SSH process@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The OpenSSH server service is running +2019-05-14T05:58:13+00:00 R: @@OpenSSH server@@result_success@@32377fd7-02fd-43d0-aab7-28460a91347b@@c844d80c-8f5d-4b93-83d6-a3a65ae8a6eb@@0@@SSH start at boot@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#OpenSSH is starting on boot as required +2019-05-14T06:58:13+00:00 R: @@OpenSSH server@@result_success@@32377fd7-02fd-43d0-aab7-28460a91347b@@c844d80c-8f5d-4b93-83d6-a3a65ae8a6eb@@0@@SSH port configuration@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The OpenSSH server port configuration is not set to be edited +2019-05-14T07:58:13+00:00 R: @@OpenSSH server@@result_success@@32377fd7-02fd-43d0-aab7-28460a91347b@@c844d80c-8f5d-4b93-83d6-a3a65ae8a6eb@@0@@SSH listening addresses configuration@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The OpenSSH server listening addresses configuration is not set to be edited +2019-05-14T08:58:13+00:00 R: @@OpenSSH server@@result_success@@32377fd7-02fd-43d0-aab7-28460a91347b@@c844d80c-8f5d-4b93-83d6-a3a65ae8a6eb@@0@@SSH configuration@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#The OpenSSH server configuration was correct +2019-05-14T09:58:13+00:00 R: @@Common@@log_info@@hasPolicyServer-root@@common-root@@0@@Make sure syslog service runs@@rsyslog@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Check if the service rsyslog is started was correct +2019-05-14T10:58:13+00:00 R: @@Common@@log_info@@hasPolicyServer-root@@common-root@@0@@Make sure syslog service runs@@rsyslog@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#Ensure that service rsyslog is running was correct +2019-05-14T11:58:13+00:00 R: @@Common@@result_na@@hasPolicyServer-root@@common-root@@0@@Monitoring@@None@@2018-08-24 15:55:01+00:00##e745a140-40bc-4b86-b6dc-084488fc906b@#No Rudder monitoring information to share with the server