Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
4b5c9d6
Added docs for EKS deployment (#2785)
sbylica-splunk Aug 11, 2025
676f0b7
Fixed sonarqube issues (#2789)
sbylica-splunk Aug 21, 2025
b9539f3
chore: running with initial ansible changes
pdudhaiya-crest Sep 10, 2025
2bb798f
chore: update ci-main instead of ci-enterprise for testing
pdudhaiya-crest Sep 10, 2025
c665d59
chore: remove RUN command
pdudhaiya-crest Sep 10, 2025
28d3973
chore: update base debian image for testing
pdudhaiya-crest Sep 10, 2025
0b447b6
chore: update env_file and inventory file
pdudhaiya-crest Sep 10, 2025
ff2015b
chore: run ansible on docker host
pdudhaiya-crest Sep 10, 2025
64d24d5
chore: test local
pdudhaiya-crest Sep 10, 2025
faaa429
chore: skip docker install via python
pdudhaiya-crest Sep 10, 2025
8d4b6c2
chore: test
pdudhaiya-crest Sep 10, 2025
e223319
chore: test
pdudhaiya-crest Sep 10, 2025
5877c4d
chore: test
pdudhaiya-crest Sep 10, 2025
746f301
chore: test
pdudhaiya-crest Sep 10, 2025
d464d5d
chore: test running directly on ubuntu GH runner
pdudhaiya-crest Sep 10, 2025
62ea7c3
chore: test
pdudhaiya-crest Sep 10, 2025
eb0ada0
chore: test
pdudhaiya-crest Sep 10, 2025
fb4c36b
chore: test
pdudhaiya-crest Sep 11, 2025
a17753e
chore: test
pdudhaiya-crest Sep 11, 2025
4bd3fc5
chore: try localhost
pdudhaiya-crest Sep 11, 2025
463eb8e
chore: export artifact
pdudhaiya-crest Sep 11, 2025
9da54ae
chore: test again
pdudhaiya-crest Sep 11, 2025
c5effa0
chore: debug
pdudhaiya-crest Sep 11, 2025
7c7c6a7
chore: debug again
pdudhaiya-crest Sep 11, 2025
c9c047a
chore: test
pdudhaiya-crest Sep 11, 2025
1d74530
chore: ignore docker installation role if docker already exists
pdudhaiya-crest Sep 11, 2025
b0333b1
chore: tests
pdudhaiya-crest Sep 11, 2025
d0c9e77
chore: tests
pdudhaiya-crest Sep 11, 2025
c1a2ddb
chore: test
pdudhaiya-crest Sep 12, 2025
20de2c0
chore: test
pdudhaiya-crest Sep 12, 2025
d82e402
chore: test
pdudhaiya-crest Sep 12, 2025
32dc981
chore: debug
pdudhaiya-crest Sep 12, 2025
1fb9ade
chore: test
pdudhaiya-crest Sep 12, 2025
2f72781
chore: fix pip
pdudhaiya-crest Sep 12, 2025
10cfc4c
chore: test
pdudhaiya-crest Sep 12, 2025
22cd7f0
chore: test
pdudhaiya-crest Sep 12, 2025
7ad18ee
chore: test
pdudhaiya-crest Sep 12, 2025
861bf7b
chore: test
pdudhaiya-crest Sep 12, 2025
025b5a9
chore: test
pdudhaiya-crest Sep 12, 2025
33129f2
chore: test
pdudhaiya-crest Sep 12, 2025
1524842
chore: test
pdudhaiya-crest Sep 12, 2025
4bdfeb8
chore: test
pdudhaiya-crest Sep 12, 2025
e1c4563
chore: test
pdudhaiya-crest Sep 12, 2025
b9ed016
chore: test
pdudhaiya-crest Sep 12, 2025
7802a07
chore: test
pdudhaiya-crest Sep 12, 2025
1df0e7d
chore: test
pdudhaiya-crest Sep 12, 2025
1d83d5e
chore: test building env images
pdudhaiya-crest Sep 17, 2025
258bedc
chore: made changes to ubuntu image
pdudhaiya-crest Sep 17, 2025
ccf5592
chore: test with dind
pdudhaiya-crest Sep 17, 2025
7fa77f1
chore: test
pdudhaiya-crest Sep 17, 2025
08945b0
chore: test
pdudhaiya-crest Sep 17, 2025
9a66eaa
chore: test
pdudhaiya-crest Sep 18, 2025
ba881a4
chore: test
pdudhaiya-crest Sep 18, 2025
7f0ca9a
chore: test
pdudhaiya-crest Sep 18, 2025
74aad4a
chore: test
pdudhaiya-crest Sep 18, 2025
7e0951c
chore: test
pdudhaiya-crest Sep 18, 2025
6ce193a
chore: test
pdudhaiya-crest Sep 18, 2025
230a1ab
chore: test
pdudhaiya-crest Sep 18, 2025
d7a9825
chore: test
pdudhaiya-crest Sep 18, 2025
141b159
chore: test
pdudhaiya-crest Sep 19, 2025
b7d33d6
chore: test
pdudhaiya-crest Sep 19, 2025
0944235
chore : test2
pdudhaiya-crest Sep 19, 2025
e65981a
chore: test
pdudhaiya-crest Sep 19, 2025
aa542e8
chore: test
pdudhaiya-crest Sep 22, 2025
8a72246
chore: test
pdudhaiya-crest Sep 22, 2025
e056a4f
chore: test
pdudhaiya-crest Sep 22, 2025
8758a2d
chore: test
pdudhaiya-crest Sep 22, 2025
5faf056
chore: test
pdudhaiya-crest Sep 22, 2025
26a1138
chore : test
pdudhaiya-crest Sep 22, 2025
6669c1f
chore: t
pdudhaiya-crest Sep 22, 2025
8d76ac3
chore : test
pdudhaiya-crest Sep 22, 2025
ed95f5b
chore : test
pdudhaiya-crest Sep 22, 2025
e25ed76
chore: test
pdudhaiya-crest Sep 22, 2025
d151e3d
chore: test
pdudhaiya-crest Sep 22, 2025
e8d8dd5
yy
pdudhaiya-crest Sep 22, 2025
8f9cd02
chore: test
pdudhaiya-crest Sep 22, 2025
634fdcc
chore: test
pdudhaiya-crest Sep 22, 2025
69a77f6
chore: test
pdudhaiya-crest Sep 23, 2025
b086907
chore: test
pdudhaiya-crest Sep 23, 2025
2fc3bd9
chore: test
pdudhaiya-crest Sep 23, 2025
d7e83a5
chore: test
pdudhaiya-crest Sep 23, 2025
684cee8
test
pdudhaiya-crest Sep 23, 2025
bd82c2a
chore: test 2
pdudhaiya-crest Sep 23, 2025
8477a90
chore: test
pdudhaiya-crest Sep 23, 2025
6e0c9c3
1
pdudhaiya-crest Sep 23, 2025
a160ba5
chore: test
pdudhaiya-crest Sep 23, 2025
1bfa600
chore: test
pdudhaiya-crest Sep 24, 2025
6d2e9f4
chore: test
pdudhaiya-crest Sep 24, 2025
59a0550
chore: test
pdudhaiya-crest Sep 24, 2025
0b77aa6
chore: test
pdudhaiya-crest Sep 24, 2025
d6ed73a
chore: test
pdudhaiya-crest Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci-env-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build and Publish CI Environment Images

on:
pull_request:
branches:
- develop
paths:
- 'tests/container_images/docker/ubuntu_24/Dockerfile'
- 'tests/container_images/docker/redhat_9/Dockerfile'


jobs:
build-and-push-ci-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # Required to push to GHCR

strategy:
fail-fast: false # Set to false to build all images even if one fails
matrix:
os_variant: [ubuntu, rhel]
include:
- os_variant: ubuntu
dockerfile_path: tests/container_images/docker/ubuntu_24/Dockerfile
image_name_suffix: ci-env-ubuntu
# Build args specific to Ubuntu
ansible_version: "6.1.0"
ansible_core_version: "2.13.13"
poetry_installer_version: "1.5.1"
- os_variant: rhel
dockerfile_path: tests/container_images/docker/redhat_9/Dockerfile
image_name_suffix: ci-env-rhel
# Build args specific to RHEL
ansible_version: "6.1.0"
ansible_core_version: "2.13.13"
poetry_installer_version: "1.5.1"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }} # Your Docker Hub username
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.image_name_suffix }}
tags: |
type=raw,value=latest

