From af3f88b14d70e5b53c4d233d429d110b758acf94 Mon Sep 17 00:00:00 2001 From: Minoru Kobayashi Date: Mon, 9 Dec 2024 14:04:05 +0900 Subject: [PATCH 1/2] artif: get findmnt and lsblk results in JSON format JSON format is easier to parse in scripts than plain text output. --- artifacts/live_response/storage/findmnt.yaml | 9 +++++++-- artifacts/live_response/storage/lsblk.yaml | 21 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/artifacts/live_response/storage/findmnt.yaml b/artifacts/live_response/storage/findmnt.yaml index e744487b..f4a80e74 100644 --- a/artifacts/live_response/storage/findmnt.yaml +++ b/artifacts/live_response/storage/findmnt.yaml @@ -1,4 +1,4 @@ -version: 2.0 +version: 2.1 condition: command_exists "findmnt" output_directory: /live_response/storage artifacts: @@ -8,4 +8,9 @@ artifacts: collector: command command: findmnt --ascii output_file: findmnt.txt - \ No newline at end of file + - + description: Displays all mounted file systems in the tree-like format as JSON. + supported_os: [linux] + collector: command + command: findmnt -J + output_file: findmnt_-J.txt diff --git a/artifacts/live_response/storage/lsblk.yaml b/artifacts/live_response/storage/lsblk.yaml index 2ba72e07..01c677cc 100644 --- a/artifacts/live_response/storage/lsblk.yaml +++ b/artifacts/live_response/storage/lsblk.yaml @@ -1,4 +1,4 @@ -version: 3.0 +version: 3.1 condition: command_exists "lsblk" output_directory: /live_response/storage artifacts: @@ -8,16 +8,33 @@ artifacts: collector: command command: lsblk output_file: lsblk.txt + - + description: List block devices as JSON. + supported_os: [linux] + collector: command + command: lsblk -J + output_file: lsblk_-J.txt - description: List block devices. supported_os: [linux] collector: command command: lsblk -l output_file: lsblk_-l.txt + - + description: List block devices as JSON. + supported_os: [linux] + collector: command + command: lsblk -l -J + output_file: lsblk_-l_-J.txt - description: List block devices including information about filesystems. supported_os: [linux] collector: command command: lsblk -f output_file: lsblk_-f.txt - \ No newline at end of file + - + description: List block devices including information about filesystems as JSON. + supported_os: [linux] + collector: command + command: lsblk -f -J + output_file: lsblk_-f_-J.txt From 2eae9a3ef4063ef03c7d367da8d2cf03a9c27702 Mon Sep 17 00:00:00 2001 From: Thiago Canozzo Lahr Date: Tue, 17 Dec 2024 08:15:05 -0300 Subject: [PATCH 2/2] refactor: new artifacts --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf97f7a3..93e2ca9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ - live_response/packages/conary.yaml: Added collection of the list of installed packages managed by the Conary package manager [linux] (by [Pierre-Gronau-ndaal](https://github.com/Pierre-Gronau-ndaal)). - live_response/packages/dpkg.yaml: Updated to verify all packages to compare information about the installed files in the package with information about the files taken from the package metadata stored in the dpkg database [linux] ([mnrkbys](https://github.com/mnrkbys)). - live_response/packages/package_owns_file.yaml: Added collection of which installed package owns a specific file or command. Note that this artifact is resource-intensive and time-consuming to execute, so it is disabled by default in all profiles [linux] ([mnrkbys](https://github.com/mnrkbys)). +- live_response/storage/findmnt.yaml: Added JSON output format for listing all mounted file systems [linux] ([mnrkbys](https://github.com/mnrkbys)). +- live_response/storage/lsblk.yaml: Added JSON output format for listing block devices [linux] ([mnrkbys](https://github.com/mnrkbys)). - live_response/system/coredump.yaml: Added collection of core dump files information [linux] ([mnrkbys](https://github.com/mnrkbys)). - live_response/system/getcap.yaml: Added functionality to collect the list of files with associated process capabilities [linux] ([mnrkbys](https://github.com/mnrkbys)). - live_response/system/ulimit.yaml: Added collection of all resource limits information [all] ([mnrkbys](https://github.com/mnrkbys)).