Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-42593: hardening service account automount #327

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

msherif1234
Copy link
Contributor

Address security warning about automount service account token – set to FALSE

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.61%. Comparing base (aa3840d) to head (02a49cc).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #327   +/-   ##
=======================================
  Coverage   27.60%   27.61%           
=======================================
  Files          87       87           
  Lines        7499     7500    +1     
=======================================
+ Hits         2070     2071    +1     
  Misses       5228     5228           
  Partials      201      201           
Flag Coverage Δ
unittests 27.61% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
@@ -321,6 +322,7 @@ func LoadAndConfigureBpfmanDs(config *corev1.ConfigMap, path string) *appsv1.Dae
staticBpfmanDeployment.Spec.Template.ObjectMeta.Annotations["bpfman.io.bpfman.agent.metricaddr"] = bpfmanMetricAddr
staticBpfmanDeployment.Name = internal.BpfmanDsName
staticBpfmanDeployment.Namespace = config.Namespace
staticBpfmanDeployment.Spec.Template.Spec.AutomountServiceAccountToken = ptr.To(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be a stupid question, but I'm trying to understand this change.

If we weren't automounting the service account token before, were we manually mounting it or passing it in somehow? And, If so, should that mechanism be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a valid question for the manual token creation there should have been
oc create token <token-name> somewhere in the process but I couldn't find that
so to me this looked like a bug that was waiting to happen when trying to mount secrets volume /var/run/secrets/kubernetes.io/serviceaccount for specific serviceAccount

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for looking into it. LGTM.

Copy link
Contributor

@anfredette anfredette left a comment

Choose a reason for hiding this comment

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

/LGTM

@mergify mergify bot merged commit ed47e2b into bpfman:main Oct 30, 2024
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