-
Notifications
You must be signed in to change notification settings - Fork 36
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
Services are accessible even if their namespace doesn’t exist locally #605
Comments
Signed-off-by: I <danibachar89@gmail.com>
Signed-off-by: I <danibachar89@gmail.com>
Signed-off-by: I <danibachar89@gmail.com>
Signed-off-by: I <danibachar89@gmail.com>
Signed-off-by: I <danibachar89@gmail.com>
@skitt - what would be the expected behavior in that case but that the DNS query specify the destination cluster (which is hosting the relevant namespace)? I'm not quite sure why would we even block access? Do you think it is a security risk? |
Signed-off-by: I <danibachar89@gmail.com>
Signed-off-by: I <danibachar89@gmail.com>
Signed-off-by: I <danibachar89@gmail.com>
See the MCS API:
So
I’m not sure it’s a security risk, but it could be a surprise for the administrator — in |
Ideal fix for this issue would be with #214 Namely, we would rely on aggregated import for DNS resolution but we won't aggregate the import if namespace is not present locally. |
@vthapar I think #214 is independent of this issue. #214 is concerned with merging multiple ServiceImports that are allowed to happen per the spec. This issue is concerned with not allowing a ServiceImport when the relevant namespace is not present in the candidate importing cluster. A related issue: the kep strongly implies that the ServiceImport object should be created in the namespace that the Service was exported from and Submariner currently diverges from this; the ServiceImports are in the submariner-operator namespace. If we were to create ServiceImports in the correct namespace, then this issue could be resolved as part of that work. I am not familiar enough with the code to know whether syncing to multiple namespaces would end up creating sync or permissions problems though. Another detail from the kep:
My guess is that it could be a policy / broker configuration option to auto-create namespaces. Enabling it would mean that namespace existence could not be used as a way of controlling which clusters services get imported to. |
Yes, creating the |
I have a potential patch to move ServiceImports into the appropriate namespace. Will test to see if any more work is needed. |
@donaldh You're correct that it is a different issue from #214 but our intention was to implement namespace checks when we aggreate service imports. Namespace checks will be implicitly done as part of creating aggregated serviceimport in the service namespace. Whether we decide to auto-create namespace or set ServiceImport status to error, either can be done when aggregating serviceimports. ServiceImports in broker namespace are more a result of way we distribute ServiceImports through broker. But yes, we can have ServiceImports created in apporpriate namespace without aggregation and if you can bring in a patch it would be great. Note that one of the reasons we deviate from spec is that we don't implement a ClusterSetIP like spec requires. |
@vthapar Is your intention that the ServiceImports would be synchronised to the submariner-operator namespace and then merged into a single ServiceImport in the target namespace? |
@donaldh Yes. Other way would be to aggregate at source in correct namespace,keep only one copy on broker and sync to origin namespace on remotes. Both have pros and cons.
I do think 1 will scale better in longer run with lesser data being synced across clusters. |
This issue has been automatically marked as stale because it has not had activity for 60 days. It will be closed if no further activity occurs. Please make a comment if this issue/pr is still valid. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had activity for 60 days. It will be closed if no further activity occurs. Please make a comment if this issue/pr is still valid. Thank you for your contributions. |
The aggregated |
...to verify an imported service is not accessible if the service namespace doesn't exist locally. Since the service is created in the framework's generated namespace, the test deletes this namespace from the source cluster and creates another namespace to contain the netshoot deployment. The test was placed in a new folder named "internal" so it isn't run with 'subctl verify'. We should only need to verify this functionality in CI plus it has the overhead of an additional namespace. Fixes submariner-io#605 Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
...to verify an imported service is not accessible if the service namespace doesn't exist locally. Since the service is created in the framework's generated namespace, the test deletes this namespace from the source cluster and creates another namespace to contain the netshoot deployment. The test was placed in a new folder named "internal" so it isn't run with 'subctl verify'. We should only need to verify this functionality in CI plus it has the overhead of an additional namespace. Fixes submariner-io#605 Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
...to verify an imported service is not accessible if the service namespace doesn't exist locally. Since the service is created in the framework's generated namespace, the test deletes this namespace from the source cluster and creates another namespace to contain the netshoot deployment. The test was placed in a new folder named "internal" so it isn't run with 'subctl verify'. We should only need to verify this functionality in CI plus it has the overhead of an additional namespace. Fixes submariner-io#605 Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
...to verify an imported service is not accessible if the service namespace doesn't exist locally. Since the service is created in the framework's generated namespace, the test deletes this namespace from the source cluster and creates another namespace to contain the netshoot deployment. The test was placed in a new folder named "internal" so it isn't run with 'subctl verify'. We should only need to verify this functionality in CI plus it has the overhead of an additional namespace. Fixes #605 Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
What happened:
In a two-cluster setup running Lighthouse (devel), I set up a namespace and service in cluster2, and exported it. The namespace didn’t exist in cluster1, but even so, the exported service was accessible.
What you expected to happen:
Given that the namespace containing the service doesn’t exist in cluster1, the service shouldn’t be imported there.
How to reproduce it (as minimally and precisely as possible):
make deploy
from Lighthouse or the operatorThe text was updated successfully, but these errors were encountered: