Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

fix: allow only credhub and uaa for apps #434

Merged
merged 7 commits into from
Mar 5, 2020
Merged

Conversation

f0rmiga
Copy link
Member

@f0rmiga f0rmiga commented Mar 3, 2020

Description

Removes the internal security group that allows apps to communicate to the k8s service and pod IP ranges. Instead, create internal security groups allowing apps to communicate with credhub and UAA only.

Motivation and Context

We currently have some internal app security group stuff for CredHub (from #281); this requires the administrator to set kube.service_cluster_ip_range and kube.pod_cluster_ip_range in their helm values. This is unwieldy and error-prone; we should instead auto-detect the appropriate values and set the application security groups from code.

This fixes #304.

How Has This Been Tested?

Manually, running CATS and asserting that the credhub suite pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code has security implications.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Removes the internal security group that allows apps to communicate to
the k8s service and pod IP ranges. Instead, create internal security
groups allowing apps to communicate with credhub and UAA only.

Co-authored-by: Mark Yen <mark.yen@suse.com>
@f0rmiga f0rmiga added the Type: Bug Something isn't working label Mar 3, 2020
@f0rmiga f0rmiga added this to the 1.0.0 milestone Mar 3, 2020
@f0rmiga f0rmiga requested a review from mook-as March 3, 2020 19:43
Copy link
Contributor

@mook-as mook-as left a comment

Choose a reason for hiding this comment

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

We should spawn off the tasks to make this better before merging. (But we don't need to complete those tasks, obviously.)

value: /var/vcap/packages/cf-cli-6-linux/bin
- name: CF_API
value: https://api.((system_domain))
- name: CF_USERNAME
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be done with a client credential instead (so if the admin ever changes the password restarting the job won't be a problem).

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #450.

- name: CF_CLI_PATH
value: /var/vcap/packages/cf-cli-6-linux/bin
- name: CF_API
value: https://api.((system_domain))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be using the internal host name for CC for this? (Mostly thinking about things like "what if the external endpoint is behind a load balancer we can't reach from the inside", and "which SSL cert is that going to use")

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm. I'll try to connect to the internal hostname and load the CA cert to be able to remove --skip-ssl-validation from the cf api command.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #449.

sleep 1
done

cf api --skip-ssl-validation "${CF_API}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do anything to avoid the --skip-ssl-validation?

Copy link
Member

Choose a reason for hiding this comment

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

+1, we can't leave insecure in
also --silent is a bad idea

Copy link
Member Author

@f0rmiga f0rmiga Mar 4, 2020

Choose a reason for hiding this comment

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

@viovanov I guess the --silent is regarding the curl command. That command will be triggered multiple times, and we don't want it to spam logs.

For the --skip-ssl-validation, I have a plan for it that ties with the comment above about using the internal hostname.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #451.

sleep 1
done

cf api --skip-ssl-validation "${CF_API}"
Copy link
Member

Choose a reason for hiding this comment

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

+1, we can't leave insecure in
also --silent is a bad idea

Copy link
Contributor

@mook-as mook-as left a comment

Choose a reason for hiding this comment

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

Doesn't seem worse than the status quo, and given #449 #450 and #451 we can probably merge now and improve later.

@f0rmiga f0rmiga dismissed viovanov’s stale review March 5, 2020 19:56

The comment was addressed.

@f0rmiga f0rmiga merged commit 758fc7e into master Mar 5, 2020
@f0rmiga f0rmiga deleted the f0rmiga/credhub-sec-group branch March 5, 2020 20:27
bikramnehra pushed a commit that referenced this pull request Apr 21, 2020
…ec-group

fix: allow only credhub and uaa for apps
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Priority: High Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove security group that allows apps to communicate with internal network
4 participants