cli icon indicating copy to clipboard operation
cli copied to clipboard

Security group seems awkward

Open fraenkel opened this issue 12 years ago • 11 comments

The more I see of how the cli is forming, the more I get concerned about how this will work. If we take a step back and just work on a simple use case. I want to create a security group that defines some set of rules that applies to a set of spaces that span organizations.

Currently the API allows, create-security-group mysecuritygroup --rules [my_rules] --space myspace . So there would be no way for me to add your space in a different organization. Now as an admin I would probably just do create-security-group mysecuritygroup --rules [my_rules], then associate spaces to the security group.

But this doesn't seem possible. Although it looks like there is no way to update anything yet. Just throwing it out there now.

fraenkel avatar Jun 27 '14 18:06 fraenkel

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/74063514.

cf-gitbot avatar Jun 27 '14 18:06 cf-gitbot

Moving this to the CLI tracker.

tedsuo avatar Jun 27 '14 18:06 tedsuo

Edit: Just realized that space names are only unique within the context of an org. That makes this ... very awkward indeed.

tjarratt avatar Jun 27 '14 22:06 tjarratt

And will I be able to add a space or update the rules later?

fraenkel avatar Jun 27 '14 22:06 fraenkel

We commented on the story in tracker, but just to bring the conversation here -- we're considering adding new commands to associate / remove spaces from a security group. That way create and update are much, much simpler. How does that strike you, @fraenkel?

tjarratt avatar Jun 27 '14 22:06 tjarratt

Can't update tracker. But yes, those commands would help. One could also come up with something like an org/space naming but --space wouldn't work. And having --org --space would seem a bit awkward. But starting with the basic operations I think will give us a starting point.

What also strikes me odd is that the defaults are just a boolean so why a separate command? Just mark the security group as --default-running --default-staging. The alternative is close to what you have but allow me to specify multiple groups. One seems a bit limiting.

fraenkel avatar Jun 27 '14 22:06 fraenkel

So we're going to change the CLI commands to the following:

  • create/read/update delete of the security group
    • name specified on the CLI
    • rules input via file (triplets of)
      • destination
      • ports
      • type
  • assignment of a group to a set of spaces
    • rules input via file (pairs of)
      • org
      • space
  • assignment to staging defaults
  • assignment to the running defaults

lcddave avatar Jun 28 '14 23:06 lcddave

Sounds good.

Rules are a bit more complicated. There is a common set across all protocols but tcp/udp have ports, icmp has type and code, and all allows nothing additional.

fraenkel avatar Jun 28 '14 23:06 fraenkel

Thanks for reminding me on that. I think there will be both json and csv input.

lcddave avatar Jun 28 '14 23:06 lcddave

@fraenkel have you had a chance to see how the cf assign-security-group and cf unassign-security-group commands work? That should be a fairly straightforward way of associating security groups to a space.

Trying to help elucidate what more we can do to close this issue for now. We're inclined to mark these commands as "experimental" for a release or two while we shore up the user experience.

XenoPhex avatar Jul 02 '14 20:07 XenoPhex

We can close this for now and see how people like the new API and function before we call this "done".

fraenkel avatar Jul 03 '14 00:07 fraenkel