Skip to content

GSoC 2016 Proposal: WebSocket for syslog ng (sriram0706)

Sriram edited this page Mar 19, 2016 · 12 revisions

Introduction

Syslog-ng is an open source implementation of the syslogd model which is capable of receiving log messages from various sources, filtering and sending to destinations such as sql, tcp etc. It was developed by Balabit IT Security Ltd. The Syslog-ng Open Source Edition has a General Public License and the premium edition is under Proprietary License.

Objective

The main objective of this project is

 1. To create a Websocket destination for Syslog-ng to communicate with the Webserver and receive messages. 

 2. A sample webserver to receive and handle the messages. 

 3. A Websocket source to which is wired with the destination.

 4. A long term objective would be to make Syslog-ng support TLS while using Websocket communication.

Purpose of this project

The purpose of using Websocket protocol is enable full duplex communication between client and webserver. In the traditional method, the client has to establish an HTTP connection with the web server using TCP three way handshake and close the connection gracefully using FIN/ACK messages. Syslog-ng clients will have to send logs constantly to web servers and the overhead of using HTTP over TCP is tremendous. When a web socket connection is established between client and server, the server can keep the web socket connection open for a specific time to receive log messages before closing the connection.

Benefit to the community

Organizations using Syslog-ng client-webserver mechanism will definitely benefit from using Websocket protocol. The throughput will definitely be increased when compared to the normal HTTP connection. As Websockets are already being implemented worldwide, the chances of experiencing compatibility issues are very less.

When organizations use the concept of centralized logging system, some Syslog-ng servers can act as relay hosts. Servers can also request clients to resend log messages over Websocket, if there is an error in the logs at the application layer.

Motivation

I have already worked with socket programming where I created multiple clients, DNS and HTTP servers to reliably transfer files using Java programming language. I would like to extend my interests in working on creating Websocket destination for Syslog-ng. I feel motivated based on the fact that my contribution to this project will benefit thousands of open source Syslog-ng users.

Required knowledge areas

 1. Familiarity with Syslog-ng code base.

 2. Working knowledge on Websocket protocol.

 3. Familiarity with C language at a strong user level

 4. Knowledge on using Bison and Flex.

I am familiar with socket programming and working of Websocket protocol. I have to focus on getting used to the Syslog-ng code base.

Timeline

 • Apr 22nd – May 22nd

    o Getting familiarized with the Syslog-ng code base.

    o Trying to solve small bugs as a part of code learning.

    o Working with mentor to extend the proposal to a viable description.

    o Creating and updating Kanban calendar. 

 • May 23rd – June 6th

    o Creating and designing a websocket destination for Syslog-ng. 

    o Making the connection configurable.

 • June 6th – June 20th

    o Creating and designing a basic websocket source for Syslog-ng.

    o Scripting and running a sample apache web server.

    o Successfully connecting syslog ng client to the sample web server. 

 • June 20th – July 4th

    o Sending log messages to webserver through Websocket. 

    o Making the webserver handle log messages (either store the logs locally or making the server act as a relay host). 

 • July 4th – July 25th

    o Writing unit tests and functional tests. 

    o Finding memory leaks using Valgrind and fixing it.

 • July 25th – August 15th

    o Working with mentor to look for enhancements.

    o Code review and removing bugs.

    o Creating proper documentation.

    o Testing the final release.

I am expecting to complete majority of the work for midterm evaluations.

Implementation

I would use libwebsockets library designed for C language which consumes minimal CPU and memory resources. The websocket destination module will typically have the following functions.

    ws_init()

    ws_add_host_and_port()

    Ws_connect()

    Ws_addheader()

    Ws_write()

    Ws_timeout()

    Ws_flowcontrol()
    
    Ws_callback()

    Ws_disconnect()

    Ws_deinit()

I'll be adding more functions after having a proper discussion with mentors.

About me

I am Sriram Raghunathan, a graduate student studying Master's in Computer systems networking and Information security at University of Pittsburgh, USA. I am familiar with C, Java and Python programming languages. I have been using Syslog-ng for the past one year for an academic research project. I have configured syslog-ng to meet our project needs. I just started understanding the syslog-ng code base and I am confident that I’ll be able to take up this role.

I enjoy contributing to open source projects where I made some significant contribution to the project on location privacy done by researchers at Georgia Institute of Technology, USA.

Once I complete the task, I foresee myself by further enhancing the work done during GSoC 2016. I’ll also be a part of Syslog-ng community to share and work on ideas for further improvement.

My previous work on Sockets could be found here.

Availability

I am available to spend approximately 35 to 40 hours a week throughout the summer. I do not have any other commitments apart from this project.

Contact

Name: Sriram Raghunathan

E-mail: sri_ram@pitt.edu

Phone: +1-(412)-608-7691

References

  1. https://www.balabit.com/sites/default/files/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html-single/index.html#reference-destination-http

  2. https://libwebsockets.org/libwebsockets-api-doc.html

  3. https://en.wikipedia.org/wiki/WebSocket

  4. http://lucumr.pocoo.org/2012/9/24/websockets-101/

For any clarifications regarding the proposal, please reach out to me at sri_ram@pitt.edu.

Finally I would like to thank Laci Mészáros and Viktor Juhász for extending their thoughts on this project.

Clone this wiki locally