osquery client returns no records from hardware_events table
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 23.6k
- Forks
- 2.6k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 14
Description
Bug report
We have golang application which fetches records from the osquery using https://github.com/osquery/osquery-go library. SQL request looks like this select he.action,he.driver, he.model, he.model_id, he.path, he.revision, he.serial, he.vendor, he.vendor_id, DATETIME(ROUND(he.time), 'unixepoch') as time from hardware_events he;.
When I execute the same query but via osqueryi I can see these events.
Issue is reproducible after I reboot the computer.
It stops to be reproducible after some time after restart OR after restart the osquery daemon.
osquery.conf :
{
"options": {
"host_identifier": "PLACEHOLDER_HOSTNAME",
"schedule_splay_percent": 10,
"config_plugin": "filesystem",
"logger_plugin": "filesystem",
"logger_path": "/var/log/osquery",
"disable_logging": "false",
"pidfile": "/var/osquery/osquery.pidfile",
"database_path": "/var/osquery/osquery.db",
"worker_threads": "8",
"disable_events": "false",
"disable_audit": "false",
"audit_allow_config": "true",
"enable_syslog": "true",
"syslog_pipe_path": "/var/osquery/syslog_pipe",
"syslog_events_expiry": "900",
"events_expiry": "1",
"force": "true",
"audit_allow_sockets": "true",
"enable_file_events": "true",
"enable_ntfs_publisher": "true",
"schedule_default_interval": "3600"
},
"file_paths": {
"configuration": [
"/etc/localtime",
"/etc/group",
"/etc/gshadow",
"/etc/passwd",
"/etc/shadow",
"/etc/security/opasswd",
"/etc/sudoers",
"/etc/sudoers.d/%%",
"/etc/resolv.conf",
"/etc/rsyslog.conf",
"/etc/osquery/%%",
"/etc/systemd/%%",
"/etc/issue",
"/etc/issue.net",
"/etc/hosts",
"/etc/sysconfig/network"
]
},
"schedule": {
}
}
osquery.flags
--extensions_socket=/var/osquery/sock/osquery.em
--watchdog_memory_limit=700
We want to retrieve hardware_events.
What operating system and version are you using?
CentOS Linux release 7.9.2009 (Core)
What version of osquery are you using?
4.8.0
What steps did you take to reproduce the issue?
- Reboot computer.
- Plug and unplug keyboard.
- Start golang application which executes command
select he.action,he.driver, he.model, he.model_id, he.path, he.revision, he.serial, he.vendor, he.vendor_id, DATETIME(ROUND(he.time), 'unixepoch') as time from hardware_events he;
What did you expect to see?
I want to see two events - adding and removing device (keyboard).
What did you see instead?
I can't see any events.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue after reboot on CentOS 7.9 with osquery 4.8.0, comparing the hardware_events query through the osquery-go application and osqueryi. Check the listed osquery.conf and flags, then verify that keyboard add and remove events are returned by both paths; also note whether restarting the osquery daemon changes the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- centos, go, sql
- Domain
- databases, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100