Skip to content

Commit 20c4498

Browse files
author
Vihas Splunk
committed
fix: fix cve, update ruby, ubi
1 parent 5fe0a0d commit 20c4498

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

.github/workflows/ci_build_test.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v2
1515

16-
- name: Set up Ruby 2.6.1
16+
- name: Setup Ruby and install gems
1717
uses: ruby/setup-ruby@v1
1818
with:
19-
ruby-version: 2.6.1
19+
bundler-cache: true
20+
ruby-version: 3.1
2021

2122
- name: Install dependencies
2223
run: |
2324
sudo ci_scripts/install_dep.sh
2425
2526
- name: Builder
2627
run: |
27-
rake build -t -v
28+
bundle exec rake build -t -v
2829
cp -R pkg /tmp
2930
3031
- name: Cache pkg
@@ -62,12 +63,12 @@ jobs:
6263
CI_SPLUNK_PORT: 8089
6364
CI_SPLUNK_USERNAME: admin
6465
CI_SPLUNK_HEC_TOKEN: a6b5e77f-d5f6-415a-bd43-930cecb12959
65-
CI_SPLUNK_PASSWORD: helloworld
66+
CI_SPLUNK_PASSWORD: changeme2
6667
CI_INDEX_EVENTS: ci_events
6768
CI_INDEX_OBJECTS: ci_objects
6869
CI_INDEX_METRICS: ci_metrics
6970
KUBERNETES_VERSION: v1.23.2
70-
MINIKUBE_VERSION: v1.24.0
71+
MINIKUBE_VERSION: latest
7172
MINIKUBE_NODE_COUNTS: 2
7273
GITHUB_ACTIONS: true
7374

@@ -158,6 +159,8 @@ jobs:
158159
curl -X POST -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD -k https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/servicesNS/nobody/splunk_httpinput/data/inputs/http/http/enable
159160
# Create new HEC token
160161
curl -X POST -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD -k -d "name=splunk_hec_token&token=a6b5e77f-d5f6-415a-bd43-930cecb12959&disabled=0&index=default-events&indexes=default-events,$CI_INDEX_METRICS,$CI_INDEX_OBJECTS,$CI_INDEX_EVENTS,ns-anno,pod-anno" https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/servicesNS/nobody/splunk_httpinput/data/inputs/http
162+
# lower the limit to 50MiB. Higher limits throws error 'Search not executed XXXX'
163+
kubectl exec -it splunk -- bash -c 'echo -e "\n[diskUsage]\nminFreeSpace = 50" >> /opt/splunk/etc/system/local/server.conf'
161164
# Restart Splunk
162165
curl -k -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/services/server/control/restart -X POST
163166

ci_scripts/k8s-splunk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ spec:
2626
- name: SPLUNK_USER
2727
value: root
2828
- name: SPLUNK_PASSWORD
29-
value: helloworld
29+
value: changeme2
3030
- name: SPLUNK_LAUNCH_CONF
3131
value: OPTIMISTIC_ABOUT_FILE_LOCKING=1

docker/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:2.7.4-buster as builder
1+
FROM ruby:3.1.4-buster as builder
22

33
ADD ./ /app/
44
WORKDIR /app
@@ -8,7 +8,7 @@ RUN bundle install
88

99
RUN bundle exec rake build -t -v
1010

11-
FROM registry.access.redhat.com/ubi8/ruby-27
11+
FROM registry.access.redhat.com/ubi9/ruby-31
1212

1313
ARG VERSION
1414

@@ -31,8 +31,6 @@ RUN mkdir /licenses
3131
COPY --from=builder /app/LICENSE /licenses/LICENSE
3232

3333
COPY --from=builder /app/docker/Gemfile* ./
34-
RUN gem update date cgi
35-
RUN rm -f /usr/share/gems/specifications/default/cgi-0.1.0.gemspec /usr/share/gems/specifications/default/date-3.0.0.gemspec
3634
RUN yum update -y \
3735
&& yum remove -y nodejs npm \
3836
&& gem install bundler \

docker/Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ gem 'bigdecimal', '=3.0.0'
1313
gem 'kubeclient', '=4.9.3'
1414
gem 'http_parser.rb', '=0.8.0'
1515
gem 'rack', '>= 3.0.0'
16+
gem 'cgi', '~> 0.3.6'
17+
gem 'date', '~> 3.3.3'
1618

1719
gem "fluent-plugin-splunk-hec", "= 1.3.2"
1820
gem 'fluent-plugin-kubernetes-metrics', path: 'gem/'

docker/Gemfile.lock

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ PATH
1010
GEM
1111
remote: https://rubygems.org/
1212
specs:
13-
activemodel (7.0.4.3)
14-
activesupport (= 7.0.4.3)
15-
activesupport (7.0.4.3)
13+
activemodel (7.0.7.2)
14+
activesupport (= 7.0.7.2)
15+
activesupport (7.0.7.2)
1616
concurrent-ruby (~> 1.0, >= 1.0.2)
1717
i18n (>= 1.6, < 2)
1818
minitest (>= 5.1)
@@ -23,9 +23,11 @@ GEM
2323
attr_required (1.0.1)
2424
bigdecimal (3.0.0)
2525
bindata (2.4.14)
26+
cgi (0.3.6)
2627
concurrent-ruby (1.1.10)
2728
connection_pool (2.3.0)
2829
cool.io (1.7.1)
30+
date (3.3.3)
2931
domain_name (0.5.20190701)
3032
unf (>= 0.0.5, < 1.0.0)
3133
faraday (2.7.1)
@@ -118,7 +120,7 @@ GEM
118120
webfinger (>= 1.0.1)
119121
prometheus-client (4.0.0)
120122
public_suffix (4.0.7)
121-
rack (3.0.6.1)
123+
rack (3.0.8)
122124
rack-oauth2 (1.21.3)
123125
activesupport
124126
attr_required
@@ -167,6 +169,8 @@ PLATFORMS
167169

168170
DEPENDENCIES
169171
bigdecimal (= 3.0.0)
172+
cgi (~> 0.3.6)
173+
date (~> 3.3.3)
170174
fluent-plugin-jq (= 0.5.1)
171175
fluent-plugin-kubernetes-metrics!
172176
fluent-plugin-prometheus (>= 2.0)
@@ -180,4 +184,4 @@ DEPENDENCIES
180184
rack (>= 3.0.0)
181185

182186
BUNDLED WITH
183-
2.1.4
187+
2.3.11

0 commit comments

Comments
 (0)