r5 - 2013-07-31 - 23:00:49 - HarlanStennYou are here: NTP >  Dev Web > GoogleSummerOfCode > GSoC2013LoggingDebugging > GSoC2013LoggingDebuggingDetailedImplementation
NTP users are strongly urged to take immediate action to ensure that their NTP daemons are not susceptible to being used in distributed denial-of-service (DDoS) attacks. Please also take this opportunity to defeat denial-of-service attacks by implementing Ingress and Egress filtering through BCP38.

ntp-4.2.8p13 was released on 07 March 2019. It addresses 1 medium-severity security issue in ntpd, and provides 17 non-security bugfixes and 1 other improvements over 4.2.8p12.

Please see the NTP Security Notice for vulnerability and mitigation details.

Are you using Autokey in production? If so, please contact Harlan - he's got some questions for you.

NTP Logging and Debugging API Manual

Configuration

The NTP Logging Framework shall take most of its logging configuration by parsing the ntp.conf configuration file. All the lines in ntp.conf beginning with “logging” shall pertain to logging settings.

logging channel channel _ parameters severities minimum_allowed_severities tags allowed_tags

  • logging : all config lines related to logging shall begin with this
  • channel : Can be any of the following
    • SYSLOG
    • FILE
    • TERMINAL
  • channel parameters : They are specific parameters pertaining to particular channel
    • SYSLOG
      • FACILITY : Specify the facility of SYSLOG about which we are talking
    • FILE
      • PATH : Specify the path of the file
    • TERMINAL
      • stdout/stderr/some remote screen
  • severities : optional
    • minimum_allowed_severity : Specify the severity from which we want to log the messages to a particular channel.
    • For example, if we specify, logging FILE “/tmp/dummy” severities ERROR, then only messages with severity ERROR and above, like CRITICAL, ALERT, EMERGENCY are logged to “/tmp/dummy”
    • If severity clause is not specified then all severities are logged
  • tags : optional
    • allowed_tags : these are the tags that need be logged to the particular channel
    • The allowed tags should be a list enclosed within () , {} or []
    • If tags clause is not specified then all tags are logged
 

MACROS and ENUM defined and that can be used

Log Errors: LOG_ERR_OK, LOG_ERR_LEVEL, LOG_ERR_NULL, LOG_ERR_OPEN_FILE, LOG_ERR_NOT_FOUNF, LOG_ERR_NOT_IMPLEMENTED etc.

Log Levels: LOG_SILENT, LOG_BASIC, LOG_WARNING, LOG_INFO, LOG_FINE, LOG_FINEST

Output Types: STDOUT, STDERR, FILEOUT, RBUFOUT, SYSLOG

DESIGN

Logger is implemented as doubly linked list.

/*LOGGER TYPE*/

struct logger_s {

   /* identifier of the logger */

   uint16_t id;

   /* channel list */

   loggingChannel_t* chnlList;

   /* logger output type */

   logc_loggerType_t type;

   /* log level */

   logc_logLevel_t level;

   /* record type for error logging */

   logc_errRecordType_t errRecordType;

   /* record type for log logging */

   logc_logRecordType_t logRecordType;

   /* pointer to publisher function */

   publisher_t publisher;

   /* destination to write */

   void dest;

};

/*Implementation*/

struct loggerList_s {
  
   logger_t logger; 

   struct loggerList_s* next;

   struct loggerList_s* before;
};

Logger type has the capablity to define level and channel list( which have various tags). I think we can define logger for each level and sink the log to channel according to level for each logger call.

-- ShubhamSinghal - 2013-07-21

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r5 < r4 < r3 < r2 < r1 | More topic actions
 
SSL security by CAcert
Get the CAcert Root Certificate
This site is powered by the TWiki collaboration platform
IPv6 Ready
Copyright & 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding the site? Send feedback