Graylog: Strengthening communication security

This documentation is part of the Using with Python guide. You can view the complete guide here: How to send logs from Python to Graylog.

👋 Welcome to the Stackhero documentation!

Stackhero offers a ready-to-use Graylog cloud solution that provides a host of benefits, including:

  • Unlimited and dedicated SMTP email server included.
  • Effortless updates with just a click.
  • Customisable domain name secured with HTTPS (for example, https://logs.your-company.com).
  • Optimal performance and robust security powered by a private and dedicated VM.

Save time and simplify your life: it only takes 5 minutes to try Stackhero's Graylog cloud hosting solution!

Although the previous examples use TLS encryption, they do not validate the certificate. This is fine for testing, but in a production environment, it is important to verify the certificate's validity.

You can enable certificate validation by adding the validate and ca_certs options as shown below:

handler = graypy.GELFTLSHandler('<XXXXXX>.stackhero-network.com', 12201, validate=True, ca_certs='/etc/ssl/certs/ca-certificates.crt')

Make sure the file /etc/ssl/certs/ca-certificates.crt exists on your system:

  • On Ubuntu/Debian, install it with sudo apt install ca-certificates.
  • On Alpine Linux, install it with apk add ca-certificates.
  • On macOS, it is installed by default, but the file is called /etc/ssl/cert.pem.