Giter VIP home page Giter VIP logo

lamskm / osquery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from osquery/osquery

0.0 0.0 0.0 23.45 MB

SQL powered operating system instrumentation, monitoring, and analytics.

Home Page: https://osquery.io

License: Other

C 22.73% C++ 65.09% Thrift 0.04% Objective-C++ 1.59% Shell 0.26% Python 2.19% PowerShell 0.56% Roff 0.05% CMake 7.33% Dockerfile 0.03% Assembly 0.12% Makefile 0.01%

osquery's Introduction

##osquery new table ping

REPO LOCATION: https://github.com/lamskm/osquery

[1]. Instructions to use osquery ping table:

In the forked repo of osquery above, an extension table named ping has been added to osquery.

Three CMakeLists.txt files have been modified (added a line for the ping table code):

https://github.com/lamskm/osquery/blob/master/specs/CMakeLists.txt
https://github.com/lamskm/osquery/blob/master/osquery/tables/networking/CMakeLists.txt
https://github.com/lamskm/osquery/blob/master/tests/integration/tables/CMakeLists.txt

and three files have been added:

https://github.com/lamskm/osquery/blob/master/specs/ping.table
https://github.com/lamskm/osquery/blob/master/osquery/tables/networking/ping.cpp
https://github.com/lamskm/osquery/blob/master/tests/integration/tables/ping.cpp

These 3 changes and 3 files can be downloaded and integrated into an existing osquery repo to build. And the same invocation of osqueryi will allow the use of the ping table, such as:

osquery> select * from ping where host = "yahoo.com";
osquery> select * from ping where host = "yahoo.com" or host = "8.8.8.8";

[2]. The design choices mostly follow what existed and worked well.

The code style and amount of logic follow that of the existing osquery curl table.
(/osquery/tables/networking/curl.cpp)
Input checking mainly relies on the existing infrastructure, such that invalid input (URL value) is ignored. Since a part of the server code is in C/C++, there is a potential of buffer overflow. But the osquery infrastructure seems to be able to handle over 1M of URL length without crashing.

For the ping/ICMP logic, a number of existing ping programs have been referenced. But the logic of Mike Muuss's program at https://gist.github.com/bugparty/ccba5744ba8f1cece5e0 has been modeled the most. Using socket sendto() sending of the ICMP packet followed by select() to wait for the server reply seems like a more comprehensive approach to handle all kinds of responses .

osquery's People

Contributors

marpaia avatar smjert avatar theopolis avatar akindyakov avatar javuto avatar obelisk avatar muffins avatar fmanco avatar guliashvili avatar alessandrogario avatar zwass avatar poppyseedplehzr avatar directionless avatar sharvilshah avatar mike-myers-tob avatar mofarrell avatar mkareta avatar unixist avatar yying avatar lamskm avatar clong avatar spasam avatar lwhsu avatar allanliu avatar wxsbsd avatar jkeljo avatar ryanheffernan avatar npamnani-uptycs avatar breakwell avatar artemist avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.