- name: Build and push Docker image for ${{ matrix.os_variant }}
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile_path }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: |
pipconf=${{ secrets.PIP_CONF_CONTENT }} # Pass pip.conf content as a secret
build-args: |
ANSIBLE_VERSION=${{ matrix.ansible_version }}
ANSIBLE_CORE_VERSION=${{ matrix.ansible_core_version }}
POETRY_INSTALLER_VERSION=${{ matrix.poetry_installer_version }}
101 changes: 64 additions & 37 deletions .github/workflows/ci-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,13 @@ jobs:
scanners: "vuln"

test-container:
strategy:
matrix:
deployment_type: ["docker", "podman"]
runs-on: ubuntu-latest
needs:
- meta
- build_action
# runs all of the steps inside the specified container rather than on the VM host.
# Because of this the network configuration changes from host based network to a container network.
container:
image: python:3.9-buster

services:
splunk:
Expand All @@ -200,42 +199,64 @@ jobs:
SPLUNK_START_ARGS: --accept-license
SPLUNK_APPS_URL: https://github.com/splunk/splunk-configurations-base-indexes/releases/download/v1.0.0/splunk_configurations_base_indexes-1.0.0.tar.gz

sc4s:
image: ${{ needs.meta.outputs.container_base }}
ports:
- 514:514
- 601:601
- 5614:5514
- 5601:5601
- 6000:6000
- 6002:6002
- 9000:9000
env:
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL: https://splunk:8088
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY: "no"
SC4S_DEST_SPLUNK_HEC_DEFAULT_HTTP_COMPRESSION: "yes"
SC4S_LISTEN_PFSENSE_FIREWALL_TCP_PORT: 6000
SC4S_LISTEN_SIMPLE_TEST_ONE_TCP_PORT: 5514
SC4S_LISTEN_SIMPLE_TEST_ONE_UDP_PORT: 5514
SC4S_LISTEN_SIMPLE_TEST_TWO_TCP_PORT: 5601
SC4S_LISTEN_SPECTRACOM_NTP_TCP_PORT: 6002
SC4S_LISTEN_CISCO_ESA_TCP_PORT: 9000
SC4S_LISTEN_RARITAN_DSX_TCP_PORT: 9001
SC4S_LISTEN_CHECKPOINT_SPLUNK_NOISE_CONTROL: "yes"
SC4S_SOURCE_RICOH_SYSLOG_FIXHOST: "yes"
TEST_SC4S_ACTIVATE_EXAMPLES: "yes"
SC4S_DEBUG_CONTAINER: "yes"
SC4S_SOURCE_VMWARE_VSPHERE_GROUPMSG: "yes"
SC4S_NETAPP_ONTAP_NEW_FORMAT: "yes"
SC4S_USE_VPS_CACHE: "yes"

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
persist-credentials: false
- name: Install Ansible and other dependencies as python package
run: |
pip install ansible~=6.1.0 --no-cache-dir \
&& pip install pywinrm>=0.4.2 --no-cache-dir \
&& pip install ansible-lint>=6.0.0 --no-cache-dir \
&& pip install docker
- name: Configure Ansible Environment Variables
env:
ANSIBLE_CONFIG: ansible.cfg
ANSIBLE_HOST_KEY_CHECKING: False
run: |
echo "ANSIBLE_CONFIG is set to: $ANSIBLE_CONFIG"
echo "ANSIBLE_HOST_KEY_CHECKING is set to: $ANSIBLE_HOST_KEY_CHECKING"
- name: Update inventory file
run: |
cat << EOF > ansible/inventory/inventory.yaml
---
all:
hosts:
children:
node:
hosts:
node_1:
ansible_host: 127.0.0.1
ansible_connection: local
ansible_user: root
- name: Update env_file
run: |
echo "Updating ansible/inventory/inventory.yaml"
cat << EOF > ansible/resources/env_file
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://127.0.0.1:8088
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=70b6ae71-76b3-4c38-9597-0c5b37ad9630
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no

