Skip to content

Add sample data to File integrity monitoring and inventory #7373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 29 commits into
base: change/wz-27903-fim-system-inventory-tables-indexer-data
Choose a base branch
from

Conversation

yenienserrano
Copy link
Member

@yenienserrano yenienserrano commented Mar 25, 2025

Description

Adds the option to add sample data for File integrity monitoring, Inventory and Vulnerability.

Issues Resolved

Evidence

UI

image image image image image

CLI

image

ianyenienserrano@MacBook-Pro-de-Ian sample-data % node cli.js \    --dataset states-inventory-hardware \
    --format bulk-api \
    --index states-inventory-hardware-sample-data > output.ndjson
ianyenienserrano@MacBook-Pro-de-Ian sample-data % curl -k -u admin:admin https://localhost:9200/_bulk -H "Content-Type: application/x-ndjson" --data-binary "@output.ndjson"
{"took":92,"errors":false,"items":[{"index":{"_index":"states-inventory-hardware-sample-data","_id":"U42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"VI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":1,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"VY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":2,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"Vo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":3,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"V42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":4,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"WI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":5,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"WY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":6,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"Wo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":7,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"W42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":8,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"XI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":9,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"XY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":10,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"Xo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":11,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"X42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":12,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"YI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":13,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"YY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":14,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"Yo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":15,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"Y42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":16,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"ZI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":17,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"ZY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":18,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"Zo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":19,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"Z42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":20,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"aI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":21,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"aY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":22,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"ao2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":23,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"a42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":24,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"bI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":25,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"bY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":26,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"bo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":27,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"b42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":28,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"cI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":29,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"cY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":30,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"co2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":31,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"c42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":32,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"dI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":33,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"dY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":34,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"do2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":35,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"d42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":36,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"eI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":37,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"eY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":38,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"eo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":39,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"e42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":40,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"fI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":41,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"fY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":42,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"fo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":43,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"f42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":44,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"gI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":45,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"gY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":46,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"go2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":47,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"g42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":48,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"hI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":49,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"hY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":50,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"ho2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":51,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"h42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":52,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"iI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":53,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"iY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":54,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"io2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":55,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"i42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":56,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"jI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":57,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"jY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":58,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"jo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":59,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"j42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":60,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"kI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":61,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"kY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":62,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"ko2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":63,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"k42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":64,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"lI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":65,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"lY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":66,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"lo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":67,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"l42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":68,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"mI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":69,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"mY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":70,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"mo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":71,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"m42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":72,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"nI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":73,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"nY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":74,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"no2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":75,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"n42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":76,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"oI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":77,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"oY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":78,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"oo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":79,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"o42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":80,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"pI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":81,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"pY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":82,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"po2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":83,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"p42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":84,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"qI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":85,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"qY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":86,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"qo2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":87,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"q42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":88,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"rI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":89,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"rY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":90,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"ro2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":91,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"r42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":92,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"sI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":93,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"sY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":94,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"so2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":95,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"s42wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":96,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"tI2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":97,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"tY2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":98,"_primary_term":1,"status":201}},{"index":{"_index":"states-inventory-hardware-sample-data","_id":"to2wWJYBeIZcCgc5WbSy","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":99,"_primary_term":1,"status":201}}]}%        
image

Test

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

…nd FIM datasets

This commit introduces new modules for generating sample data for different inventory and FIM (File Integrity Monitoring) datasets. The modules include functions to generate random data for agents, hosts, packages, processes, networks, and more. Additionally, JSON templates for Elasticsearch mappings are provided to ensure proper indexing of the generated data. This feature is essential for testing and development purposes, allowing for realistic data simulation in the Wazuh ecosystem.
@yenienserrano yenienserrano self-assigned this Apr 15, 2025
Introduce sample inventory data for various categories such as hardware, hotfixes, interfaces, networks, packages, ports, processes, protocols, and system. This includes adding new constants, routes, and sample data generation logic to support inventory-related functionalities. Additionally, remove unnecessary console log and update module paths for consistency.
Update WAZUH_SAMPLE_ALERTS_DEFAULT_NUMBER_ALERTS to 3000 and refactor WAZUH_SETTING_FIM_FILES_PREFIX and WAZUH_SETTING_FIM_REGISTRIES_PREFIX to include dataSet. Improve sample alerts indexing by using Promise.all for concurrent operations and adding error handling.
…e generateSampleData

Moved common utility functions like `generate_random_agent`, `generate_random_host`, and `generate_random_wazuh` to a new `shared-utils.js` file to reduce code duplication. Renamed `generateSampleData` to `generateAlertsWithDataset` for better clarity and consistency. Simplified the `generateAlerts` function by removing redundant logic related to sample data generation.
…a' into enhancement/7369-sample-data-it-hygiene-fim-vulnerabiities
Introduce a new CLI tool in the sample-data scripts directory to generate sample data for Wazuh. The tool supports multiple datasets, formats, and output options, including ndjson and bulk-api. This enhances the ability to create and manage sample data programmatically.
This commit removes the sample-data scripts and all related files, including configuration, templates, and utility modules. The removal is part of cleaning up unused or outdated code to improve maintainability and reduce clutter in the codebase.
…a' into enhancement/7369-sample-data-it-hygiene-fim-vulnerabiities
Refactor the CLI scripts to enhance readability by breaking long strings into multiple lines. This change does not affect functionality but makes the code easier to maintain and understand.
…a' into enhancement/7369-sample-data-it-hygiene-fim-vulnerabiities
…a' into enhancement/7369-sample-data-it-hygiene-fim-vulnerabiities
… consistency

Rename `generateAlertsWithDataset` to `generateSampleDataWithDataset` and update related variables to reflect the broader scope of sample data generation. This change improves code readability and aligns with the functionality of generating various types of sample data, not just alerts.
Introduce a new `SampleDataWarning` component to display a warning when dashboards contain sample data. This enhances user awareness and provides a link to configure sample data settings.
Removed the debug console log in the WazuhElasticCtrl class and updated the sample data generation logic to include network and observer details instead of protocol information. This improves code cleanliness and aligns with the updated data structure requirements.
Rename all snake_case function names to camelCase to align with JavaScript naming conventions. This improves code readability and maintainability across the sample data generation modules. Additionally, remove unused default constants to simplify the codebase.
…bility detection

Introduce new sample data, templates, and configurations for vulnerability detection. This includes adding a new dataset for vulnerabilities, updating constants, and enhancing the random data generation utility to support vulnerability-related fields. The changes ensure that vulnerability data can be sampled and visualized within the system.
…a' into enhancement/7369-sample-data-it-hygiene-fim-vulnerabiities
Update endpoint paths from `/elastic/samplealerts` to `/indexer/sampledata` and rename related variables to reflect the broader scope of sample data handling. This change improves consistency and clarity in the codebase.
…a' into enhancement/7369-sample-data-it-hygiene-fim-vulnerabiities
…ta handling

Replace synchronous loop with Promise.all for index name generation to improve performance. Refactor sample data processing logic to handle multiple data sets and templates more efficiently. Simplify bulk operation response handling by removing redundant logging.
Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 16.9% ( 5104 / 30195 )
Branches 10.36% ( 1988 / 19173 )
Functions 17.56% ( 1289 / 7338 )
Lines 17.16% ( 4991 / 29080 )

The SampleDataWarning component has been refactored to handle multiple sample data categories. This change ensures that the component can check for the existence of sample data across multiple categories and display a warning if any of them are found. The changes include updating the component's props, logic, and API calls to support this functionality. Additionally, the component has been integrated into various dashboards and modules to provide consistent sample data warnings across the application.
This change renames all references to "sample alerts" to "sample data" in both routes and controllers. The update improves clarity and consistency in the codebase by using a more generic term that better represents the data being handled.
This commit introduces a new script that downloads and updates template.json files from a public GitHub repository. The script reads the version from a VERSION.json file, determines the branch, and updates the templates for all relevant datasets. It also creates backups of existing files before overwriting them and provides a summary of the update process.
Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 78.72% ( 185 / 235 )
Branches 62.72% ( 69 / 110 )
Functions 61.7% ( 29 / 47 )
Lines 78.72% ( 185 / 235 )

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 46.09% ( 425 / 922 )
Branches 41.09% ( 157 / 382 )
Functions 41.64% ( 137 / 329 )
Lines 46.28% ( 423 / 914 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add UI sample data generators for system inventory, FIM and Vulnerabilities
1 participant