osquery/osquery-python được TopGit xếp vào nhóm dự án mã nguồn mở, với 308 sao trên GitHub, viết chủ yếu bằng Python. Python bindings for osquery's Thrift API
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
osquery exposes an operating system as a high-performance relational database. This allows you to write SQL-based queries to explore operating system data. With osquery, SQL tables represent abstract concepts such as running processes, loaded kernel modules, open network connections, browser plugins, hardware events or file hashes.
If you're interested in learning more about osquery, visit the GitHub project, the website, and the users guide.
What is osquery-python?
In osquery, SQL tables, configuration retrieval, log handling, etc are implemented via a simple, robust plugin and extensions API. This project contains the official Python bindings for creating osquery extensions in Python. Consider the following example:
osqueryi --nodisable_extensions
osquery> select value from osquery_flags where name = 'extensions_socket';
+-----------------------------------+
| value |
+-----------------------------------+
| /Users/USERNAME/.osquery/shell.em |
+-----------------------------------+
Alternatively, you can also autoload your extension when starting an osquery shell:
osqueryi --extension path_to_my_table_plugin.py
This will register a table called "foobar". As you can see, the table will return two rows:
osquery> select * from foobar;
+-----+-----+
| foo | baz |
+-----+-----+
| bar | baz |
| bar | baz |
+-----+-----+
osquery>
This is obviously a contrived example, but it's easy to imagine the possibilities.
Using the instructions found on the wiki, you can easily deploy your extension with an existing osquery deployment.
Extensions are the core way that you can extend and customize osquery. At Facebook, we use extensions extensively to implement many plugins that take advantage of internal APIs and tools.
Execute queries in Python
The same Thrift bindings can be used to create a Python client for the osqueryd or osqueryi's extension socket. There are helper classes provided that spawn an ephemeral osquery process for consecutive or long running client instances.
import osquery
if __name__ == "__main__":
# Spawn an osquery process using an ephemeral extension socket.
instance = osquery.SpawnInstance()
instance.open() # This may raise an exception
# Issues queries and call osquery Thrift APIs.
instance.client.query("select timestamp from time")
Connect to an existing socket
In the example above the SpawnInstance() method is used to fork and configure an osquery instance. We can use similar APIs to connect to the Thrift socket of an existing osquery instance. Remember, normal UNIX permissions apply to the Thrift socket.
import osquery
if __name__ == "__main__":
# You must know the Thrift socket path
# For an installed and running system osqueryd, this is:
# Linux and macOS: /var/osquery/osquery.em
# FreeBSD: /var/run/osquery.em
# Windows: \\.\pipe\osquery.em
instance = osquery.ExtensionClient('/home/you/.osquery/osqueryd.sock')
instance.open() # This may raise an exception
# Issue queries and call osquery Thrift APIs.
client = instance.extension_client()
client.query('select timestamp from time')
Install
To install from PyPi, run the following:
pip install osquery
Alternatively, to install from this repo, run the following:
python setup.py build
python setup.py install
Development
See CONTRIBUTING.md and the osquery wiki for development information.
How To Release
Pick a version number
Update osquery/__init__.py to match
Use the GitHub release
Make sure the GitHub Action ran
Vulnerabilities
Facebook has a bug bounty program that includes osquery. If you find a security vulnerability in osquery, please submit it via the process outlined on that page and do not file a public issue. For more information on finding vulnerabilities in osquery, see a recent blog post about bug-hunting osquery.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/osquery/osquery-python là nguồn chính thức.
osquery/osquery-python có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho osquery/osquery-python. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
osquery/osquery-python là gì?
osquery/osquery-python (osquery/osquery-python) là dự án Python trên GitHub. Theo mô tả gốc: Python bindings for osquery's Thrift API
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về osquery-python?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về osquery-python.