- name: Debug
run: |
whoami
uname -a
cat /etc/os-release
cat ansible/inventory/inventory.yaml
cat ansible/resources/env_file
docker ps
- name: Run Ansible Playbook
run: |
ansible-playbook --connection=local -i ansible/inventory/inventory.yaml ansible/playbooks/${{ matrix.deployment_type }}.yml
- name: Debug 2
run: |
whoami
uname -a
docker ps
systemctl status sc4s
docker images
- name: Run tests
run: |
pip3 install poetry
Expand All @@ -244,11 +265,17 @@ jobs:
poetry run pytest -v --tb=long \
--splunk_type=external \
--splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
--splunk_host=splunk \
--sc4s_host=sc4s \
--splunk_host=127.0.0.1 \
--sc4s_host=127.0.0.1 \
--junitxml=test-results/test.xml \
-n 14 \
-k 'not lite and not name_cache'
- name: artifact-test-results
uses: actions/upload-artifact@v4
with:
name: test-results-xml
path: test-results/test.xml
if: ${{ !cancelled() }}

test-ipv4-name-cache:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -462,4 +489,4 @@ jobs:
@google/[email protected]
[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }}
4 changes: 4 additions & 0 deletions ansible/playbooks/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
vars:
iface: "{{ swarm_iface | default('eth0') }}"
tasks:
- name: Check if 'docker' command exists on target (if not using docker connection)
ansible.builtin.command: which docker
register: docker_command_check
ignore_errors: true
- name: Docker installation role
include_role:
name: install_docker
Expand Down
2 changes: 1 addition & 1 deletion ansible/resources/env_file
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=http://xxx.xxx.xxx.xxx:8088
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://xxx.xxx.xxx.xxx:8088
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=xxxxxxxxxxxxxxxxxx
#Uncomment the following line if using untrusted SSL certificates
#SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@
repo: deb https://download.docker.com/linux/ubuntu focal stable
state: present

