-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: adopot EP HEC implementation for SC4S * feat: implement mTLS for EP * feat: automation k8s secret creation of mTLS * docs: describe mTLS encryption * docs: review edge processor documentation (#2402) * docs: Edge Processor docs * Update edge_processor.md Hi, please take a look at my edits to make sure i did not accidentally misinterpret the meaning of the original text. I'll do another final pass after that. * Update edge_processor.md * Update edge_processor.md Updated docs based on feedback * Update edge_processor.md updated line 40 based on feedback * docs: fix logical mistakes --------- Co-authored-by: Ilya Kheifets <[email protected]> * fix: small improvements * fix: make generic deploy certs --------- Co-authored-by: JENNIFER WORTHINGTON <[email protected]>
- Loading branch information
1 parent
a265bad
commit d4e4e79
Showing
11 changed files
with
176 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
- name: Load k8s secrets | ||
include_vars: | ||
file: "{{ item }}" | ||
with_first_found: | ||
- files: | ||
- /opt/ansible/resources/k8s_secrets.yaml | ||
- /opt/charts/splunk-connect-for-syslog/secrets.yaml | ||
|
||
- name: Create mTLS secret | ||
ansible.builtin.shell: | | ||
microk8s kubectl apply -f - <<EOF | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ hec_tls.secret }} | ||
type: Opaque | ||
data: | ||
key.pem: {{ hec_tls.value.key | b64encode }} | ||
cert.pem: {{ hec_tls.value.cert | b64encode }} | ||
ca_cert.pem: {{ hec_tls.value.ca | b64encode }} | ||
EOF | ||
when: | ||
- hec_tls is defined | ||
- ('secret' in hec_tls) and ('value' in hec_tls) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Edge Processor integration guide (Experimental) | ||
|
||
## Intro | ||
|
||
You can use the `Edge Processor` to: | ||
|
||
* Enrich log messages with extra data, such as adding a new field or overriding an index using `SPL2`. | ||
* Filter log messages using `SPL2`. | ||
* Send log messages to alternative destinations, for example, `AWS S3` or `Apache Kafka`. | ||
|
||
## How it works | ||
|
||
```mermaid | ||
stateDiagram | ||
direction LR | ||
SC4S: SC4S | ||
EP: Edge Processor | ||
Dest: Another destination | ||
Device: Your device | ||
S3: AWS S3 | ||
Instance: Instance | ||
Pipeline: Pipeline with SPL2 | ||
Device --> SC4S: Syslog protocol | ||
SC4S --> EP: HEC | ||
state EP { | ||
direction LR | ||
Instance --> Pipeline | ||
} | ||
EP --> Splunk | ||
EP --> S3 | ||
EP --> Dest | ||
``` | ||
|
||
## Set up the Edge Processor for SC4S | ||
|
||
### Set up on Docker / Podman | ||
|
||
1. On the `env_file`, configure the HEC URL as IP of *managed instance*, that you registered on Edge Processor. | ||
2. Add your HEC token. You can find your token in the Edge Processor "global settings" page. | ||
|
||
``` | ||
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=http://x.x.x.x:8088 | ||
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | ||
``` | ||
|
||
### Kubernetes | ||
|
||
1. Set up the Edge Processor on your `values.yaml` HEC URL using the IP of *managed instance*, that you registered on Edge Processor. | ||
|
||
2. Provide the hec_token. You can find this token on the Edge Processor's "global settings" page. | ||
|
||
``` | ||
splunk: | ||
hec_url: "http://x.x.x.x:8088" | ||
hec_token: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
``` | ||
|
||
## mTLS encryption | ||
|
||
### Prepare your certificates | ||
|
||
Before setup, [generate mTLS certificates](https://docs.splunk.com/Documentation/SplunkCloud/9.1.2308/EdgeProcessor/SecureForwarders). Server mTLS certificates should be uploaded to `Edge Processor` and client certifcates should be used with `SC4S`. | ||
|
||
Rename the certificate files. SC4S requires the following names: | ||
|
||
* `key.pem` - client certificate key | ||
* `cert.pem` - client certificate | ||
* `ca_cert.pem` - certificate authority | ||
|
||
### Docker / Podman | ||
|
||
1. Use HTTPS in HEC url: `SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://x.x.x.x:8088`. | ||
2. Move your clients mTLS certificates to `/opt/sc4s/tls/hec`. | ||
3. Mount `/opt/sc4s/tls/hec` to `/etc/syslog-ng/tls/hec` using docker/podman volumes. | ||
4. Define mounting mTLS point for HEC: `SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_MOUNT=/etc/syslog-ng/tls/hec`. | ||
5. Start or restart SC4S. | ||
|
||
### Kubernetes | ||
|
||
1. Add the secret name of the mTLS certificates to the `values.yaml` file: | ||
|
||
``` | ||
splunk: | ||
hec_url: "https://x.x.x.x:8088" | ||
hec_token: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
hec_tls: "hec-tls-secret" | ||
``` | ||
|
||
2. Add your mTLS certificates to the `charts/splunk-connect-for-syslog/secrets.yaml` file: | ||
|
||
``` | ||
hec_tls: | ||
secret: "hec-tls-secret" | ||
value: | ||
key: | | ||
-----BEGIN PRIVATE KEY----- | ||
Exmaple key | ||
-----END PRIVATE KEY----- | ||
cert: | | ||
-----BEGIN CERTIFICATE----- | ||
Exmaple cert | ||
-----END CERTIFICATE----- | ||
ca: | | ||
-----BEGIN CERTIFICATE----- | ||
Example ca | ||
-----END CERTIFICATE----- | ||
``` | ||
|
||
3. Encrypt your `secrets.yaml` using `ansible-vault encrypt charts/splunk-connect-for-syslog/secrets.yaml`. | ||
4. Add the IP address for your cluster nodes to the inventory file `ansible/inventory/inventory_microk8s_ha.yaml`. | ||
5. Deploy the Ansible playbook `ansible-playbook -i ansible/inventory/inventory_microk8s_ha.yaml ansible/playbooks/microk8s_ha.yml --ask-vault-pass` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters