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

Add firewallRule mgmt feature #1083

Merged

Conversation

jihoon-seo
Copy link
Member

CB-Spider Mock 드라이버에 대해 테스트했습니다.

[Test results]

❯ ./create-securityGroup.sh -n jhseo -c mock -r 1
Click to expand!
####################################################################
## 4. SecurityGroup: Create
####################################################################


- Create securityGroup in mock-seoul
{
  "id": "mock-seoul-jhseo",
  "name": "mock-seoul-jhseo",
  "connectionName": "mock-seoul",
  "vNetId": "ns01-mock-seoul-jhseo",
  "description": "test description",
  "firewallRules": [
    {
      "FromPort": "1",
      "ToPort": "65535",
      "IPProtocol": "TCP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    },
    {
      "FromPort": "1",
      "ToPort": "65535",
      "IPProtocol": "UDP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    },
    {
      "FromPort": "-1",
      "ToPort": "-1",
      "IPProtocol": "ICMP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    }
  ],
  "cspSecurityGroupId": "ns01-mock-c9nk2hd6qs89aspqgup0",
  "cspSecurityGroupName": "ns01-mock-seoul-jhseo",
  "keyValueList": null,
  "associatedObjectList": [],
  "isAutoGenerated": false,
  "systemLabel": ""
}
❯ ./test-create-firewallRules.sh -n jhseo -c mock -r 1
Click to expand!
####################################################################
## 4. firewallRules: Create
####################################################################


- Create firewallRules in mock-seoul
{
  "id": "mock-seoul-jhseo",
  "name": "mock-seoul-jhseo",
  "connectionName": "mock-seoul",
  "vNetId": "ns01-mock-seoul-jhseo",
  "description": "test description",
  "firewallRules": [
    {
      "FromPort": "1",
      "ToPort": "65535",
      "IPProtocol": "TCP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    },
    {
      "FromPort": "1",
      "ToPort": "65535",
      "IPProtocol": "UDP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    },
    {
      "FromPort": "-1",
      "ToPort": "-1",
      "IPProtocol": "ICMP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    },
    {
      "FromPort": "1",
      "ToPort": "65534",
      "IPProtocol": "TCP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    },
    {
      "FromPort": "1",
      "ToPort": "65534",
      "IPProtocol": "UDP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    },
    {
      "FromPort": "-1",
      "ToPort": "-1",
      "IPProtocol": "IGMP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    }
  ],
  "cspSecurityGroupId": "ns01-mock-c9nk2hd6qs89aspqgup0",
  "cspSecurityGroupName": "ns01-mock-seoul-jhseo",
  "keyValueList": null,
  "associatedObjectList": [],
  "isAutoGenerated": false,
  "systemLabel": ""
}
❯ ./test-create-firewallRules.sh -n jhseo -c mock -r 1
Click to expand!
####################################################################
## 4. firewallRules: Create
####################################################################


- Create firewallRules in mock-seoul
{
  "message": "One of submitted firewall rules already exists."
}
❯ ./test-delete-firewallRules.sh -n jhseo -c mock -r 1
Click to expand!
####################################################################
## 4. firewallRules: Delete
####################################################################


- Delete firewallRules in mock-seoul
{
  "id": "mock-seoul-jhseo",
  "name": "mock-seoul-jhseo",
  "connectionName": "mock-seoul",
  "vNetId": "ns01-mock-seoul-jhseo",
  "description": "test description",
  "firewallRules": [
    {
      "FromPort": "1",
      "ToPort": "65535",
      "IPProtocol": "TCP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    },
    {
      "FromPort": "1",
      "ToPort": "65535",
      "IPProtocol": "UDP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    },
    {
      "FromPort": "-1",
      "ToPort": "-1",
      "IPProtocol": "ICMP",
      "Direction": "inbound",
      "CIDR": "0.0.0.0/0"
    }
  ],
  "cspSecurityGroupId": "ns01-mock-c9nk2hd6qs89aspqgup0",
  "cspSecurityGroupName": "ns01-mock-seoul-jhseo",
  "keyValueList": null,
  "associatedObjectList": [],
  "isAutoGenerated": false,
  "systemLabel": ""
}
❯ ./test-delete-firewallRules.sh -n jhseo -c mock -r 1
Click to expand!
####################################################################
## 4. firewallRules: Delete
####################################################################


- Delete firewallRules in mock-seoul
{
  "message": "Any of submitted firewall rules does not exist in ."
}

@jihoon-seo jihoon-seo requested a review from seokho-son as a code owner May 2, 2022 02:58
@seokho-son
Copy link
Member

LGTM :)

@jihoon-seo 혹시 실제 CSP에서도 테스트해보고 머지하는 것이 좋을까요?

@jihoon-seo
Copy link
Member Author

Please refer to cloud-barista/cb-spider#621 😅

@jihoon-seo jihoon-seo linked an issue May 3, 2022 that may be closed by this pull request
@jihoon-seo jihoon-seo removed the hold Need to hold merge label May 3, 2022
@jihoon-seo
Copy link
Member Author

@seokho-son AWS 에 대해서도 의도대로 동작하는 것을 확인했습니다. 😊

@jihoon-seo jihoon-seo force-pushed the 220415_Add_firewallRule_mgmt_feature branch from 7f5f303 to a272de3 Compare May 3, 2022 09:28
@seokho-son
Copy link
Member

CB-Spider master head 에서만 동작하므로, 마이너 릴리스와 연계 필요.

@seokho-son seokho-son merged commit d47fd74 into cloud-barista:main May 4, 2022
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

Successfully merging this pull request may close these issues.

Add SG rules addition/deletion functionality
2 participants