Skip to content

Fix security issues#35

Merged
rranjan3 merged 7 commits into
mainfrom
sec-issues-fix
Jun 12, 2026
Merged

Fix security issues#35
rranjan3 merged 7 commits into
mainfrom
sec-issues-fix

Conversation

@rranjan3

@rranjan3 rranjan3 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

PULL DESCRIPTION

Resolving the Security issues identified during SDLe Security check analysis.

  • Fix 1.1: Source kubeconfig exported globally as root
  • Fix 6.1: K3S_TOKEN passed as environment variable
  • Fix 9.2: Binaries downloaded and made executable without checksum
  • Fix 10.1: Internet fallback: curl | bash to /tmp without checksum
  • Fix 1: Temporary World-Writable /etc/fstab (TOCTOU)
  • Fix 3: Unrestricted Passwordless sudo for Generic User

Verified with VEN for kubernetes host-type

image

Impact Analysis

Info Please fill out this column
Root Cause Specifically for bugs, empty in case of no variants
Jira ticket ITEP-93333

CODE MAINTAINABILITY

  • Added required new tests relevant to the changes and the URL has been included
  • Updated Documentation as relevant to the changes
  • PR change contains code related to security
  • PR introduces changes that break compatibility with other modules/services (If YES, please provide description)

Code must act as a teacher for future developers

rranjan3 added 6 commits June 11, 2026 20:59
Signed-off-by: Rajeev Ranjan <rajeev2.ranjan@intel.com>
Signed-off-by: Rajeev Ranjan <rajeev2.ranjan@intel.com>
Signed-off-by: Rajeev Ranjan <rajeev2.ranjan@intel.com>
Signed-off-by: Rajeev Ranjan <rajeev2.ranjan@intel.com>
Signed-off-by: Rajeev Ranjan <rajeev2.ranjan@intel.com>
Signed-off-by: Rajeev Ranjan <rajeev2.ranjan@intel.com>
local file="$1" expected="$2" got
[[ "${#expected}" -eq 64 ]] || { echo "[ERROR] verify_sha256_hex: invalid expected sha length for $(basename "$file")"; return 2; }
got="$(sha256sum "$file" | awk '{print $1}')"
if [[ "$got" != "$expected" ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the curly brackets for the variables to avoid shellcheck errors?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoted & unambiguous. So not needed.

Environment="CONTAINERD_NO_PROXY=${NO_PROXY}"
EOF
)
chmod 0600 "$DROPIN"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curly brackets for variables.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoted & unambiguous. So not needed.

echo "Waiting for K3s API server to be ready..."
for i in $(seq 1 60); do
kubectl get nodes --no-headers 2>/dev/null | grep -q ' Ready' && break
k get nodes --no-headers 2>/dev/null | grep -q ' Ready' && break

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is k can be used instead of kubectl ? Did we set this alias in environment file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ -f "${INSTALL_SCRIPTS}/nfd-node-feature-rules.yaml" ] && kubectl apply -f "${INSTALL_SCRIPTS}/nfd-node-feature-rules.yaml" || true
[ -f "${INSTALL_SCRIPTS}/gpu-plugin.yaml" ] && kubectl apply -f "${INSTALL_SCRIPTS}/gpu-plugin.yaml" || true
[ -f "${INSTALL_SCRIPTS}/npu-plugin.yaml" ] && kubectl apply -f "${INSTALL_SCRIPTS}/npu-plugin.yaml" || true
[ -f "${INSTALL_SCRIPTS}/nfd.yaml" ] && k apply -f "${INSTALL_SCRIPTS}/nfd.yaml" && sleep 15 || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the k alias set in environment file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


echo "=== Pod status after plugin installation ==="
kubectl get pods -A
k get pods -A

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to reconfirm on k

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: Rajeev Ranjan <rajeev2.ranjan@intel.com>
@rranjan3 rranjan3 marked this pull request as ready for review June 12, 2026 04:29

@abjyoti abjyoti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rranjan3 rranjan3 merged commit b09be03 into main Jun 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants