-
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.
Merge branch 'main' into jenworthington-patch-5
- Loading branch information
Showing
54 changed files
with
1,014 additions
and
412 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
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
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
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) |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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` |
Oops, something went wrong.