Skip to content

Commit 7f8161b

Browse files
fix fluentd startup failure in legacy cluster and guardian check ignore (#1467)
* fluentD failure fix * ignore some guardian check
1 parent 014357e commit 7f8161b

File tree

3 files changed

+54
-16
lines changed

3 files changed

+54
-16
lines changed

.gdn/.gdnsuppress

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"tool": "credscan",
3+
"suppressions": [
4+
{
5+
"file": "scripts/troubleshoot/TroubleshootError.ps1",
6+
"line": 935,
7+
"justification": "general kubectl command to get cres for troubleshooting"
8+
},
9+
{
10+
"file": "scripts/troubleshoot/TroubleshootError_nonAzureK8s.ps1",
11+
"line": 452,
12+
"justification": "general kubectl command to get creds for troubleshooting"
13+
},
14+
{
15+
"file": "test/testkube/helm-testkube-values.yaml",
16+
"line": 506,
17+
"justification": "a configuration key name, not a secret"
18+
},
19+
{
20+
"file": "test/testkube/helm-testkube-values.yaml",
21+
"line": 687,
22+
"justification": "used for ci testing clusters, not public accessible"
23+
}
24+
]
25+
}

.pipelines/azure_pipeline_mergedbranches.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ extends:
5858
targetPath: '$(Build.ArtifactStagingDirectory)'
5959
artifactName: drop
6060
steps:
61+
- bash: |
62+
echo "Current directory: $(pwd)"
63+
echo "Contents of .gdn directory:"
64+
find . -name ".gdnsuppress" -type f
65+
ls -la .gdn/ || echo ".gdn directory not found"
66+
echo "Build.SourcesDirectory: $(Build.SourcesDirectory)"
67+
echo "System.DefaultWorkingDirectory: $(System.DefaultWorkingDirectory)"
68+
echo "Copying Guardian suppression file to workspace root..."
69+
mkdir -p /mnt/vss/_work/1/.gdn
70+
cp .gdn/.gdnsuppress /mnt/vss/_work/1/.gdn/.gdnsuppress
71+
echo "Verification - suppression file copied:"
72+
ls -la /mnt/vss/_work/1/.gdn/
73+
displayName: 'copy over Guardian suppression file'
6174
- task: ComponentGovernanceComponentDetection@0
6275
- bash: |
6376
commit=$(git describe)

kubernetes/windows/Dockerfile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@ RUN reg add "HKLM\Software\Wow6432Node\Microsoft\Cryptography\Wintrust\Config" /
1212
# Docker creates a layer for every RUN-Statement
1313
ENV chocolateyVersion 1.4.0
1414
RUN powershell -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
15-
# Fluentd depends on cool.io whose fat gem is only available for Ruby < 2.5, so need to specify --platform ruby when install Ruby > 2.5 and install msys2 to get dev tools
16-
RUN choco install -y ruby --version 3.1.1.1 --params "'/InstallDir:C:\ruby31'" \
17-
&& choco install -y msys2 --version 20211130.0.0 --params "'/NoPath /NoUpdate /InstallDir:C:\ruby31\msys64'"
1815

19-
# gangams - optional MSYS2 update via ridk failing in merged docker file so skipping that since we dont need optional update
16+
17+
# Original code: https://github.com/fluent/fluentd-docker-image/blob/master/v1.16/windows-ltsc2022/Dockerfile
18+
# rexml 3.2.5 gem was installed during ruby 3.1.1.1 installation for xml parsing, not related to fluentd (dependency of fluentd 1.16.3: https://rubygems.org/gems/fluentd/versions/1.16.3-x64-mingw-ucrt)
19+
# removed it for vulnerability reasons.
20+
# https://github.com/ManageIQ/rbvmomi2/issues/62
21+
# when ruby has a version change, a different version of rexml might be installed,
22+
# so need to review the installed version of rexml, and uninstall it.
23+
RUN choco install -y ruby --version 3.1.1.1 --params "'/InstallDir:C:\ruby31'" \
24+
&& choco install -y msys2 --version 20240113.0.0 --params "'/NoPath /NoUpdate /InstallDir:C:\ruby31\msys64'"
2025
RUN refreshenv \
21-
&& ridk install 2 3 \
22-
&& C:\ruby31\msys64\usr\bin\bash.exe -lc "pacman -Rns --noconfirm mingw-w64-ucrt-x86_64-gcc" \
23-
&& C:\ruby31\msys64\usr\bin\bash.exe -lc "curl -O https://repo.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-gcc-libs-14.2.0-3-any.pkg.tar.zst" \
24-
&& C:\ruby31\msys64\usr\bin\bash.exe -lc 'pacman -U --noconfirm mingw-w64-ucrt-x86_64-gcc-libs-14.2.0-3-any.pkg.tar.zst' \
25-
&& C:\ruby31\msys64\usr\bin\bash.exe -lc "rm mingw-w64-ucrt-x86_64-gcc-libs-14.2.0-3-any.pkg.tar.zst" \
26-
&& C:\ruby31\msys64\usr\bin\bash.exe -lc "curl -O https://repo.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-gcc-14.2.0-3-any.pkg.tar.zst" \
27-
&& C:\ruby31\msys64\usr\bin\bash.exe -lc 'pacman -U --noconfirm mingw-w64-ucrt-x86_64-gcc-14.2.0-3-any.pkg.tar.zst' \
28-
&& C:\ruby31\msys64\usr\bin\bash.exe -lc "rm mingw-w64-ucrt-x86_64-gcc-14.2.0-3-any.pkg.tar.zst" \
26+
&& ridk install 3 \
2927
&& echo gem: --no-document >> C:\ProgramData\gemrc \
30-
&& gem install cool.io -v 1.9.0 --platform ruby \
31-
&& gem install oj -v 3.16.10 \
28+
# Install fluentd and its dependencies
29+
&& gem install oj -v 3.16.1 \
3230
&& gem install fluentd -v 1.16.3 \
33-
&& gem install win32-service -v 1.0.1 \
31+
&& gem install win32-service -v 2.3.2 \
3432
&& gem install win32-ipc -v 0.7.0 \
3533
&& gem install win32-event -v 0.6.3 \
34+
# remove rexml gem to avoid vulnerability
35+
&& gem uninstall rexml -v 3.2.5 --force\
36+
# The following gems are required for fluentd plugins, or ruby for configuration parsing
3637
&& gem install windows-pr -v 1.2.6 \
3738
&& gem install tomlrb -v 2.0.1 \
3839
&& gem install gyoku -v 1.3.1 \
3940
&& gem install ipaddress -v 0.8.3 \
4041
&& gem install jwt -v 2.7.1 \
41-
&& gem uninstall rexml -v 3.2.5 --force \
4242
&& gem sources --clear-all
4343

4444
# Remove gem cache and chocolatey

0 commit comments

Comments
 (0)