- name: Check if 'docker' command exists
ansible.builtin.command: which docker
register: docker_command_check
ignore_errors: true

- name: Install docker-ce
apt:
name: docker-ce
state: latest
when: docker_command_check.rc != 0

- name: Install Docker Module for Python
pip:
Expand Down
10 changes: 5 additions & 5 deletions ansible/roles/install_docker/tasks/install_docker_rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
state: latest
update_cache: true

- name: Install Docker Module for Python
pip:
name:
- docker
- jsondiff
# - name: Install Docker Module for Python
# pip:
# name:
# - docker
# - jsondiff

- name: Start Docker
ansible.builtin.service:
Expand Down
4 changes: 2 additions & 2 deletions ansible/tasks/docker/deploy_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

- name: Copying unit file on the server
copy:
src: "/opt/ansible/resources/docker_sc4s.service"
src: "../../../ansible/resources/docker_sc4s.service"
dest: "/lib/systemd/system/sc4s.service"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
mode: u=rw,g=rw

- name: Copying env_file file on the server
copy:
src: "/opt/ansible/resources/env_file"
src: "../../../ansible/resources/env_file"
dest: "/opt/sc4s/env_file"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
Expand Down
4 changes: 2 additions & 2 deletions ansible/tasks/podman/deploy_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

- name: Copying unit file on the server
copy:
src: "/opt/ansible/resources/podman_sc4s.service"
src: "../../../ansible/resources/podman_sc4s.service"
dest: "/lib/systemd/system/sc4s.service"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
mode: u=rw,g=rw

- name: Copying env_file file on the server
copy:
src: "/opt/ansible/resources/env_file"
src: "../../../ansible/resources/env_file"
dest: "/opt/sc4s/env_file"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
Expand Down
8 changes: 4 additions & 4 deletions docs/gettingstarted/ansible-docker-podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ docker exec -it ansible_sc4s /bin/bash

* To authenticate with username and password:
``` bash
ansible-playbook -i path/to/inventory.yaml -u <username> --ask-pass path/to/playbooks/docker.yml
ansible-playbook -i ansible/inventory/inventory.yaml -u <username> --ask-pass ansible/playbooks/playbooks/docker.yml
or
ansible-playbook -i path/to/inventory.yaml -u <username> --ask-pass path/to/playbooks/podman.yml
ansible-playbook -i ansible/inventory/inventory.yaml -u <username> --ask-pass ansible/playbooks/playbooks/podman.yml

```
* To authenticate using a key pair:
``` bash
ansible-playbook -i path/to/inventory.yaml -u <username> --key-file <key_file> path/to/playbooks/docker.yml
ansible-playbook -i ansible/inventory/inventory.yaml -u <username> --key-file <key_file> ansible/playbooks/playbooks/docker.yml
or
ansible-playbook -i path/to/inventory.yaml -u <username> --key-file <key_file> path/to/playbooks/podman.yml
ansible-playbook -i ansible/inventory/inventory.yaml -u <username> --key-file <key_file> ansible/playbooks/playbooks/podman.yml
```

# Step 3: Validate your configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/gettingstarted/ansible-docker-swarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ansible-playbook -i path/to/inventory_swarm.yaml -u <username> --key-file <key_f
|sc4s | 1 | Swarm |

* To scale your number of services:
```sudo docker service update --replicas 2 sc4s_sc4s```
```sudo docker service update --replicas 2 SC4S_sc4s```

* To see services running in a given stack:
```sudo docker stack services sc4s```
Expand Down
Loading
Loading