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

feat(terraform): add CKV NCP rules about ncloud access control group rule #3860

Merged
merged 12 commits into from
Dec 4, 2022
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
metadata:
id: "CKV_NCP_26"
name: "Ensure Access Control Group has Access Control Group Rule attached"
category: "NETWORKING"
definition:
and:
- cond_type: filter
attribute: resource_type
value:
- ncloud_access_control_group
operator: within
- resource_types:
- ncloud_access_control_group
connected_resource_types:
- ncloud_access_control_group_rule
operator: exists
cond_type: connection
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pass:
- "ncloud_access_control_group.pass"
fail:
- "ncloud_access_control_group.fail"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

resource "ncloud_access_control_group" "pass" {
name = "my-acg"
description = "description"
vpc_no = ncloud_vpc.vpc.id
}

resource "ncloud_access_control_group_rule" "acg-rule" {
access_control_group_no = ncloud_access_control_group.pass.id
}

resource "ncloud_access_control_group" "fail" {
name = "my-acg"
description = "description"
vpc_no = ncloud_vpc.vpc.id
}
3 changes: 3 additions & 0 deletions tests/terraform/graph/checks/test_yaml_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def setUp(self) -> None:
warnings.filterwarnings("ignore", category=ResourceWarning)
warnings.filterwarnings("ignore", category=DeprecationWarning)

def test_AccessControlGroupRuleDefine(self):
self.go("AccessControlGroupRuleDefine")

def test_ADORepositoryHasMinTwoReviewers(self):
self.go("ADORepositoryHasMinTwoReviewers")

Expand Down