nebari-dev / nebari-dev/data-science-pack
Security(L-02): Hub-to-Nebi egress NetworkPolicy selects an entire namespace with no pod selector
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5
- Forks
- 7
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 13
Description
Summary
The Hub-to-Nebi egress NetworkPolicy selects the entire Nebi namespace with no destination pod selector, so any pod in that namespace is reachable from the hub on the allowed port. The rule is port-scoped to TCP/8460 and only renders when a Nebi internal URL is configured, which bounds the exposure.
Severity: Low · CWE-284 (Improper Access Control)
Validation: Confirmed against HEAD f932d80 on 2026-07-14 (assessed at 69c84f7; unchanged since).
Evidence
templates/hub-nebi-networkpolicy.yaml:19-26: the egressto:peer has anamespaceSelectormatchingkubernetes.io/metadata.name: {{ .Values.nebi.namespace }}but nopodSelector. Port defaults to 8460 (values.yaml:249).- The policy only renders when both
nebi.internalURLandnebi.namespaceare set (hub-nebi-networkpolicy.yaml:1).nebi.internalURLdefaults to empty (values.yaml:240), so on a default install this policy is not emitted at all; it applies only once a deployer sets an explicit internal URL.
Impact
When the policy is active, a malicious or compromised pod in the Nebi namespace that listens on 8460 becomes reachable from the hub. The exposure is limited to that single port, not all traffic.
Remediation
- Add a
podSelectormatching the exact Nebi workload labels alongside the namespace selector. - Use service identity where the CNI supports it.
Acceptance criteria
- Unrelated pods listening on 8460 in the Nebi namespace remain unreachable from the hub.
Source: data-science-pack 0.1.0 security assessment (pinned commit 69c84f72df259ec755ed40bfc83f20158c550d55), finding L-02.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with templates/hub-nebi-networkpolicy.yaml:19-26 and values.yaml:240,249, then inspect the chart’s Nebi workload definitions to identify the exact pod labels. Render the policy with nebi.internalURL and nebi.namespace configured, and verify that unrelated pods in the Nebi namespace cannot reach the hub on TCP/8460 while the Nebi workload remains reachable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes
- Domain
- infrastructure, networking, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100