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

.ambassador_ignore_crds files written to root and breaks non writeable setups #1614

Closed
n1koo opened this issue Jun 8, 2019 · 3 comments
Closed
Assignees

Comments

@n1koo
Copy link
Contributor

n1koo commented Jun 8, 2019

Describe the bug
The files that are used for signaling existance of CRDs are written to the root device. This breaks non-rw containers

These files: https://github.com/datawire/ambassador/blob/c61e9c2f2e7a9f32a79095fbbbcd2babf5723d22/ambassador/kubewatch.py#L152-L173 in https://github.com/datawire/ambassador/blob/c61e9c2f2e7a9f32a79095fbbbcd2babf5723d22/ambassador/kubewatch.py#L196

2019-06-08 09:06:25 kubewatch [9 TMainThread] 0.71.0 DEBUG: CRD type definition not found for modules.getambassador.io
Traceback (most recent call last):
  File "/ambassador/kubewatch.py", line 212, in <module>
    main()
  File "/usr/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/ambassador/kubewatch.py", line 196, in main
    Path(touchfile).touch()
  File "/usr/lib/python3.6/pathlib.py", line 1238, in touch
    fd = self._raw_open(flags, mode)
  File "/usr/lib/python3.6/pathlib.py", line 1046, in _raw_open
    return self._accessor.open(self, flags, mode)
  File "/usr/lib/python3.6/pathlib.py", line 387, in wrapped
    return strfunc(str(pathobj), *args)
PermissionError: [Errno 13] Permission denied: '.ambassador_ignore_crds'

To Reproduce
Steps to reproduce the behavior:

  1. Run the containers without write privs on root and without CRDs

Expected behavior
The files should be written to eg. AMBASSADOR_CONFIG_BASE_DIR which people already should have writable

Versions (please complete the following information):

  • Ambassador: 0.71.0
  • Kubernetes 1.34

Additional context
In general would be great if all these features would be tested with a read only FS setup as this is the Nth time a change has broken our setup and having more security on edge makes sense for most folks. I'll try to see if I have time to PR a change to the test suite.

@kflynn
Copy link
Member

kflynn commented Jun 8, 2019

Ouch, sorry! Even if you don’t have time to do the PR, if you can share how you’re setting up your pods, I can make sure it’s included.

@n1koo
Copy link
Contributor Author

n1koo commented Jun 10, 2019

We are running a PodSecurityPolicy with

spec:
  allowPrivilegeEscalation: false
  fsGroup:
    ranges:
    - max: 65535
      min: 1
    rule: MustRunAs
  readOnlyRootFilesystem: true

which basically means non-root, no writeable layer in the pod (except for outside volumes)

@kflynn kflynn added this to the sagrada-familia milestone Jun 12, 2019
@kflynn kflynn self-assigned this Jun 12, 2019
@richarddli
Copy link
Contributor

Fixed in 0.72

LukeShu pushed a commit that referenced this issue Jul 16, 2020
…lsContext-type

[rel/v1.6] Change Host.spec.tlsContext to LocalObjectReference
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

No branches or pull requests

3 participants