Elastic Stack 8 : Packetbeat स्थापित करें2023/09/26 |
|
Packetbeat स्थापित करें जो नेटवर्क पैकेट एकत्र और विश्लेषण करता है।
|
|
| [1] | Packetbeat स्थापित करें। इसके पहले Elasticsearch रिपॉजिटरी को कॉन्फ़िगर करें। |
|
root@dlp:~# apt -y install packetbeat
|
| [2] | बुनियादी सेटिंग्स कॉन्फ़िगर करें और पैकेटबीट प्रारंभ करें। |
|
root@dlp:~#
vi /etc/packetbeat/packetbeat.yml # पंक्ति 58 : डेटा एकत्र करने के लिए आइटम सेट करें # यदि ICMPv4/ICMPv6 को अक्षम करें, तो गलत पर जाएँ # पंक्ति 44 और बाद में: कई वस्तुओं को डिफ़ॉल्ट रूप से निगरानी के रूप में लक्षित किया जाता है, # लेकिन यदि आवश्यकता नहीं है, तो पंक्ति पर टिप्पणी करें [ports: ***] packetbeat.protocols: - type: icmp # Enable ICMPv4 and ICMPv6 monitoring. Default: false enabled: true - type: amqp # Configure the ports where to listen for AMQP traffic. You can disable # the AMQP protocol by commenting out the list of ports. ports: [5672] ..... ..... # पंक्ति 181: यदि Kibana का उपयोग करें, तो टिप्पणी हटाएं और आउटपुट होस्ट निर्दिष्ट करें # यदि Kibana पर SSL सक्षम है, तो होस्टनाम प्रमाणपत्रों में होस्टनाम के समान होना चाहिए # [username] और [password] व्यवस्थापक उपयोगकर्ता का है # यदि स्व-हस्ताक्षरित प्रमाणपत्र का उपयोग कर रहे हैं, तो निर्दिष्ट करें [ssl.verification_mode: none] setup.kibana: ..... host: "https://dlp.srv.world:5601" protocol: "https" username: "elastic" password: "password" ssl.enabled: true ssl.verification_mode: none # पंक्ति 217: Elasticsearch का आउटपुट निर्दिष्ट करें # [username] और [password] व्यवस्थापक उपयोगकर्ता का है # [ssl.certificate_authorities] Elasticsearch इंस्टालेशन द्वारा उत्पन्न कैसर्ट है output.elasticsearch: # Array of hosts to connect to. hosts: ["https://dlp.srv.world:9200"] protocol: "https" username: "elastic" password: "password" ssl.certificate_authorities: "/etc/elasticsearch/certs/http_ca.crt" ..... .....
root@dlp:~#
vi /etc/packetbeat/packetbeat.reference.yml # पंक्ति 1759 : यदि Kibana का उपयोग करें, तो टिप्पणी हटाएं और आउटपुट होस्ट निर्दिष्ट करें # यदि Kibana पर SSL सक्षम है, तो SSL संबंधित पंक्तियों पर टिप्पणी हटाएँ # [username] और [password] व्यवस्थापक उपयोगकर्ता का है # यदि स्व-हस्ताक्षरित प्रमाणपत्र का उपयोग कर रहे हैं, तो निर्दिष्ट करें [ssl.verification_mode: none] setup.kibana: # Kibana Host # Scheme and port can be left out and will be set to the default (http and 5601) # In case you specify and additional path, the scheme is required: http://localhost:5601/path # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601 host: "https://dlp.srv.world:5601" # Optional protocol and basic auth credentials. protocol: "https" username: "elastic" password: "password" # Optional HTTP Path #path: "" # Use SSL settings for HTTPS. Default is true. ssl.enabled: true ..... ..... # after very careful consideration. It is primarily intended as a temporary # diagnostic mechanism when attempting to resolve TLS errors; its use in # production environments is strongly discouraged. # The default value is full. ssl.verification_mode: noneroot@dlp:~# systemctl enable --now packetbeat
|
| [3] | स्थिति सत्यापित करें कि डेटा सामान्य रूप से एकत्र किया गया है। |
|
# सूचकांक सूची root@dlp:~# curl -u elastic --cacert /etc/elasticsearch/certs/http_ca.crt https://127.0.0.1:9200/_cat/indices?v Enter host password for user 'elastic' health status index uuid pri rep docs.count docs.deleted store.size pri.store.size yellow open .ds-metricbeat-8.5.0-2022.11.09-000001 MRfmgqLxSGCLapOAJDDZww 1 1 12454 0 15.5mb 15.5mb yellow open .ds-packetbeat-8.5.0-2022.11.09-000001 ooN-ezjvT_-j19g8hmYkwQ 1 1 269 0 232.4kb 232.4kb yellow open test_index Yw-_PdilSIueIBLM9KmihQ 1 1 1 0 6.4kb 6.4kb # सूचकांक पर दस्तावेज़ सूची root@dlp:~# curl -u elastic --cacert /etc/elasticsearch/certs/http_ca.crt https://127.0.0.1:9200/.ds-packetbeat-8.5.0-2022.11.09-000001/_search?pretty
Enter host password for user 'elastic':
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 581,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : ".ds-packetbeat-8.5.0-2022.11.09-000001",
"_id" : "5ENMW4QBQ1Dwm2jJqUBa",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2022-11-09T07:31:00.588Z",
"host" : {
"containerized" : false,
"ip" : [
"10.0.0.30",
"fe80::5054:ff:fe97:aacc"
.....
.....
|
| [4] | यदि Kibana चल रहा है, नमूना डैशबोर्ड में डेटा आयात करना संभव है। |
|
root@dlp:~# packetbeat setup --dashboards Loading dashboards (Kibana must be running and reachable) Loaded dashboards |
|
| Sponsored Link |
|
|