π‘οΈ Security
πΊοΈ Overview
All core CogStack-NiFi services β including NiFi, Elasticsearch/OpenSearch, Kibana/OpenSearch Dashboards, JupyterHub, NGINX and Gitea β are now deployed with HTTPS enabled by default.
Each component is provisioned with its own X.509 certificates issued by the shared root CA generated via the create_root_ca_cert.sh script.
This ensures full end-to-end encryption across the stack for essential operations, including service-to-service communication and user-facing endpoints.
Security is achieved through:
- A unified root Certificate Authority (CA),
- Per-service certificate generation and signing scripts,
- Environment variable management for secrets and credentials, and
- Optional reverse-proxy enforcement via NGINX.
β οΈ Important: Always generate unique certificates and credentials for each deployment.
The repository provides sample certificates for demonstration only.
π§© Components secured with HTTPS
| Service | HTTPS/TLS Enabled | Certificate Location | Script(s) Used |
|---|---|---|---|
| NiFi | β | security/certificates/nifi/ |
nifi_toolkit_security.sh |
| Elasticsearch / OpenSearch | β | security/certificates/elastic/(elasticsearch or opensearch)/ |
create_es_native_certs.sh, create_opensearch_node_cert.sh |
| Kibana / OpenSearch Dashboards | β | security/certificates/elastic/(elasticsearch or opensearch)/ |
create_opensearch_client_admin_certs.sh |
| JupyterHub | β | security/certificates/root/ |
create_root_ca_cert.sh |
| Gitea | β | security/certificates/root/ |
create_root_ca_cert.sh |
| NGINX | β | security/certificates/root/ |
create_root_ca_cert.sh |
π Folder structure
The security/ directory centralizes all certificate, credential, and role management for CogStack-NiFi.
Below is the high-level structure with explanations for each sub-folder.
security/
βββ certificates/ # All generated certificates and keystores
β βββ elastic/ # Elasticsearch / OpenSearch + Kibana certs
β βββ nifi/ # Apache NiFi certificates (generated via NiFi Toolkit)
β βββ root/ # Root CA files and truststores
β
βββ env/ # Environment variable definitions for certs and users
β βββ certificates_*.env # Variables controlling certificate generation
β βββ users_*.env # Default credentials for each service
β
βββ es_roles/ # Role and role mapping definitions for ES / OpenSearch
β βββ elasticsearch/ # Native Elasticsearch roles
β βββ opensearch/ # OpenSearch Security Plugin configs
β
βββ scripts/ # Shell utilities for creating certs and credentials
β βββ create_root_ca_cert.sh # Generates the shared root CA (trust anchor)
β βββ create_es_native_certs.sh # Elasticsearch node and client certs
β βββ create_es_native_credentials.sh # Runs post-deployment to create default Elasticsearch system users and tokens
β βββ create_opensearch_node_cert.sh # Generates certificates and JKS stores for each OpenSearch node
β βββ create_opensearch_admin_certs.sh # Creates admin + client certificates for OpenSearch Dashboards (Kibana equivalent)
β βββ create_opensearch_internal_passwords.sh # Generates bcrypt password hashes for OpenSearch internal_users.yml
β βββ update_opensearch_users.sh # Updates password hashes for every user in OpenSearch internal_users.yml
β βββ create_opensearch_users.sh # Creates OpenSearch internal users and role mappings (manual execution post-startup)
β βββ nifi_toolkit_security.sh # Generates NiFi HTTPS certs using NiFi Toolkit (for NiFi < 2.0, no longer used for certs as of 2.0+)
β βββ nifi_init_create_user_auth.sh # Bootstraps a temporary NiFi container to create a single-user authentication file
β βββ nifi_create_single_user_auth.sh # Helper script executed inside the container to generate NiFi single-user credentials
β βββ es_native_cert_generator.sh # Helper called by create_es_native_certs.sh to assemble ES cert bundles
β βββ create_keystore.sh # Builds Java KeyStores (JKS) from PEM or PKCS#12 certificates
β
βββ templates/ # OpenSSL / X.509 configuration templates
βββ ssl-extensions-x509.cnf # SAN extensions used across certificate scripts