Skip to content
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

Develop #16

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4fad660
Update README.md
punisherVX Aug 2, 2023
336c1ca
Update README.md
punisherVX Aug 2, 2023
6ca5e5a
Update README.md
punisherVX Aug 2, 2023
93ec6b9
remove references to gitlab
punisherVX Aug 2, 2023
ffa86d4
updated ndjson with fixes for older non-used field names in visualiza…
punisherVX Aug 3, 2023
49124bb
update README
punisherVX Aug 9, 2023
7df4a43
changed week number to day of month in output index
punisherVX Aug 9, 2023
372aa60
updated gitignore with .pensando-elk virtualenv
punisherVX Aug 14, 2023
2f07528
testing auto build of docs
punisherVX Aug 14, 2023
5feb2ab
adjustments for new fields in syslog for AOSCX 10.13
punisherVX Dec 6, 2023
be14d83
updates for newest versions of containers
punisherVX Dec 6, 2023
abe7f7c
updates for 10.13 release
punisherVX Dec 6, 2023
d41d057
update README
punisherVX Dec 6, 2023
d19a951
fixes for null values
punisherVX Dec 12, 2023
b42542a
update README
punisherVX Dec 12, 2023
86b4105
remove stdout reference
punisherVX Dec 17, 2023
4205e5b
fix for unknown fields
punisherVX Jan 3, 2024
b9d8725
connection tracking field for MR1 release
punisherVX Jan 15, 2024
ba9fdca
removed extra comma
punisherVX Jan 22, 2024
efde1af
changed docker compose version to be backwards compatible
punisherVX Feb 28, 2024
effc9af
updates for 10.14.x branches
punisherVX Jun 25, 2024
f9b7fb3
updates for 10.14.x branches
punisherVX Jun 25, 2024
7ba2c29
updates for 10.14.x branches
punisherVX Jun 25, 2024
7810003
updates for 10.14.x branches
punisherVX Jun 25, 2024
37a0c99
updates about ipfix not working
punisherVX Jun 26, 2024
d4b53c3
update README and change elastiflow version in compose file
punisherVX Jul 11, 2024
f3e0c87
Update README.md
punisherVX Aug 20, 2024
5c35381
update README
punisherVX Aug 20, 2024
737bd2f
update README
punisherVX Aug 21, 2024
34d20eb
update visualizations and dashboards
punisherVX Aug 21, 2024
ec3175f
10.15_draft
tdmakepeace Mar 7, 2025
7a7815b
Error in Maintaince Plan Template
tdmakepeace Mar 7, 2025
8db1aa5
LocalIP
tdmakepeace Mar 7, 2025
2202bf6
Elastiflow JSON rename.
tdmakepeace Mar 7, 2025
a7a0861
Development Dashboard
tdmakepeace Mar 13, 2025
a16399b
Remove Event Original
tdmakepeace Mar 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ data/es_backups/
*.retry
.vscode
.vimrc
.pensando-elk


# # Sphinx doc supporting files and dirs
Expand Down
38 changes: 0 additions & 38 deletions .gitlab-ci.yml

This file was deleted.

118 changes: 91 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<img src="https://www.amd.com/system/files/styles/992px/private/2022-05/1423875-pensando-logo-white-1260x709_0.png?itok=D5gjoCQP" alt="AMD Pensando" width="350"/>
<img src="https://th.bing.com/th/id/OIP.CwPiU5tKuxQpL4ZMRSoVIQAAAA?pid=ImgDet&rs=1" alt="AMD Pensando" width="350"/>


ELK based analytics for Pensado Systems

This repository is the starting point for building and utlizing the Elasticstack for monitoring and analyzing
data, both about and traversing, the Pensando DSS(es) - DSC(s) coming soon - within your environment. The purpose is to consolidate the
applications and tools used for said monitoring and analysis and deploy them in an automated fashion.
data, both about and traversing, the Pensando DSS(es) within your environment. The purpose is to consolidate the
applications and tools used for said monitoring and analysis and deploy them in an easy fashion.

