Skip to content

Instantly share code, notes, and snippets.

@soheileghbali
soheileghbali / README.md
Created August 10, 2023 10:20 — forked from jeanlescure/README.md
Ubuntu/Debian Offline Repository Creation

Ubuntu/Debian Offline Repository Creation Gist

When I googled how to create my own offline repository of packages for use in an offline Ubuntu/Debian machine, the results were disheartening and the steps to be taken scattered all over the place.

The files within this gist will allow you to:

  • Download specific apt-get packages... with dependencies included!
  • Create a Packages.gz file so that you can add the repository folder you create to the target machine's /etc/apt/sources.list file.

Before using

@soheileghbali
soheileghbali / 01nginx-tls-sni.md
Created July 29, 2023 11:38 — forked from kekru/01nginx-tls-sni.md
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@soheileghbali
soheileghbali / java_keytool_cheat_sheet.md
Created June 17, 2023 16:55 — forked from Hakky54/java_keytool_cheat_sheet.md
Keytool Cheat Sheet - Some list of keytool commands for create, check and verify your keys

Keytool CheatSheet 🔐

Some history

This cheat sheet came into life when I started working on a tutorial of setting up one way tls and two way tls, which can be found here: GitHub - Mutual TLS SSL

Creation and importing

Generate a Java keystore and key pair

keytool -genkeypair -keyalg RSA -keysize 2048 -keystore keystore.jks -alias server -validity 3650
@soheileghbali
soheileghbali / openssl_commands.md
Created June 17, 2023 16:54 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@soheileghbali
soheileghbali / elasticsearch.md
Created May 4, 2023 10:25 — forked from nirev/elasticsearch.md
Elasticsearch Data Streams
@soheileghbali
soheileghbali / cheatsheet-elasticsearch.md
Created April 29, 2023 06:12 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@soheileghbali
soheileghbali / logstash-ssl.md
Created April 6, 2023 10:41 — forked from tanji/logstash-ssl.md
Creating SSL certificates for use with Logstash
  • Create the CA:
openssl genrsa -aes256 -out ca.key 4096
openssl req -key ca.key -new -x509 -days 7300 -sha256 -extensions v3_ca -out ca.crt
  • Create server certificate and key:
openssl genrsa -out server.key 2048
openssl req -new -key server.key -out server.csr

How to configure FileBeat and Logstash with SSL mutual authentication.

How to configure SSL for FileBeat and Logstash step by step with OpenSSL (Create CA, CSRs, Certificates, etc).

The Elasticsearch documentation "Securing Communication With Logstash by Using SSL" does not show how to create with openssl the necessary keys and certificates to have the mutual authentication between FileBeat (output) and Logstash (input). It is not a difficult task but it can be very tedious if you are not familiar with the use of openssl.

These are some errors that can be found in the FileBeat and Logstash logs when SSL is not properly configured.

# FileBeat.
@soheileghbali
soheileghbali / README.md
Created April 6, 2023 08:45 — forked from austinsonger/README.md
ELK Made Easy

Elasticsearch, Logstash, Kibana Installation Made Easy

This includes more than just Elasticsearch, Logstash, and Kibana. It also includes the following:

  • Metricbeat
  • Packetbeat
  • Auditbeat

TO-DO

  • Finish rpm_elk to match debian_elk