Instantiation can be done on any system with docker and docker-compose installed.

Expand All @@ -14,34 +14,46 @@ Instantiation can be done on any system with docker and docker-compose installed

:warning: <span style="color:yellow">**WARNING**</span> :warning:

<mark>DO NOT RUN DOCKER AS ROOT!!! IT WILL NOT WORK. </mark>
<mark>DO NOT DO *ANYTHING* AS ROOT. NEVER SUDO TO INSTALL OR CONFIGURE THIS, EVERYTHING BREAKS!!! </mark>
<mark>DO NOT RUN THE INSTALL OR CONFIGURATION AS ROOT!!! IT WILL NOT WORK. </mark> <br/>
To run docker as a non-root user, simply add the user to the docker group, then log out and log back in.

```
sudo usermod -aG docker ${USER}
```




<br/>

---
**NOTE**

This branch works with the following software.
This branch works with the following software. <br/>

CXOS: 10.12.x <br/>
PSM: 1.59.0-50 or later
CXOS: 10.15.x <br/>
PSM: 1.100.2-T-8 or later

If these do not match your current install, [check one of the other branches](https://gitlab.com/pensando/tbd/siem/elastic/elk-pensando/-/branches)
If these do not match your current install, [check one of the other branches](https://github.com/amd/pensando-elk/branches)

---

### Please fully read the Support Policy below if you are having problems installing or configuring this

#### Installation and running

1. Clone this repository

2. Change into the directory where it is stored
1. Verify you are on the correct branch before starting
```
git branch
```

2. If you are not, use the following command to switch to the correct branch:
```
git checkout develop
```

3. run the following command (change 8.6.2 if the version of ELK you want is different):
```
echo "TAG=8.6.2" >.env
echo "TAG=8.16.1" >.env
```

4. Create the following directories and give them full write permissions (777 works)
Expand All @@ -63,19 +75,35 @@ If these do not match your current install, [check one of the other branches](ht

Change false to true
``` bash
EF_OUTPUT_ELASTICSEARCH_ENABLE: 'false'
EF_OUTPUT_ELASTICSEARCH_ENABLE: 'true'
```

Change the "CHANGEME" in this line to the IP address of your system. Do not use localhost or the loopback, it will not work
``` bash
EF_OUTPUT_ELASTICSEARCH_ADDRESSES: 'CHANGEME:9200'
```
Enable daily log file rotation by uncommenting the line
``` bash
EF_OUTPUT_ELASTICSEARCH_INDEX_PERIOD: 'daily'
```
Or:
```
localip=`hostname -I | cut -d " " -f1`
sed -i.bak 's/EF_OUTPUT_ELASTICSEARCH_ENABLE: '\''false'\''/EF_OUTPUT_ELASTICSEARCH_ENABLE: '\''true'\''/' docker-compose.yml
sed -i.bak -r "s/EF_OUTPUT_ELASTICSEARCH_ADDRESSES: 'CHANGEME:9200'/EF_OUTPUT_ELASTICSEARCH_ADDRESSES: '$localip:9200'/" docker-compose.yml
sed -i.bak -r "s/#EF_OUTPUT_ELASTICSEARCH_INDEX_PERIOD: 'daily'/EF_OUTPUT_ELASTICSEARCH_INDEX_PERIOD: 'daily'/" docker-compose.yml
```


7. Using PSM, point your DSS firewall syslog (RFC5424) at the IP of your ELK cluster, UDP port 5514 (this number can be changed in the logstash/dss_syslog.conf file in the input section at the top)

7. Using PSM, point your DSS firewall syslog (RFC5424) at the IP of your ELK cluster, UDP port 5514 (this number can be changed in the logstash/ taormina.conf file in the input section at the top)*
</br>

8. If collecting IPFix, use PSM point your DSS IPFix flows (flow export policy) at the IP of your ELK cluster, UDP port 9995 (this port number can be changed in the docker-compose file using the EF_FLOW_SERVER_UDP_PORT parameter)*
8. If collecting IPFix, use PSM point your DSS IPFix flows (flow export policy) at the IP of your ELK cluster, UDP port 9995 (this port number can be changed in the docker-compose file using the EF_FLOW_SERVER_UDP_PORT parameter)*

10. Run
</br>

9. Run

If using docker-compose v1 (standalone)

Expand All @@ -85,22 +113,58 @@ If these do not match your current install, [check one of the other branches](ht

`docker compose up --detach`

11. From the install directory, load the elasticsearch schema (mappings) for the Pensando DSS Firewall index-pattern using the following cli:
</br>
**NOTE:** Give it about 5 minutes to start up

</br>

10. From the install directory, load the elasticsearch schema (mappings) for the Pensando DSS Firewall index-pattern using the following cli:

curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_index_template/pensando-fwlog-session-end?pretty' -d @./elasticsearch/template/pensando-fwlog-session-end.json
curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_index_template/pensando-fwlog-create-allow?pretty' -d @./elasticsearch/template/pensando-fwlog-create-allow.json
curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_index_template/pensando-fwlog-empty-delete?pretty' -d @./elasticsearch/template/pensando-fwlog-empty-delete.json
curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_index_template/pensando-fwlog-create-deny?pretty' -d @./elasticsearch/template/pensando-fwlog-create-deny.json




11. From the install directory, load the elasticsearch index retention settings for the Pensando DSS Firewall index-pattern using the following cli:

`curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_index_template/pensando-fwlog?pretty' -d @./elasticsearch/pensando_fwlog_mapping.json`
curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_ilm/policy/pensando_empty_delete' -d @./elasticsearch/policy/pensando_empty_delete.json
curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_ilm/policy/pensando_create_allow' -d @./elasticsearch/policy/pensando_create_allow.json
curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_ilm/policy/pensando_session_end' -d @./elasticsearch/policy/pensando_session_end.json
curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_ilm/policy/pensando_create_deny' -d @./elasticsearch/policy/pensando_create_deny.json
curl -XPUT -H'Content-Type: application/json' 'http://localhost:9200/_ilm/policy/elastiflow' -d @./elasticsearch/policy/elastiflow.json



12. Give it about 5 minutes to start up and point your browser to the ip of your ELK cluster, port 5601
12. From the install directory, load the Kibana dashboard for syslog:

13. In Kibana, import ```./kibana/pensando-dss-elk.ndjson``` into your saved objects
curl -X POST "http://localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" -H "securitytenant: global" --form file=@/kibana/pensando-dss-10.15.x-syslog.ndjson

</br>

14. If collecting IPFix, in Kibana import ```./kibana/kibana-7.17.x-flow-codex.ndjson``` into your saved objects
13. From the install directory, load the Kibana dashboard IPFIX:

curl -X POST "http://localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" -H "securitytenant: global" --form file=@/kibana/kibana-8.2.x-flow-codex.ndjson

</br>



14. Point your browser to the ip of your ELK cluster, port 5601

</br>



15. Use basic docker commands, like ```docker ps``` and ```docker logs <container name>``` to view status of how the containers are doing -

</br>

*NOTE: It could take about 5 mins for visualizations to become populated in both the DSS and IPFix dashboards.

## Support
If you need help or have questions, you can [email us](mailto:contact-project+pensando-tbd-elastic-pensando-elk-25427733-issue-@incoming.gitlab.com) and we will get back to you as soon as we can
</br>

## Support Policy
The code and templates in the repo are released under an as-is, best effort, support policy. These scripts should be seen as community supported and AMD Pensando will contribute our expertise as and when possible. We do not provide technical support or help in using or troubleshooting the components of the project through our normal support options. Unless explicitly tagged, all projects or work posted in our GitLab repository (at https://gitlab.com/Pensando).
The code and templates in the repo are released under an as-is, best effort, support policy. These scripts should be seen as community supported and AMD Pensando will contribute our expertise as and when possible. The absolute best (and quickest) way to get help/support is to [file an issue](https://github.com/amd/pensando-elk/issues). Any other attempts at contact will probably be lost in the ether and you will rarely, if ever, hear back.
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
version: '3.7'
services:
# The environment variable "TAG" is used throughout this file to
# specify the version of the images to run. The default is set in the
# '.env' file in this folder. It can be overridden with any normal
# technique for setting environment variables, for example:
#
# TAG=6.0.0-beta1 docker-compose up
# TAG=8.11.0 docker-compose up
#
# REF: https://docs.docker.com/compose/compose-file/#variable-substitution
#
# Also be sure to set the ELASTIC_VERSION variable. For released versions,
# ${TAG} and ${ELASTIC_VERSION} will be identical, but for pre-release
# versions, ${TAG} might contain an extra build identifier, like
# "6.0.0-beta1-3eab5b40", so a full invocation might look like:
# "8.11.0-beta1-3eab5b40", so a full invocation might look like:
#
# ELASTIC_VERSION=6.0.0-beta1 TAG=6.0.0-beta1-3eab5b40 docker-compose up
# ELASTIC_VERSION=8.11.0-beta1 TAG=8.11.0-beta1-3eab5b40 docker-compose up
#
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
Expand All @@ -28,6 +27,7 @@ services:
- ES_JAVA_OPTS=-Xms4g -Xmx4g
- xpack.security.enabled=false
- action.destructive_requires_name=false
- path.repo=/usr/share/elasticsearch/backups
ulimits:
nproc: 65535
memlock:
Expand Down Expand Up @@ -69,14 +69,14 @@ services:

# ElastiFlow Unified Collector
flow-collector:
image: elastiflow/flow-collector:6.2.2
image: elastiflow/flow-collector:7.0.0
container_name: pensando-elastiflow
restart: 'unless-stopped'
ports:
- target: 9995
published: 9995
protocol: udp
network_mode: "host"
networks: ['elk-stack']
depends_on: ['elasticsearch']
volumes:
- ./data/elastiflow:/etc/elastiflow
Expand Down
36 changes: 36 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Pensando ELK analytics documentation
---

::: {.toctree maxdepth="2" caption="Contents:"}
overview download run setup stop
:::

About
=====

Pensando-ELK is a tool to search and view data that is generated by one
or more Pensando Distributed Services Switch (DSS). It is a set of
containers instantiated by docker-compose and Pensando provided
visualizations and dashboards to allow for flow monitoring, network
threat detection and security event viewing.

::: {.note}
::: {.title}
Note
:::

[Check the version in the README
file](https://gitlab.com/pensando/tbd/siem/elastic/elk-pensando/-/blob/main/README.md?plain=0)
for the branch you are using to verify that the CXOS and PSM sofware
releases are compatible with the version of pensando-elk you are using.
:::

Disclaimer
==========

This software is provided without warranty or guarantee. Support is on a
best-effort basis via [Gitlab
Issues](https://gitlab.com/pensando/tbd/elastic/pensando-elk/issues) and
is licensed under the [Apache License
2.0](https://apache.org/licenses/LICENSE-2.0)
31 changes: 31 additions & 0 deletions elasticsearch/policy/elastiflow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"set_priority": {
"priority": 100
}
}
},
"cold": {
"min_age": "1d",
"actions": {
"readonly": {},
"set_priority": {
"priority": 50
}
}
},
"delete": {
"min_age": "7d",
"actions": {
"delete": {
"delete_searchable_snapshot": true
}
}
}
}
}
}
31 changes: 31 additions & 0 deletions elasticsearch/policy/pensando_create_allow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"set_priority": {
"priority": 100
}
}
},
"cold": {
"min_age": "1h",
"actions": {
"readonly": {},
"set_priority": {
"priority": 0
}
}
},
"delete": {
"min_age": "2h",
"actions": {
"delete": {
"delete_searchable_snapshot": true
}
}
}
}
}
}
Loading