diff --git a/CHANGELOG.md b/CHANGELOG.md index 57e8798a..f745a2e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ +## 2.2.0 (November 8, 2022) + +FEATURES +* **New Resource:** `resource_checkpoint_management_administrator` +* **New Resource:** `resource_checkpoint_management_azure_ad` +* **New Resource:** `resource_checkpoint_management_lsv_profile` +* **New Resource:** `resource_checkpoint_management_tacacs_group` +* **New Resource:** `resource_checkpoint_management_tacacs_server` +* **New Resource:** `resource_checkpoint_management_tag` +* **New Resource:** `resource_checkpoint_management_threat_layer` +* **New Resource:** `resource_checkpoint_management_nutanix_data_center_server` +* **New Resource:** `resource_checkpoint_management_oracle_cloud_data_center_server` +* **New Resource:** `resource_checkpoint_management_radius_server` +* **New Resource:** `resource_checkpoint_management_radius_group` +* **New Data Source:** `data_source_checkpoint_management_administrator` +* **New Data Source:** `data_source_checkpoint_management_azure_ad` +* **New Data Source:** `data_source_checkpoint_management_azure_ad_content` +* **New Data Source:** `data_source_checkpoint_management_lsv_profile` +* **New Data Source:** `data_source_checkpoint_management_tacacs_group` +* **New Data Source:** `data_source_checkpoint_management_tacacs_server` +* **New Data Source:** `data_source_checkpoint_management_tag` +* **New Data Source:** `data_source_checkpoint_management_threat_layer` +* **New Data Source:** `data_source_checkpoint_management_nutanix_data_center_server` +* **New Data Source:** `data_source_checkpoint_management_oracle_cloud_data_center_server` +* **New Data Source:** `data_source_checkpoint_management_radius_server` +* **New Data Source:** `data_source_checkpoint_management_radius_group` + +ENHANCEMENTS +* Add support to new parameters of `checkpoint_management_simple_gateway`, `checkpoint_management_simple_cluster` from API V1.9. +* Add support to set session description using `session_description` or via environment variable `CHECKPOINT_SESSION_DESCRIPTION`. + + + ## 2.1.0 (September 20, 2022) FEATURES diff --git a/checkpoint/data_source_checkpoint_management_administrator.go b/checkpoint/data_source_checkpoint_management_administrator.go new file mode 100644 index 00000000..134fa03d --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_administrator.go @@ -0,0 +1,266 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "log" +) + +func dataSourceManagementAdministrator() *schema.Resource { + return &schema.Resource{ + Read: dataSourceManagementAdministratorRead, + Schema: map[string]*schema.Schema{ + "uid": { + Type: schema.TypeString, + Optional: true, + Description: "Object unique identifier.", + }, + "name": { + Type: schema.TypeString, + Optional: true, + Description: "Object name.", + }, + "authentication_method": { + Type: schema.TypeString, + Computed: true, + Description: "Authentication method.", + }, + "email": { + Type: schema.TypeString, + Computed: true, + Description: "Administrator email.", + }, + "expiration_date": { + Type: schema.TypeMap, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "iso_8601": { + Type: schema.TypeString, + Computed: true, + Description: "Date and time represented in international ISO 8601 format.", + }, + "posix": { + Type: schema.TypeInt, + Computed: true, + Description: "Number of milliseconds that have elapsed since 00:00:00, 1 January 1970.", + }, + }, + }, + }, + "multi_domain_profile": { + Type: schema.TypeString, + Computed: true, + Description: "Administrator multi-domain profile. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level.", + }, + "must_change_password": { + Type: schema.TypeBool, + Computed: true, + Description: "True if administrator must change password on the next login.", + }, + "permissions_profile": { + Type: schema.TypeList, + Optional: true, + Description: "Administrator permissions profile. Permissions profile should not be provided when multi-domain-profile is set to \"Multi-Domain Super User\" or \"Domain Super User\".", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "domain": { + Type: schema.TypeString, + Required: true, + }, + "profile": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "phone_number": { + Type: schema.TypeString, + Computed: true, + Description: "Administrator phone number.", + }, + "radius_server": { + Type: schema.TypeString, + Computed: true, + Description: "RADIUS server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"RADIUS\". Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level.", + }, + "sic_name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of the Secure Internal Connection Trust.", + }, + "tacacs_server": { + Type: schema.TypeString, + Computed: true, + Description: "TACACS server object identified by the name or UID . Must be set when \"authentication-method\" was selected to be \"TACACS\". Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level.", + }, + "tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Collection of tag identifiers.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "color": { + Type: schema.TypeString, + Computed: true, + Description: "Color of the object. Should be one of existing colors.", + }, + "comments": { + Type: schema.TypeString, + Computed: true, + Description: "Comments string.", + }, + }, + } +} + +func dataSourceManagementAdministratorRead(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + name := d.Get("name").(string) + uid := d.Get("uid").(string) + + payload := make(map[string]interface{}) + + if name != "" { + payload["name"] = name + } else if uid != "" { + payload["uid"] = uid + } + + showAdministratorRes, err := client.ApiCall("show-administrator", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showAdministratorRes.Success { + return fmt.Errorf(showAdministratorRes.ErrorMsg) + } + + administrator := showAdministratorRes.GetData() + log.Println("Read Administrator - Show JSON = ", administrator) + + if v := administrator["name"]; v != nil { + _ = d.Set("name", v) + } + + if v := administrator["uid"]; v != nil { + _ = d.Set("uid", v) + d.SetId(v.(string)) + } + + if v := administrator["authentication-method"]; v != nil { + _ = d.Set("authentication_method", v) + } + + if v := administrator["email"]; v != nil { + _ = d.Set("email", v) + } + + if v := administrator["expiration-date"]; v != nil { + _ = d.Set("expiration_date", v) + } + + if administrator["multi-domain-profile"] != nil { + if multiDomainProfileMap, ok := administrator["multi-domain-profile"].(map[string]interface{}); ok { + if v, _ := multiDomainProfileMap["name"]; v != nil { + _ = d.Set("multi_domain_profile", v) + } + } + } + + if v := administrator["must-change-password"]; v != nil { + _ = d.Set("must_change_password", v) + } + + if v := administrator["password"]; v != nil { + _ = d.Set("password", v) + } + + if v := administrator["password-hash"]; v != nil { + _ = d.Set("password_hash", v) + } + + if v := administrator["must-change-password"]; v != nil { + _ = d.Set("must_change_password", v) + } + + if administrator["permissions-profile"] != nil { + var permissionsProfileListToReturn []map[string]interface{} + + if permissionsProfileList, ok := administrator["permissions-profile"].([]interface{}); ok { + + for i := range permissionsProfileList { + permissionsProfileMap := permissionsProfileList[i].(map[string]interface{}) + + permissionsProfileMapToAdd := make(map[string]interface{}) + + if profile, _ := permissionsProfileMap["profile"]; profile != nil { + if v, _ := profile.(map[string]interface{})["name"]; v != nil { + permissionsProfileMapToAdd["profile"] = v.(string) + } + } + if domain, _ := permissionsProfileMap["domain"]; domain != nil { + if v, _ := domain.(map[string]interface{})["name"]; v != nil { + permissionsProfileMapToAdd["domain"] = v.(string) + } + } + permissionsProfileListToReturn = append(permissionsProfileListToReturn, permissionsProfileMapToAdd) + } + + } else if v, ok := administrator["permissions-profile"].(map[string]interface{}); ok { + permissionsProfileListToReturn = []map[string]interface{}{ + { + "domain": "SMC User", + "profile": v["name"].(string), + }, + } + } + _ = d.Set("permissions_profile", permissionsProfileListToReturn) + + } + + if v := administrator["phone-number"]; v != nil { + _ = d.Set("phone_number", v) + } + + if v := administrator["radius-server"]; v != nil { + _ = d.Set("radius_server", v) + } + + if v := administrator["tacacs-server"]; v != nil { + _ = d.Set("tacacs_server", v) + } + + if administrator["tags"] != nil { + tagsJson := administrator["tags"].([]interface{}) + var tagsIds = make([]string, 0) + if len(tagsJson) > 0 { + // Create slice of tag names + for _, tag := range tagsJson { + tag := tag.(map[string]interface{}) + tagsIds = append(tagsIds, tag["name"].(string)) + } + } + _ = d.Set("tags", tagsIds) + } else { + _ = d.Set("tags", nil) + } + + if v := administrator["color"]; v != nil { + _ = d.Set("color", v) + } + + if v := administrator["comments"]; v != nil { + _ = d.Set("comments", v) + } + + if v := administrator["sic-name"]; v != nil { + _ = d.Set("sic_name", v) + } + + return nil +} diff --git a/checkpoint/data_source_checkpoint_management_azure_ad.go b/checkpoint/data_source_checkpoint_management_azure_ad.go new file mode 100644 index 00000000..a99bb04a --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_azure_ad.go @@ -0,0 +1,153 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "log" +) + +func dataSourceManagementAzureAd() *schema.Resource { + return &schema.Resource{ + Read: dataSourceManagementAzureAdRead, + Schema: map[string]*schema.Schema{ + "uid": { + Type: schema.TypeString, + Optional: true, + Description: "Object unique identifier.", + }, + "name": { + Type: schema.TypeString, + Optional: true, + Description: "Object name.", + }, + "properties": { + Type: schema.TypeList, + Computed: true, + Description: "Azure AD connection properties.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + }, + "value": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Collection of tag objects identified by the name or UID. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "color": { + Type: schema.TypeString, + Computed: true, + Description: "Color of the object. Should be one of existing colors.", + }, + "comments": { + Type: schema.TypeString, + Computed: true, + Description: "Comments string.", + }, + }, + } +} + +func dataSourceManagementAzureAdRead(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + name := d.Get("name").(string) + uid := d.Get("uid").(string) + + payload := make(map[string]interface{}) + + if name != "" { + payload["name"] = name + } else if uid != "" { + payload["uid"] = uid + } + + showAzureAdRes, err := client.ApiCall("show-azure-ad", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showAzureAdRes.Success { + return fmt.Errorf(showAzureAdRes.ErrorMsg) + } + + azureAd := showAzureAdRes.GetData() + + log.Println("Read Azure Ad - Show JSON = ", azureAd) + + if v := azureAd["uid"]; v != nil { + _ = d.Set("uid", v) + d.SetId(v.(string)) + } + + if v := azureAd["name"]; v != nil { + _ = d.Set("name", v) + } + + if azureAd["properties"] != nil { + propertiesList := azureAd["properties"].([]interface{}) + + if len(propertiesList) > 0 { + var propertiesListToReturn []map[string]interface{} + + for i := range propertiesList { + propertiesMap := propertiesList[i].(map[string]interface{}) + + propertiesMapToAdd := make(map[string]interface{}) + + if v, _ := propertiesMap["name"]; v != nil { + propertiesMapToAdd["name"] = v + } + if v, _ := propertiesMap["value"]; v != nil { + propertiesMapToAdd["value"] = v + } + + propertiesListToReturn = append(propertiesListToReturn, propertiesMapToAdd) + } + + _ = d.Set("properties", propertiesListToReturn) + } else { + _ = d.Set("properties", propertiesList) + } + + } else { + _ = d.Set("properties", nil) + } + + if azureAd["tags"] != nil { + tagsJson, ok := azureAd["tags"].([]interface{}) + if ok { + tagsIds := make([]string, 0) + if len(tagsJson) > 0 { + for _, tags := range tagsJson { + tags := tags.(map[string]interface{}) + tagsIds = append(tagsIds, tags["name"].(string)) + } + } + _ = d.Set("tags", tagsIds) + } + } else { + _ = d.Set("tags", nil) + } + + if v := azureAd["color"]; v != nil { + _ = d.Set("color", v) + } + + if v := azureAd["comments"]; v != nil { + _ = d.Set("comments", v) + } + + return nil +} diff --git a/checkpoint/data_source_checkpoint_management_azure_ad_content.go b/checkpoint/data_source_checkpoint_management_azure_ad_content.go new file mode 100644 index 00000000..12d33211 --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_azure_ad_content.go @@ -0,0 +1,311 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "log" + "strconv" +) + +func dataSourceManagementAzureAdContent() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAzureAdContentRead, + Schema: map[string]*schema.Schema{ + "azure_ad_name": { + Type: schema.TypeString, + Optional: true, + Description: "Name of the Azure AD Server where to search for objects.", + }, + "azure_ad_uid": { + Type: schema.TypeString, + Optional: true, + Description: "Unique identifier of the Azure AD Server where to search for objects.", + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + Default: 50, + Description: "The maximal number of returned results.", + }, + "offset": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + Description: "Number of the results to initially skip.", + }, + "order": { + Type: schema.TypeList, + Optional: true, + Description: "Sorts the results by search criteria. Automatically sorts the results by Name, in the ascending order.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "asc": { + Type: schema.TypeString, + Optional: true, + Description: "Sorts results by the given field in ascending order.", + }, + "desc": { + Type: schema.TypeString, + Optional: true, + Description: "Sorts results by the given field in descending order.", + }, + }, + }, + }, + "uid_in_azure_ad": { + Type: schema.TypeString, + Optional: true, + Description: "Return result matching the unique identifier of the object on the Azure AD Server.", + }, + "filter": { + Type: schema.TypeMap, + Optional: true, + Description: "Return results matching the specified filter.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "text": { + Type: schema.TypeString, + Optional: true, + Description: "Return results containing the specified text value.", + }, + "uri": { + Type: schema.TypeString, + Optional: true, + Description: "Return results under the specified Data Center Object (identified by URI).", + }, + "parent_uid_in_data_center": { + Type: schema.TypeString, + Optional: true, + Description: "Return results under the specified Data Center Object (identified by UID).", + }, + }, + }, + }, + "from": { + Type: schema.TypeInt, + Computed: true, + Description: "From which element number the query was done.", + }, + "objects": { + Type: schema.TypeList, + Computed: true, + Description: "Remote objects views.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name_in_azure_ad": { + Type: schema.TypeString, + Computed: true, + Description: "Object name in the Azure AD.", + }, + "uid_in_azure_ad": { + Type: schema.TypeString, + Computed: true, + Description: "Unique identifier of the object in the Azure AD.", + }, + "azure_ad_object": { + Type: schema.TypeString, + Computed: true, + Description: "The imported management object (if exists). Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Object management name.", + }, + "type_in_azure_ad": { + Type: schema.TypeString, + Computed: true, + Description: "Object type in Azure AD.", + }, + "additional_properties": { + Type: schema.TypeList, + Computed: true, + Description: "Additional properties on the object.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + }, + "value": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + "to": { + Type: schema.TypeInt, + Computed: true, + Description: "To which element number the query was done.", + }, + "total": { + Type: schema.TypeInt, + Computed: true, + Description: "Total number of elements returned by the query.", + }, + }, + } +} + +func dataSourceAzureAdContentRead(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + payload := make(map[string]interface{}) + + if v, ok := d.GetOk("azure_ad_name"); ok { + payload["azure-ad-name"] = v.(string) + } + + if v, ok := d.GetOk("azure_ad_uid"); ok { + payload["azure-ad-uid"] = v.(string) + } + + if v, ok := d.GetOk("limit"); ok { + payload["limit"] = v.(int) + } + + if v, ok := d.GetOk("offset"); ok { + payload["offset"] = v.(int) + } + + if v, ok := d.GetOk("order"); ok { + orderList := v.([]interface{}) + if len(orderList) > 0 { + + var orderPayload []map[string]interface{} + + for i := range orderList { + payload := make(map[string]interface{}) + + if v, ok := d.GetOk("order." + strconv.Itoa(i) + ".asc"); ok { + payload["asc"] = v.(string) + } + if v, ok := d.GetOk("order." + strconv.Itoa(i) + ".desc"); ok { + payload["desc"] = v.(string) + } + + orderPayload = append(orderPayload, payload) + } + + payload["order"] = orderPayload + } + } + + if v, ok := d.GetOk("uid_in_azure_ad"); ok { + payload["uid-in-azure-ad"] = v.(string) + } + + if _, ok := d.GetOk("filter"); ok { + res := make(map[string]interface{}) + + if v, ok := d.GetOk("filter.text"); ok { + res["text"] = v.(string) + } + if v, ok := d.GetOk("filter.uri"); ok { + res["uri"] = v.(string) + } + if v, ok := d.GetOk("filter.parent_uid_in_data_center"); ok { + res["parent-uid-in-data-center"] = v.(string) + } + payload["filter"] = res + } + + showAzureAdContentRes, err := client.ApiCall("show-azure-ad-content", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showAzureAdContentRes.Success { + return fmt.Errorf(showAzureAdContentRes.ErrorMsg) + } + + azureAdContent := showAzureAdContentRes.GetData() + + log.Println("Read Azure Ad Content - Show JSON = ", azureAdContent) + + if v := azureAdContent["from"]; v != nil { + _ = d.Set("from", v) + } + + if azureAdContent["objects"] != nil { + objectsList := azureAdContent["objects"].([]interface{}) + + if len(objectsList) > 0 { + var objectsListToReturn []map[string]interface{} + + for i := range objectsList { + objectsMap := objectsList[i].(map[string]interface{}) + + objectsMapToAdd := make(map[string]interface{}) + + if v, _ := objectsMap["name-in-azure-ad"]; v != nil { + objectsMapToAdd["name_in_azure_ad"] = v + } + if v, _ := objectsMap["uid-in-azure-ad"]; v != nil { + objectsMapToAdd["uid_in_azure_ad"] = v + } + + if objectsMap["azure-ad-object"] != nil { + azureAdObjectMap := objectsMap["azure-ad-object"].(map[string]interface{}) + + objectsMapToAdd["azure_ad_object"] = azureAdObjectMap["name"] + } + + if v, _ := objectsMap["name"]; v != nil { + objectsMapToAdd["name"] = v + } + if v, _ := objectsMap["type-in-azure-ad"]; v != nil { + objectsMapToAdd["type_in_azure_ad"] = v + } + if objectsMap["additional-properties"] != nil { + additionalPropertiesList := objectsMap["additional-properties"].([]interface{}) + + if len(additionalPropertiesList) > 0 { + var additionalPropertiesListToReturn []map[string]interface{} + + for i := range additionalPropertiesList { + additionalPropertiesMap := additionalPropertiesList[i].(map[string]interface{}) + + additionalPropertiesMapToAdd := make(map[string]interface{}) + + if v, _ := additionalPropertiesMap["name"]; v != nil { + additionalPropertiesMapToAdd["name"] = v + } + if v, _ := additionalPropertiesMap["value"]; v != nil { + additionalPropertiesMapToAdd["value"] = v + } + + additionalPropertiesListToReturn = append(additionalPropertiesListToReturn, additionalPropertiesMapToAdd) + } + objectsMapToAdd["additional_properties"] = additionalPropertiesListToReturn + } + } else { + objectsMapToAdd["additional_properties"] = nil + } + + objectsListToReturn = append(objectsListToReturn, objectsMapToAdd) + } + + _ = d.Set("objects", objectsListToReturn) + } else { + _ = d.Set("objects", objectsList) + } + + } else { + _ = d.Set("objects", nil) + } + + if v := azureAdContent["to"]; v != nil { + _ = d.Set("to", v) + } + + if v := azureAdContent["total"]; v != nil { + _ = d.Set("total", v) + } + + return nil +} diff --git a/checkpoint/data_source_checkpoint_management_ips_protection_extended_attribute.go b/checkpoint/data_source_checkpoint_management_ips_protection_extended_attribute.go index c9a4db67..2e88fbfb 100644 --- a/checkpoint/data_source_checkpoint_management_ips_protection_extended_attribute.go +++ b/checkpoint/data_source_checkpoint_management_ips_protection_extended_attribute.go @@ -21,44 +21,6 @@ func dataSourceManagementIpsProtectionExtendedAttribute() *schema.Resource { Optional: true, Description: "Object name.", }, - //"object": { - // Type: schema.TypeMap, - // Computed: true, - // Description: "N/A", - // Elem: &schema.Resource{ - // Schema: map[string]*schema.Schema{ - // "name": { - // Type: schema.TypeString, - // Computed: true, - // Description: "Object name. Must be unique in the domain.", - // }, - // "uid": { - // Type: schema.TypeString, - // Computed: true, - // Description: "Object unique identifier.", - // }, - // "values": { - // Type: schema.TypeList, - // Computed: true, - // Description: "N/A", - // Elem: &schema.Resource{ - // Schema: map[string]*schema.Schema{ - // "name": { - // Type: schema.TypeString, - // Computed: true, - // Description: "Object name. Must be unique in the domain.", - // }, - // "uid": { - // Type: schema.TypeString, - // Computed: true, - // Description: "Object unique identifier.", - // }, - // }, - // }, - // }, - // }, - // }, - //}, "values": { Type: schema.TypeList, Computed: true, diff --git a/checkpoint/data_source_checkpoint_management_nutanix_data_center_server.go b/checkpoint/data_source_checkpoint_management_nutanix_data_center_server.go new file mode 100644 index 00000000..26b414f1 --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_nutanix_data_center_server.go @@ -0,0 +1,172 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceManagementNutanixDataCenterServer() *schema.Resource { + return &schema.Resource{ + Read: dataSourceNutanixDataCenterServerRead, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Optional: true, + Description: "Object name.", + }, + "uid": { + Type: schema.TypeString, + Optional: true, + Description: "Object unique identifier.", + }, + "automatic_refresh": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether the data center server's content is automatically updated.", + }, + "data_center_type": { + Type: schema.TypeString, + Computed: true, + Description: "Data Center type.", + }, + "properties": { + Type: schema.TypeList, + Computed: true, + Description: "Data Center properties.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + }, + "value": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Collection of tag identifiers.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "color": { + Type: schema.TypeString, + Computed: true, + Description: "Color of the object. Should be one of existing colors.", + }, + "comments": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceNutanixDataCenterServerRead(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + var name string + var uid string + + if v, ok := d.GetOk("name"); ok { + name = v.(string) + } + if v, ok := d.GetOk("uid"); ok { + uid = v.(string) + } + payload := make(map[string]interface{}) + + if name != "" { + payload["name"] = name + } else if uid != "" { + payload["uid"] = uid + } + + showNutanixDataCenterServerRes, err := client.ApiCall("show-data-center-server", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showNutanixDataCenterServerRes.Success { + return fmt.Errorf(showNutanixDataCenterServerRes.ErrorMsg) + } + + nutanixDataCenterServer := showNutanixDataCenterServerRes.GetData() + + if v := nutanixDataCenterServer["uid"]; v != nil { + _ = d.Set("uid", v) + d.SetId(v.(string)) + } + + if v := nutanixDataCenterServer["name"]; v != nil { + _ = d.Set("name", v) + } + + if nutanixDataCenterServer["properties"] != nil { + propertiesList := nutanixDataCenterServer["properties"].([]interface{}) + + if len(propertiesList) > 0 { + var propertiesListToReturn []map[string]interface{} + + for i := range propertiesList { + propertiesMap := propertiesList[i].(map[string]interface{}) + + propertiesMapToAdd := make(map[string]interface{}) + + if v, _ := propertiesMap["name"]; v != nil { + propertiesMapToAdd["name"] = v + } + if v, _ := propertiesMap["value"]; v != nil { + propertiesMapToAdd["value"] = v + } + + propertiesListToReturn = append(propertiesListToReturn, propertiesMapToAdd) + } + + _ = d.Set("properties", propertiesListToReturn) + } else { + _ = d.Set("properties", propertiesList) + } + + } else { + _ = d.Set("properties", nil) + } + + if nutanixDataCenterServer["tags"] != nil { + tagsJson, ok := nutanixDataCenterServer["tags"].([]interface{}) + if ok { + tagsIds := make([]string, 0) + if len(tagsJson) > 0 { + for _, tags := range tagsJson { + tags := tags.(map[string]interface{}) + tagsIds = append(tagsIds, tags["name"].(string)) + } + } + _ = d.Set("tags", tagsIds) + } + } else { + _ = d.Set("tags", nil) + } + + if v := nutanixDataCenterServer["color"]; v != nil { + _ = d.Set("color", v) + } + + if v := nutanixDataCenterServer["comments"]; v != nil { + _ = d.Set("comments", v) + } + + if v := nutanixDataCenterServer["automatic-refresh"]; v != nil { + _ = d.Set("automatic_refresh", v) + } + + if v := nutanixDataCenterServer["data-center-type"]; v != nil { + _ = d.Set("data_center_type", v) + } + + return nil +} diff --git a/checkpoint/data_source_checkpoint_management_oracle_cloud_data_center_server.go b/checkpoint/data_source_checkpoint_management_oracle_cloud_data_center_server.go new file mode 100644 index 00000000..ca41fd2f --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_oracle_cloud_data_center_server.go @@ -0,0 +1,172 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceManagementOracleCloudDataCenterServer() *schema.Resource { + return &schema.Resource{ + Read: dataSourceOracleCloudDataCenterServerRead, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Optional: true, + Description: "Object name.", + }, + "uid": { + Type: schema.TypeString, + Optional: true, + Description: "Object unique identifier.", + }, + "automatic_refresh": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether the data center server's content is automatically updated.", + }, + "data_center_type": { + Type: schema.TypeString, + Computed: true, + Description: "Data Center type.", + }, + "properties": { + Type: schema.TypeList, + Computed: true, + Description: "Data Center properties.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + }, + "value": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Collection of tag identifiers.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "color": { + Type: schema.TypeString, + Computed: true, + Description: "Color of the object. Should be one of existing colors.", + }, + "comments": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceOracleCloudDataCenterServerRead(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + var name string + var uid string + + if v, ok := d.GetOk("name"); ok { + name = v.(string) + } + if v, ok := d.GetOk("uid"); ok { + uid = v.(string) + } + payload := make(map[string]interface{}) + + if name != "" { + payload["name"] = name + } else if uid != "" { + payload["uid"] = uid + } + + showOracleCloudDataCenterServerRes, err := client.ApiCall("show-data-center-server", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showOracleCloudDataCenterServerRes.Success { + return fmt.Errorf(showOracleCloudDataCenterServerRes.ErrorMsg) + } + + oracleCloudDataCenterServer := showOracleCloudDataCenterServerRes.GetData() + + if v := oracleCloudDataCenterServer["uid"]; v != nil { + _ = d.Set("uid", v) + d.SetId(v.(string)) + } + + if v := oracleCloudDataCenterServer["name"]; v != nil { + _ = d.Set("name", v) + } + + if oracleCloudDataCenterServer["properties"] != nil { + propertiesList := oracleCloudDataCenterServer["properties"].([]interface{}) + + if len(propertiesList) > 0 { + var propertiesListToReturn []map[string]interface{} + + for i := range propertiesList { + propertiesMap := propertiesList[i].(map[string]interface{}) + + propertiesMapToAdd := make(map[string]interface{}) + + if v, _ := propertiesMap["name"]; v != nil { + propertiesMapToAdd["name"] = v + } + if v, _ := propertiesMap["value"]; v != nil { + propertiesMapToAdd["value"] = v + } + + propertiesListToReturn = append(propertiesListToReturn, propertiesMapToAdd) + } + + _ = d.Set("properties", propertiesListToReturn) + } else { + _ = d.Set("properties", propertiesList) + } + + } else { + _ = d.Set("properties", nil) + } + + if oracleCloudDataCenterServer["tags"] != nil { + tagsJson, ok := oracleCloudDataCenterServer["tags"].([]interface{}) + if ok { + tagsIds := make([]string, 0) + if len(tagsJson) > 0 { + for _, tags := range tagsJson { + tags := tags.(map[string]interface{}) + tagsIds = append(tagsIds, tags["name"].(string)) + } + } + _ = d.Set("tags", tagsIds) + } + } else { + _ = d.Set("tags", nil) + } + + if v := oracleCloudDataCenterServer["color"]; v != nil { + _ = d.Set("color", v) + } + + if v := oracleCloudDataCenterServer["comments"]; v != nil { + _ = d.Set("comments", v) + } + + if v := oracleCloudDataCenterServer["automatic-refresh"]; v != nil { + _ = d.Set("automatic_refresh", v) + } + + if v := oracleCloudDataCenterServer["data-center-type"]; v != nil { + _ = d.Set("data_center_type", v) + } + + return nil +} diff --git a/checkpoint/data_source_checkpoint_management_simple_cluster.go b/checkpoint/data_source_checkpoint_management_simple_cluster.go index bf20fc5a..2c611880 100644 --- a/checkpoint/data_source_checkpoint_management_simple_cluster.go +++ b/checkpoint/data_source_checkpoint_management_simple_cluster.go @@ -5,6 +5,7 @@ import ( checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "log" + "strconv" ) func dataSourceManagementSimpleCluster() *schema.Resource { @@ -36,6 +37,972 @@ func dataSourceManagementSimpleCluster() *schema.Resource { Computed: true, Description: "Cluster mode.", }, + "advanced_settings": { + Type: schema.TypeList, + Computed: true, + Description: "N/A", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "connection_persistence": { + Type: schema.TypeString, + Computed: true, + Description: "Handling established connections when installing a new policy.", + }, + "sam": { + Type: schema.TypeList, + Computed: true, + Description: "SAM.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "forward_to_other_sam_servers": { + Type: schema.TypeBool, + Computed: true, + Description: "Forward SAM clients' requests to other SAM servers.", + }, + "use_early_versions": { + Type: schema.TypeList, + Computed: true, + Description: "Use early versions compatibility mode.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Computed: true, + Description: "Use early versions compatibility mode.", + }, + "compatibility_mode": { + Type: schema.TypeString, + Computed: true, + Description: "Early versions compatibility mode.", + }, + }, + }, + }, + "purge_sam_file": { + Type: schema.TypeList, + Computed: true, + Description: "Purge SAM File.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Computed: true, + Description: "Purge SAM File.", + }, + "purge_when_size_reaches_to": { + Type: schema.TypeInt, + Computed: true, + Description: "Purge SAM File When it Reaches to.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "enable_https_inspection": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable HTTPS Inspection after defining an outbound inspection certificate.
To define the outbound certificate use outbound inspection certificate API.", + }, + "fetch_policy": { + Type: schema.TypeSet, + Computed: true, + Description: "Security management server(s) to fetch the policy from.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hit_count": { + Type: schema.TypeBool, + Computed: true, + Description: "Hit count tracks the number of connections each rule matches.", + }, + "https_inspection": { + Type: schema.TypeList, + Computed: true, + Description: "HTTPS inspection.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bypass_on_failure": { + Type: schema.TypeList, + Computed: true, + Description: "Set to be true in order to bypass all requests (Fail-open) in case of internal system error.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "site_categorization_allow_mode": { + Type: schema.TypeList, + Computed: true, + Description: "Set to 'background' in order to allowed requests until categorization is complete.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeString, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_untrusted_server_cert": { + Type: schema.TypeList, + Computed: true, + Description: "Set to be true in order to drop traffic from servers with untrusted server certificate.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_revoked_server_cert": { + Type: schema.TypeList, + Computed: true, + Description: "Set to be true in order to drop traffic from servers with revoked server certificate (validate CRL).", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_expired_server_cert": { + Type: schema.TypeList, + Computed: true, + Description: "Set to be true in order to drop traffic from servers with expired server certificate.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + }, + }, + }, + "identity_awareness": { + Type: schema.TypeBool, + Computed: true, + Description: "Identity awareness blade enabled.", + }, + "identity_awareness_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Gateway Identity Awareness settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "browser_based_authentication": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable Browser Based Authentication source.", + }, + "browser_based_authentication_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Browser Based Authentication settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Authentication Settings for Browser Based Authentication.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_method": { + Type: schema.TypeString, + Computed: true, + Description: "Authentication method.", + }, + "identity_provider": { + Type: schema.TypeSet, + Computed: true, + Description: "Identity provider object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"identity provider\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "radius": { + Type: schema.TypeString, + Computed: true, + Description: "Radius server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"radius\".", + }, + "users_directories": { + Type: schema.TypeList, + Computed: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "External user profile.", + }, + "internal_users": { + Type: schema.TypeBool, + Computed: true, + Description: "Internal users.", + }, + "users_from_external_directories": { + Type: schema.TypeString, + Computed: true, + Description: "Users from external directories.", + }, + "specific": { + Type: schema.TypeSet, + Computed: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "browser_based_authentication_portal_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Browser Based Authentication portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "portal_web_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Computed: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Computed: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Computed: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Computed: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_agent": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable Identity Agent source.", + }, + "identity_agent_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity Agent settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agents_interval_keepalive": { + Type: schema.TypeInt, + Computed: true, + Description: "Agents send keepalive period (minutes).", + }, + "user_reauthenticate_interval": { + Type: schema.TypeInt, + Computed: true, + Description: "Agent reauthenticate time interval (minutes).", + }, + "authentication_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Authentication Settings for Identity Agent.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_method": { + Type: schema.TypeString, + Computed: true, + Description: "Authentication method.", + }, + "radius": { + Type: schema.TypeString, + Computed: true, + Description: "Radius server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"radius\".", + }, + "users_directories": { + Type: schema.TypeList, + Computed: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "External user profile.", + }, + "internal_users": { + Type: schema.TypeBool, + Computed: true, + Description: "Internal users.", + }, + "users_from_external_directories": { + Type: schema.TypeString, + Computed: true, + Description: "Users from external directories.", + }, + "specific": { + Type: schema.TypeSet, + Computed: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_agent_portal_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity Agent accessibility settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_collector": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable Identity Collector source.", + }, + "identity_collector_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity Collector settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authorized_clients": { + Type: schema.TypeList, + Computed: true, + Description: "Authorized Clients.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "client": { + Type: schema.TypeString, + Computed: true, + Description: "Host / Network Group Name or UID.", + }, + "client_secret": { + Type: schema.TypeString, + Computed: true, + Description: "Client Secret.", + }, + }, + }, + }, + "authentication_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Authentication Settings for Identity Collector.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "users_directories": { + Type: schema.TypeList, + Computed: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "External user profile.", + }, + "internal_users": { + Type: schema.TypeBool, + Computed: true, + Description: "Internal users.", + }, + "users_from_external_directories": { + Type: schema.TypeString, + Computed: true, + Description: "Users from external directories.", + }, + "specific": { + Type: schema.TypeSet, + Computed: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "client_access_permissions": { + Type: schema.TypeList, + Computed: true, + Description: "Identity Collector accessibility settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_sharing_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity sharing settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "share_with_other_gateways": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable identity sharing with other gateways.", + }, + "receive_from_other_gateways": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable receiving identity from other gateways.", + }, + "receive_from": { + Type: schema.TypeSet, + Computed: true, + Description: "Gateway(s) to receive identity from.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "proxy_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity-Awareness Proxy settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "detect_using_x_forward_for": { + Type: schema.TypeBool, + Computed: true, + Description: "Whether to use X-Forward-For HTTP header, which is added by the proxy server to keep track of the original source IP.", + }, + }, + }, + }, + "remote_access": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable Remote Access Identity source.", + }, + }, + }, + }, + "ips_update_policy": { + Type: schema.TypeString, + Computed: true, + Description: "Specifies whether the IPS will be downloaded from the Management or directly to the Gateway.", + }, + "nat_hide_internal_interfaces": { + Type: schema.TypeBool, + Computed: true, + Description: "Hide internal networks behind the Gateway's external IP.", + }, + "nat_settings": { + Type: schema.TypeMap, + Computed: true, + Description: "NAT settings.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "auto_rule": { + Type: schema.TypeBool, + Computed: true, + Description: "Whether to add automatic address translation rules.", + }, + "ipv4_address": { + Type: schema.TypeString, + Computed: true, + Description: "IPv4 address.", + }, + "ipv6_address": { + Type: schema.TypeString, + Computed: true, + Description: "IPv6 address.", + }, + "hide_behind": { + Type: schema.TypeString, + Computed: true, + Description: "Hide behind method. This parameter is forbidden in case \"method\" parameter is \"static\".", + }, + "install_on": { + Type: schema.TypeString, + Computed: true, + Description: "Which gateway should apply the NAT translation.", + }, + "method": { + Type: schema.TypeString, + Computed: true, + Description: "NAT translation method.", + }, + }, + }, + }, + "platform_portal_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Platform portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "portal_web_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Computed: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Computed: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Computed: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Computed: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "proxy_settings": { + Type: schema.TypeMap, + Computed: true, + Description: "Proxy Server for Gateway.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "use_custom_proxy": { + Type: schema.TypeBool, + Computed: true, + Description: "Use custom proxy settings for this network object.", + Default: false, + }, + "proxy_server": { + Type: schema.TypeString, + Computed: true, + Description: "N/A", + }, + "port": { + Type: schema.TypeInt, + Computed: true, + Description: "N/A", + Default: 80, + }, + }, + }, + }, + "qos": { + Type: schema.TypeBool, + Computed: true, + Description: "QoS.", + }, + "usercheck_portal_settings": { + Type: schema.TypeList, + Computed: true, + Description: "UserCheck portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Computed: true, + Description: "State of the web portal (enabled or disabled). The supported blades are: {'Application Control', 'URL Filtering', 'Data Loss Prevention', 'Anti Virus', 'Anti Bot', 'Threat Emulation', 'Threat Extraction', 'Data Awareness'}.", + }, + "portal_web_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Computed: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Computed: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Computed: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Computed: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "zero_phishing": { + Type: schema.TypeBool, + Computed: true, + Description: "Zero Phishing blade enabled.", + }, + "zero_phishing_fqdn": { + Type: schema.TypeString, + Computed: true, + Description: "Zero Phishing gateway FQDN.", + }, "interfaces": { Type: schema.TypeList, Computed: true, @@ -945,6 +1912,458 @@ func dataSourceManagementSimpleClusterRead(d *schema.ResourceData, m interface{} _ = d.Set("cluster_mode", v) } + if cluster["advanced-settings"] != nil { + + advancedSettingsMap, ok := cluster["advanced-settings"].(map[string]interface{}) + + if ok { + advancedSettingsMapToReturn := make(map[string]interface{}) + + if v := advancedSettingsMap["connection-persistence"]; v != nil { + advancedSettingsMapToReturn["connection_persistence"] = v + } + if v, ok := advancedSettingsMap["sam"]; ok { + + samMap, ok := v.(map[string]interface{}) + if ok { + samMapToReturn := make(map[string]interface{}) + + if v, _ := samMap["forward-to-other-sam-servers"]; v != nil { + samMapToReturn["forward_to_other_sam_servers"] = v + } + if v, _ := samMap["use-early-versions"]; v != nil { + samMapToReturn["use_early_versions"] = v + } + if v, _ := samMap["purge-sam-file"]; v != nil { + samMapToReturn["purge_sam_file"] = v + } + advancedSettingsMapToReturn["sam"] = []interface{}{samMapToReturn} + } + } + _ = d.Set("advanced_settings", []interface{}{advancedSettingsMapToReturn}) + + } + } else { + _ = d.Set("advanced_settings", nil) + } + + if v := cluster["enable-https-inspection"]; v != nil { + _ = d.Set("enable_https_inspection", v) + } + + if cluster["fetch-policy"] != nil { + fetchPolicyJson, ok := cluster["fetch-policy"].([]interface{}) + if ok { + fetchPolicyIds := make([]string, 0) + if len(fetchPolicyJson) > 0 { + for _, fetch_policy := range fetchPolicyJson { + fetch_policy := fetch_policy.(map[string]interface{}) + fetchPolicyIds = append(fetchPolicyIds, fetch_policy["name"].(string)) + } + } + _ = d.Set("fetch_policy", fetchPolicyIds) + } + } else { + _ = d.Set("fetch_policy", nil) + } + + if v := cluster["hit-count"]; v != nil { + _ = d.Set("hit_count", v) + } + + if cluster["https-inspection"] != nil { + + httpsInspectionMap, ok := cluster["https-inspection"].(map[string]interface{}) + + if ok { + httpsInspectionMapToReturn := make(map[string]interface{}) + + if v, ok := httpsInspectionMap["bypass-on-failure"]; ok { + + bypassOnFailureMap, ok := v.(map[string]interface{}) + if ok { + bypassOnFailureMapToReturn := make(map[string]interface{}) + + if v, _ := bypassOnFailureMap["override-profile"]; v != nil { + bypassOnFailureMapToReturn["override_profile"] = v + } + if v, _ := bypassOnFailureMap["value"]; v != nil { + bypassOnFailureMapToReturn["value"] = v + } + httpsInspectionMapToReturn["bypass_on_failure"] = []interface{}{bypassOnFailureMapToReturn} + } + } + if v, ok := httpsInspectionMap["site-categorization-allow-mode"]; ok { + + siteCategorizationAllowModeMap, ok := v.(map[string]interface{}) + if ok { + siteCategorizationAllowModeMapToReturn := make(map[string]interface{}) + + if v, _ := siteCategorizationAllowModeMap["override-profile"]; v != nil { + siteCategorizationAllowModeMapToReturn["override_profile"] = v + } + if v, _ := siteCategorizationAllowModeMap["value"]; v != nil { + siteCategorizationAllowModeMapToReturn["value"] = v + } + httpsInspectionMapToReturn["site_categorization_allow_mode"] = []interface{}{siteCategorizationAllowModeMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-untrusted-server-cert"]; ok { + + denyUntrustedServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyUntrustedServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyUntrustedServerCertMap["override-profile"]; v != nil { + denyUntrustedServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyUntrustedServerCertMap["value"]; v != nil { + denyUntrustedServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_untrusted_server_cert"] = []interface{}{denyUntrustedServerCertMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-revoked-server-cert"]; ok { + + denyRevokedServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyRevokedServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyRevokedServerCertMap["override-profile"]; v != nil { + denyRevokedServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyRevokedServerCertMap["value"]; v != nil { + denyRevokedServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_revoked_server_cert"] = []interface{}{denyRevokedServerCertMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-expired-server-cert"]; ok { + + denyExpiredServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyExpiredServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyExpiredServerCertMap["override-profile"]; v != nil { + denyExpiredServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyExpiredServerCertMap["value"]; v != nil { + denyExpiredServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_expired_server_cert"] = []interface{}{denyExpiredServerCertMapToReturn} + } + } + _ = d.Set("https_inspection", []interface{}{httpsInspectionMapToReturn}) + + } + } else { + _ = d.Set("https_inspection", nil) + } + + if v := cluster["identity-awareness"]; v != nil { + _ = d.Set("identity_awareness", v) + } + + if cluster["identity-awareness-settings"] != nil { + + identityAwarenessSettingsMap, ok := cluster["identity-awareness-settings"].(map[string]interface{}) + + if ok { + identityAwarenessSettingsMapToReturn := make(map[string]interface{}) + + if v := identityAwarenessSettingsMap["browser-based-authentication"]; v != nil { + identityAwarenessSettingsMapToReturn["browser_based_authentication"] = v + } + if v, ok := identityAwarenessSettingsMap["browser-based-authentication-settings"]; ok { + + browserBasedAuthenticationSettingsMap, ok := v.(map[string]interface{}) + if ok { + browserBasedAuthenticationSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := browserBasedAuthenticationSettingsMap["authentication-settings"]; v != nil { + browserBasedAuthenticationSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := browserBasedAuthenticationSettingsMap["browser-based-authentication-portal-settings"]; v != nil { + browserBasedAuthenticationSettingsMapToReturn["browser_based_authentication_portal_settings"] = v + } + identityAwarenessSettingsMapToReturn["browser_based_authentication_settings"] = []interface{}{browserBasedAuthenticationSettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["identity-agent"]; v != nil { + identityAwarenessSettingsMapToReturn["identity_agent"] = v + } + if v, ok := identityAwarenessSettingsMap["identity-agent-settings"]; ok { + + identityAgentSettingsMap, ok := v.(map[string]interface{}) + if ok { + identityAgentSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identityAgentSettingsMap["agents-interval-keepalive"]; v != nil { + identityAgentSettingsMapToReturn["agents_interval_keepalive"] = v + } + if v, _ := identityAgentSettingsMap["user-reauthenticate-interval"]; v != nil { + identityAgentSettingsMapToReturn["user_reauthenticate_interval"] = v + } + if v, _ := identityAgentSettingsMap["authentication-settings"]; v != nil { + identityAgentSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := identityAgentSettingsMap["identity-agent-portal-settings"]; v != nil { + identityAgentSettingsMapToReturn["identity_agent_portal_settings"] = v + } + identityAwarenessSettingsMapToReturn["identity_agent_settings"] = []interface{}{identityAgentSettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["identity-collector"]; v != nil { + identityAwarenessSettingsMapToReturn["identity_collector"] = v + } + if v, ok := identityAwarenessSettingsMap["identity-collector-settings"]; ok { + + identityCollectorSettingsMap, ok := v.(map[string]interface{}) + if ok { + identityCollectorSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identityCollectorSettingsMap["authorized-clients"]; v != nil { + identityCollectorSettingsMapToReturn["authorized_clients"] = v + } + if v, _ := identityCollectorSettingsMap["authentication-settings"]; v != nil { + identityCollectorSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := identityCollectorSettingsMap["client-access-permissions"]; v != nil { + identityCollectorSettingsMapToReturn["client_access_permissions"] = v + } + identityAwarenessSettingsMapToReturn["identity_collector_settings"] = []interface{}{identityCollectorSettingsMapToReturn} + } + } + if v, ok := identityAwarenessSettingsMap["identity-sharing-settings"]; ok { + + identitySharingSettingsMap, ok := v.(map[string]interface{}) + if ok { + identitySharingSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identitySharingSettingsMap["share-with-other-gateways"]; v != nil { + identitySharingSettingsMapToReturn["share_with_other_gateways"] = v + } + if v, _ := identitySharingSettingsMap["receive-from-other-gateways"]; v != nil { + identitySharingSettingsMapToReturn["receive_from_other_gateways"] = v + } + if v, _ := identitySharingSettingsMap["receive-from"]; v != nil { + identitySharingSettingsMapToReturn["receive_from"] = v + } + identityAwarenessSettingsMapToReturn["identity_sharing_settings"] = []interface{}{identitySharingSettingsMapToReturn} + } + } + if v, ok := identityAwarenessSettingsMap["proxy-settings"]; ok { + + proxySettingsMap, ok := v.(map[string]interface{}) + if ok { + proxySettingsMapToReturn := make(map[string]interface{}) + + if v, _ := proxySettingsMap["detect-using-x-forward-for"]; v != nil { + proxySettingsMapToReturn["detect_using_x_forward_for"] = v + } + identityAwarenessSettingsMapToReturn["proxy_settings"] = []interface{}{proxySettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["remote-access"]; v != nil { + identityAwarenessSettingsMapToReturn["remote_access"] = v + } + _ = d.Set("identity_awareness_settings", []interface{}{identityAwarenessSettingsMapToReturn}) + + } + } else { + _ = d.Set("identity_awareness_settings", nil) + } + + if v := cluster["ips-update-policy"]; v != nil { + _ = d.Set("ips_update_policy", v) + } + + if v := cluster["nat-hide-internal-interfaces"]; v != nil { + _ = d.Set("nat_hide_internal_interfaces", v) + } + + if cluster["nat-settings"] != nil { + + natSettingsMap := cluster["nat-settings"].(map[string]interface{}) + + natSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := natSettingsMap["auto-rule"]; v != nil { + natSettingsMapToReturn["auto_rule"] = strconv.FormatBool(v.(bool)) + } + if v, _ := natSettingsMap["ipv4-address"]; v != nil && v != "" { + natSettingsMapToReturn["ipv4_address"] = v + } + if v, _ := natSettingsMap["ipv6-address"]; v != nil && v != "" { + natSettingsMapToReturn["ipv6_address"] = v + } + if v, _ := natSettingsMap["hide-behind"]; v != nil { + natSettingsMapToReturn["hide_behind"] = v + } + if v, _ := natSettingsMap["install-on"]; v != nil { + natSettingsMapToReturn["install_on"] = v + } + if v, _ := natSettingsMap["method"]; v != nil { + natSettingsMapToReturn["method"] = v + } + _ = d.Set("nat_settings", natSettingsMapToReturn) + } else { + _ = d.Set("nat_settings", nil) + } + + if cluster["platform-portal-settings"] != nil { + + platformPortalSettingsMap, ok := cluster["platform-portal-settings"].(map[string]interface{}) + + if ok { + platformPortalSettingsMapToReturn := make(map[string]interface{}) + + if v, ok := platformPortalSettingsMap["portal-web-settings"]; ok { + + portalWebSettingsMap, ok := v.(map[string]interface{}) + if ok { + portalWebSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := portalWebSettingsMap["aliases"]; v != nil { + portalWebSettingsMapToReturn["aliases"] = v + } + if v, _ := portalWebSettingsMap["main-url"]; v != nil { + portalWebSettingsMapToReturn["main_url"] = v + } + platformPortalSettingsMapToReturn["portal_web_settings"] = []interface{}{portalWebSettingsMapToReturn} + } + } + if v, ok := platformPortalSettingsMap["certificate-settings"]; ok { + + certificateSettingsMap, ok := v.(map[string]interface{}) + if ok { + certificateSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := certificateSettingsMap["base64-certificate"]; v != nil { + certificateSettingsMapToReturn["base64_certificate"] = v + } + if v, _ := certificateSettingsMap["base64-password"]; v != nil { + certificateSettingsMapToReturn["base64_password"] = v + } + platformPortalSettingsMapToReturn["certificate_settings"] = []interface{}{certificateSettingsMapToReturn} + } + } + if v, ok := platformPortalSettingsMap["accessibility"]; ok { + + accessibilityMap, ok := v.(map[string]interface{}) + if ok { + accessibilityMapToReturn := make(map[string]interface{}) + + if v, _ := accessibilityMap["allow-access-from"]; v != nil { + accessibilityMapToReturn["allow_access_from"] = v + } + if v, _ := accessibilityMap["internal-access-settings"]; v != nil { + accessibilityMapToReturn["internal_access_settings"] = v + } + platformPortalSettingsMapToReturn["accessibility"] = []interface{}{accessibilityMapToReturn} + } + } + _ = d.Set("platform_portal_settings", []interface{}{platformPortalSettingsMapToReturn}) + + } + } else { + _ = d.Set("platform_portal_settings", nil) + } + + if cluster["proxy-settings"] != nil { + + proxySettingsMap := cluster["proxy-settings"].(map[string]interface{}) + + proxySettingsMapToReturn := make(map[string]interface{}) + + if v, _ := proxySettingsMap["use-custom-proxy"]; v != nil { + proxySettingsMapToReturn["use_custom_proxy"] = strconv.FormatBool(v.(bool)) + } + if v, _ := proxySettingsMap["proxy-server"]; v != nil { + proxySettingsMapToReturn["proxy_server"] = v + } + if v, _ := proxySettingsMap["port"]; v != nil { + proxySettingsMapToReturn["port"] = v + } + _ = d.Set("proxy_settings", proxySettingsMapToReturn) + } else { + _ = d.Set("proxy_settings", nil) + } + + if v := cluster["qos"]; v != nil { + _ = d.Set("qos", v) + } + + if cluster["usercheck-portal-settings"] != nil { + + usercheckPortalSettingsMap, ok := cluster["usercheck-portal-settings"].(map[string]interface{}) + + if ok { + usercheckPortalSettingsMapToReturn := make(map[string]interface{}) + + if v := usercheckPortalSettingsMap["enabled"]; v != nil { + usercheckPortalSettingsMapToReturn["enabled"] = v + } + if v, ok := usercheckPortalSettingsMap["portal-web-settings"]; ok { + + portalWebSettingsMap, ok := v.(map[string]interface{}) + if ok { + portalWebSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := portalWebSettingsMap["aliases"]; v != nil { + portalWebSettingsMapToReturn["aliases"] = v + } + if v, _ := portalWebSettingsMap["main-url"]; v != nil { + portalWebSettingsMapToReturn["main_url"] = v + } + usercheckPortalSettingsMapToReturn["portal_web_settings"] = []interface{}{portalWebSettingsMapToReturn} + } + } + if v, ok := usercheckPortalSettingsMap["certificate-settings"]; ok { + + certificateSettingsMap, ok := v.(map[string]interface{}) + if ok { + certificateSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := certificateSettingsMap["base64-certificate"]; v != nil { + certificateSettingsMapToReturn["base64_certificate"] = v + } + if v, _ := certificateSettingsMap["base64-password"]; v != nil { + certificateSettingsMapToReturn["base64_password"] = v + } + usercheckPortalSettingsMapToReturn["certificate_settings"] = []interface{}{certificateSettingsMapToReturn} + } + } + if v, ok := usercheckPortalSettingsMap["accessibility"]; ok { + + accessibilityMap, ok := v.(map[string]interface{}) + if ok { + accessibilityMapToReturn := make(map[string]interface{}) + + if v, _ := accessibilityMap["allow-access-from"]; v != nil { + accessibilityMapToReturn["allow_access_from"] = v + } + if v, _ := accessibilityMap["internal-access-settings"]; v != nil { + accessibilityMapToReturn["internal_access_settings"] = v + } + usercheckPortalSettingsMapToReturn["accessibility"] = []interface{}{accessibilityMapToReturn} + } + } + _ = d.Set("usercheck_portal_settings", []interface{}{usercheckPortalSettingsMapToReturn}) + + } + } else { + _ = d.Set("usercheck_portal_settings", nil) + } + + if v := cluster["zero-phishing"]; v != nil { + _ = d.Set("zero_phishing", v) + } + + if v := cluster["zero-phishing-fqdn"]; v != nil { + _ = d.Set("zero_phishing_fqdn", v) + } + if v := cluster["interfaces"]; v != nil { interfacesList := v.(map[string]interface{})["objects"].([]interface{}) if len(interfacesList) > 0 { diff --git a/checkpoint/data_source_checkpoint_management_simple_gateway.go b/checkpoint/data_source_checkpoint_management_simple_gateway.go index 2ff80cdd..67a9f9f8 100644 --- a/checkpoint/data_source_checkpoint_management_simple_gateway.go +++ b/checkpoint/data_source_checkpoint_management_simple_gateway.go @@ -33,6 +33,972 @@ func dataSourceManagementSimpleGateway() *schema.Resource { Computed: true, Description: "IPv6 address.", }, + "advanced_settings": { + Type: schema.TypeList, + Computed: true, + Description: "N/A", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "connection_persistence": { + Type: schema.TypeString, + Computed: true, + Description: "Handling established connections when installing a new policy.", + }, + "sam": { + Type: schema.TypeList, + Computed: true, + Description: "SAM.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "forward_to_other_sam_servers": { + Type: schema.TypeBool, + Computed: true, + Description: "Forward SAM clients' requests to other SAM servers.", + }, + "use_early_versions": { + Type: schema.TypeList, + Computed: true, + Description: "Use early versions compatibility mode.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Computed: true, + Description: "Use early versions compatibility mode.", + }, + "compatibility_mode": { + Type: schema.TypeString, + Computed: true, + Description: "Early versions compatibility mode.", + }, + }, + }, + }, + "purge_sam_file": { + Type: schema.TypeList, + Computed: true, + Description: "Purge SAM File.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Computed: true, + Description: "Purge SAM File.", + }, + "purge_when_size_reaches_to": { + Type: schema.TypeInt, + Computed: true, + Description: "Purge SAM File When it Reaches to.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "enable_https_inspection": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable HTTPS Inspection after defining an outbound inspection certificate.
To define the outbound certificate use outbound inspection certificate API.", + }, + "fetch_policy": { + Type: schema.TypeSet, + Computed: true, + Description: "Security management server(s) to fetch the policy from.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hit_count": { + Type: schema.TypeBool, + Computed: true, + Description: "Hit count tracks the number of connections each rule matches.", + }, + "https_inspection": { + Type: schema.TypeList, + Computed: true, + Description: "HTTPS inspection.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bypass_on_failure": { + Type: schema.TypeList, + Computed: true, + Description: "Set to be true in order to bypass all requests (Fail-open) in case of internal system error.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "site_categorization_allow_mode": { + Type: schema.TypeList, + Computed: true, + Description: "Set to 'background' in order to allowed requests until categorization is complete.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeString, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_untrusted_server_cert": { + Type: schema.TypeList, + Computed: true, + Description: "Set to be true in order to drop traffic from servers with untrusted server certificate.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_revoked_server_cert": { + Type: schema.TypeList, + Computed: true, + Description: "Set to be true in order to drop traffic from servers with revoked server certificate (validate CRL).", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_expired_server_cert": { + Type: schema.TypeList, + Computed: true, + Description: "Set to be true in order to drop traffic from servers with expired server certificate.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Computed: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + }, + }, + }, + "identity_awareness": { + Type: schema.TypeBool, + Computed: true, + Description: "Identity awareness blade enabled.", + }, + "identity_awareness_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Gateway Identity Awareness settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "browser_based_authentication": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable Browser Based Authentication source.", + }, + "browser_based_authentication_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Browser Based Authentication settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Authentication Settings for Browser Based Authentication.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_method": { + Type: schema.TypeString, + Computed: true, + Description: "Authentication method.", + }, + "identity_provider": { + Type: schema.TypeSet, + Computed: true, + Description: "Identity provider object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"identity provider\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "radius": { + Type: schema.TypeString, + Computed: true, + Description: "Radius server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"radius\".", + }, + "users_directories": { + Type: schema.TypeList, + Computed: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "External user profile.", + }, + "internal_users": { + Type: schema.TypeBool, + Computed: true, + Description: "Internal users.", + }, + "users_from_external_directories": { + Type: schema.TypeString, + Computed: true, + Description: "Users from external directories.", + }, + "specific": { + Type: schema.TypeSet, + Computed: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "browser_based_authentication_portal_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Browser Based Authentication portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "portal_web_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Computed: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Computed: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Computed: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Computed: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_agent": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable Identity Agent source.", + }, + "identity_agent_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity Agent settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agents_interval_keepalive": { + Type: schema.TypeInt, + Computed: true, + Description: "Agents send keepalive period (minutes).", + }, + "user_reauthenticate_interval": { + Type: schema.TypeInt, + Computed: true, + Description: "Agent reauthenticate time interval (minutes).", + }, + "authentication_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Authentication Settings for Identity Agent.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_method": { + Type: schema.TypeString, + Computed: true, + Description: "Authentication method.", + }, + "radius": { + Type: schema.TypeString, + Computed: true, + Description: "Radius server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"radius\".", + }, + "users_directories": { + Type: schema.TypeList, + Computed: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "External user profile.", + }, + "internal_users": { + Type: schema.TypeBool, + Computed: true, + Description: "Internal users.", + }, + "users_from_external_directories": { + Type: schema.TypeString, + Computed: true, + Description: "Users from external directories.", + }, + "specific": { + Type: schema.TypeSet, + Computed: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_agent_portal_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity Agent accessibility settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_collector": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable Identity Collector source.", + }, + "identity_collector_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity Collector settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authorized_clients": { + Type: schema.TypeList, + Computed: true, + Description: "Authorized Clients.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "client": { + Type: schema.TypeString, + Computed: true, + Description: "Host / Network Group Name or UID.", + }, + "client_secret": { + Type: schema.TypeString, + Computed: true, + Description: "Client Secret.", + }, + }, + }, + }, + "authentication_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Authentication Settings for Identity Collector.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "users_directories": { + Type: schema.TypeList, + Computed: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Computed: true, + Description: "External user profile.", + }, + "internal_users": { + Type: schema.TypeBool, + Computed: true, + Description: "Internal users.", + }, + "users_from_external_directories": { + Type: schema.TypeString, + Computed: true, + Description: "Users from external directories.", + }, + "specific": { + Type: schema.TypeSet, + Computed: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "client_access_permissions": { + Type: schema.TypeList, + Computed: true, + Description: "Identity Collector accessibility settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_sharing_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity sharing settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "share_with_other_gateways": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable identity sharing with other gateways.", + }, + "receive_from_other_gateways": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable receiving identity from other gateways.", + }, + "receive_from": { + Type: schema.TypeSet, + Computed: true, + Description: "Gateway(s) to receive identity from.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "proxy_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Identity-Awareness Proxy settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "detect_using_x_forward_for": { + Type: schema.TypeBool, + Computed: true, + Description: "Whether to use X-Forward-For HTTP header, which is added by the proxy server to keep track of the original source IP.", + }, + }, + }, + }, + "remote_access": { + Type: schema.TypeBool, + Computed: true, + Description: "Enable Remote Access Identity source.", + }, + }, + }, + }, + "ips_update_policy": { + Type: schema.TypeString, + Computed: true, + Description: "Specifies whether the IPS will be downloaded from the Management or directly to the Gateway.", + }, + "nat_hide_internal_interfaces": { + Type: schema.TypeBool, + Computed: true, + Description: "Hide internal networks behind the Gateway's external IP.", + }, + "nat_settings": { + Type: schema.TypeMap, + Computed: true, + Description: "NAT settings.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "auto_rule": { + Type: schema.TypeBool, + Computed: true, + Description: "Whether to add automatic address translation rules.", + }, + "ipv4_address": { + Type: schema.TypeString, + Computed: true, + Description: "IPv4 address.", + }, + "ipv6_address": { + Type: schema.TypeString, + Computed: true, + Description: "IPv6 address.", + }, + "hide_behind": { + Type: schema.TypeString, + Computed: true, + Description: "Hide behind method. This parameter is forbidden in case \"method\" parameter is \"static\".", + }, + "install_on": { + Type: schema.TypeString, + Computed: true, + Description: "Which gateway should apply the NAT translation.", + }, + "method": { + Type: schema.TypeString, + Computed: true, + Description: "NAT translation method.", + }, + }, + }, + }, + "platform_portal_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Platform portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "portal_web_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Computed: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Computed: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Computed: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Computed: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "proxy_settings": { + Type: schema.TypeMap, + Computed: true, + Description: "Proxy Server for Gateway.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "use_custom_proxy": { + Type: schema.TypeBool, + Computed: true, + Description: "Use custom proxy settings for this network object.", + Default: false, + }, + "proxy_server": { + Type: schema.TypeString, + Computed: true, + Description: "N/A", + }, + "port": { + Type: schema.TypeInt, + Computed: true, + Description: "N/A", + Default: 80, + }, + }, + }, + }, + "qos": { + Type: schema.TypeBool, + Computed: true, + Description: "QoS.", + }, + "usercheck_portal_settings": { + Type: schema.TypeList, + Computed: true, + Description: "UserCheck portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Computed: true, + Description: "State of the web portal (enabled or disabled). The supported blades are: {'Application Control', 'URL Filtering', 'Data Loss Prevention', 'Anti Virus', 'Anti Bot', 'Threat Emulation', 'Threat Extraction', 'Data Awareness'}.", + }, + "portal_web_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Computed: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Computed: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Computed: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Computed: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Computed: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Computed: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Computed: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "zero_phishing": { + Type: schema.TypeBool, + Computed: true, + Description: "Zero Phishing blade enabled.", + }, + "zero_phishing_fqdn": { + Type: schema.TypeString, + Computed: true, + Description: "Zero Phishing gateway FQDN.", + }, "interfaces": { Type: schema.TypeList, Computed: true, @@ -905,6 +1871,458 @@ func dataSourceManagementSimpleGatewayRead(d *schema.ResourceData, m interface{} _ = d.Set("ipv6_address", v) } + if gateway["advanced-settings"] != nil { + + advancedSettingsMap, ok := gateway["advanced-settings"].(map[string]interface{}) + + if ok { + advancedSettingsMapToReturn := make(map[string]interface{}) + + if v := advancedSettingsMap["connection-persistence"]; v != nil { + advancedSettingsMapToReturn["connection_persistence"] = v + } + if v, ok := advancedSettingsMap["sam"]; ok { + + samMap, ok := v.(map[string]interface{}) + if ok { + samMapToReturn := make(map[string]interface{}) + + if v, _ := samMap["forward-to-other-sam-servers"]; v != nil { + samMapToReturn["forward_to_other_sam_servers"] = v + } + if v, _ := samMap["use-early-versions"]; v != nil { + samMapToReturn["use_early_versions"] = v + } + if v, _ := samMap["purge-sam-file"]; v != nil { + samMapToReturn["purge_sam_file"] = v + } + advancedSettingsMapToReturn["sam"] = []interface{}{samMapToReturn} + } + } + _ = d.Set("advanced_settings", []interface{}{advancedSettingsMapToReturn}) + + } + } else { + _ = d.Set("advanced_settings", nil) + } + + if v := gateway["enable-https-inspection"]; v != nil { + _ = d.Set("enable_https_inspection", v) + } + + if gateway["fetch-policy"] != nil { + fetchPolicyJson, ok := gateway["fetch-policy"].([]interface{}) + if ok { + fetchPolicyIds := make([]string, 0) + if len(fetchPolicyJson) > 0 { + for _, fetch_policy := range fetchPolicyJson { + fetch_policy := fetch_policy.(map[string]interface{}) + fetchPolicyIds = append(fetchPolicyIds, fetch_policy["name"].(string)) + } + } + _ = d.Set("fetch_policy", fetchPolicyIds) + } + } else { + _ = d.Set("fetch_policy", nil) + } + + if v := gateway["hit-count"]; v != nil { + _ = d.Set("hit_count", v) + } + + if gateway["https-inspection"] != nil { + + httpsInspectionMap, ok := gateway["https-inspection"].(map[string]interface{}) + + if ok { + httpsInspectionMapToReturn := make(map[string]interface{}) + + if v, ok := httpsInspectionMap["bypass-on-failure"]; ok { + + bypassOnFailureMap, ok := v.(map[string]interface{}) + if ok { + bypassOnFailureMapToReturn := make(map[string]interface{}) + + if v, _ := bypassOnFailureMap["override-profile"]; v != nil { + bypassOnFailureMapToReturn["override_profile"] = v + } + if v, _ := bypassOnFailureMap["value"]; v != nil { + bypassOnFailureMapToReturn["value"] = v + } + httpsInspectionMapToReturn["bypass_on_failure"] = []interface{}{bypassOnFailureMapToReturn} + } + } + if v, ok := httpsInspectionMap["site-categorization-allow-mode"]; ok { + + siteCategorizationAllowModeMap, ok := v.(map[string]interface{}) + if ok { + siteCategorizationAllowModeMapToReturn := make(map[string]interface{}) + + if v, _ := siteCategorizationAllowModeMap["override-profile"]; v != nil { + siteCategorizationAllowModeMapToReturn["override_profile"] = v + } + if v, _ := siteCategorizationAllowModeMap["value"]; v != nil { + siteCategorizationAllowModeMapToReturn["value"] = v + } + httpsInspectionMapToReturn["site_categorization_allow_mode"] = []interface{}{siteCategorizationAllowModeMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-untrusted-server-cert"]; ok { + + denyUntrustedServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyUntrustedServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyUntrustedServerCertMap["override-profile"]; v != nil { + denyUntrustedServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyUntrustedServerCertMap["value"]; v != nil { + denyUntrustedServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_untrusted_server_cert"] = []interface{}{denyUntrustedServerCertMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-revoked-server-cert"]; ok { + + denyRevokedServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyRevokedServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyRevokedServerCertMap["override-profile"]; v != nil { + denyRevokedServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyRevokedServerCertMap["value"]; v != nil { + denyRevokedServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_revoked_server_cert"] = []interface{}{denyRevokedServerCertMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-expired-server-cert"]; ok { + + denyExpiredServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyExpiredServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyExpiredServerCertMap["override-profile"]; v != nil { + denyExpiredServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyExpiredServerCertMap["value"]; v != nil { + denyExpiredServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_expired_server_cert"] = []interface{}{denyExpiredServerCertMapToReturn} + } + } + _ = d.Set("https_inspection", []interface{}{httpsInspectionMapToReturn}) + + } + } else { + _ = d.Set("https_inspection", nil) + } + + if v := gateway["identity-awareness"]; v != nil { + _ = d.Set("identity_awareness", v) + } + + if gateway["identity-awareness-settings"] != nil { + + identityAwarenessSettingsMap, ok := gateway["identity-awareness-settings"].(map[string]interface{}) + + if ok { + identityAwarenessSettingsMapToReturn := make(map[string]interface{}) + + if v := identityAwarenessSettingsMap["browser-based-authentication"]; v != nil { + identityAwarenessSettingsMapToReturn["browser_based_authentication"] = v + } + if v, ok := identityAwarenessSettingsMap["browser-based-authentication-settings"]; ok { + + browserBasedAuthenticationSettingsMap, ok := v.(map[string]interface{}) + if ok { + browserBasedAuthenticationSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := browserBasedAuthenticationSettingsMap["authentication-settings"]; v != nil { + browserBasedAuthenticationSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := browserBasedAuthenticationSettingsMap["browser-based-authentication-portal-settings"]; v != nil { + browserBasedAuthenticationSettingsMapToReturn["browser_based_authentication_portal_settings"] = v + } + identityAwarenessSettingsMapToReturn["browser_based_authentication_settings"] = []interface{}{browserBasedAuthenticationSettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["identity-agent"]; v != nil { + identityAwarenessSettingsMapToReturn["identity_agent"] = v + } + if v, ok := identityAwarenessSettingsMap["identity-agent-settings"]; ok { + + identityAgentSettingsMap, ok := v.(map[string]interface{}) + if ok { + identityAgentSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identityAgentSettingsMap["agents-interval-keepalive"]; v != nil { + identityAgentSettingsMapToReturn["agents_interval_keepalive"] = v + } + if v, _ := identityAgentSettingsMap["user-reauthenticate-interval"]; v != nil { + identityAgentSettingsMapToReturn["user_reauthenticate_interval"] = v + } + if v, _ := identityAgentSettingsMap["authentication-settings"]; v != nil { + identityAgentSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := identityAgentSettingsMap["identity-agent-portal-settings"]; v != nil { + identityAgentSettingsMapToReturn["identity_agent_portal_settings"] = v + } + identityAwarenessSettingsMapToReturn["identity_agent_settings"] = []interface{}{identityAgentSettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["identity-collector"]; v != nil { + identityAwarenessSettingsMapToReturn["identity_collector"] = v + } + if v, ok := identityAwarenessSettingsMap["identity-collector-settings"]; ok { + + identityCollectorSettingsMap, ok := v.(map[string]interface{}) + if ok { + identityCollectorSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identityCollectorSettingsMap["authorized-clients"]; v != nil { + identityCollectorSettingsMapToReturn["authorized_clients"] = v + } + if v, _ := identityCollectorSettingsMap["authentication-settings"]; v != nil { + identityCollectorSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := identityCollectorSettingsMap["client-access-permissions"]; v != nil { + identityCollectorSettingsMapToReturn["client_access_permissions"] = v + } + identityAwarenessSettingsMapToReturn["identity_collector_settings"] = []interface{}{identityCollectorSettingsMapToReturn} + } + } + if v, ok := identityAwarenessSettingsMap["identity-sharing-settings"]; ok { + + identitySharingSettingsMap, ok := v.(map[string]interface{}) + if ok { + identitySharingSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identitySharingSettingsMap["share-with-other-gateways"]; v != nil { + identitySharingSettingsMapToReturn["share_with_other_gateways"] = v + } + if v, _ := identitySharingSettingsMap["receive-from-other-gateways"]; v != nil { + identitySharingSettingsMapToReturn["receive_from_other_gateways"] = v + } + if v, _ := identitySharingSettingsMap["receive-from"]; v != nil { + identitySharingSettingsMapToReturn["receive_from"] = v + } + identityAwarenessSettingsMapToReturn["identity_sharing_settings"] = []interface{}{identitySharingSettingsMapToReturn} + } + } + if v, ok := identityAwarenessSettingsMap["proxy-settings"]; ok { + + proxySettingsMap, ok := v.(map[string]interface{}) + if ok { + proxySettingsMapToReturn := make(map[string]interface{}) + + if v, _ := proxySettingsMap["detect-using-x-forward-for"]; v != nil { + proxySettingsMapToReturn["detect_using_x_forward_for"] = v + } + identityAwarenessSettingsMapToReturn["proxy_settings"] = []interface{}{proxySettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["remote-access"]; v != nil { + identityAwarenessSettingsMapToReturn["remote_access"] = v + } + _ = d.Set("identity_awareness_settings", []interface{}{identityAwarenessSettingsMapToReturn}) + + } + } else { + _ = d.Set("identity_awareness_settings", nil) + } + + if v := gateway["ips-update-policy"]; v != nil { + _ = d.Set("ips_update_policy", v) + } + + if v := gateway["nat-hide-internal-interfaces"]; v != nil { + _ = d.Set("nat_hide_internal_interfaces", v) + } + + if gateway["nat-settings"] != nil { + + natSettingsMap := gateway["nat-settings"].(map[string]interface{}) + + natSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := natSettingsMap["auto-rule"]; v != nil { + natSettingsMapToReturn["auto_rule"] = strconv.FormatBool(v.(bool)) + } + if v, _ := natSettingsMap["ipv4-address"]; v != nil && v != "" { + natSettingsMapToReturn["ipv4_address"] = v + } + if v, _ := natSettingsMap["ipv6-address"]; v != nil && v != "" { + natSettingsMapToReturn["ipv6_address"] = v + } + if v, _ := natSettingsMap["hide-behind"]; v != nil { + natSettingsMapToReturn["hide_behind"] = v + } + if v, _ := natSettingsMap["install-on"]; v != nil { + natSettingsMapToReturn["install_on"] = v + } + if v, _ := natSettingsMap["method"]; v != nil { + natSettingsMapToReturn["method"] = v + } + _ = d.Set("nat_settings", natSettingsMapToReturn) + } else { + _ = d.Set("nat_settings", nil) + } + + if gateway["platform-portal-settings"] != nil { + + platformPortalSettingsMap, ok := gateway["platform-portal-settings"].(map[string]interface{}) + + if ok { + platformPortalSettingsMapToReturn := make(map[string]interface{}) + + if v, ok := platformPortalSettingsMap["portal-web-settings"]; ok { + + portalWebSettingsMap, ok := v.(map[string]interface{}) + if ok { + portalWebSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := portalWebSettingsMap["aliases"]; v != nil { + portalWebSettingsMapToReturn["aliases"] = v + } + if v, _ := portalWebSettingsMap["main-url"]; v != nil { + portalWebSettingsMapToReturn["main_url"] = v + } + platformPortalSettingsMapToReturn["portal_web_settings"] = []interface{}{portalWebSettingsMapToReturn} + } + } + if v, ok := platformPortalSettingsMap["certificate-settings"]; ok { + + certificateSettingsMap, ok := v.(map[string]interface{}) + if ok { + certificateSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := certificateSettingsMap["base64-certificate"]; v != nil { + certificateSettingsMapToReturn["base64_certificate"] = v + } + if v, _ := certificateSettingsMap["base64-password"]; v != nil { + certificateSettingsMapToReturn["base64_password"] = v + } + platformPortalSettingsMapToReturn["certificate_settings"] = []interface{}{certificateSettingsMapToReturn} + } + } + if v, ok := platformPortalSettingsMap["accessibility"]; ok { + + accessibilityMap, ok := v.(map[string]interface{}) + if ok { + accessibilityMapToReturn := make(map[string]interface{}) + + if v, _ := accessibilityMap["allow-access-from"]; v != nil { + accessibilityMapToReturn["allow_access_from"] = v + } + if v, _ := accessibilityMap["internal-access-settings"]; v != nil { + accessibilityMapToReturn["internal_access_settings"] = v + } + platformPortalSettingsMapToReturn["accessibility"] = []interface{}{accessibilityMapToReturn} + } + } + _ = d.Set("platform_portal_settings", []interface{}{platformPortalSettingsMapToReturn}) + + } + } else { + _ = d.Set("platform_portal_settings", nil) + } + + if gateway["proxy-settings"] != nil { + + proxySettingsMap := gateway["proxy-settings"].(map[string]interface{}) + + proxySettingsMapToReturn := make(map[string]interface{}) + + if v, _ := proxySettingsMap["use-custom-proxy"]; v != nil { + proxySettingsMapToReturn["use_custom_proxy"] = strconv.FormatBool(v.(bool)) + } + if v, _ := proxySettingsMap["proxy-server"]; v != nil { + proxySettingsMapToReturn["proxy_server"] = v + } + if v, _ := proxySettingsMap["port"]; v != nil { + proxySettingsMapToReturn["port"] = v + } + _ = d.Set("proxy_settings", proxySettingsMapToReturn) + } else { + _ = d.Set("proxy_settings", nil) + } + + if v := gateway["qos"]; v != nil { + _ = d.Set("qos", v) + } + + if gateway["usercheck-portal-settings"] != nil { + + usercheckPortalSettingsMap, ok := gateway["usercheck-portal-settings"].(map[string]interface{}) + + if ok { + usercheckPortalSettingsMapToReturn := make(map[string]interface{}) + + if v := usercheckPortalSettingsMap["enabled"]; v != nil { + usercheckPortalSettingsMapToReturn["enabled"] = v + } + if v, ok := usercheckPortalSettingsMap["portal-web-settings"]; ok { + + portalWebSettingsMap, ok := v.(map[string]interface{}) + if ok { + portalWebSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := portalWebSettingsMap["aliases"]; v != nil { + portalWebSettingsMapToReturn["aliases"] = v + } + if v, _ := portalWebSettingsMap["main-url"]; v != nil { + portalWebSettingsMapToReturn["main_url"] = v + } + usercheckPortalSettingsMapToReturn["portal_web_settings"] = []interface{}{portalWebSettingsMapToReturn} + } + } + if v, ok := usercheckPortalSettingsMap["certificate-settings"]; ok { + + certificateSettingsMap, ok := v.(map[string]interface{}) + if ok { + certificateSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := certificateSettingsMap["base64-certificate"]; v != nil { + certificateSettingsMapToReturn["base64_certificate"] = v + } + if v, _ := certificateSettingsMap["base64-password"]; v != nil { + certificateSettingsMapToReturn["base64_password"] = v + } + usercheckPortalSettingsMapToReturn["certificate_settings"] = []interface{}{certificateSettingsMapToReturn} + } + } + if v, ok := usercheckPortalSettingsMap["accessibility"]; ok { + + accessibilityMap, ok := v.(map[string]interface{}) + if ok { + accessibilityMapToReturn := make(map[string]interface{}) + + if v, _ := accessibilityMap["allow-access-from"]; v != nil { + accessibilityMapToReturn["allow_access_from"] = v + } + if v, _ := accessibilityMap["internal-access-settings"]; v != nil { + accessibilityMapToReturn["internal_access_settings"] = v + } + usercheckPortalSettingsMapToReturn["accessibility"] = []interface{}{accessibilityMapToReturn} + } + } + _ = d.Set("usercheck_portal_settings", []interface{}{usercheckPortalSettingsMapToReturn}) + + } + } else { + _ = d.Set("usercheck_portal_settings", nil) + } + + if v := gateway["zero-phishing"]; v != nil { + _ = d.Set("zero_phishing", v) + } + + if v := gateway["zero-phishing-fqdn"]; v != nil { + _ = d.Set("zero_phishing_fqdn", v) + } + if v := gateway["interfaces"]; v != nil { interfacesList := v.([]interface{}) if len(interfacesList) > 0 { diff --git a/checkpoint/data_source_checkpoint_management_tacacs_group_test.go b/checkpoint/data_source_checkpoint_management_tacacs_group_test.go new file mode 100644 index 00000000..ddcb8736 --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_tacacs_group_test.go @@ -0,0 +1,58 @@ +package checkpoint + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "os" + "testing" +) + +func TestAccDataSourceCheckpointManagementTacacsGroup_basic(t *testing.T) { + + objName := "tfTestManagementDataTacacsGroup_" + acctest.RandString(6) + resourceName := "checkpoint_management_tacacs_group.tacacs_group" + dataSourceName := "data.checkpoint_management_tacacs_group.data_tacacs_group" + + context := os.Getenv("CHECKPOINT_CONTEXT") + if context != "web_api" { + t.Skip("Skipping management test") + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceManagementTacacsGroupConfig(objName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), + ), + }, + }, + }) + +} + +func testAccDataSourceManagementTacacsGroupConfig(name string) string { + return fmt.Sprintf(` +resource "checkpoint_management_host" "t_host" { + name = "tacacs_host" + ipv4_address = "212.122.122.212" +} + +resource "checkpoint_management_tacacs_server" "tacacs_server" { + name = "tacacs_example" + server = "${checkpoint_management_host.t_host.name}" +} + +resource "checkpoint_management_tacacs_group" "tacacs_group" { + name = "%s" + members = ["${checkpoint_management_tacacs_server.tacacs_server.name}"] +} + +data "checkpoint_management_tacacs_group" "data_tacacs_group" { + name = "${checkpoint_management_tacacs_group.tacacs_group.name}" +} +`, name) +} diff --git a/checkpoint/data_source_checkpoint_management_tacacs_server.go b/checkpoint/data_source_checkpoint_management_tacacs_server.go new file mode 100644 index 00000000..f0b28006 --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_tacacs_server.go @@ -0,0 +1,187 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "log" +) + +func dataSourceManagementTacacsServer() *schema.Resource { + return &schema.Resource{ + Read: dataSourceManagementTacacsServerRead, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Optional: true, + Description: "Object name.", + }, + "uid": { + Type: schema.TypeString, + Optional: true, + Description: "Object unique identifier.", + }, + "encryption": { + Type: schema.TypeBool, + Computed: true, + Description: "Is there a secret key defined on the server. Must be set true when \"server-type\" was selected to be \"TACACS+\".", + }, + "groups": { + Type: schema.TypeSet, + Computed: true, + Description: "Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "priority": { + Type: schema.TypeInt, + Computed: true, + Description: "The priority of the TACACS Server in case it is a member of a TACACS Group.", + }, + "server": { + Type: schema.TypeMap, + Computed: true, + Description: "The UID or Name of the host that is the TACACS Server.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Object name. Must be unique in the domain.", + }, + "uid": { + Type: schema.TypeString, + Computed: true, + Description: "Object unique identifier.", + }, + }, + }, + }, + "server_type": { + Type: schema.TypeString, + Computed: true, + Description: "Server type, TACACS or TACACS+.", + }, + "service": { + Type: schema.TypeMap, + Computed: true, + Description: "Server service, only relevant when \"server-type\" is TACACS.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Object name. Must be unique in the domain.", + }, + "uid": { + Type: schema.TypeString, + Computed: true, + Description: "Object unique identifier.", + }, + }, + }, + }, + }, + } +} + +func dataSourceManagementTacacsServerRead(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + name := d.Get("name").(string) + uid := d.Get("uid").(string) + + payload := make(map[string]interface{}) + + if name != "" { + payload["name"] = name + } else if uid != "" { + payload["uid"] = uid + } + + showTacacsServerRes, err := client.ApiCall("show-tacacs-server", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showTacacsServerRes.Success { + return fmt.Errorf(showTacacsServerRes.ErrorMsg) + } + + tacacsServer := showTacacsServerRes.GetData() + + log.Println("Read Tacacs Server - Show JSON = ", tacacsServer) + + if v := tacacsServer["uid"]; v != nil { + _ = d.Set("uid", v) + d.SetId(v.(string)) + } + + if v := tacacsServer["name"]; v != nil { + _ = d.Set("name", v) + } + + if v := tacacsServer["encryption"]; v != nil { + _ = d.Set("encryption", v) + } + + if tacacsServer["groups"] != nil { + groupsJson := tacacsServer["groups"].([]interface{}) + groupsIds := make([]string, 0) + if len(groupsJson) > 0 { + // Create slice of group names + for _, group := range groupsJson { + group := group.(map[string]interface{}) + groupsIds = append(groupsIds, group["name"].(string)) + } + } + _ = d.Set("groups", groupsIds) + } else { + _ = d.Set("groups", nil) + } + + if v := tacacsServer["priority"]; v != nil { + _ = d.Set("priority", v) + } + + if tacacsServer["server"] != nil { + serverMap := tacacsServer["server"].(map[string]interface{}) + + serverMapToReturn := make(map[string]interface{}) + + if v, _ := serverMap["name"]; v != nil { + serverMapToReturn["name"] = v + } + if v, _ := serverMap["uid"]; v != nil { + serverMapToReturn["uid"] = v + } + + _ = d.Set("server", serverMapToReturn) + } else { + _ = d.Set("server", nil) + } + + if v := tacacsServer["server-type"]; v != nil { + _ = d.Set("server_type", v) + } + + if tacacsServer["service"] != nil { + serviceMap := tacacsServer["service"].(map[string]interface{}) + log.Println("service detected!!!") + serviceMapToReturn := make(map[string]interface{}) + + if v, _ := serviceMap["name"]; v != nil { + serviceMapToReturn["name"] = v + } + if v, _ := serviceMap["uid"]; v != nil { + serviceMapToReturn["uid"] = v + } + + _ = d.Set("service", serviceMapToReturn) + + } else { + _ = d.Set("service", nil) + } + + return nil +} diff --git a/checkpoint/data_source_checkpoint_management_tacacs_server_test.go b/checkpoint/data_source_checkpoint_management_tacacs_server_test.go new file mode 100644 index 00000000..cc4160c2 --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_tacacs_server_test.go @@ -0,0 +1,48 @@ +package checkpoint + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "os" + "testing" +) + +func TestAccDataSourceCheckpointManagementTacacsServer_basic(t *testing.T) { + + objName := "tfTestManagementDataTacacsServer_" + acctest.RandString(6) + resourceName := "checkpoint_management_tacacs_server.tacacs_server" + dataSourceName := "data.checkpoint_management_tacacs_server.data_tacacs_server" + + context := os.Getenv("CHECKPOINT_CONTEXT") + if context != "web_api" { + t.Skip("Skipping management test") + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceManagementTacacsServerConfig(objName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), + ), + }, + }, + }) + +} + +func testAccDataSourceManagementTacacsServerConfig(name string) string { + return fmt.Sprintf(` +resource "checkpoint_management_tacacs_server" "tacacs_server" { + name = "%s" + server = "yoni" +} + +data "checkpoint_management_tacacs_server" "data_tacacs_server" { + name = "${checkpoint_management_tacacs_server.tacacs_server.name}" +} +`, name) +} diff --git a/checkpoint/data_source_checkpoint_management_tag.go b/checkpoint/data_source_checkpoint_management_tag.go index 10260474..2475547d 100644 --- a/checkpoint/data_source_checkpoint_management_tag.go +++ b/checkpoint/data_source_checkpoint_management_tag.go @@ -26,6 +26,14 @@ func dataSourceManagementTag() *schema.Resource { Computed: true, Description: "Color of the object. Should be one of existing colors", }, + "tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Collection of tag identifiers.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "comments": { Type: schema.TypeString, Computed: true, diff --git a/checkpoint/data_source_checkpoint_management_tag_test.go b/checkpoint/data_source_checkpoint_management_tag_test.go new file mode 100644 index 00000000..b642ee8e --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_tag_test.go @@ -0,0 +1,48 @@ +package checkpoint + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "os" + "testing" +) + +func TestAccDataSourceCheckpointManagementTag_basic(t *testing.T) { + + objName := "tfTestManagementDataAccessLayer_" + acctest.RandString(6) + resourceName := "checkpoint_management_tag.tag" + dataSourceName := "data.checkpoint_management_tag.data_tag" + + context := os.Getenv("CHECKPOINT_CONTEXT") + if context != "web_api" { + t.Skip("Skipping management test") + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceManagementTagConfig(objName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), + ), + }, + }, + }) + +} + +func testAccDataSourceManagementTagConfig(name string) string { + return fmt.Sprintf(` +resource "checkpoint_management_tag" "tag" { + name = "%s" + tags = ["tag1", "tag2"] +} + +data "checkpoint_management_tag" "data_tag" { + name = "${checkpoint_management_tag.tag.name}" +} +`, name) +} diff --git a/checkpoint/data_source_checkpoint_management_threat_layer.go b/checkpoint/data_source_checkpoint_management_threat_layer.go index 05984344..0eb2ad69 100644 --- a/checkpoint/data_source_checkpoint_management_threat_layer.go +++ b/checkpoint/data_source_checkpoint_management_threat_layer.go @@ -39,6 +39,16 @@ func dataSourceManagementThreatLayer() *schema.Resource { Computed: true, Description: "Comments string.", }, + "ips_layer": { + Type: schema.TypeBool, + Computed: true, + Description: "N/A", + }, + "parent_layer": { + Type: schema.TypeString, + Computed: true, + Description: "N/A", + }, }, } } @@ -101,5 +111,13 @@ func dataSourceManagementThreatLayerRead(d *schema.ResourceData, m interface{}) _ = d.Set("comments", v) } + if v := threatLayer["ips-layer"]; v != nil { + _ = d.Set("ips_layer", v) + } + + if v := threatLayer["parent-layer"]; v != nil { + _ = d.Set("parent_layer", v) + } + return nil } diff --git a/checkpoint/data_source_checkpoint_management_threat_layer_test.go b/checkpoint/data_source_checkpoint_management_threat_layer_test.go new file mode 100644 index 00000000..f9e0ec66 --- /dev/null +++ b/checkpoint/data_source_checkpoint_management_threat_layer_test.go @@ -0,0 +1,48 @@ +package checkpoint + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "os" + "testing" +) + +func TestAccDataSourceCheckpointManagementThreatLayer_basic(t *testing.T) { + + objName := "tfTestManagementDataThreatLayer_" + acctest.RandString(6) + resourceName := "checkpoint_management_threat_layer.threat_layer" + dataSourceName := "data.checkpoint_management_threat_layer.data_threat_layer" + + context := os.Getenv("CHECKPOINT_CONTEXT") + if context != "web_api" { + t.Skip("Skipping management test") + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceManagementThreatLayerConfig(objName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), + ), + }, + }, + }) + +} + +func testAccDataSourceManagementThreatLayerConfig(name string) string { + return fmt.Sprintf(` +resource "checkpoint_management_threat_layer" "threat_layer" { + name = "%s" + color = "blue" +} + +data "checkpoint_management_threat_layer" "data_threat_layer" { + name = "${checkpoint_management_threat_layer.threat_layer.name}" +} +`, name) +} diff --git a/checkpoint/provider.go b/checkpoint/provider.go index 4ad2c717..d9dfd003 100644 --- a/checkpoint/provider.go +++ b/checkpoint/provider.go @@ -85,6 +85,12 @@ func Provider() terraform.ResourceProvider { DefaultFunc: schema.EnvDefaultFunc("CHECKPOINT_SESSION_NAME", ""), Description: "Session unique name.", }, + "session_description": { + Type: schema.TypeString, + Optional: true, + DefaultFunc: schema.EnvDefaultFunc("CHECKPOINT_SESSION_DESCRIPTION", ""), + Description: "A description of the session's purpose.", + }, "cloud_mgmt_id": { Type: schema.TypeString, Optional: true, @@ -251,6 +257,10 @@ func Provider() terraform.ResourceProvider { "checkpoint_management_command_export_smart_task": resourceManagementExportSmartTask(), "checkpoint_management_command_import_management": resourceManagementImportManagement(), "checkpoint_management_command_set_global_properties": resourceManagementSetGlobalProperties(), + "checkpoint_management_administrator": resourceManagementAdministrator(), + "checkpoint_management_oracle_cloud_data_center_server": resourceManagementOracleCloudDataCenterServer(), + "checkpoint_management_nutanix_data_center_server": resourceManagementNutanixDataCenterServer(), + "checkpoint_management_azure_ad": resourceManagementAzureAd(), }, DataSourcesMap: map[string]*schema.Resource{ "checkpoint_management_data_host": dataSourceManagementHost(), @@ -361,6 +371,12 @@ func Provider() terraform.ResourceProvider { "checkpoint_management_lsv_profile": dataSourceManagementLsvProfile(), "checkpoint_management_ips_protection_extended_attribute": dataSourceManagementIpsProtectionExtendedAttribute(), "checkpoint_management_global_domain": dataSourceManagementGlobalDomain(), + "checkpoint_management_tacacs_server": dataSourceManagementTacacsServer(), + "checkpoint_management_administrator": dataSourceManagementAdministrator(), + "checkpoint_management_nutanix_data_center_server": dataSourceManagementNutanixDataCenterServer(), + "checkpoint_management_oracle_cloud_data_center_server": dataSourceManagementOracleCloudDataCenterServer(), + "checkpoint_management_azure_ad_content": dataSourceManagementAzureAdContent(), + "checkpoint_management_azure_ad": dataSourceManagementAzureAd(), }, ConfigureFunc: providerConfigure, } @@ -380,6 +396,7 @@ func providerConfigure(data *schema.ResourceData) (interface{}, error) { proxyPort := data.Get("proxy_port").(int) apiKey := data.Get("api_key").(string) sessionName := data.Get("session_name").(string) + sessionDescription := data.Get("session_description").(string) cloudMgmtId := data.Get("cloud_mgmt_id").(string) if server == "" || ((username == "" || password == "") && apiKey == "") { @@ -418,7 +435,7 @@ func providerConfigure(data *schema.ResourceData) (interface{}, error) { mgmt := checkpoint.APIClient(args) if ok := CheckSession(mgmt, s.Uid); !ok { // session is not valid, need to perform login - s, err = login(mgmt, username, password, apiKey, domain, sessionName) + s, err = login(mgmt, username, password, apiKey, domain, sessionName, sessionDescription) if err != nil { log.Println("Failed to perform login") return nil, err @@ -431,7 +448,7 @@ func providerConfigure(data *schema.ResourceData) (interface{}, error) { return mgmt, nil case checkpoint.GaiaContext: gaia := checkpoint.APIClient(args) - _, err := login(gaia, username, password, "", "", "") + _, err := login(gaia, username, password, "", "", "", "") if err != nil { log.Println("Failed to perform login") return nil, err @@ -442,7 +459,7 @@ func providerConfigure(data *schema.ResourceData) (interface{}, error) { } } -func login(client *checkpoint.ApiClient, username string, pwd string, apiKey string, domain string, sessionName string) (Session, error) { +func login(client *checkpoint.ApiClient, username string, pwd string, apiKey string, domain string, sessionName string, sessionDescription string) (Session, error) { log.Printf("Perform login") var loginRes checkpoint.APIResponse var err error @@ -452,6 +469,10 @@ func login(client *checkpoint.ApiClient, username string, pwd string, apiKey str payload["session-name"] = sessionName } + if sessionDescription != "" { + payload["session-description"] = sessionDescription + } + if apiKey != "" { loginRes, err = client.ApiLoginWithApiKey(apiKey, false, domain, false, payload) } else { diff --git a/checkpoint/resource_checkpoint_management_administrator.go b/checkpoint/resource_checkpoint_management_administrator.go new file mode 100644 index 00000000..3df2b1b8 --- /dev/null +++ b/checkpoint/resource_checkpoint_management_administrator.go @@ -0,0 +1,504 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "log" +) + +func resourceManagementAdministrator() *schema.Resource { + return &schema.Resource{ + Create: createManagementAdministrator, + Read: readManagementAdministrator, + Update: updateManagementAdministrator, + Delete: deleteManagementAdministrator, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Object name. Should be unique in the domain.", + }, + "authentication_method": { + Type: schema.TypeString, + Optional: true, + Description: "Authentication method.", + Default: "check point password", + }, + "email": { + Type: schema.TypeString, + Optional: true, + Description: "Administrator email.", + }, + "expiration_date": { + Type: schema.TypeString, + Optional: true, + Description: "Format: YYYY-MM-DD, YYYY-mm-ddThh:mm:ss.", + }, + "multi_domain_profile": { + Type: schema.TypeString, + Optional: true, + Description: "Administrator multi-domain profile.", + }, + "must_change_password": { + Type: schema.TypeBool, + Optional: true, + Description: "True if administrator must change password on the next login.", + Default: true, + }, + "password": { + Type: schema.TypeString, + Optional: true, + Sensitive: true, + Description: "Administrator password.", + }, + "password_hash": { + Type: schema.TypeString, + Optional: true, + Sensitive: true, + Description: "Administrator password hash.", + }, + "permissions_profile": { + Type: schema.TypeList, + Optional: true, + Description: "Administrator permissions profile. Permissions profile should not be provided when multi-domain-profile is set to \"Multi-Domain Super User\" or \"Domain Super User\".", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "domain": { + Type: schema.TypeString, + Required: true, + }, + "profile": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "phone_number": { + Type: schema.TypeString, + Optional: true, + Description: "Administrator phone number.", + }, + "radius_server": { + Type: schema.TypeString, + Optional: true, + Description: "RADIUS server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"RADIUS\".", + }, + "tacacs_server": { + Type: schema.TypeString, + Optional: true, + Description: "TACACS server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"TACACS\".", + }, + "tags": { + Type: schema.TypeSet, + Optional: true, + Description: "Collection of tag identifiers.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "color": { + Type: schema.TypeString, + Optional: true, + Description: "Color of the object. Should be one of existing colors.", + Default: "black", + }, + "comments": { + Type: schema.TypeString, + Optional: true, + Description: "Comments string.", + }, + "ignore_warnings": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Apply changes ignoring warnings.\nApply changes ignoring warnings.", + }, + "ignore_errors": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored.", + }, + "sic_name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of the Secure Internal Connection Trust.", + }, + }, + } +} + +func createManagementAdministrator(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + administrator := make(map[string]interface{}) + + if v, ok := d.GetOk("name"); ok { + administrator["name"] = v.(string) + } + + if v, ok := d.GetOk("authentication_method"); ok { + administrator["authentication-method"] = v.(string) + } + + if v, ok := d.GetOk("email"); ok { + administrator["email"] = v.(string) + } + + if v, ok := d.GetOk("expiration_date"); ok { + administrator["expiration-date"] = v.(string) + } + + if v, ok := d.GetOk("multi_domain_profile"); ok { + administrator["multi-domain-profile"] = v.(string) + } + + if v, ok := d.GetOkExists("must_change_password"); ok { + administrator["must-change-password"] = v.(bool) + } + + if v, ok := d.GetOk("password"); ok { + administrator["password"] = v.(string) + } + + if v, ok := d.GetOk("password_hash"); ok { + administrator["password-hash"] = v.(string) + } + + if v, ok := d.GetOk("permissions_profile"); ok { + permissionsProfileList := v.([]interface{}) + + if v, _ := d.GetOk("permissions_profile.0.domain"); v.(string) == "SMC User" { + if len(permissionsProfileList) == 1 { + + if v, ok := d.GetOk("permissions_profile.0.profile"); ok { + administrator["permissions-profile"] = v.(string) + } + + } + + } else { + administrator["permissions-profile"] = permissionsProfileList + } + } + + if v, ok := d.GetOk("phone_number"); ok { + administrator["phone-number"] = v.(string) + } + + if v, ok := d.GetOk("radius_server"); ok { + administrator["radius-sever"] = v.(string) + } + + if v, ok := d.GetOk("tacacs_server"); ok { + administrator["tacacs-sever"] = v.(string) + } + + if v, ok := d.GetOk("tags"); ok { + administrator["tags"] = v.(*schema.Set).List() + } + + if v, ok := d.GetOk("color"); ok { + administrator["color"] = v.(string) + } + + if v, ok := d.GetOk("comments"); ok { + administrator["comments"] = v.(string) + } + + if v, ok := d.GetOkExists("ignore_warnings"); ok { + administrator["ignore-warnings"] = v.(bool) + } + + if v, ok := d.GetOkExists("ignore_errors"); ok { + administrator["ignore-errors"] = v.(bool) + } + + log.Println("Create Administrator - Map = ", administrator) + + addAdministratorRes, err := client.ApiCall("add-administrator", administrator, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil || !addAdministratorRes.Success { + if addAdministratorRes.ErrorMsg != "" { + return fmt.Errorf(addAdministratorRes.ErrorMsg) + } + return fmt.Errorf(err.Error()) + } + + d.SetId(addAdministratorRes.GetData()["uid"].(string)) + return readManagementAdministrator(d, m) +} + +func readManagementAdministrator(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + payload := map[string]interface{}{ + "uid": d.Id(), + } + + showAdministratorRes, err := client.ApiCall("show-administrator", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showAdministratorRes.Success { + // Handle delete resource from other clients + if objectNotFound(showAdministratorRes.GetData()["code"].(string)) { + d.SetId("") + return nil + } + return fmt.Errorf(showAdministratorRes.ErrorMsg) + } + + administrator := showAdministratorRes.GetData() + log.Println("Read Administrator - Show JSON = ", administrator) + + if v := administrator["name"]; v != nil { + _ = d.Set("name", v) + } + + if v := administrator["authentication-method"]; v != nil { + _ = d.Set("authentication_method", v) + } + + if v := administrator["email"]; v != nil { + _ = d.Set("email", v) + } + + if v := administrator["expiration-date"]; v != nil { + _ = d.Set("expiration_date", v) + } + + if administrator["multi-domain-profile"] != nil { + if multiDomainProfileMap, ok := administrator["multi-domain-profile"].(map[string]interface{}); ok { + if v, _ := multiDomainProfileMap["name"]; v != nil { + _ = d.Set("multi_domain_profile", v) + } + } + } + + if v := administrator["must-change-password"]; v != nil { + _ = d.Set("must_change_password", v) + } + + if v := administrator["password"]; v != nil { + _ = d.Set("password", v) + } + + if v := administrator["password-hash"]; v != nil { + _ = d.Set("password_hash", v) + } + + if v := administrator["must-change-password"]; v != nil { + _ = d.Set("must_change_password", v) + } + + if administrator["permissions-profile"] != nil { + var permissionsProfileListToReturn []map[string]interface{} + + if permissionsProfileList, ok := administrator["permissions-profile"].([]interface{}); ok { + + for i := range permissionsProfileList { + permissionsProfileMap := permissionsProfileList[i].(map[string]interface{}) + + permissionsProfileMapToAdd := make(map[string]interface{}) + + if profile, _ := permissionsProfileMap["profile"]; profile != nil { + if v, _ := profile.(map[string]interface{})["name"]; v != nil { + permissionsProfileMapToAdd["profile"] = v.(string) + } + } + if domain, _ := permissionsProfileMap["domain"]; domain != nil { + if v, _ := domain.(map[string]interface{})["name"]; v != nil { + permissionsProfileMapToAdd["domain"] = v.(string) + } + } + permissionsProfileListToReturn = append(permissionsProfileListToReturn, permissionsProfileMapToAdd) + } + + } else if v, ok := administrator["permissions-profile"].(map[string]interface{}); ok { + permissionsProfileListToReturn = []map[string]interface{}{ + { + "domain": "SMC User", + "profile": v["name"].(string), + }, + } + } + _ = d.Set("permissions_profile", permissionsProfileListToReturn) + + } + + if v := administrator["phone-number"]; v != nil { + _ = d.Set("phone_number", v) + } + + if v := administrator["radius-server"]; v != nil { + _ = d.Set("radius_server", v) + } + + if v := administrator["tacacs-server"]; v != nil { + _ = d.Set("tacacs_server", v) + } + + if administrator["tags"] != nil { + tagsJson := administrator["tags"].([]interface{}) + var tagsIds = make([]string, 0) + if len(tagsJson) > 0 { + // Create slice of tag names + for _, tag := range tagsJson { + tag := tag.(map[string]interface{}) + tagsIds = append(tagsIds, tag["name"].(string)) + } + } + _ = d.Set("tags", tagsIds) + } else { + _ = d.Set("tags", nil) + } + + if v := administrator["color"]; v != nil { + _ = d.Set("color", v) + } + + if v := administrator["comments"]; v != nil { + _ = d.Set("comments", v) + } + + if v := administrator["sic-name"]; v != nil { + _ = d.Set("sic_name", v) + } + + return nil +} + +func updateManagementAdministrator(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + administrator := make(map[string]interface{}) + + if d.HasChange("name") { + oldName, newName := d.GetChange("name") + administrator["name"] = oldName + administrator["new-name"] = newName + } else { + administrator["name"] = d.Get("name") + } + + if d.HasChange("authentication_method") { + administrator["authentication-method"] = d.Get("authentication_method") + } + + if d.HasChange("email") { + administrator["email"] = d.Get("email") + } + + if d.HasChange("expiration_date") { + administrator["expiration-date"] = d.Get("expiration_date") + } + + if d.HasChange("multi_domain_profile") { + administrator["multi-domain-profile"] = d.Get("multi_domain_profile") + } + + if d.HasChange("email") { + administrator["email"] = d.Get("email") + } + + if v, ok := d.GetOkExists("must_change_password"); ok { + administrator["must-change-password"] = v.(bool) + } + + if d.HasChange("password") { + administrator["password"] = d.Get("password") + } + + if d.HasChange("password_hash") { + administrator["password-hash"] = d.Get("password_hash") + } + + if d.HasChange("permissions_profile") { + + if v, ok := d.GetOk("permissions_profile"); ok { + permissionsProfileList := v.([]interface{}) + + if len(permissionsProfileList) == 1 { + if v, _ := d.GetOk("permissions_profile.0.domain"); v.(string) == "SMC User" { + + if v, ok := d.GetOk("permissions_profile.0.profile"); ok { + administrator["permissions-profile"] = v.(string) + } + } + + } else { + administrator["permissions-profile"] = permissionsProfileList + } + } + } + + if d.HasChange("phone_number") { + administrator["phone-number"] = d.Get("phone_number") + } + + if d.HasChange("radius_server") { + administrator["radius-server"] = d.Get("radius_server") + } + + if d.HasChange("tacacs_server") { + administrator["tacacs-server"] = d.Get("tacacs_server") + } + + if ok := d.HasChange("tags"); ok { + if v, ok := d.GetOk("tags"); ok { + administrator["tags"] = v.(*schema.Set).List() + } else { + oldTags, _ := d.GetChange("tags") + administrator["tags"] = map[string]interface{}{"remove": oldTags.(*schema.Set).List()} + } + } + + if d.HasChange("color") { + administrator["color"] = d.Get("color") + } + + if d.HasChange("comments") { + administrator["comments"] = d.Get("comments") + } + + if v, ok := d.GetOkExists("ignore_errors"); ok { + administrator["ignore-errors"] = v.(bool) + } + if v, ok := d.GetOkExists("ignore_warnings"); ok { + administrator["ignore-warnings"] = v.(bool) + } + + log.Println("Update Administrator - Map = ", administrator) + updateAdministratorRes, err := client.ApiCall("set-administrator", administrator, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil || !updateAdministratorRes.Success { + if updateAdministratorRes.ErrorMsg != "" { + return fmt.Errorf(updateAdministratorRes.ErrorMsg) + } + return fmt.Errorf(err.Error()) + } + + return readManagementAdministrator(d, m) +} + +func deleteManagementAdministrator(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + administratorPayload := map[string]interface{}{ + "uid": d.Id(), + } + + deleteAdministratorRes, err := client.ApiCall("delete-administrator", administratorPayload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil || !deleteAdministratorRes.Success { + if deleteAdministratorRes.ErrorMsg != "" { + return fmt.Errorf(deleteAdministratorRes.ErrorMsg) + } + return fmt.Errorf(err.Error()) + } + d.SetId("") + + return nil +} diff --git a/checkpoint/resource_checkpoint_management_azure_ad.go b/checkpoint/resource_checkpoint_management_azure_ad.go new file mode 100644 index 00000000..3678ca72 --- /dev/null +++ b/checkpoint/resource_checkpoint_management_azure_ad.go @@ -0,0 +1,370 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "log" +) + +func resourceManagementAzureAd() *schema.Resource { + return &schema.Resource{ + Create: createManagementAzureAd, + Read: readManagementAzureAd, + Update: updateManagementAzureAd, + Delete: deleteManagementAzureAd, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Object name.", + }, + "authentication_method": { + Type: schema.TypeString, + Required: true, + Description: "user-authentication uses the Azure AD User to authenticate. service-principal-authentication uses the Service Principal to authenticate.", + }, + "password": { + Type: schema.TypeString, + Required: true, + Sensitive: true, + Description: "Password of the Azure account. Required for authentication-method: user-authentication.", + }, + "username": { + Type: schema.TypeString, + Required: true, + Description: "An Azure Active Directory user Format @. Required for authentication-method: user-authentication", + }, + "application_id": { + Type: schema.TypeString, + Required: true, + Description: "The Application ID of the Service Principal, in UUID format. Required for authentication-method: service-principal-authentication.", + }, + "application_key": { + Type: schema.TypeString, + Required: true, + Description: "The key created for the Service Principal. Required for authentication-method: service-principal-authentication.", + }, + "directory_id": { + Type: schema.TypeString, + Required: true, + Description: "The Directory ID of the Azure AD, in UUID format. Required for authentication-method: service-principal-authentication.", + }, + "tags": { + Type: schema.TypeSet, + Optional: true, + Description: "Collection of tag identifiers.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "color": { + Type: schema.TypeString, + Optional: true, + Description: "Color of the object. Should be one of existing colors.", + Default: "black", + }, + "comments": { + Type: schema.TypeString, + Optional: true, + Description: "Comments string.", + }, + "ignore_warnings": { + Type: schema.TypeBool, + Optional: true, + Description: "Apply changes ignoring warnings.", + Default: false, + }, + "ignore_errors": { + Type: schema.TypeBool, + Optional: true, + Description: "Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored.", + Default: false, + }, + "task_id": { + Type: schema.TypeString, + Computed: true, + Description: "Azure AD Operation task-id, use show-task command to check the progress of the task.", + }, + }, + } +} + +func createManagementAzureAd(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + azureAd := make(map[string]interface{}) + + if v, ok := d.GetOk("name"); ok { + azureAd["name"] = v.(string) + } + + if v, ok := d.GetOk("authentication_method"); ok { + azureAd["authentication-method"] = v.(string) + } + + if v, ok := d.GetOk("password"); ok { + azureAd["password"] = v.(string) + } + + if v, ok := d.GetOk("username"); ok { + azureAd["username"] = v.(string) + } + + if v, ok := d.GetOk("application_id"); ok { + azureAd["application-id"] = v.(string) + } + + if v, ok := d.GetOk("application_key"); ok { + azureAd["application-key"] = v.(string) + } + + if v, ok := d.GetOk("directory_id"); ok { + azureAd["directory-id"] = v.(string) + } + + if v, ok := d.GetOk("tags"); ok { + azureAd["tags"] = v.(*schema.Set).List() + } + + if v, ok := d.GetOk("color"); ok { + azureAd["color"] = v.(string) + } + + if v, ok := d.GetOk("comments"); ok { + azureAd["comments"] = v.(string) + } + + if v, ok := d.GetOkExists("ignore_warnings"); ok { + azureAd["ignore-warnings"] = v.(bool) + } + + if v, ok := d.GetOkExists("ignore_errors"); ok { + azureAd["ignore-errors"] = v.(bool) + } + + log.Println("Create AzureAd - Map = ", azureAd) + + addAzureAdRes, err := client.ApiCall("add-azure-ad", azureAd, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil || !addAzureAdRes.Success { + if addAzureAdRes.ErrorMsg != "" { + return fmt.Errorf(addAzureAdRes.ErrorMsg) + } + return fmt.Errorf(err.Error()) + } + + d.SetId(addAzureAdRes.GetData()["uid"].(string)) + _ = d.Set("task_id", resolveTaskId(addAzureAdRes.GetData())) + + return readManagementAzureAd(d, m) +} + +func readManagementAzureAd(d *schema.ResourceData, m interface{}) error { + + client := m.(*checkpoint.ApiClient) + + payload := map[string]interface{}{ + "uid": d.Id(), + } + + showAzureAdRes, err := client.ApiCall("show-azure-ad", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showAzureAdRes.Success { + if objectNotFound(showAzureAdRes.GetData()["code"].(string)) { + d.SetId("") + return nil + } + return fmt.Errorf(showAzureAdRes.ErrorMsg) + } + + azureAd := showAzureAdRes.GetData() + + log.Println("Read AzureAd - Show JSON = ", azureAd) + + if v := azureAd["name"]; v != nil { + _ = d.Set("name", v) + } + + if v := azureAd["authentication-method"]; v != nil { + _ = d.Set("authentication_method", v) + } + + if v := azureAd["password"]; v != nil { + _ = d.Set("password", v) + } + + if v := azureAd["username"]; v != nil { + _ = d.Set("username", v) + } + + if v := azureAd["application-id"]; v != nil { + _ = d.Set("application_id", v) + } + + if v := azureAd["application-key"]; v != nil { + _ = d.Set("application_key", v) + } + + if v := azureAd["directory-id"]; v != nil { + _ = d.Set("directory_id", v) + } + + if azureAd["tags"] != nil { + tagsJson, ok := azureAd["tags"].([]interface{}) + if ok { + tagsIds := make([]string, 0) + if len(tagsJson) > 0 { + for _, tags := range tagsJson { + tags := tags.(map[string]interface{}) + tagsIds = append(tagsIds, tags["name"].(string)) + } + } + _ = d.Set("tags", tagsIds) + } + } else { + _ = d.Set("tags", nil) + } + + if v := azureAd["color"]; v != nil { + _ = d.Set("color", v) + } + + if v := azureAd["comments"]; v != nil { + _ = d.Set("comments", v) + } + + if azureAd["properties"] != nil { + propertiesList := azureAd["properties"].([]interface{}) + + if len(propertiesList) > 0 { + var propertiesListToReturn []map[string]interface{} + + for i := range propertiesList { + propertiesMap := propertiesList[i].(map[string]interface{}) + + propertiesMapToAdd := make(map[string]interface{}) + + if v, _ := propertiesMap["name"]; v != nil { + propertiesMapToAdd["name"] = v + } + if v, _ := propertiesMap["value"]; v != nil { + propertiesMapToAdd["value"] = v + } + + propertiesListToReturn = append(propertiesListToReturn, propertiesMapToAdd) + } + + _ = d.Set("properties", propertiesListToReturn) + + } else { + _ = d.Set("properties", propertiesList) + } + } else { + _ = d.Set("properties", nil) + } + + return nil + +} + +func updateManagementAzureAd(d *schema.ResourceData, m interface{}) error { + + client := m.(*checkpoint.ApiClient) + azureAd := make(map[string]interface{}) + + if ok := d.HasChange("name"); ok { + oldName, newName := d.GetChange("name") + azureAd["name"] = oldName + azureAd["new-name"] = newName + } else { + azureAd["name"] = d.Get("name") + } + + if ok := d.HasChange("authentication_method"); ok { + azureAd["authentication-method"] = d.Get("authentication_method") + } + + if ok := d.HasChange("password"); ok { + azureAd["password"] = d.Get("password") + } + + if ok := d.HasChange("username"); ok { + azureAd["username"] = d.Get("username") + } + + if ok := d.HasChange("application_id"); ok { + azureAd["application-id"] = d.Get("application_id") + } + + if ok := d.HasChange("application_key"); ok { + azureAd["application-key"] = d.Get("application_key") + } + + if ok := d.HasChange("directory_id"); ok { + azureAd["directory-id"] = d.Get("directory_id") + } + + if d.HasChange("tags") { + if v, ok := d.GetOk("tags"); ok { + azureAd["tags"] = v.(*schema.Set).List() + } else { + oldTags, _ := d.GetChange("tags") + azureAd["tags"] = map[string]interface{}{"remove": oldTags.(*schema.Set).List()} + } + } + + if ok := d.HasChange("color"); ok { + azureAd["color"] = d.Get("color") + } + + if ok := d.HasChange("comments"); ok { + azureAd["comments"] = d.Get("comments") + } + + if v, ok := d.GetOkExists("ignore_warnings"); ok { + azureAd["ignore-warnings"] = v.(bool) + } + + if v, ok := d.GetOkExists("ignore_errors"); ok { + azureAd["ignore-errors"] = v.(bool) + } + + log.Println("Update AzureAd - Map = ", azureAd) + + updateAzureAdRes, err := client.ApiCall("set-azure-ad", azureAd, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil || !updateAzureAdRes.Success { + if updateAzureAdRes.ErrorMsg != "" { + return fmt.Errorf(updateAzureAdRes.ErrorMsg) + } + return fmt.Errorf(err.Error()) + } + + return readManagementAzureAd(d, m) +} + +func deleteManagementAzureAd(d *schema.ResourceData, m interface{}) error { + + client := m.(*checkpoint.ApiClient) + + azureAdPayload := map[string]interface{}{ + "uid": d.Id(), + } + + log.Println("Delete AzureAd") + + deleteAzureAdRes, err := client.ApiCall("delete-azure-ad", azureAdPayload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil || !deleteAzureAdRes.Success { + if deleteAzureAdRes.ErrorMsg != "" { + return fmt.Errorf(deleteAzureAdRes.ErrorMsg) + } + return fmt.Errorf(err.Error()) + } + d.SetId("") + + return nil +} diff --git a/checkpoint/resource_checkpoint_management_nutanix_data_center_server.go b/checkpoint/resource_checkpoint_management_nutanix_data_center_server.go new file mode 100644 index 00000000..b3b83e1a --- /dev/null +++ b/checkpoint/resource_checkpoint_management_nutanix_data_center_server.go @@ -0,0 +1,352 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "log" +) + +func resourceManagementNutanixDataCenterServer() *schema.Resource { + return &schema.Resource{ + Create: createManagementNutanixDataCenterServer, + Read: readManagementNutanixDataCenterServer, + Update: updateManagementNutanixDataCenterServer, + Delete: deleteManagementNutanixDataCenterServer, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Object name. Must be unique in the domain.", + }, + "hostname": { + Type: schema.TypeString, + Required: true, + Description: "IP Address or hostname of the Nutanix Prism server.", + }, + "username": { + Type: schema.TypeString, + Required: true, + Description: "Username of the Nutanix Prism server.", + }, + "password": { + Type: schema.TypeString, + Required: true, + Sensitive: true, + Description: "Password of the Nutanix Prism server.", + }, + "certificate_fingerprint": { + Type: schema.TypeString, + Optional: true, + Description: "Specify the SHA-1 or SHA-256 fingerprint of the Data Center Server's certificate.", + }, + "unsafe_auto_accept": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "When set to false, the current Data Center Server's certificate should be trusted, either by providing the certificate-fingerprint argument or by relying on a previously trusted certificate of this hostname. When set to true, trust the current Data Center Server's certificate as-is.", + }, + "tags": { + Type: schema.TypeSet, + Optional: true, + Description: "Collection of tag identifiers.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "color": { + Type: schema.TypeString, + Optional: true, + Default: "black", + Description: "Color of the object. Should be one of existing colors.", + }, + "comments": { + Type: schema.TypeString, + Optional: true, + Description: "Comments string", + }, + "ignore_warnings": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Apply changes ignoring warnings. By Setting this parameter to 'true' test connection failure will be ignored.", + }, + "ignore_errors": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored.", + }, + "automatic_refresh": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether the data center server's content is automatically updated.", + }, + "data_center_type": { + Type: schema.TypeString, + Computed: true, + Description: "Data Center type.", + }, + }, + } +} + +func createManagementNutanixDataCenterServer(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + nutanixDataCenterServer := make(map[string]interface{}) + + if v, ok := d.GetOk("name"); ok { + nutanixDataCenterServer["name"] = v.(string) + } + + nutanixDataCenterServer["type"] = "nutanix" + + if v, ok := d.GetOk("hostname"); ok { + nutanixDataCenterServer["hostname"] = v.(string) + } + + if v, ok := d.GetOk("username"); ok { + nutanixDataCenterServer["username"] = v.(string) + } + + if v, ok := d.GetOk("password"); ok { + nutanixDataCenterServer["password"] = v.(string) + } + + if v, ok := d.GetOk("certificate_fingerprint"); ok { + nutanixDataCenterServer["certificate-fingerprint"] = v.(string) + } + + if v, ok := d.GetOkExists("unsafe_auto_accept"); ok { + nutanixDataCenterServer["unsafe-auto-accept"] = v.(bool) + } + + if v, ok := d.GetOk("tags"); ok { + nutanixDataCenterServer["tags"] = v.(*schema.Set).List() + } + + if v, ok := d.GetOk("color"); ok { + nutanixDataCenterServer["color"] = v.(string) + } + + if v, ok := d.GetOk("comments"); ok { + nutanixDataCenterServer["comments"] = v.(string) + } + + if v, ok := d.GetOkExists("ignore_warnings"); ok { + nutanixDataCenterServer["ignore-warnings"] = v.(bool) + } + + if v, ok := d.GetOkExists("ignore_errors"); ok { + nutanixDataCenterServer["ignore-errors"] = v.(bool) + } + + log.Println("Create Nutanix Data Center Server - Map = ", nutanixDataCenterServer) + + addNutanixDataCenterServerRes, err := client.ApiCall("add-data-center-server", nutanixDataCenterServer, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !addNutanixDataCenterServerRes.Success { + if addNutanixDataCenterServerRes.ErrorMsg != "" { + return fmt.Errorf(addNutanixDataCenterServerRes.ErrorMsg) + } + msg := createTaskFailMessage("add-data-center-server", addNutanixDataCenterServerRes.GetData()) + return fmt.Errorf(msg) + } + payload := map[string]interface{}{ + "name": nutanixDataCenterServer["name"], + } + showNutanixDataCenterServerRes, err := client.ApiCall("show-data-center-server", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showNutanixDataCenterServerRes.Success { + return fmt.Errorf(showNutanixDataCenterServerRes.ErrorMsg) + } + d.SetId(showNutanixDataCenterServerRes.GetData()["uid"].(string)) + return readManagementNutanixDataCenterServer(d, m) +} + +func readManagementNutanixDataCenterServer(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + payload := map[string]interface{}{ + "uid": d.Id(), + } + + showNutanixDataCenterServerRes, err := client.ApiCall("show-data-center-server", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showNutanixDataCenterServerRes.Success { + if objectNotFound(showNutanixDataCenterServerRes.GetData()["code"].(string)) { + d.SetId("") + return nil + } + return fmt.Errorf(showNutanixDataCenterServerRes.ErrorMsg) + } + + nutanixDataCenterServer := showNutanixDataCenterServerRes.GetData() + + log.Println("Read Nutanix Data Center - Show JSON = ", nutanixDataCenterServer) + + if v := nutanixDataCenterServer["name"]; v != nil { + _ = d.Set("name", v) + } + + if v := nutanixDataCenterServer["data-center-type"]; v != nil { + _ = d.Set("data_center_type", v) + } + + if nutanixDataCenterServer["properties"] != nil { + propertiesList := nutanixDataCenterServer["properties"].([]interface{}) + + if len(propertiesList) > 0 { + var propertiesListToReturn []map[string]interface{} + + for i := range propertiesList { + propertiesMap := propertiesList[i].(map[string]interface{}) + + propertiesMapToAdd := make(map[string]interface{}) + + if v, _ := propertiesMap["name"]; v != nil { + propertiesMapToAdd["name"] = v + } + if v, _ := propertiesMap["value"]; v != nil { + propertiesMapToAdd["value"] = v + } + + propertiesListToReturn = append(propertiesListToReturn, propertiesMapToAdd) + } + + _ = d.Set("properties", propertiesListToReturn) + + } else { + _ = d.Set("properties", propertiesList) + } + } else { + _ = d.Set("properties", nil) + } + + if v := nutanixDataCenterServer["automatic-refresh"]; v != nil { + _ = d.Set("automatic_refresh", v) + } + + if nutanixDataCenterServer["tags"] != nil { + tagsJson, ok := nutanixDataCenterServer["tags"].([]interface{}) + if ok { + tagsIds := make([]string, 0) + if len(tagsJson) > 0 { + for _, tags := range tagsJson { + tags := tags.(map[string]interface{}) + tagsIds = append(tagsIds, tags["name"].(string)) + } + } + _ = d.Set("tags", tagsIds) + } + } else { + _ = d.Set("tags", nil) + } + + return nil +} + +func updateManagementNutanixDataCenterServer(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + nutanixDataCenterServer := make(map[string]interface{}) + + if ok := d.HasChange("name"); ok { + oldName, newName := d.GetChange("name") + nutanixDataCenterServer["name"] = oldName + nutanixDataCenterServer["new-name"] = newName + } else { + nutanixDataCenterServer["name"] = d.Get("name") + } + + if ok := d.HasChange("hostname"); ok { + nutanixDataCenterServer["hostname"] = d.Get("hostname") + } + + if ok := d.HasChange("username"); ok { + nutanixDataCenterServer["username"] = d.Get("username") + } + + if ok := d.HasChange("password"); ok { + nutanixDataCenterServer["password"] = d.Get("password") + } + + if ok := d.HasChange("certificate_fingerprint"); ok { + nutanixDataCenterServer["certificate-fingerprint"] = d.Get("certificate_fingerprint") + } + + if ok := d.HasChange("unsafe_auto_accept"); ok { + nutanixDataCenterServer["unsafe-auto-accept"] = d.Get("unsafe_auto_accept") + } + + if d.HasChange("tags") { + if v, ok := d.GetOk("tags"); ok { + nutanixDataCenterServer["tags"] = v.(*schema.Set).List() + } else { + oldTags, _ := d.GetChange("tags") + nutanixDataCenterServer["tags"] = map[string]interface{}{"remove": oldTags.(*schema.Set).List()} + } + } + + if ok := d.HasChange("color"); ok { + nutanixDataCenterServer["color"] = d.Get("color") + } + + if ok := d.HasChange("comments"); ok { + nutanixDataCenterServer["comments"] = d.Get("comments") + } + + if v, ok := d.GetOkExists("ignore_warnings"); ok { + nutanixDataCenterServer["ignore-warnings"] = v.(bool) + } + + if v, ok := d.GetOkExists("ignore_errors"); ok { + nutanixDataCenterServer["ignore-errors"] = v.(bool) + } + + log.Println("Update nutanixDataCenterServer - Map = ", nutanixDataCenterServer) + + updateNutanixDataCenterServerRes, err := client.ApiCall("set-data-center-server", nutanixDataCenterServer, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !updateNutanixDataCenterServerRes.Success { + if updateNutanixDataCenterServerRes.ErrorMsg != "" { + return fmt.Errorf(updateNutanixDataCenterServerRes.ErrorMsg) + } + msg := createTaskFailMessage("set-data-center-server", updateNutanixDataCenterServerRes.GetData()) + return fmt.Errorf(msg) + } + + return readManagementNutanixDataCenterServer(d, m) +} + +func deleteManagementNutanixDataCenterServer(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + nutanixDataCenterServerPayload := map[string]interface{}{ + "uid": d.Id(), + } + + log.Println("Delete nutanixDataCenterServer") + + deleteNutanixDataCenterServerRes, err := client.ApiCall("delete-data-center-server", nutanixDataCenterServerPayload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil || !deleteNutanixDataCenterServerRes.Success { + if deleteNutanixDataCenterServerRes.ErrorMsg != "" { + return fmt.Errorf(deleteNutanixDataCenterServerRes.ErrorMsg) + } + return fmt.Errorf(err.Error()) + } + d.SetId("") + + return nil +} diff --git a/checkpoint/resource_checkpoint_management_oracle_cloud_data_center_server.go b/checkpoint/resource_checkpoint_management_oracle_cloud_data_center_server.go new file mode 100644 index 00000000..6fba32c1 --- /dev/null +++ b/checkpoint/resource_checkpoint_management_oracle_cloud_data_center_server.go @@ -0,0 +1,346 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "log" +) + +func resourceManagementOracleCloudDataCenterServer() *schema.Resource { + return &schema.Resource{ + Create: createManagementOracleCloudDataCenterServer, + Read: readManagementOracleCloudDataCenterServer, + Update: updateManagementOracleCloudDataCenterServer, + Delete: deleteManagementOracleCloudDataCenterServer, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Object name. Must be unique in the domain.", + }, + "authentication_method": { + Type: schema.TypeString, + Required: true, + Description: "key-authentication Uses the Service Account private key file to authenticate. vm-instance-authentication Uses VM Instance to authenticate. This option requires the Security Management Server deployed in Oracle Cloud, and running in a dynamic group with the required permissions", + }, + "private_key": { + Type: schema.TypeString, + Required: true, + Sensitive: true, + Description: " An Oracle Cloud API key PEM file, encoded in base64. Required for authentication-method: key-authentication.", + }, + "key_user": { + Type: schema.TypeString, + Required: true, + Description: "An Oracle Cloud user id associated with key. Required for authentication-method: key-authentication.", + }, + "key_tenant": { + Type: schema.TypeString, + Required: true, + Description: "An Oracle Cloud tenancy id where the key was created. Required for authentication-method: key-authentication.", + }, + "key_region": { + Type: schema.TypeString, + Required: true, + Description: "An Oracle Cloud region for where to create scanner. Required for authentication-method: key-authentication.", + }, + "tags": { + Type: schema.TypeSet, + Optional: true, + Description: "Collection of tag identifiers.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "color": { + Type: schema.TypeString, + Optional: true, + Description: "Color of the object. Should be one of existing colors.", + }, + "comments": { + Type: schema.TypeString, + Optional: true, + Description: "Comments string.", + }, + "ignore_warnings": { + Type: schema.TypeBool, + Optional: true, + Description: "Apply changes ignoring warnings. By Setting this parameter to 'true' test connection failure will be ignored.", + }, + "ignore_errors": { + Type: schema.TypeBool, + Optional: true, + Description: "Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored.", + }, + "automatic_refresh": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether the data center server's content is automatically updated.", + }, + "data_center_type": { + Type: schema.TypeString, + Computed: true, + Description: "Data Center type.", + }, + }, + } +} + +func createManagementOracleCloudDataCenterServer(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + oracleCloudDataCenterServer := make(map[string]interface{}) + + if v, ok := d.GetOk("name"); ok { + oracleCloudDataCenterServer["name"] = v.(string) + } + + oracleCloudDataCenterServer["type"] = "oci" + + if v, ok := d.GetOk("authentication_method"); ok { + oracleCloudDataCenterServer["authentication-method"] = v.(string) + } + + if v, ok := d.GetOk("private_key"); ok { + oracleCloudDataCenterServer["private-key"] = v.(string) + } + + if v, ok := d.GetOk("key_user"); ok { + oracleCloudDataCenterServer["key-user"] = v.(string) + } + + if v, ok := d.GetOk("key_tenant"); ok { + oracleCloudDataCenterServer["key-tenant"] = v.(string) + } + + if v, ok := d.GetOk("key_region"); ok { + oracleCloudDataCenterServer["key-region"] = v.(string) + } + + if v, ok := d.GetOk("tags"); ok { + oracleCloudDataCenterServer["tags"] = v.(*schema.Set).List() + } + + if v, ok := d.GetOk("color"); ok { + oracleCloudDataCenterServer["color"] = v.(string) + } + + if v, ok := d.GetOk("comments"); ok { + oracleCloudDataCenterServer["comments"] = v.(string) + } + + if v, ok := d.GetOkExists("ignore_warnings"); ok { + oracleCloudDataCenterServer["ignore-warnings"] = v.(bool) + } + + if v, ok := d.GetOkExists("ignore_errors"); ok { + oracleCloudDataCenterServer["ignore-errors"] = v.(bool) + } + + log.Println("Create oracleCloudDataCenterServer - Map = ", oracleCloudDataCenterServer) + + addOracleCloudDataCenterServerRes, err := client.ApiCall("add-data-center-server", oracleCloudDataCenterServer, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !addOracleCloudDataCenterServerRes.Success { + if addOracleCloudDataCenterServerRes.ErrorMsg != "" { + return fmt.Errorf(addOracleCloudDataCenterServerRes.ErrorMsg) + } + msg := createTaskFailMessage("add-data-center-server", addOracleCloudDataCenterServerRes.GetData()) + return fmt.Errorf(msg) + } + payload := map[string]interface{}{ + "name": oracleCloudDataCenterServer["name"], + } + + showOracleCloudDataCenterServerRes, err := client.ApiCall("show-data-center-server", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showOracleCloudDataCenterServerRes.Success { + return fmt.Errorf(showOracleCloudDataCenterServerRes.ErrorMsg) + } + d.SetId(showOracleCloudDataCenterServerRes.GetData()["uid"].(string)) + + return readManagementOracleCloudDataCenterServer(d, m) +} + +func readManagementOracleCloudDataCenterServer(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + payload := map[string]interface{}{ + "uid": d.Id(), + } + + showOracleCloudDataCenterServerRes, err := client.ApiCall("show-data-center-server", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showOracleCloudDataCenterServerRes.Success { + if objectNotFound(showOracleCloudDataCenterServerRes.GetData()["code"].(string)) { + d.SetId("") + return nil + } + return fmt.Errorf(showOracleCloudDataCenterServerRes.ErrorMsg) + } + + oracleCloudDataCenterServer := showOracleCloudDataCenterServerRes.GetData() + + if v := oracleCloudDataCenterServer["name"]; v != nil { + _ = d.Set("name", v) + } + + if oracleCloudDataCenterServer["properties"] != nil { + propertiesList := oracleCloudDataCenterServer["properties"].([]interface{}) + + if len(propertiesList) > 0 { + var propertiesListToReturn []map[string]interface{} + + for i := range propertiesList { + propertiesMap := propertiesList[i].(map[string]interface{}) + + propertiesMapToAdd := make(map[string]interface{}) + + if v, _ := propertiesMap["name"]; v != nil { + propertiesMapToAdd["name"] = v + } + if v, _ := propertiesMap["value"]; v != nil { + propertiesMapToAdd["value"] = v + } + + propertiesListToReturn = append(propertiesListToReturn, propertiesMapToAdd) + } + + _ = d.Set("properties", propertiesListToReturn) + + } else { + _ = d.Set("properties", propertiesList) + } + } else { + _ = d.Set("properties", nil) + } + + if oracleCloudDataCenterServer["tags"] != nil { + tagsJson, ok := oracleCloudDataCenterServer["tags"].([]interface{}) + if ok { + tagsIds := make([]string, 0) + if len(tagsJson) > 0 { + for _, tags := range tagsJson { + tags := tags.(map[string]interface{}) + tagsIds = append(tagsIds, tags["name"].(string)) + } + } + _ = d.Set("tags", tagsIds) + } + } else { + _ = d.Set("tags", nil) + } + + if v := oracleCloudDataCenterServer["automatic-refresh"]; v != nil { + _ = d.Set("automatic_refresh", v) + } + + if v := oracleCloudDataCenterServer["data-center-type"]; v != nil { + _ = d.Set("data_center_type", v) + } + + return nil +} + +func updateManagementOracleCloudDataCenterServer(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + oracleCloudDataCenterServer := make(map[string]interface{}) + + if ok := d.HasChange("name"); ok { + oldName, newName := d.GetChange("name") + oracleCloudDataCenterServer["name"] = oldName + oracleCloudDataCenterServer["new-name"] = newName + } else { + oracleCloudDataCenterServer["name"] = d.Get("name") + } + + if ok := d.HasChange("authentication_method"); ok { + oracleCloudDataCenterServer["authentication-method"] = d.Get("authentication_method") + } + + if ok := d.HasChange("private_key"); ok { + oracleCloudDataCenterServer["private-key"] = d.Get("private_key") + } + + if ok := d.HasChange("key_user"); ok { + oracleCloudDataCenterServer["key-user"] = d.Get("key_user") + } + + if ok := d.HasChange("key_tenant"); ok { + oracleCloudDataCenterServer["key-tenant"] = d.Get("key_tenant") + } + + if ok := d.HasChange("key_region"); ok { + oracleCloudDataCenterServer["key-region"] = d.Get("key_region") + } + + if d.HasChange("tags") { + if v, ok := d.GetOk("tags"); ok { + oracleCloudDataCenterServer["tags"] = v.(*schema.Set).List() + } else { + oldTags, _ := d.GetChange("tags") + oracleCloudDataCenterServer["tags"] = map[string]interface{}{"remove": oldTags.(*schema.Set).List()} + } + } + + if ok := d.HasChange("color"); ok { + oracleCloudDataCenterServer["color"] = d.Get("color") + } + + if ok := d.HasChange("comments"); ok { + oracleCloudDataCenterServer["comments"] = d.Get("comments") + } + + if v, ok := d.GetOkExists("ignore_warnings"); ok { + oracleCloudDataCenterServer["ignore-warnings"] = v.(bool) + } + + if v, ok := d.GetOkExists("ignore_errors"); ok { + oracleCloudDataCenterServer["ignore-errors"] = v.(bool) + } + + log.Println("Update oracleCloudDataCenterServer - Map = ", oracleCloudDataCenterServer) + + updateOracleCloudDataCenterServerRes, err := client.ApiCall("set-data-center-server", oracleCloudDataCenterServer, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !updateOracleCloudDataCenterServerRes.Success { + if updateOracleCloudDataCenterServerRes.ErrorMsg != "" { + return fmt.Errorf(updateOracleCloudDataCenterServerRes.ErrorMsg) + } + msg := createTaskFailMessage("set-data-center-server", updateOracleCloudDataCenterServerRes.GetData()) + return fmt.Errorf(msg) + } + + return readManagementOracleCloudDataCenterServer(d, m) +} + +func deleteManagementOracleCloudDataCenterServer(d *schema.ResourceData, m interface{}) error { + + client := m.(*checkpoint.ApiClient) + + oracleCloudDataCenterServerPayload := map[string]interface{}{ + "uid": d.Id(), + } + + deleteOracleCloudDataCenterServerRes, err := client.ApiCall("delete-data-center-server", oracleCloudDataCenterServerPayload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil || !deleteOracleCloudDataCenterServerRes.Success { + if deleteOracleCloudDataCenterServerRes.ErrorMsg != "" { + return fmt.Errorf(deleteOracleCloudDataCenterServerRes.ErrorMsg) + } + return fmt.Errorf(err.Error()) + } + d.SetId("") + + return nil +} diff --git a/checkpoint/resource_checkpoint_management_simple_cluster.go b/checkpoint/resource_checkpoint_management_simple_cluster.go index b2522078..743a403f 100644 --- a/checkpoint/resource_checkpoint_management_simple_cluster.go +++ b/checkpoint/resource_checkpoint_management_simple_cluster.go @@ -39,6 +39,995 @@ func resourceManagementSimpleCluster() *schema.Resource { Description: "Cluster mode.", Default: "cluster-xl-ha", }, + "advanced_settings": { + Type: schema.TypeList, + Optional: true, + Description: "N/A", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "connection_persistence": { + Type: schema.TypeString, + Optional: true, + Description: "Handling established connections when installing a new policy.", + Default: "rematch-connections", + }, + "sam": { + Type: schema.TypeList, + Optional: true, + Description: "SAM.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "forward_to_other_sam_servers": { + Type: schema.TypeBool, + Optional: true, + Description: "Forward SAM clients' requests to other SAM servers.", + Default: false, + }, + "use_early_versions": { + Type: schema.TypeList, + Optional: true, + Description: "Use early versions compatibility mode.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Use early versions compatibility mode.", + Default: false, + }, + "compatibility_mode": { + Type: schema.TypeString, + Optional: true, + Description: "Early versions compatibility mode.", + Default: "auth_opsec", + }, + }, + }, + }, + "purge_sam_file": { + Type: schema.TypeList, + Optional: true, + Description: "Purge SAM File.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Purge SAM File.", + Default: false, + }, + "purge_when_size_reaches_to": { + Type: schema.TypeInt, + Optional: true, + Description: "Purge SAM File When it Reaches to.", + Default: 100, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "enable_https_inspection": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable HTTPS Inspection after defining an outbound inspection certificate.
To define the outbound certificate use outbound inspection certificate API.", + }, + "fetch_policy": { + Type: schema.TypeSet, + Optional: true, + Description: "Security management server(s) to fetch the policy from.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hit_count": { + Type: schema.TypeBool, + Optional: true, + Description: "Hit count tracks the number of connections each rule matches.", + Default: true, + }, + "https_inspection": { + Type: schema.TypeList, + Optional: true, + Description: "HTTPS inspection.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bypass_on_failure": { + Type: schema.TypeList, + Optional: true, + Description: "Set to be true in order to bypass all requests (Fail-open) in case of internal system error.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "site_categorization_allow_mode": { + Type: schema.TypeList, + Optional: true, + Description: "Set to 'background' in order to allowed requests until categorization is complete.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeString, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_untrusted_server_cert": { + Type: schema.TypeList, + Optional: true, + Description: "Set to be true in order to drop traffic from servers with untrusted server certificate.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_revoked_server_cert": { + Type: schema.TypeList, + Optional: true, + Description: "Set to be true in order to drop traffic from servers with revoked server certificate (validate CRL).", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_expired_server_cert": { + Type: schema.TypeList, + Optional: true, + Description: "Set to be true in order to drop traffic from servers with expired server certificate.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + }, + }, + }, + "identity_awareness": { + Type: schema.TypeBool, + Optional: true, + Description: "Identity awareness blade enabled.", + }, + "identity_awareness_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Gateway Identity Awareness settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "browser_based_authentication": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable Browser Based Authentication source.", + }, + "browser_based_authentication_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Browser Based Authentication settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Authentication Settings for Browser Based Authentication.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_method": { + Type: schema.TypeString, + Optional: true, + Description: "Authentication method.", + Default: "username and password", + }, + "identity_provider": { + Type: schema.TypeSet, + Optional: true, + Description: "Identity provider object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"identity provider\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "radius": { + Type: schema.TypeString, + Optional: true, + Description: "Radius server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"radius\".", + }, + "users_directories": { + Type: schema.TypeList, + Optional: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "External user profile.", + Default: true, + }, + "internal_users": { + Type: schema.TypeBool, + Optional: true, + Description: "Internal users.", + Default: true, + }, + "users_from_external_directories": { + Type: schema.TypeString, + Optional: true, + Description: "Users from external directories.", + Default: "all gateways directories", + }, + "specific": { + Type: schema.TypeSet, + Optional: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "browser_based_authentication_portal_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Browser Based Authentication portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "portal_web_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Optional: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Optional: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Optional: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Optional: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_agent": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable Identity Agent source.", + }, + "identity_agent_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity Agent settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agents_interval_keepalive": { + Type: schema.TypeInt, + Optional: true, + Description: "Agents send keepalive period (minutes).", + Default: 5, + }, + "user_reauthenticate_interval": { + Type: schema.TypeInt, + Optional: true, + Description: "Agent reauthenticate time interval (minutes).", + Default: 480, + }, + "authentication_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Authentication Settings for Identity Agent.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_method": { + Type: schema.TypeString, + Optional: true, + Description: "Authentication method.", + Default: "username and password", + }, + "radius": { + Type: schema.TypeString, + Optional: true, + Description: "Radius server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"radius\".", + }, + "users_directories": { + Type: schema.TypeList, + Optional: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "External user profile.", + Default: true, + }, + "internal_users": { + Type: schema.TypeBool, + Optional: true, + Description: "Internal users.", + Default: true, + }, + "users_from_external_directories": { + Type: schema.TypeString, + Optional: true, + Description: "Users from external directories.", + Default: "all gateways directories", + }, + "specific": { + Type: schema.TypeSet, + Optional: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_agent_portal_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity Agent accessibility settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_collector": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable Identity Collector source.", + }, + "identity_collector_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity Collector settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authorized_clients": { + Type: schema.TypeList, + Required: true, + Description: "Authorized Clients.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "client": { + Type: schema.TypeString, + Optional: true, + Description: "Host / Network Group Name or UID.", + }, + "client_secret": { + Type: schema.TypeString, + Optional: true, + Description: "Client Secret.", + }, + }, + }, + }, + "authentication_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Authentication Settings for Identity Collector.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "users_directories": { + Type: schema.TypeList, + Optional: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "External user profile.", + Default: true, + }, + "internal_users": { + Type: schema.TypeBool, + Optional: true, + Description: "Internal users.", + Default: true, + }, + "users_from_external_directories": { + Type: schema.TypeString, + Optional: true, + Description: "Users from external directories.", + Default: "all gateways directories", + }, + "specific": { + Type: schema.TypeSet, + Optional: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "client_access_permissions": { + Type: schema.TypeList, + Optional: true, + Description: "Identity Collector accessibility settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_sharing_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity sharing settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "share_with_other_gateways": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable identity sharing with other gateways.", + }, + "receive_from_other_gateways": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable receiving identity from other gateways.", + }, + "receive_from": { + Type: schema.TypeSet, + Optional: true, + Description: "Gateway(s) to receive identity from.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "proxy_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity-Awareness Proxy settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "detect_using_x_forward_for": { + Type: schema.TypeBool, + Optional: true, + Description: "Whether to use X-Forward-For HTTP header, which is added by the proxy server to keep track of the original source IP.", + Default: false, + }, + }, + }, + }, + "remote_access": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable Remote Access Identity source.", + }, + }, + }, + }, + "ips_update_policy": { + Type: schema.TypeString, + Optional: true, + Description: "Specifies whether the IPS will be downloaded from the Management or directly to the Gateway.", + Default: "gateway automatic update", + }, + "nat_hide_internal_interfaces": { + Type: schema.TypeBool, + Optional: true, + Description: "Hide internal networks behind the Gateway's external IP.", + }, + "nat_settings": { + Type: schema.TypeMap, + Optional: true, + Description: "NAT settings.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "auto_rule": { + Type: schema.TypeBool, + Optional: true, + Description: "Whether to add automatic address translation rules.", + Default: false, + }, + "ipv4_address": { + Type: schema.TypeString, + Optional: true, + Description: "IPv4 address.", + }, + "ipv6_address": { + Type: schema.TypeString, + Optional: true, + Description: "IPv6 address.", + }, + "hide_behind": { + Type: schema.TypeString, + Optional: true, + Description: "Hide behind method. This parameter is forbidden in case \"method\" parameter is \"static\".", + }, + "install_on": { + Type: schema.TypeString, + Optional: true, + Description: "Which gateway should apply the NAT translation.", + }, + "method": { + Type: schema.TypeString, + Optional: true, + Description: "NAT translation method.", + }, + }, + }, + }, + "platform_portal_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Platform portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "portal_web_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Optional: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Optional: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Optional: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Optional: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "proxy_settings": { + Type: schema.TypeMap, + Optional: true, + Description: "Proxy Server for Gateway.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "use_custom_proxy": { + Type: schema.TypeBool, + Optional: true, + Description: "Use custom proxy settings for this network object.", + Default: false, + }, + "proxy_server": { + Type: schema.TypeString, + Optional: true, + Description: "N/A", + }, + "port": { + Type: schema.TypeInt, + Optional: true, + Description: "N/A", + Default: 80, + }, + }, + }, + }, + "qos": { + Type: schema.TypeBool, + Optional: true, + Description: "QoS.", + }, + "usercheck_portal_settings": { + Type: schema.TypeList, + Optional: true, + Description: "UserCheck portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "State of the web portal (enabled or disabled). The supported blades are: {'Application Control', 'URL Filtering', 'Data Loss Prevention', 'Anti Virus', 'Anti Bot', 'Threat Emulation', 'Threat Extraction', 'Data Awareness'}.", + }, + "portal_web_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Optional: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Optional: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Optional: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Optional: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "zero_phishing": { + Type: schema.TypeBool, + Optional: true, + Description: "Zero Phishing blade enabled.", + }, + "zero_phishing_fqdn": { + Type: schema.TypeString, + Optional: true, + Description: "Zero Phishing gateway FQDN.", + }, "interfaces": { Type: schema.TypeList, Optional: true, @@ -758,27 +1747,398 @@ func resourceManagementSimpleCluster() *schema.Resource { }, }, } -} +} + +func createManagementSimpleCluster(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + cluster := make(map[string]interface{}) + + if v, ok := d.GetOk("name"); ok { + cluster["name"] = v.(string) + } + + if v, ok := d.GetOk("ipv4_address"); ok { + cluster["ipv4-address"] = v.(string) + } + + if v, ok := d.GetOk("ipv6_address"); ok { + cluster["ipv6-address"] = v.(string) + } + + if v, ok := d.GetOk("cluster_mode"); ok { + cluster["cluster-mode"] = v.(string) + } + + if v, ok := d.GetOk("advanced_settings"); ok { + + advancedSettingsList := v.([]interface{}) + + if len(advancedSettingsList) > 0 { + + advancedSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("advanced_settings.0.connection_persistence"); ok { + advancedSettingsPayload["connection-persistence"] = v.(string) + } + if _, ok := d.GetOk("advanced_settings.0.sam"); ok { + + samPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("advanced_settings.0.sam.0.forward_to_other_sam_servers"); ok { + samPayload["forward-to-other-sam-servers"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("advanced_settings.0.sam.0.use_early_versions"); ok { + samPayload["use-early-versions"] = v + } + if v, ok := d.GetOk("advanced_settings.0.sam.0.purge_sam_file"); ok { + samPayload["purge-sam-file"] = v + } + advancedSettingsPayload["sam"] = samPayload + } + cluster["advanced-settings"] = advancedSettingsPayload + } + } + + if v, ok := d.GetOkExists("enable_https_inspection"); ok { + cluster["enable-https-inspection"] = v.(bool) + } + + if v, ok := d.GetOk("fetch_policy"); ok { + cluster["fetch-policy"] = v.(*schema.Set).List() + } + + if v, ok := d.GetOkExists("hit_count"); ok { + cluster["hit-count"] = v.(bool) + } + + if v, ok := d.GetOk("https_inspection"); ok { + + httpsInspectionList := v.([]interface{}) + + if len(httpsInspectionList) > 0 { + + httpsInspectionPayload := make(map[string]interface{}) + + if _, ok := d.GetOk("https_inspection.0.bypass_on_failure"); ok { + + bypassOnFailurePayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.bypass_on_failure.0.override_profile"); ok { + bypassOnFailurePayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.bypass_on_failure.0.value"); ok { + bypassOnFailurePayload["value"] = strconv.FormatBool(v.(bool)) + } + httpsInspectionPayload["bypass-on-failure"] = bypassOnFailurePayload + } + if _, ok := d.GetOk("https_inspection.0.site_categorization_allow_mode"); ok { + + siteCategorizationAllowModePayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.site_categorization_allow_mode.0.override_profile"); ok { + siteCategorizationAllowModePayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.site_categorization_allow_mode.0.value"); ok { + siteCategorizationAllowModePayload["value"] = v.(string) + } + httpsInspectionPayload["site-categorization-allow-mode"] = siteCategorizationAllowModePayload + } + if _, ok := d.GetOk("https_inspection.0.deny_untrusted_server_cert"); ok { + + denyUntrustedServerCertPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.deny_untrusted_server_cert.0.override_profile"); ok { + denyUntrustedServerCertPayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.deny_untrusted_server_cert.0.value"); ok { + denyUntrustedServerCertPayload["value"] = strconv.FormatBool(v.(bool)) + } + httpsInspectionPayload["deny-untrusted-server-cert"] = denyUntrustedServerCertPayload + } + if _, ok := d.GetOk("https_inspection.0.deny_revoked_server_cert"); ok { + + denyRevokedServerCertPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.deny_revoked_server_cert.0.override_profile"); ok { + denyRevokedServerCertPayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.deny_revoked_server_cert.0.value"); ok { + denyRevokedServerCertPayload["value"] = strconv.FormatBool(v.(bool)) + } + httpsInspectionPayload["deny-revoked-server-cert"] = denyRevokedServerCertPayload + } + if _, ok := d.GetOk("https_inspection.0.deny_expired_server_cert"); ok { + + denyExpiredServerCertPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.deny_expired_server_cert.0.override_profile"); ok { + denyExpiredServerCertPayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.deny_expired_server_cert.0.value"); ok { + denyExpiredServerCertPayload["value"] = strconv.FormatBool(v.(bool)) + } + httpsInspectionPayload["deny-expired-server-cert"] = denyExpiredServerCertPayload + } + cluster["https-inspection"] = httpsInspectionPayload + } + } + + if v, ok := d.GetOkExists("identity_awareness"); ok { + cluster["identity-awareness"] = v.(bool) + } + + if v, ok := d.GetOk("identity_awareness_settings"); ok { + + identityAwarenessSettingsList := v.([]interface{}) + + if len(identityAwarenessSettingsList) > 0 { + + identityAwarenessSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.browser_based_authentication"); ok { + identityAwarenessSettingsPayload["browser-based-authentication"] = v.(bool) + } + if _, ok := d.GetOk("identity_awareness_settings.0.browser_based_authentication_settings"); ok { + + browserBasedAuthenticationSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.browser_based_authentication_settings.0.authentication_settings"); ok { + browserBasedAuthenticationSettingsPayload["authentication-settings"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.browser_based_authentication_settings.0.browser_based_authentication_portal_settings"); ok { + browserBasedAuthenticationSettingsPayload["browser-based-authentication-portal-settings"] = v + } + identityAwarenessSettingsPayload["browser-based-authentication-settings"] = browserBasedAuthenticationSettingsPayload + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent"); ok { + identityAwarenessSettingsPayload["identity-agent"] = v.(bool) + } + if _, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings"); ok { + + identityAgentSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings.0.agents_interval_keepalive"); ok { + identityAgentSettingsPayload["agents-interval-keepalive"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings.0.user_reauthenticate_interval"); ok { + identityAgentSettingsPayload["user-reauthenticate-interval"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings.0.authentication_settings"); ok { + identityAgentSettingsPayload["authentication-settings"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings.0.identity_agent_portal_settings"); ok { + identityAgentSettingsPayload["identity-agent-portal-settings"] = v + } + identityAwarenessSettingsPayload["identity-agent-settings"] = identityAgentSettingsPayload + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_collector"); ok { + identityAwarenessSettingsPayload["identity-collector"] = v.(bool) + } + if _, ok := d.GetOk("identity_awareness_settings.0.identity_collector_settings"); ok { + + identityCollectorSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.identity_collector_settings.0.authorized_clients"); ok { + identityCollectorSettingsPayload["authorized-clients"] = v.(*schema.Set).List() + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_collector_settings.0.authentication_settings"); ok { + identityCollectorSettingsPayload["authentication-settings"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_collector_settings.0.client_access_permissions"); ok { + identityCollectorSettingsPayload["client-access-permissions"] = v + } + identityAwarenessSettingsPayload["identity-collector-settings"] = identityCollectorSettingsPayload + } + if _, ok := d.GetOk("identity_awareness_settings.0.identity_sharing_settings"); ok { + + identitySharingSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.identity_sharing_settings.0.share_with_other_gateways"); ok { + identitySharingSettingsPayload["share-with-other-gateways"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_sharing_settings.0.receive_from_other_gateways"); ok { + identitySharingSettingsPayload["receive-from-other-gateways"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_sharing_settings.0.receive_from"); ok { + identitySharingSettingsPayload["receive-from"] = v.(*schema.Set).List() + } + identityAwarenessSettingsPayload["identity-sharing-settings"] = identitySharingSettingsPayload + } + if _, ok := d.GetOk("identity_awareness_settings.0.proxy_settings"); ok { + + proxySettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.proxy_settings.0.detect_using_x_forward_for"); ok { + proxySettingsPayload["detect-using-x-forward-for"] = strconv.FormatBool(v.(bool)) + } + identityAwarenessSettingsPayload["proxy-settings"] = proxySettingsPayload + } + if v, ok := d.GetOk("identity_awareness_settings.0.remote_access"); ok { + identityAwarenessSettingsPayload["remote-access"] = v.(bool) + } + cluster["identity-awareness-settings"] = identityAwarenessSettingsPayload + } + } + + if v, ok := d.GetOk("ips_update_policy"); ok { + cluster["ips-update-policy"] = v.(string) + } + + if v, ok := d.GetOkExists("nat_hide_internal_interfaces"); ok { + cluster["nat-hide-internal-interfaces"] = v.(bool) + } + + if _, ok := d.GetOk("nat_settings"); ok { + + res := make(map[string]interface{}) + + if v, ok := d.GetOk("nat_settings.auto_rule"); ok { + res["auto-rule"] = v + } + if v, ok := d.GetOk("nat_settings.ipv4_address"); ok { + res["ipv4-address"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.ipv6_address"); ok { + res["ipv6-address"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.hide_behind"); ok { + res["hide-behind"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.install_on"); ok { + res["install-on"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.method"); ok { + res["method"] = v.(string) + } + cluster["nat-settings"] = res + } + + if v, ok := d.GetOk("platform_portal_settings"); ok { + + platformPortalSettingsList := v.([]interface{}) + + if len(platformPortalSettingsList) > 0 { + + platformPortalSettingsPayload := make(map[string]interface{}) + + if _, ok := d.GetOk("platform_portal_settings.0.portal_web_settings"); ok { + + portalWebSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("platform_portal_settings.0.portal_web_settings.0.aliases"); ok { + portalWebSettingsPayload["aliases"] = v.(*schema.Set).List() + } + if v, ok := d.GetOk("platform_portal_settings.0.portal_web_settings.0.main_url"); ok { + portalWebSettingsPayload["main-url"] = v.(string) + } + platformPortalSettingsPayload["portal-web-settings"] = portalWebSettingsPayload + } + if _, ok := d.GetOk("platform_portal_settings.0.certificate_settings"); ok { + + certificateSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("platform_portal_settings.0.certificate_settings.0.base64_certificate"); ok { + certificateSettingsPayload["base64-certificate"] = v.(string) + } + if v, ok := d.GetOk("platform_portal_settings.0.certificate_settings.0.base64_password"); ok { + certificateSettingsPayload["base64-password"] = v.(string) + } + platformPortalSettingsPayload["certificate-settings"] = certificateSettingsPayload + } + if _, ok := d.GetOk("platform_portal_settings.0.accessibility"); ok { + + accessibilityPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("platform_portal_settings.0.accessibility.0.allow_access_from"); ok { + accessibilityPayload["allow-access-from"] = v.(string) + } + if v, ok := d.GetOk("platform_portal_settings.0.accessibility.0.internal_access_settings"); ok { + accessibilityPayload["internal-access-settings"] = v + } + platformPortalSettingsPayload["accessibility"] = accessibilityPayload + } + cluster["platform-portal-settings"] = platformPortalSettingsPayload + } + } -func createManagementSimpleCluster(d *schema.ResourceData, m interface{}) error { - client := m.(*checkpoint.ApiClient) + if _, ok := d.GetOk("proxy_settings"); ok { - cluster := make(map[string]interface{}) + res := make(map[string]interface{}) - if v, ok := d.GetOk("name"); ok { - cluster["name"] = v.(string) + if v, ok := d.GetOk("proxy_settings.use_custom_proxy"); ok { + res["use-custom-proxy"] = v + } + if v, ok := d.GetOk("proxy_settings.proxy_server"); ok { + res["proxy-server"] = v.(string) + } + if v, ok := d.GetOk("proxy_settings.port"); ok { + res["port"] = v + } + cluster["proxy-settings"] = res } - if v, ok := d.GetOk("ipv4_address"); ok { - cluster["ipv4-address"] = v.(string) + if v, ok := d.GetOkExists("qos"); ok { + cluster["qos"] = v.(bool) } - if v, ok := d.GetOk("ipv6_address"); ok { - cluster["ipv6-address"] = v.(string) + if v, ok := d.GetOk("usercheck_portal_settings"); ok { + + usercheckPortalSettingsList := v.([]interface{}) + + if len(usercheckPortalSettingsList) > 0 { + + usercheckPortalSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("usercheck_portal_settings.0.enabled"); ok { + usercheckPortalSettingsPayload["enabled"] = v.(bool) + } + if _, ok := d.GetOk("usercheck_portal_settings.0.portal_web_settings"); ok { + + portalWebSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("usercheck_portal_settings.0.portal_web_settings.0.aliases"); ok { + portalWebSettingsPayload["aliases"] = v.(*schema.Set).List() + } + if v, ok := d.GetOk("usercheck_portal_settings.0.portal_web_settings.0.main_url"); ok { + portalWebSettingsPayload["main-url"] = v.(string) + } + usercheckPortalSettingsPayload["portal-web-settings"] = portalWebSettingsPayload + } + if _, ok := d.GetOk("usercheck_portal_settings.0.certificate_settings"); ok { + + certificateSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("usercheck_portal_settings.0.certificate_settings.0.base64_certificate"); ok { + certificateSettingsPayload["base64-certificate"] = v.(string) + } + if v, ok := d.GetOk("usercheck_portal_settings.0.certificate_settings.0.base64_password"); ok { + certificateSettingsPayload["base64-password"] = v.(string) + } + usercheckPortalSettingsPayload["certificate-settings"] = certificateSettingsPayload + } + if _, ok := d.GetOk("usercheck_portal_settings.0.accessibility"); ok { + + accessibilityPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("usercheck_portal_settings.0.accessibility.0.allow_access_from"); ok { + accessibilityPayload["allow-access-from"] = v.(string) + } + if v, ok := d.GetOk("usercheck_portal_settings.0.accessibility.0.internal_access_settings"); ok { + accessibilityPayload["internal-access-settings"] = v + } + usercheckPortalSettingsPayload["accessibility"] = accessibilityPayload + } + cluster["usercheck-portal-settings"] = usercheckPortalSettingsPayload + } } - if v, ok := d.GetOk("cluster_mode"); ok { - cluster["cluster-mode"] = v.(string) + if v, ok := d.GetOkExists("zero_phishing"); ok { + cluster["zero-phishing"] = v.(bool) + } + + if v, ok := d.GetOk("zero_phishing_fqdn"); ok { + cluster["zero-phishing-fqdn"] = v.(string) } if v, ok := d.GetOk("interfaces"); ok { @@ -1225,75 +2585,527 @@ func createManagementSimpleCluster(d *schema.ResourceData, m interface{}) error return fmt.Errorf(msg) } - // add-simple-cluster returns task-id. Call show-simple-cluster for object uid. - showClusterRes, err := client.ApiCall("show-simple-cluster", map[string]interface{}{"name": d.Get("name")}, client.GetSessionID(), true, client.IsProxyUsed()) - if err != nil { - return fmt.Errorf(err.Error()) - } - if !showClusterRes.Success { - return fmt.Errorf(showClusterRes.ErrorMsg) + // add-simple-cluster returns task-id. Call show-simple-cluster for object uid. + showClusterRes, err := client.ApiCall("show-simple-cluster", map[string]interface{}{"name": d.Get("name")}, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showClusterRes.Success { + return fmt.Errorf(showClusterRes.ErrorMsg) + } + + d.SetId(showClusterRes.GetData()["uid"].(string)) + + return readManagementSimpleCluster(d, m) +} + +func readManagementSimpleCluster(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + payload := map[string]interface{}{ + "uid": d.Id(), + } + + showClusterRes, err := client.ApiCall("show-simple-cluster", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showClusterRes.Success { + if objectNotFound(showClusterRes.GetData()["code"].(string)) { + d.SetId("") + return nil + } + return fmt.Errorf(showClusterRes.ErrorMsg) + } + + cluster := showClusterRes.GetData() + + // If total interfaces above 50, Run show-simple-cluster with interface-limit + if v := cluster["interfaces"]; v != nil { + if total, ok := v.(map[string]interface{})["total"]; ok { + totalInterfaces := int(total.(float64)) + if totalInterfaces > 50 { + payload["limit-interfaces"] = totalInterfaces + showClusterRes, err := client.ApiCall("show-simple-cluster", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showClusterRes.Success { + return fmt.Errorf(showClusterRes.ErrorMsg) + } + cluster = showClusterRes.GetData() + } + } + } + + log.Println("Read Simple Cluster - Show JSON = ", cluster) + + if v := cluster["name"]; v != nil { + _ = d.Set("name", v) + } + + if v := cluster["ipv4-address"]; v != nil { + _ = d.Set("ipv4_address", v) + } + + if v := cluster["ipv6-address"]; v != nil { + _ = d.Set("ipv6_address", v) + } + + if v := cluster["cluster-mode"]; v != nil { + _ = d.Set("cluster_mode", v) + } + + if cluster["advanced-settings"] != nil { + + advancedSettingsMap, ok := cluster["advanced-settings"].(map[string]interface{}) + + if ok { + advancedSettingsMapToReturn := make(map[string]interface{}) + + if v := advancedSettingsMap["connection-persistence"]; v != nil { + advancedSettingsMapToReturn["connection_persistence"] = v + } + if v, ok := advancedSettingsMap["sam"]; ok { + + samMap, ok := v.(map[string]interface{}) + if ok { + samMapToReturn := make(map[string]interface{}) + + if v, _ := samMap["forward-to-other-sam-servers"]; v != nil { + samMapToReturn["forward_to_other_sam_servers"] = v + } + if v, _ := samMap["use-early-versions"]; v != nil { + samMapToReturn["use_early_versions"] = v + } + if v, _ := samMap["purge-sam-file"]; v != nil { + samMapToReturn["purge_sam_file"] = v + } + advancedSettingsMapToReturn["sam"] = []interface{}{samMapToReturn} + } + } + _ = d.Set("advanced_settings", []interface{}{advancedSettingsMapToReturn}) + + } + } else { + _ = d.Set("advanced_settings", nil) + } + + if v := cluster["enable-https-inspection"]; v != nil { + _ = d.Set("enable_https_inspection", v) + } + + if cluster["fetch-policy"] != nil { + fetchPolicyJson, ok := cluster["fetch-policy"].([]interface{}) + if ok { + fetchPolicyIds := make([]string, 0) + if len(fetchPolicyJson) > 0 { + for _, fetch_policy := range fetchPolicyJson { + fetch_policy := fetch_policy.(map[string]interface{}) + fetchPolicyIds = append(fetchPolicyIds, fetch_policy["name"].(string)) + } + } + _ = d.Set("fetch_policy", fetchPolicyIds) + } + } else { + _ = d.Set("fetch_policy", nil) + } + + if v := cluster["hit-count"]; v != nil { + _ = d.Set("hit_count", v) + } + + if cluster["https-inspection"] != nil { + + httpsInspectionMap, ok := cluster["https-inspection"].(map[string]interface{}) + + if ok { + httpsInspectionMapToReturn := make(map[string]interface{}) + + if v, ok := httpsInspectionMap["bypass-on-failure"]; ok { + + bypassOnFailureMap, ok := v.(map[string]interface{}) + if ok { + bypassOnFailureMapToReturn := make(map[string]interface{}) + + if v, _ := bypassOnFailureMap["override-profile"]; v != nil { + bypassOnFailureMapToReturn["override_profile"] = v + } + if v, _ := bypassOnFailureMap["value"]; v != nil { + bypassOnFailureMapToReturn["value"] = v + } + httpsInspectionMapToReturn["bypass_on_failure"] = []interface{}{bypassOnFailureMapToReturn} + } + } + if v, ok := httpsInspectionMap["site-categorization-allow-mode"]; ok { + + siteCategorizationAllowModeMap, ok := v.(map[string]interface{}) + if ok { + siteCategorizationAllowModeMapToReturn := make(map[string]interface{}) + + if v, _ := siteCategorizationAllowModeMap["override-profile"]; v != nil { + siteCategorizationAllowModeMapToReturn["override_profile"] = v + } + if v, _ := siteCategorizationAllowModeMap["value"]; v != nil { + siteCategorizationAllowModeMapToReturn["value"] = v + } + httpsInspectionMapToReturn["site_categorization_allow_mode"] = []interface{}{siteCategorizationAllowModeMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-untrusted-server-cert"]; ok { + + denyUntrustedServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyUntrustedServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyUntrustedServerCertMap["override-profile"]; v != nil { + denyUntrustedServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyUntrustedServerCertMap["value"]; v != nil { + denyUntrustedServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_untrusted_server_cert"] = []interface{}{denyUntrustedServerCertMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-revoked-server-cert"]; ok { + + denyRevokedServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyRevokedServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyRevokedServerCertMap["override-profile"]; v != nil { + denyRevokedServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyRevokedServerCertMap["value"]; v != nil { + denyRevokedServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_revoked_server_cert"] = []interface{}{denyRevokedServerCertMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-expired-server-cert"]; ok { + + denyExpiredServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyExpiredServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyExpiredServerCertMap["override-profile"]; v != nil { + denyExpiredServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyExpiredServerCertMap["value"]; v != nil { + denyExpiredServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_expired_server_cert"] = []interface{}{denyExpiredServerCertMapToReturn} + } + } + _ = d.Set("https_inspection", []interface{}{httpsInspectionMapToReturn}) + + } + } else { + _ = d.Set("https_inspection", nil) + } + + if v := cluster["identity-awareness"]; v != nil { + _ = d.Set("identity_awareness", v) + } + + if cluster["identity-awareness-settings"] != nil { + + identityAwarenessSettingsMap, ok := cluster["identity-awareness-settings"].(map[string]interface{}) + + if ok { + identityAwarenessSettingsMapToReturn := make(map[string]interface{}) + + if v := identityAwarenessSettingsMap["browser-based-authentication"]; v != nil { + identityAwarenessSettingsMapToReturn["browser_based_authentication"] = v + } + if v, ok := identityAwarenessSettingsMap["browser-based-authentication-settings"]; ok { + + browserBasedAuthenticationSettingsMap, ok := v.(map[string]interface{}) + if ok { + browserBasedAuthenticationSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := browserBasedAuthenticationSettingsMap["authentication-settings"]; v != nil { + browserBasedAuthenticationSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := browserBasedAuthenticationSettingsMap["browser-based-authentication-portal-settings"]; v != nil { + browserBasedAuthenticationSettingsMapToReturn["browser_based_authentication_portal_settings"] = v + } + identityAwarenessSettingsMapToReturn["browser_based_authentication_settings"] = []interface{}{browserBasedAuthenticationSettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["identity-agent"]; v != nil { + identityAwarenessSettingsMapToReturn["identity_agent"] = v + } + if v, ok := identityAwarenessSettingsMap["identity-agent-settings"]; ok { + + identityAgentSettingsMap, ok := v.(map[string]interface{}) + if ok { + identityAgentSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identityAgentSettingsMap["agents-interval-keepalive"]; v != nil { + identityAgentSettingsMapToReturn["agents_interval_keepalive"] = v + } + if v, _ := identityAgentSettingsMap["user-reauthenticate-interval"]; v != nil { + identityAgentSettingsMapToReturn["user_reauthenticate_interval"] = v + } + if v, _ := identityAgentSettingsMap["authentication-settings"]; v != nil { + identityAgentSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := identityAgentSettingsMap["identity-agent-portal-settings"]; v != nil { + identityAgentSettingsMapToReturn["identity_agent_portal_settings"] = v + } + identityAwarenessSettingsMapToReturn["identity_agent_settings"] = []interface{}{identityAgentSettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["identity-collector"]; v != nil { + identityAwarenessSettingsMapToReturn["identity_collector"] = v + } + if v, ok := identityAwarenessSettingsMap["identity-collector-settings"]; ok { + + identityCollectorSettingsMap, ok := v.(map[string]interface{}) + if ok { + identityCollectorSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identityCollectorSettingsMap["authorized-clients"]; v != nil { + identityCollectorSettingsMapToReturn["authorized_clients"] = v + } + if v, _ := identityCollectorSettingsMap["authentication-settings"]; v != nil { + identityCollectorSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := identityCollectorSettingsMap["client-access-permissions"]; v != nil { + identityCollectorSettingsMapToReturn["client_access_permissions"] = v + } + identityAwarenessSettingsMapToReturn["identity_collector_settings"] = []interface{}{identityCollectorSettingsMapToReturn} + } + } + if v, ok := identityAwarenessSettingsMap["identity-sharing-settings"]; ok { + + identitySharingSettingsMap, ok := v.(map[string]interface{}) + if ok { + identitySharingSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identitySharingSettingsMap["share-with-other-gateways"]; v != nil { + identitySharingSettingsMapToReturn["share_with_other_gateways"] = v + } + if v, _ := identitySharingSettingsMap["receive-from-other-gateways"]; v != nil { + identitySharingSettingsMapToReturn["receive_from_other_gateways"] = v + } + if v, _ := identitySharingSettingsMap["receive-from"]; v != nil { + identitySharingSettingsMapToReturn["receive_from"] = v + } + identityAwarenessSettingsMapToReturn["identity_sharing_settings"] = []interface{}{identitySharingSettingsMapToReturn} + } + } + if v, ok := identityAwarenessSettingsMap["proxy-settings"]; ok { + + proxySettingsMap, ok := v.(map[string]interface{}) + if ok { + proxySettingsMapToReturn := make(map[string]interface{}) + + if v, _ := proxySettingsMap["detect-using-x-forward-for"]; v != nil { + proxySettingsMapToReturn["detect_using_x_forward_for"] = v + } + identityAwarenessSettingsMapToReturn["proxy_settings"] = []interface{}{proxySettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["remote-access"]; v != nil { + identityAwarenessSettingsMapToReturn["remote_access"] = v + } + _ = d.Set("identity_awareness_settings", []interface{}{identityAwarenessSettingsMapToReturn}) + + } + } else { + _ = d.Set("identity_awareness_settings", nil) + } + + if v := cluster["ips-update-policy"]; v != nil { + _ = d.Set("ips_update_policy", v) + } + + if v := cluster["nat-hide-internal-interfaces"]; v != nil { + _ = d.Set("nat_hide_internal_interfaces", v) + } + + if cluster["nat-settings"] != nil { + + natSettingsMap := cluster["nat-settings"].(map[string]interface{}) + + natSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := natSettingsMap["auto-rule"]; v != nil { + natSettingsMapToReturn["auto_rule"] = strconv.FormatBool(v.(bool)) + } + if v, _ := natSettingsMap["ipv4-address"]; v != nil && v != "" { + natSettingsMapToReturn["ipv4_address"] = v + } + if v, _ := natSettingsMap["ipv6-address"]; v != nil && v != "" { + natSettingsMapToReturn["ipv6_address"] = v + } + if v, _ := natSettingsMap["hide-behind"]; v != nil { + natSettingsMapToReturn["hide_behind"] = v + } + if v, _ := natSettingsMap["install-on"]; v != nil { + natSettingsMapToReturn["install_on"] = v + } + if v, _ := natSettingsMap["method"]; v != nil { + natSettingsMapToReturn["method"] = v + } + _ = d.Set("nat_settings", natSettingsMapToReturn) + } else { + _ = d.Set("nat_settings", nil) + } + + if cluster["platform-portal-settings"] != nil { + + platformPortalSettingsMap, ok := cluster["platform-portal-settings"].(map[string]interface{}) + + if ok { + platformPortalSettingsMapToReturn := make(map[string]interface{}) + + if v, ok := platformPortalSettingsMap["portal-web-settings"]; ok { + + portalWebSettingsMap, ok := v.(map[string]interface{}) + if ok { + portalWebSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := portalWebSettingsMap["aliases"]; v != nil { + portalWebSettingsMapToReturn["aliases"] = v + } + if v, _ := portalWebSettingsMap["main-url"]; v != nil { + portalWebSettingsMapToReturn["main_url"] = v + } + platformPortalSettingsMapToReturn["portal_web_settings"] = []interface{}{portalWebSettingsMapToReturn} + } + } + if v, ok := platformPortalSettingsMap["certificate-settings"]; ok { + + certificateSettingsMap, ok := v.(map[string]interface{}) + if ok { + certificateSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := certificateSettingsMap["base64-certificate"]; v != nil { + certificateSettingsMapToReturn["base64_certificate"] = v + } + if v, _ := certificateSettingsMap["base64-password"]; v != nil { + certificateSettingsMapToReturn["base64_password"] = v + } + platformPortalSettingsMapToReturn["certificate_settings"] = []interface{}{certificateSettingsMapToReturn} + } + } + if v, ok := platformPortalSettingsMap["accessibility"]; ok { + + accessibilityMap, ok := v.(map[string]interface{}) + if ok { + accessibilityMapToReturn := make(map[string]interface{}) + + if v, _ := accessibilityMap["allow-access-from"]; v != nil { + accessibilityMapToReturn["allow_access_from"] = v + } + if v, _ := accessibilityMap["internal-access-settings"]; v != nil { + accessibilityMapToReturn["internal_access_settings"] = v + } + platformPortalSettingsMapToReturn["accessibility"] = []interface{}{accessibilityMapToReturn} + } + } + _ = d.Set("platform_portal_settings", []interface{}{platformPortalSettingsMapToReturn}) + + } + } else { + _ = d.Set("platform_portal_settings", nil) } - d.SetId(showClusterRes.GetData()["uid"].(string)) + if cluster["proxy-settings"] != nil { - return readManagementSimpleCluster(d, m) -} + proxySettingsMap := cluster["proxy-settings"].(map[string]interface{}) -func readManagementSimpleCluster(d *schema.ResourceData, m interface{}) error { - client := m.(*checkpoint.ApiClient) + proxySettingsMapToReturn := make(map[string]interface{}) - payload := map[string]interface{}{ - "uid": d.Id(), + if v, _ := proxySettingsMap["use-custom-proxy"]; v != nil { + proxySettingsMapToReturn["use_custom_proxy"] = strconv.FormatBool(v.(bool)) + } + if v, _ := proxySettingsMap["proxy-server"]; v != nil { + proxySettingsMapToReturn["proxy_server"] = v + } + if v, _ := proxySettingsMap["port"]; v != nil { + proxySettingsMapToReturn["port"] = v + } + _ = d.Set("proxy_settings", proxySettingsMapToReturn) + } else { + _ = d.Set("proxy_settings", nil) } - showClusterRes, err := client.ApiCall("show-simple-cluster", payload, client.GetSessionID(), true, client.IsProxyUsed()) - if err != nil { - return fmt.Errorf(err.Error()) - } - if !showClusterRes.Success { - if objectNotFound(showClusterRes.GetData()["code"].(string)) { - d.SetId("") - return nil - } - return fmt.Errorf(showClusterRes.ErrorMsg) + if v := cluster["qos"]; v != nil { + _ = d.Set("qos", v) } - cluster := showClusterRes.GetData() + if cluster["usercheck-portal-settings"] != nil { - // If total interfaces above 50, Run show-simple-cluster with interface-limit - if v := cluster["interfaces"]; v != nil { - if total, ok := v.(map[string]interface{})["total"]; ok { - totalInterfaces := int(total.(float64)) - if totalInterfaces > 50 { - payload["limit-interfaces"] = totalInterfaces - showClusterRes, err := client.ApiCall("show-simple-cluster", payload, client.GetSessionID(), true, client.IsProxyUsed()) - if err != nil { - return fmt.Errorf(err.Error()) + usercheckPortalSettingsMap, ok := cluster["usercheck-portal-settings"].(map[string]interface{}) + + if ok { + usercheckPortalSettingsMapToReturn := make(map[string]interface{}) + + if v := usercheckPortalSettingsMap["enabled"]; v != nil { + usercheckPortalSettingsMapToReturn["enabled"] = v + } + if v, ok := usercheckPortalSettingsMap["portal-web-settings"]; ok { + + portalWebSettingsMap, ok := v.(map[string]interface{}) + if ok { + portalWebSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := portalWebSettingsMap["aliases"]; v != nil { + portalWebSettingsMapToReturn["aliases"] = v + } + if v, _ := portalWebSettingsMap["main-url"]; v != nil { + portalWebSettingsMapToReturn["main_url"] = v + } + usercheckPortalSettingsMapToReturn["portal_web_settings"] = []interface{}{portalWebSettingsMapToReturn} } - if !showClusterRes.Success { - return fmt.Errorf(showClusterRes.ErrorMsg) + } + if v, ok := usercheckPortalSettingsMap["certificate-settings"]; ok { + + certificateSettingsMap, ok := v.(map[string]interface{}) + if ok { + certificateSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := certificateSettingsMap["base64-certificate"]; v != nil { + certificateSettingsMapToReturn["base64_certificate"] = v + } + if v, _ := certificateSettingsMap["base64-password"]; v != nil { + certificateSettingsMapToReturn["base64_password"] = v + } + usercheckPortalSettingsMapToReturn["certificate_settings"] = []interface{}{certificateSettingsMapToReturn} } - cluster = showClusterRes.GetData() } - } - } + if v, ok := usercheckPortalSettingsMap["accessibility"]; ok { - log.Println("Read Simple Cluster - Show JSON = ", cluster) + accessibilityMap, ok := v.(map[string]interface{}) + if ok { + accessibilityMapToReturn := make(map[string]interface{}) - if v := cluster["name"]; v != nil { - _ = d.Set("name", v) - } + if v, _ := accessibilityMap["allow-access-from"]; v != nil { + accessibilityMapToReturn["allow_access_from"] = v + } + if v, _ := accessibilityMap["internal-access-settings"]; v != nil { + accessibilityMapToReturn["internal_access_settings"] = v + } + usercheckPortalSettingsMapToReturn["accessibility"] = []interface{}{accessibilityMapToReturn} + } + } + _ = d.Set("usercheck_portal_settings", []interface{}{usercheckPortalSettingsMapToReturn}) - if v := cluster["ipv4-address"]; v != nil { - _ = d.Set("ipv4_address", v) + } + } else { + _ = d.Set("usercheck_portal_settings", nil) } - if v := cluster["ipv6-address"]; v != nil { - _ = d.Set("ipv6_address", v) + if v := cluster["zero-phishing"]; v != nil { + _ = d.Set("zero_phishing", v) } - if v := cluster["cluster-mode"]; v != nil { - _ = d.Set("cluster_mode", v) + if v := cluster["zero-phishing-fqdn"]; v != nil { + _ = d.Set("zero_phishing_fqdn", v) } if v := cluster["interfaces"]; v != nil { @@ -1786,6 +3598,403 @@ func updateManagementSimpleCluster(d *schema.ResourceData, m interface{}) error cluster["cluster-mode"] = d.Get("cluster_mode").(string) } + if d.HasChange("advanced_settings") { + + if v, ok := d.GetOk("advanced_settings"); ok { + + advancedSettingsList := v.([]interface{}) + + if len(advancedSettingsList) > 0 { + + advancedSettingsPayload := make(map[string]interface{}) + + if d.HasChange("advanced_settings.0.connection_persistence") { + advancedSettingsPayload["connection-persistence"] = d.Get("advanced_settings.0.connection_persistence").(string) + } + if d.HasChange("advanced_settings.0.sam") { + + samPayload := make(map[string]interface{}) + + if d.HasChange("advanced_settings.0.sam.0.forward_to_other_sam_servers") { + samPayload["forward-to-other-sam-servers"] = d.Get("advanced_settings.0.sam.0.forward_to_other_sam_servers") + } + if d.HasChange("advanced_settings.0.sam.0.use_early_versions") { + samPayload["use-early-versions"] = d.Get("advanced_settings.0.sam.0.use_early_versions") + } + if d.HasChange("advanced_settings.0.sam.0.purge_sam_file") { + samPayload["purge-sam-file"] = d.Get("advanced_settings.0.sam.0.purge_sam_file") + } + advancedSettingsPayload["sam"] = samPayload + } + cluster["advanced-settings"] = advancedSettingsPayload + } + } + } + + if v, ok := d.GetOkExists("enable_https_inspection"); ok { + cluster["enable-https-inspection"] = v.(bool) + } + + if d.HasChange("fetch_policy") { + if v, ok := d.GetOk("fetch_policy"); ok { + cluster["fetch_policy"] = v.(*schema.Set).List() + } else { + oldFetch_Policy, _ := d.GetChange("fetch_policy") + cluster["fetch-policy"] = map[string]interface{}{"remove": oldFetch_Policy.(*schema.Set).List()} + } + } + + if v, ok := d.GetOkExists("hit_count"); ok { + cluster["hit-count"] = v.(bool) + } + + if d.HasChange("https_inspection") { + + if v, ok := d.GetOk("https_inspection"); ok { + + httpsInspectionList := v.([]interface{}) + + if len(httpsInspectionList) > 0 { + + httpsInspectionPayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.bypass_on_failure") { + + bypassOnFailurePayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.bypass_on_failure.0.override_profile") { + bypassOnFailurePayload["override-profile"] = d.Get("https_inspection.0.bypass_on_failure.0.override_profile") + } + if d.HasChange("https_inspection.0.bypass_on_failure.0.value") { + bypassOnFailurePayload["value"] = d.Get("https_inspection.0.bypass_on_failure.0.value") + } + httpsInspectionPayload["bypass-on-failure"] = bypassOnFailurePayload + } + if d.HasChange("https_inspection.0.site_categorization_allow_mode") { + + siteCategorizationAllowModePayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.site_categorization_allow_mode.0.override_profile") { + siteCategorizationAllowModePayload["override-profile"] = d.Get("https_inspection.0.site_categorization_allow_mode.0.override_profile") + } + if d.HasChange("https_inspection.0.site_categorization_allow_mode.0.value") { + siteCategorizationAllowModePayload["value"] = d.Get("https_inspection.0.site_categorization_allow_mode.0.value").(string) + } + httpsInspectionPayload["site-categorization-allow-mode"] = siteCategorizationAllowModePayload + } + if d.HasChange("https_inspection.0.deny_untrusted_server_cert") { + + denyUntrustedServerCertPayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.deny_untrusted_server_cert.0.override_profile") { + denyUntrustedServerCertPayload["override-profile"] = d.Get("https_inspection.0.deny_untrusted_server_cert.0.override_profile") + } + if d.HasChange("https_inspection.0.deny_untrusted_server_cert.0.value") { + denyUntrustedServerCertPayload["value"] = d.Get("https_inspection.0.deny_untrusted_server_cert.0.value") + } + httpsInspectionPayload["deny-untrusted-server-cert"] = denyUntrustedServerCertPayload + } + if d.HasChange("https_inspection.0.deny_revoked_server_cert") { + + denyRevokedServerCertPayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.deny_revoked_server_cert.0.override_profile") { + denyRevokedServerCertPayload["override-profile"] = d.Get("https_inspection.0.deny_revoked_server_cert.0.override_profile") + } + if d.HasChange("https_inspection.0.deny_revoked_server_cert.0.value") { + denyRevokedServerCertPayload["value"] = d.Get("https_inspection.0.deny_revoked_server_cert.0.value") + } + httpsInspectionPayload["deny-revoked-server-cert"] = denyRevokedServerCertPayload + } + if d.HasChange("https_inspection.0.deny_expired_server_cert") { + + denyExpiredServerCertPayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.deny_expired_server_cert.0.override_profile") { + denyExpiredServerCertPayload["override-profile"] = d.Get("https_inspection.0.deny_expired_server_cert.0.override_profile") + } + if d.HasChange("https_inspection.0.deny_expired_server_cert.0.value") { + denyExpiredServerCertPayload["value"] = d.Get("https_inspection.0.deny_expired_server_cert.0.value") + } + httpsInspectionPayload["deny-expired-server-cert"] = denyExpiredServerCertPayload + } + cluster["https-inspection"] = httpsInspectionPayload + } + } + } + + if v, ok := d.GetOkExists("identity_awareness"); ok { + cluster["identity-awareness"] = v.(bool) + } + + if d.HasChange("identity_awareness_settings") { + + if v, ok := d.GetOk("identity_awareness_settings"); ok { + + identityAwarenessSettingsList := v.([]interface{}) + + if len(identityAwarenessSettingsList) > 0 { + + identityAwarenessSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.browser_based_authentication") { + identityAwarenessSettingsPayload["browser-based-authentication"] = d.Get("identity_awareness_settings.0.browser_based_authentication").(bool) + } + if d.HasChange("identity_awareness_settings.0.browser_based_authentication_settings") { + + browserBasedAuthenticationSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.browser_based_authentication_settings.0.authentication_settings") { + browserBasedAuthenticationSettingsPayload["authentication-settings"] = d.Get("identity_awareness_settings.0.browser_based_authentication_settings.0.authentication_settings") + } + if d.HasChange("identity_awareness_settings.0.browser_based_authentication_settings.0.browser_based_authentication_portal_settings") { + browserBasedAuthenticationSettingsPayload["browser-based-authentication-portal-settings"] = d.Get("identity_awareness_settings.0.browser_based_authentication_settings.0.browser_based_authentication_portal_settings") + } + identityAwarenessSettingsPayload["browser-based-authentication-settings"] = browserBasedAuthenticationSettingsPayload + } + if d.HasChange("identity_awareness_settings.0.identity_agent") { + identityAwarenessSettingsPayload["identity-agent"] = d.Get("identity_awareness_settings.0.identity_agent").(bool) + } + if d.HasChange("identity_awareness_settings.0.identity_agent_settings") { + + identityAgentSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.identity_agent_settings.0.agents_interval_keepalive") { + identityAgentSettingsPayload["agents-interval-keepalive"] = d.Get("identity_awareness_settings.0.identity_agent_settings.0.agents_interval_keepalive") + } + if d.HasChange("identity_awareness_settings.0.identity_agent_settings.0.user_reauthenticate_interval") { + identityAgentSettingsPayload["user-reauthenticate-interval"] = d.Get("identity_awareness_settings.0.identity_agent_settings.0.user_reauthenticate_interval") + } + if d.HasChange("identity_awareness_settings.0.identity_agent_settings.0.authentication_settings") { + identityAgentSettingsPayload["authentication-settings"] = d.Get("identity_awareness_settings.0.identity_agent_settings.0.authentication_settings") + } + if d.HasChange("identity_awareness_settings.0.identity_agent_settings.0.identity_agent_portal_settings") { + identityAgentSettingsPayload["identity-agent-portal-settings"] = d.Get("identity_awareness_settings.0.identity_agent_settings.0.identity_agent_portal_settings") + } + identityAwarenessSettingsPayload["identity-agent-settings"] = identityAgentSettingsPayload + } + if d.HasChange("identity_awareness_settings.0.identity_collector") { + identityAwarenessSettingsPayload["identity-collector"] = d.Get("identity_awareness_settings.0.identity_collector").(bool) + } + if d.HasChange("identity_awareness_settings.0.identity_collector_settings") { + + identityCollectorSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.identity_collector_settings.0.authorized_clients") { + identityCollectorSettingsPayload["authorized-clients"] = d.Get("identity_awareness_settings.0.identity_collector_settings.0.authorized_clients").(*schema.Set).List() + } + if d.HasChange("identity_awareness_settings.0.identity_collector_settings.0.authentication_settings") { + identityCollectorSettingsPayload["authentication-settings"] = d.Get("identity_awareness_settings.0.identity_collector_settings.0.authentication_settings") + } + if d.HasChange("identity_awareness_settings.0.identity_collector_settings.0.client_access_permissions") { + identityCollectorSettingsPayload["client-access-permissions"] = d.Get("identity_awareness_settings.0.identity_collector_settings.0.client_access_permissions") + } + identityAwarenessSettingsPayload["identity-collector-settings"] = identityCollectorSettingsPayload + } + if d.HasChange("identity_awareness_settings.0.identity_sharing_settings") { + + identitySharingSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.identity_sharing_settings.0.share_with_other_gateways") { + identitySharingSettingsPayload["share-with-other-gateways"] = d.Get("identity_awareness_settings.0.identity_sharing_settings.0.share_with_other_gateways") + } + if d.HasChange("identity_awareness_settings.0.identity_sharing_settings.0.receive_from_other_gateways") { + identitySharingSettingsPayload["receive-from-other-gateways"] = d.Get("identity_awareness_settings.0.identity_sharing_settings.0.receive_from_other_gateways") + } + if d.HasChange("identity_awareness_settings.0.identity_sharing_settings.0.receive_from") { + identitySharingSettingsPayload["receive-from"] = d.Get("identity_awareness_settings.0.identity_sharing_settings.0.receive_from").(*schema.Set).List() + } + identityAwarenessSettingsPayload["identity-sharing-settings"] = identitySharingSettingsPayload + } + if d.HasChange("identity_awareness_settings.0.proxy_settings") { + + proxySettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.proxy_settings.0.detect_using_x_forward_for") { + proxySettingsPayload["detect-using-x-forward-for"] = d.Get("identity_awareness_settings.0.proxy_settings.0.detect_using_x_forward_for") + } + identityAwarenessSettingsPayload["proxy-settings"] = proxySettingsPayload + } + if d.HasChange("identity_awareness_settings.0.remote_access") { + identityAwarenessSettingsPayload["remote-access"] = d.Get("identity_awareness_settings.0.remote_access").(bool) + } + cluster["identity-awareness-settings"] = identityAwarenessSettingsPayload + } + } + } + + if ok := d.HasChange("ips_update_policy"); ok { + cluster["ips-update-policy"] = d.Get("ips_update_policy") + } + + if v, ok := d.GetOkExists("nat_hide_internal_interfaces"); ok { + cluster["nat-hide-internal-interfaces"] = v.(bool) + } + + if d.HasChange("nat_settings") { + + if _, ok := d.GetOk("nat_settings"); ok { + + res := make(map[string]interface{}) + + if v, ok := d.GetOk("nat_settings.auto_rule"); ok { + res["auto-rule"] = v + } + if v, ok := d.GetOk("nat_settings.ipv4_address"); ok { + res["ipv4-address"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.ipv6_address"); ok { + res["ipv6-address"] = v.(string) + } + if d.HasChange("nat_settings.hide_behind") { + res["hide-behind"] = d.Get("nat_settings.hide_behind") + } + if d.HasChange("nat_settings.install_on") { + res["install-on"] = d.Get("nat_settings.install_on") + } + if d.HasChange("nat_settings.method") { + res["method"] = d.Get("nat_settings.method") + } + cluster["nat-settings"] = res + } + } + + if d.HasChange("platform_portal_settings") { + + if v, ok := d.GetOk("platform_portal_settings"); ok { + + platformPortalSettingsList := v.([]interface{}) + + if len(platformPortalSettingsList) > 0 { + + platformPortalSettingsPayload := make(map[string]interface{}) + + if d.HasChange("platform_portal_settings.0.portal_web_settings") { + + portalWebSettingsPayload := make(map[string]interface{}) + + if d.HasChange("platform_portal_settings.0.portal_web_settings.0.aliases") { + portalWebSettingsPayload["aliases"] = d.Get("platform_portal_settings.0.portal_web_settings.0.aliases").(*schema.Set).List() + } + if d.HasChange("platform_portal_settings.0.portal_web_settings.0.main_url") { + portalWebSettingsPayload["main-url"] = d.Get("platform_portal_settings.0.portal_web_settings.0.main_url").(string) + } + platformPortalSettingsPayload["portal-web-settings"] = portalWebSettingsPayload + } + if d.HasChange("platform_portal_settings.0.certificate_settings") { + + certificateSettingsPayload := make(map[string]interface{}) + + if d.HasChange("platform_portal_settings.0.certificate_settings.0.base64_certificate") { + certificateSettingsPayload["base64-certificate"] = d.Get("platform_portal_settings.0.certificate_settings.0.base64_certificate").(string) + } + if d.HasChange("platform_portal_settings.0.certificate_settings.0.base64_password") { + certificateSettingsPayload["base64-password"] = d.Get("platform_portal_settings.0.certificate_settings.0.base64_password").(string) + } + platformPortalSettingsPayload["certificate-settings"] = certificateSettingsPayload + } + if d.HasChange("platform_portal_settings.0.accessibility") { + + accessibilityPayload := make(map[string]interface{}) + + if d.HasChange("platform_portal_settings.0.accessibility.0.allow_access_from") { + accessibilityPayload["allow-access-from"] = d.Get("platform_portal_settings.0.accessibility.0.allow_access_from").(string) + } + if d.HasChange("platform_portal_settings.0.accessibility.0.internal_access_settings") { + accessibilityPayload["internal-access-settings"] = d.Get("platform_portal_settings.0.accessibility.0.internal_access_settings") + } + platformPortalSettingsPayload["accessibility"] = accessibilityPayload + } + cluster["platform-portal-settings"] = platformPortalSettingsPayload + } + } + } + + if d.HasChange("proxy_settings") { + + if _, ok := d.GetOk("proxy_settings"); ok { + + res := make(map[string]interface{}) + + if d.HasChange("proxy_settings.use_custom_proxy") { + res["use-custom-proxy"] = d.Get("proxy_settings.use_custom_proxy") + } + if d.HasChange("proxy_settings.proxy_server") { + res["proxy-server"] = d.Get("proxy_settings.proxy_server") + } + if d.HasChange("proxy_settings.port") { + res["port"] = d.Get("proxy_settings.port") + } + cluster["proxy-settings"] = res + } + } + + if v, ok := d.GetOkExists("qos"); ok { + cluster["qos"] = v.(bool) + } + + if d.HasChange("usercheck_portal_settings") { + + if v, ok := d.GetOk("usercheck_portal_settings"); ok { + + usercheckPortalSettingsList := v.([]interface{}) + + if len(usercheckPortalSettingsList) > 0 { + + usercheckPortalSettingsPayload := make(map[string]interface{}) + + if d.HasChange("usercheck_portal_settings.0.enabled") { + usercheckPortalSettingsPayload["enabled"] = d.Get("usercheck_portal_settings.0.enabled").(bool) + } + if d.HasChange("usercheck_portal_settings.0.portal_web_settings") { + + portalWebSettingsPayload := make(map[string]interface{}) + + if d.HasChange("usercheck_portal_settings.0.portal_web_settings.0.aliases") { + portalWebSettingsPayload["aliases"] = d.Get("usercheck_portal_settings.0.portal_web_settings.0.aliases").(*schema.Set).List() + } + if d.HasChange("usercheck_portal_settings.0.portal_web_settings.0.main_url") { + portalWebSettingsPayload["main-url"] = d.Get("usercheck_portal_settings.0.portal_web_settings.0.main_url").(string) + } + usercheckPortalSettingsPayload["portal-web-settings"] = portalWebSettingsPayload + } + if d.HasChange("usercheck_portal_settings.0.certificate_settings") { + + certificateSettingsPayload := make(map[string]interface{}) + + if d.HasChange("usercheck_portal_settings.0.certificate_settings.0.base64_certificate") { + certificateSettingsPayload["base64-certificate"] = d.Get("usercheck_portal_settings.0.certificate_settings.0.base64_certificate").(string) + } + if d.HasChange("usercheck_portal_settings.0.certificate_settings.0.base64_password") { + certificateSettingsPayload["base64-password"] = d.Get("usercheck_portal_settings.0.certificate_settings.0.base64_password").(string) + } + usercheckPortalSettingsPayload["certificate-settings"] = certificateSettingsPayload + } + if d.HasChange("usercheck_portal_settings.0.accessibility") { + + accessibilityPayload := make(map[string]interface{}) + + if d.HasChange("usercheck_portal_settings.0.accessibility.0.allow_access_from") { + accessibilityPayload["allow-access-from"] = d.Get("usercheck_portal_settings.0.accessibility.0.allow_access_from").(string) + } + if d.HasChange("usercheck_portal_settings.0.accessibility.0.internal_access_settings") { + accessibilityPayload["internal-access-settings"] = d.Get("usercheck_portal_settings.0.accessibility.0.internal_access_settings") + } + usercheckPortalSettingsPayload["accessibility"] = accessibilityPayload + } + cluster["usercheck-portal-settings"] = usercheckPortalSettingsPayload + } + } + } + + if v, ok := d.GetOkExists("zero_phishing"); ok { + cluster["zero-phishing"] = v.(bool) + } + + if ok := d.HasChange("zero_phishing_fqdn"); ok { + cluster["zero-phishing-fqdn"] = d.Get("zero_phishing_fqdn") + } + if d.HasChange("interfaces") { if v, ok := d.GetOk("interfaces"); ok { interfacesList := v.([]interface{}) diff --git a/checkpoint/resource_checkpoint_management_simple_gateway.go b/checkpoint/resource_checkpoint_management_simple_gateway.go index 0e50a114..8ba68d6a 100644 --- a/checkpoint/resource_checkpoint_management_simple_gateway.go +++ b/checkpoint/resource_checkpoint_management_simple_gateway.go @@ -34,6 +34,995 @@ func resourceManagementSimpleGateway() *schema.Resource { Optional: true, Description: "IPv6 address.", }, + "advanced_settings": { + Type: schema.TypeList, + Optional: true, + Description: "N/A", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "connection_persistence": { + Type: schema.TypeString, + Optional: true, + Description: "Handling established connections when installing a new policy.", + Default: "rematch-connections", + }, + "sam": { + Type: schema.TypeList, + Optional: true, + Description: "SAM.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "forward_to_other_sam_servers": { + Type: schema.TypeBool, + Optional: true, + Description: "Forward SAM clients' requests to other SAM servers.", + Default: false, + }, + "use_early_versions": { + Type: schema.TypeList, + Optional: true, + Description: "Use early versions compatibility mode.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Use early versions compatibility mode.", + Default: false, + }, + "compatibility_mode": { + Type: schema.TypeString, + Optional: true, + Description: "Early versions compatibility mode.", + Default: "auth_opsec", + }, + }, + }, + }, + "purge_sam_file": { + Type: schema.TypeList, + Optional: true, + Description: "Purge SAM File.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Purge SAM File.", + Default: false, + }, + "purge_when_size_reaches_to": { + Type: schema.TypeInt, + Optional: true, + Description: "Purge SAM File When it Reaches to.", + Default: 100, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "enable_https_inspection": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable HTTPS Inspection after defining an outbound inspection certificate.
To define the outbound certificate use outbound inspection certificate API.", + }, + "fetch_policy": { + Type: schema.TypeSet, + Optional: true, + Description: "Security management server(s) to fetch the policy from.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hit_count": { + Type: schema.TypeBool, + Optional: true, + Description: "Hit count tracks the number of connections each rule matches.", + Default: true, + }, + "https_inspection": { + Type: schema.TypeList, + Optional: true, + Description: "HTTPS inspection.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bypass_on_failure": { + Type: schema.TypeList, + Optional: true, + Description: "Set to be true in order to bypass all requests (Fail-open) in case of internal system error.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "site_categorization_allow_mode": { + Type: schema.TypeList, + Optional: true, + Description: "Set to 'background' in order to allowed requests until categorization is complete.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeString, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_untrusted_server_cert": { + Type: schema.TypeList, + Optional: true, + Description: "Set to be true in order to drop traffic from servers with untrusted server certificate.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_revoked_server_cert": { + Type: schema.TypeList, + Optional: true, + Description: "Set to be true in order to drop traffic from servers with revoked server certificate (validate CRL).", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + "deny_expired_server_cert": { + Type: schema.TypeList, + Optional: true, + Description: "Set to be true in order to drop traffic from servers with expired server certificate.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "override_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "Override profile of global configuration.", + }, + "value": { + Type: schema.TypeBool, + Optional: true, + Description: "Override value.
Required only for 'override-profile' is True.", + }, + }, + }, + }, + }, + }, + }, + "identity_awareness": { + Type: schema.TypeBool, + Optional: true, + Description: "Identity awareness blade enabled.", + }, + "identity_awareness_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Gateway Identity Awareness settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "browser_based_authentication": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable Browser Based Authentication source.", + }, + "browser_based_authentication_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Browser Based Authentication settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Authentication Settings for Browser Based Authentication.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_method": { + Type: schema.TypeString, + Optional: true, + Description: "Authentication method.", + Default: "username and password", + }, + "identity_provider": { + Type: schema.TypeSet, + Optional: true, + Description: "Identity provider object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"identity provider\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "radius": { + Type: schema.TypeString, + Optional: true, + Description: "Radius server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"radius\".", + }, + "users_directories": { + Type: schema.TypeList, + Optional: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "External user profile.", + Default: true, + }, + "internal_users": { + Type: schema.TypeBool, + Optional: true, + Description: "Internal users.", + Default: true, + }, + "users_from_external_directories": { + Type: schema.TypeString, + Optional: true, + Description: "Users from external directories.", + Default: "all gateways directories", + }, + "specific": { + Type: schema.TypeSet, + Optional: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "browser_based_authentication_portal_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Browser Based Authentication portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "portal_web_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Optional: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Optional: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Optional: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Optional: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_agent": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable Identity Agent source.", + }, + "identity_agent_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity Agent settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agents_interval_keepalive": { + Type: schema.TypeInt, + Optional: true, + Description: "Agents send keepalive period (minutes).", + Default: 5, + }, + "user_reauthenticate_interval": { + Type: schema.TypeInt, + Optional: true, + Description: "Agent reauthenticate time interval (minutes).", + Default: 480, + }, + "authentication_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Authentication Settings for Identity Agent.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_method": { + Type: schema.TypeString, + Optional: true, + Description: "Authentication method.", + Default: "username and password", + }, + "radius": { + Type: schema.TypeString, + Optional: true, + Description: "Radius server object identified by the name or UID. Must be set when \"authentication-method\" was selected to be \"radius\".", + }, + "users_directories": { + Type: schema.TypeList, + Optional: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "External user profile.", + Default: true, + }, + "internal_users": { + Type: schema.TypeBool, + Optional: true, + Description: "Internal users.", + Default: true, + }, + "users_from_external_directories": { + Type: schema.TypeString, + Optional: true, + Description: "Users from external directories.", + Default: "all gateways directories", + }, + "specific": { + Type: schema.TypeSet, + Optional: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_agent_portal_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity Agent accessibility settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_collector": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable Identity Collector source.", + }, + "identity_collector_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity Collector settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authorized_clients": { + Type: schema.TypeList, + Required: true, + Description: "Authorized Clients.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "client": { + Type: schema.TypeString, + Optional: true, + Description: "Host / Network Group Name or UID.", + }, + "client_secret": { + Type: schema.TypeString, + Optional: true, + Description: "Client Secret.", + }, + }, + }, + }, + "authentication_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Authentication Settings for Identity Collector.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "users_directories": { + Type: schema.TypeList, + Optional: true, + Description: "Users directories.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "external_user_profile": { + Type: schema.TypeBool, + Optional: true, + Description: "External user profile.", + Default: true, + }, + "internal_users": { + Type: schema.TypeBool, + Optional: true, + Description: "Internal users.", + Default: true, + }, + "users_from_external_directories": { + Type: schema.TypeString, + Optional: true, + Description: "Users from external directories.", + Default: "all gateways directories", + }, + "specific": { + Type: schema.TypeSet, + Optional: true, + Description: "LDAP AU objects identified by the name or UID. Must be set when \"users-from-external-directories\" was selected to be \"specific\".", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "client_access_permissions": { + Type: schema.TypeList, + Optional: true, + Description: "Identity Collector accessibility settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "identity_sharing_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity sharing settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "share_with_other_gateways": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable identity sharing with other gateways.", + }, + "receive_from_other_gateways": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable receiving identity from other gateways.", + }, + "receive_from": { + Type: schema.TypeSet, + Optional: true, + Description: "Gateway(s) to receive identity from.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "proxy_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Identity-Awareness Proxy settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "detect_using_x_forward_for": { + Type: schema.TypeBool, + Optional: true, + Description: "Whether to use X-Forward-For HTTP header, which is added by the proxy server to keep track of the original source IP.", + Default: false, + }, + }, + }, + }, + "remote_access": { + Type: schema.TypeBool, + Optional: true, + Description: "Enable Remote Access Identity source.", + }, + }, + }, + }, + "ips_update_policy": { + Type: schema.TypeString, + Optional: true, + Description: "Specifies whether the IPS will be downloaded from the Management or directly to the Gateway.", + Default: "gateway automatic update", + }, + "nat_hide_internal_interfaces": { + Type: schema.TypeBool, + Optional: true, + Description: "Hide internal networks behind the Gateway's external IP.", + }, + "nat_settings": { + Type: schema.TypeMap, + Optional: true, + Description: "NAT settings.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "auto_rule": { + Type: schema.TypeBool, + Optional: true, + Description: "Whether to add automatic address translation rules.", + Default: false, + }, + "ipv4_address": { + Type: schema.TypeString, + Optional: true, + Description: "IPv4 address.", + }, + "ipv6_address": { + Type: schema.TypeString, + Optional: true, + Description: "IPv6 address.", + }, + "hide_behind": { + Type: schema.TypeString, + Optional: true, + Description: "Hide behind method. This parameter is forbidden in case \"method\" parameter is \"static\".", + }, + "install_on": { + Type: schema.TypeString, + Optional: true, + Description: "Which gateway should apply the NAT translation.", + }, + "method": { + Type: schema.TypeString, + Optional: true, + Description: "NAT translation method.", + }, + }, + }, + }, + "platform_portal_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Platform portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "portal_web_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Optional: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Optional: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Optional: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Optional: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "proxy_settings": { + Type: schema.TypeMap, + Optional: true, + Description: "Proxy Server for Gateway.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "use_custom_proxy": { + Type: schema.TypeBool, + Optional: true, + Description: "Use custom proxy settings for this network object.", + Default: false, + }, + "proxy_server": { + Type: schema.TypeString, + Optional: true, + Description: "N/A", + }, + "port": { + Type: schema.TypeInt, + Optional: true, + Description: "N/A", + Default: 80, + }, + }, + }, + }, + "qos": { + Type: schema.TypeBool, + Optional: true, + Description: "QoS.", + }, + "usercheck_portal_settings": { + Type: schema.TypeList, + Optional: true, + Description: "UserCheck portal settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "State of the web portal (enabled or disabled). The supported blades are: {'Application Control', 'URL Filtering', 'Data Loss Prevention', 'Anti Virus', 'Anti Bot', 'Threat Emulation', 'Threat Extraction', 'Data Awareness'}.", + }, + "portal_web_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal web settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "aliases": { + Type: schema.TypeSet, + Optional: true, + Description: "List of URL aliases that are redirected to the main portal URL.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "main_url": { + Type: schema.TypeString, + Optional: true, + Description: "The main URL for the web portal.", + }, + }, + }, + }, + "certificate_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal certificate settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base64_certificate": { + Type: schema.TypeString, + Optional: true, + Description: "The certificate file encoded in Base64 with padding. This file must be in the *.p12 format.", + }, + "base64_password": { + Type: schema.TypeString, + Optional: true, + Description: "Password (encoded in Base64 with padding) for the certificate file.", + }, + }, + }, + }, + "accessibility": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the portal access settings.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_access_from": { + Type: schema.TypeString, + Optional: true, + Description: "Allowed access to the web portal (based on interfaces, or security policy).", + }, + "internal_access_settings": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration of the additional portal access settings for internal interfaces only.", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "undefined": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'.", + }, + "dmz": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'.", + }, + "vpn": { + Type: schema.TypeBool, + Optional: true, + Description: "Controls portal access settings for interfaces that are part of a VPN Encryption Domain.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "zero_phishing": { + Type: schema.TypeBool, + Optional: true, + Description: "Zero Phishing blade enabled.", + }, + "zero_phishing_fqdn": { + Type: schema.TypeString, + Optional: true, + Description: "Zero Phishing gateway FQDN.", + }, "interfaces": { Type: schema.TypeList, Optional: true, @@ -898,23 +1887,393 @@ func resourceManagementSimpleGateway() *schema.Resource { }, }, } -} +} + +func createManagementSimpleGateway(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + gateway := make(map[string]interface{}) + + if v, ok := d.GetOk("name"); ok { + gateway["name"] = v.(string) + } + + if v, ok := d.GetOk("ipv4_address"); ok { + gateway["ipv4-address"] = v.(string) + } + + if v, ok := d.GetOk("ipv6_address"); ok { + gateway["ipv6-address"] = v.(string) + } + + if v, ok := d.GetOk("advanced_settings"); ok { + + advancedSettingsList := v.([]interface{}) + + if len(advancedSettingsList) > 0 { + + advancedSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("advanced_settings.0.connection_persistence"); ok { + advancedSettingsPayload["connection-persistence"] = v.(string) + } + if _, ok := d.GetOk("advanced_settings.0.sam"); ok { + + samPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("advanced_settings.0.sam.0.forward_to_other_sam_servers"); ok { + samPayload["forward-to-other-sam-servers"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("advanced_settings.0.sam.0.use_early_versions"); ok { + samPayload["use-early-versions"] = v + } + if v, ok := d.GetOk("advanced_settings.0.sam.0.purge_sam_file"); ok { + samPayload["purge-sam-file"] = v + } + advancedSettingsPayload["sam"] = samPayload + } + gateway["advanced-settings"] = advancedSettingsPayload + } + } + + if v, ok := d.GetOkExists("enable_https_inspection"); ok { + gateway["enable-https-inspection"] = v.(bool) + } + + if v, ok := d.GetOk("fetch_policy"); ok { + gateway["fetch-policy"] = v.(*schema.Set).List() + } + + if v, ok := d.GetOkExists("hit_count"); ok { + gateway["hit-count"] = v.(bool) + } + if v, ok := d.GetOk("https_inspection"); ok { + + httpsInspectionList := v.([]interface{}) + + if len(httpsInspectionList) > 0 { + + httpsInspectionPayload := make(map[string]interface{}) + + if _, ok := d.GetOk("https_inspection.0.bypass_on_failure"); ok { + + bypassOnFailurePayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.bypass_on_failure.0.override_profile"); ok { + bypassOnFailurePayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.bypass_on_failure.0.value"); ok { + bypassOnFailurePayload["value"] = strconv.FormatBool(v.(bool)) + } + httpsInspectionPayload["bypass-on-failure"] = bypassOnFailurePayload + } + if _, ok := d.GetOk("https_inspection.0.site_categorization_allow_mode"); ok { + + siteCategorizationAllowModePayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.site_categorization_allow_mode.0.override_profile"); ok { + siteCategorizationAllowModePayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.site_categorization_allow_mode.0.value"); ok { + siteCategorizationAllowModePayload["value"] = v.(string) + } + httpsInspectionPayload["site-categorization-allow-mode"] = siteCategorizationAllowModePayload + } + if _, ok := d.GetOk("https_inspection.0.deny_untrusted_server_cert"); ok { + + denyUntrustedServerCertPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.deny_untrusted_server_cert.0.override_profile"); ok { + denyUntrustedServerCertPayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.deny_untrusted_server_cert.0.value"); ok { + denyUntrustedServerCertPayload["value"] = strconv.FormatBool(v.(bool)) + } + httpsInspectionPayload["deny-untrusted-server-cert"] = denyUntrustedServerCertPayload + } + if _, ok := d.GetOk("https_inspection.0.deny_revoked_server_cert"); ok { + + denyRevokedServerCertPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.deny_revoked_server_cert.0.override_profile"); ok { + denyRevokedServerCertPayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.deny_revoked_server_cert.0.value"); ok { + denyRevokedServerCertPayload["value"] = strconv.FormatBool(v.(bool)) + } + httpsInspectionPayload["deny-revoked-server-cert"] = denyRevokedServerCertPayload + } + if _, ok := d.GetOk("https_inspection.0.deny_expired_server_cert"); ok { + + denyExpiredServerCertPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("https_inspection.0.deny_expired_server_cert.0.override_profile"); ok { + denyExpiredServerCertPayload["override-profile"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("https_inspection.0.deny_expired_server_cert.0.value"); ok { + denyExpiredServerCertPayload["value"] = strconv.FormatBool(v.(bool)) + } + httpsInspectionPayload["deny-expired-server-cert"] = denyExpiredServerCertPayload + } + gateway["https-inspection"] = httpsInspectionPayload + } + } + + if v, ok := d.GetOkExists("identity_awareness"); ok { + gateway["identity-awareness"] = v.(bool) + } + + if v, ok := d.GetOk("identity_awareness_settings"); ok { + + identityAwarenessSettingsList := v.([]interface{}) + + if len(identityAwarenessSettingsList) > 0 { + + identityAwarenessSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.browser_based_authentication"); ok { + identityAwarenessSettingsPayload["browser-based-authentication"] = v.(bool) + } + if _, ok := d.GetOk("identity_awareness_settings.0.browser_based_authentication_settings"); ok { + + browserBasedAuthenticationSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.browser_based_authentication_settings.0.authentication_settings"); ok { + browserBasedAuthenticationSettingsPayload["authentication-settings"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.browser_based_authentication_settings.0.browser_based_authentication_portal_settings"); ok { + browserBasedAuthenticationSettingsPayload["browser-based-authentication-portal-settings"] = v + } + identityAwarenessSettingsPayload["browser-based-authentication-settings"] = browserBasedAuthenticationSettingsPayload + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent"); ok { + identityAwarenessSettingsPayload["identity-agent"] = v.(bool) + } + if _, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings"); ok { + + identityAgentSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings.0.agents_interval_keepalive"); ok { + identityAgentSettingsPayload["agents-interval-keepalive"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings.0.user_reauthenticate_interval"); ok { + identityAgentSettingsPayload["user-reauthenticate-interval"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings.0.authentication_settings"); ok { + identityAgentSettingsPayload["authentication-settings"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_agent_settings.0.identity_agent_portal_settings"); ok { + identityAgentSettingsPayload["identity-agent-portal-settings"] = v + } + identityAwarenessSettingsPayload["identity-agent-settings"] = identityAgentSettingsPayload + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_collector"); ok { + identityAwarenessSettingsPayload["identity-collector"] = v.(bool) + } + if _, ok := d.GetOk("identity_awareness_settings.0.identity_collector_settings"); ok { + + identityCollectorSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.identity_collector_settings.0.authorized_clients"); ok { + identityCollectorSettingsPayload["authorized-clients"] = v.(*schema.Set).List() + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_collector_settings.0.authentication_settings"); ok { + identityCollectorSettingsPayload["authentication-settings"] = v + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_collector_settings.0.client_access_permissions"); ok { + identityCollectorSettingsPayload["client-access-permissions"] = v + } + identityAwarenessSettingsPayload["identity-collector-settings"] = identityCollectorSettingsPayload + } + if _, ok := d.GetOk("identity_awareness_settings.0.identity_sharing_settings"); ok { + + identitySharingSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.identity_sharing_settings.0.share_with_other_gateways"); ok { + identitySharingSettingsPayload["share-with-other-gateways"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_sharing_settings.0.receive_from_other_gateways"); ok { + identitySharingSettingsPayload["receive-from-other-gateways"] = strconv.FormatBool(v.(bool)) + } + if v, ok := d.GetOk("identity_awareness_settings.0.identity_sharing_settings.0.receive_from"); ok { + identitySharingSettingsPayload["receive-from"] = v.(*schema.Set).List() + } + identityAwarenessSettingsPayload["identity-sharing-settings"] = identitySharingSettingsPayload + } + if _, ok := d.GetOk("identity_awareness_settings.0.proxy_settings"); ok { + + proxySettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("identity_awareness_settings.0.proxy_settings.0.detect_using_x_forward_for"); ok { + proxySettingsPayload["detect-using-x-forward-for"] = strconv.FormatBool(v.(bool)) + } + identityAwarenessSettingsPayload["proxy-settings"] = proxySettingsPayload + } + if v, ok := d.GetOk("identity_awareness_settings.0.remote_access"); ok { + identityAwarenessSettingsPayload["remote-access"] = v.(bool) + } + gateway["identity-awareness-settings"] = identityAwarenessSettingsPayload + } + } + + if v, ok := d.GetOk("ips_update_policy"); ok { + gateway["ips-update-policy"] = v.(string) + } + + if v, ok := d.GetOkExists("nat_hide_internal_interfaces"); ok { + gateway["nat-hide-internal-interfaces"] = v.(bool) + } + + if _, ok := d.GetOk("nat_settings"); ok { + + res := make(map[string]interface{}) + + if v, ok := d.GetOk("nat_settings.auto_rule"); ok { + res["auto-rule"] = v + } + if v, ok := d.GetOk("nat_settings.ipv4_address"); ok { + res["ipv4-address"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.ipv6_address"); ok { + res["ipv6-address"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.hide_behind"); ok { + res["hide-behind"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.install_on"); ok { + res["install-on"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.method"); ok { + res["method"] = v.(string) + } + gateway["nat-settings"] = res + } + + if v, ok := d.GetOk("platform_portal_settings"); ok { + + platformPortalSettingsList := v.([]interface{}) + + if len(platformPortalSettingsList) > 0 { + + platformPortalSettingsPayload := make(map[string]interface{}) + + if _, ok := d.GetOk("platform_portal_settings.0.portal_web_settings"); ok { + + portalWebSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("platform_portal_settings.0.portal_web_settings.0.aliases"); ok { + portalWebSettingsPayload["aliases"] = v.(*schema.Set).List() + } + if v, ok := d.GetOk("platform_portal_settings.0.portal_web_settings.0.main_url"); ok { + portalWebSettingsPayload["main-url"] = v.(string) + } + platformPortalSettingsPayload["portal-web-settings"] = portalWebSettingsPayload + } + if _, ok := d.GetOk("platform_portal_settings.0.certificate_settings"); ok { + + certificateSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("platform_portal_settings.0.certificate_settings.0.base64_certificate"); ok { + certificateSettingsPayload["base64-certificate"] = v.(string) + } + if v, ok := d.GetOk("platform_portal_settings.0.certificate_settings.0.base64_password"); ok { + certificateSettingsPayload["base64-password"] = v.(string) + } + platformPortalSettingsPayload["certificate-settings"] = certificateSettingsPayload + } + if _, ok := d.GetOk("platform_portal_settings.0.accessibility"); ok { + + accessibilityPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("platform_portal_settings.0.accessibility.0.allow_access_from"); ok { + accessibilityPayload["allow-access-from"] = v.(string) + } + if v, ok := d.GetOk("platform_portal_settings.0.accessibility.0.internal_access_settings"); ok { + accessibilityPayload["internal-access-settings"] = v + } + platformPortalSettingsPayload["accessibility"] = accessibilityPayload + } + gateway["platform-portal-settings"] = platformPortalSettingsPayload + } + } -func createManagementSimpleGateway(d *schema.ResourceData, m interface{}) error { - client := m.(*checkpoint.ApiClient) + if _, ok := d.GetOk("proxy_settings"); ok { - gateway := make(map[string]interface{}) + res := make(map[string]interface{}) - if v, ok := d.GetOk("name"); ok { - gateway["name"] = v.(string) + if v, ok := d.GetOk("proxy_settings.use_custom_proxy"); ok { + res["use-custom-proxy"] = v + } + if v, ok := d.GetOk("proxy_settings.proxy_server"); ok { + res["proxy-server"] = v.(string) + } + if v, ok := d.GetOk("proxy_settings.port"); ok { + res["port"] = v + } + gateway["proxy-settings"] = res } - if v, ok := d.GetOk("ipv4_address"); ok { - gateway["ipv4-address"] = v.(string) + if v, ok := d.GetOkExists("qos"); ok { + gateway["qos"] = v.(bool) } - if v, ok := d.GetOk("ipv6_address"); ok { - gateway["ipv6-address"] = v.(string) + if v, ok := d.GetOk("usercheck_portal_settings"); ok { + + usercheckPortalSettingsList := v.([]interface{}) + + if len(usercheckPortalSettingsList) > 0 { + + usercheckPortalSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("usercheck_portal_settings.0.enabled"); ok { + usercheckPortalSettingsPayload["enabled"] = v.(bool) + } + if _, ok := d.GetOk("usercheck_portal_settings.0.portal_web_settings"); ok { + + portalWebSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("usercheck_portal_settings.0.portal_web_settings.0.aliases"); ok { + portalWebSettingsPayload["aliases"] = v.(*schema.Set).List() + } + if v, ok := d.GetOk("usercheck_portal_settings.0.portal_web_settings.0.main_url"); ok { + portalWebSettingsPayload["main-url"] = v.(string) + } + usercheckPortalSettingsPayload["portal-web-settings"] = portalWebSettingsPayload + } + if _, ok := d.GetOk("usercheck_portal_settings.0.certificate_settings"); ok { + + certificateSettingsPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("usercheck_portal_settings.0.certificate_settings.0.base64_certificate"); ok { + certificateSettingsPayload["base64-certificate"] = v.(string) + } + if v, ok := d.GetOk("usercheck_portal_settings.0.certificate_settings.0.base64_password"); ok { + certificateSettingsPayload["base64-password"] = v.(string) + } + usercheckPortalSettingsPayload["certificate-settings"] = certificateSettingsPayload + } + if _, ok := d.GetOk("usercheck_portal_settings.0.accessibility"); ok { + + accessibilityPayload := make(map[string]interface{}) + + if v, ok := d.GetOk("usercheck_portal_settings.0.accessibility.0.allow_access_from"); ok { + accessibilityPayload["allow-access-from"] = v.(string) + } + if v, ok := d.GetOk("usercheck_portal_settings.0.accessibility.0.internal_access_settings"); ok { + accessibilityPayload["internal-access-settings"] = v + } + usercheckPortalSettingsPayload["accessibility"] = accessibilityPayload + } + gateway["usercheck-portal-settings"] = usercheckPortalSettingsPayload + } + } + + if v, ok := d.GetOkExists("zero_phishing"); ok { + gateway["zero-phishing"] = v.(bool) + } + + if v, ok := d.GetOk("zero_phishing_fqdn"); ok { + gateway["zero-phishing-fqdn"] = v.(string) } if v, ok := d.GetOk("interfaces"); ok { @@ -1354,74 +2713,525 @@ func createManagementSimpleGateway(d *schema.ResourceData, m interface{}) error if v, ok := d.GetOk("logs_settings.update_account_log_every"); ok { logsSettings["update-account-log-every"] = v } - gateway["logs-settings"] = logsSettings + gateway["logs-settings"] = logsSettings + } + + // General + if v, ok := d.GetOk("tags"); ok { + gateway["tags"] = v.(*schema.Set).List() + } + + if v, ok := d.GetOk("comments"); ok { + gateway["comments"] = v.(string) + } + + if v, ok := d.GetOk("color"); ok { + gateway["color"] = v.(string) + } + + if v, ok := d.GetOk("ignore_warnings"); ok { + gateway["ignore-warnings"] = v + } + + log.Println("Create Simple Gateway - Map = ", gateway) + + addGatewayRes, err := client.ApiCall("add-simple-gateway", gateway, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil || !addGatewayRes.Success { + if addGatewayRes.ErrorMsg != "" { + return fmt.Errorf(addGatewayRes.ErrorMsg) + } + return fmt.Errorf(err.Error()) + } + + d.SetId(addGatewayRes.GetData()["uid"].(string)) + + return readManagementSimpleGateway(d, m) +} + +func readManagementSimpleGateway(d *schema.ResourceData, m interface{}) error { + client := m.(*checkpoint.ApiClient) + + payload := map[string]interface{}{ + "uid": d.Id(), + } + + showGatewayRes, err := client.ApiCall("show-simple-gateway", payload, client.GetSessionID(), true, client.IsProxyUsed()) + if err != nil { + return fmt.Errorf(err.Error()) + } + if !showGatewayRes.Success { + if objectNotFound(showGatewayRes.GetData()["code"].(string)) { + d.SetId("") + return nil + } + return fmt.Errorf(showGatewayRes.ErrorMsg) + } + + gateway := showGatewayRes.GetData() + + log.Println("Read Simple Gateway - Show JSON = ", gateway) + + if v := gateway["name"]; v != nil { + _ = d.Set("name", v) + } + + if v := gateway["ipv4-address"]; v != nil { + _ = d.Set("ipv4_address", v) + } + + if v := gateway["ipv6-address"]; v != nil { + _ = d.Set("ipv6_address", v) + } + + if gateway["advanced-settings"] != nil { + + advancedSettingsMap, ok := gateway["advanced-settings"].(map[string]interface{}) + + if ok { + advancedSettingsMapToReturn := make(map[string]interface{}) + + if v := advancedSettingsMap["connection-persistence"]; v != nil { + advancedSettingsMapToReturn["connection_persistence"] = v + } + if v, ok := advancedSettingsMap["sam"]; ok { + + samMap, ok := v.(map[string]interface{}) + if ok { + samMapToReturn := make(map[string]interface{}) + + if v, _ := samMap["forward-to-other-sam-servers"]; v != nil { + samMapToReturn["forward_to_other_sam_servers"] = v + } + if v, _ := samMap["use-early-versions"]; v != nil { + samMapToReturn["use_early_versions"] = v + } + if v, _ := samMap["purge-sam-file"]; v != nil { + samMapToReturn["purge_sam_file"] = v + } + advancedSettingsMapToReturn["sam"] = []interface{}{samMapToReturn} + } + } + _ = d.Set("advanced_settings", []interface{}{advancedSettingsMapToReturn}) + + } + } else { + _ = d.Set("advanced_settings", nil) + } + + if v := gateway["enable-https-inspection"]; v != nil { + _ = d.Set("enable_https_inspection", v) + } + + if gateway["fetch-policy"] != nil { + fetchPolicyJson, ok := gateway["fetch-policy"].([]interface{}) + if ok { + fetchPolicyIds := make([]string, 0) + if len(fetchPolicyJson) > 0 { + for _, fetch_policy := range fetchPolicyJson { + fetch_policy := fetch_policy.(map[string]interface{}) + fetchPolicyIds = append(fetchPolicyIds, fetch_policy["name"].(string)) + } + } + _ = d.Set("fetch_policy", fetchPolicyIds) + } + } else { + _ = d.Set("fetch_policy", nil) + } + + if v := gateway["hit-count"]; v != nil { + _ = d.Set("hit_count", v) + } + if gateway["https-inspection"] != nil { + + httpsInspectionMap, ok := gateway["https-inspection"].(map[string]interface{}) + + if ok { + httpsInspectionMapToReturn := make(map[string]interface{}) + + if v, ok := httpsInspectionMap["bypass-on-failure"]; ok { + + bypassOnFailureMap, ok := v.(map[string]interface{}) + if ok { + bypassOnFailureMapToReturn := make(map[string]interface{}) + + if v, _ := bypassOnFailureMap["override-profile"]; v != nil { + bypassOnFailureMapToReturn["override_profile"] = v + } + if v, _ := bypassOnFailureMap["value"]; v != nil { + bypassOnFailureMapToReturn["value"] = v + } + httpsInspectionMapToReturn["bypass_on_failure"] = []interface{}{bypassOnFailureMapToReturn} + } + } + if v, ok := httpsInspectionMap["site-categorization-allow-mode"]; ok { + + siteCategorizationAllowModeMap, ok := v.(map[string]interface{}) + if ok { + siteCategorizationAllowModeMapToReturn := make(map[string]interface{}) + + if v, _ := siteCategorizationAllowModeMap["override-profile"]; v != nil { + siteCategorizationAllowModeMapToReturn["override_profile"] = v + } + if v, _ := siteCategorizationAllowModeMap["value"]; v != nil { + siteCategorizationAllowModeMapToReturn["value"] = v + } + httpsInspectionMapToReturn["site_categorization_allow_mode"] = []interface{}{siteCategorizationAllowModeMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-untrusted-server-cert"]; ok { + + denyUntrustedServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyUntrustedServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyUntrustedServerCertMap["override-profile"]; v != nil { + denyUntrustedServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyUntrustedServerCertMap["value"]; v != nil { + denyUntrustedServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_untrusted_server_cert"] = []interface{}{denyUntrustedServerCertMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-revoked-server-cert"]; ok { + + denyRevokedServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyRevokedServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyRevokedServerCertMap["override-profile"]; v != nil { + denyRevokedServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyRevokedServerCertMap["value"]; v != nil { + denyRevokedServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_revoked_server_cert"] = []interface{}{denyRevokedServerCertMapToReturn} + } + } + if v, ok := httpsInspectionMap["deny-expired-server-cert"]; ok { + + denyExpiredServerCertMap, ok := v.(map[string]interface{}) + if ok { + denyExpiredServerCertMapToReturn := make(map[string]interface{}) + + if v, _ := denyExpiredServerCertMap["override-profile"]; v != nil { + denyExpiredServerCertMapToReturn["override_profile"] = v + } + if v, _ := denyExpiredServerCertMap["value"]; v != nil { + denyExpiredServerCertMapToReturn["value"] = v + } + httpsInspectionMapToReturn["deny_expired_server_cert"] = []interface{}{denyExpiredServerCertMapToReturn} + } + } + _ = d.Set("https_inspection", []interface{}{httpsInspectionMapToReturn}) + + } + } else { + _ = d.Set("https_inspection", nil) + } + + if v := gateway["identity-awareness"]; v != nil { + _ = d.Set("identity_awareness", v) + } + + if gateway["identity-awareness-settings"] != nil { + + identityAwarenessSettingsMap, ok := gateway["identity-awareness-settings"].(map[string]interface{}) + + if ok { + identityAwarenessSettingsMapToReturn := make(map[string]interface{}) + + if v := identityAwarenessSettingsMap["browser-based-authentication"]; v != nil { + identityAwarenessSettingsMapToReturn["browser_based_authentication"] = v + } + if v, ok := identityAwarenessSettingsMap["browser-based-authentication-settings"]; ok { + + browserBasedAuthenticationSettingsMap, ok := v.(map[string]interface{}) + if ok { + browserBasedAuthenticationSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := browserBasedAuthenticationSettingsMap["authentication-settings"]; v != nil { + browserBasedAuthenticationSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := browserBasedAuthenticationSettingsMap["browser-based-authentication-portal-settings"]; v != nil { + browserBasedAuthenticationSettingsMapToReturn["browser_based_authentication_portal_settings"] = v + } + identityAwarenessSettingsMapToReturn["browser_based_authentication_settings"] = []interface{}{browserBasedAuthenticationSettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["identity-agent"]; v != nil { + identityAwarenessSettingsMapToReturn["identity_agent"] = v + } + if v, ok := identityAwarenessSettingsMap["identity-agent-settings"]; ok { + + identityAgentSettingsMap, ok := v.(map[string]interface{}) + if ok { + identityAgentSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identityAgentSettingsMap["agents-interval-keepalive"]; v != nil { + identityAgentSettingsMapToReturn["agents_interval_keepalive"] = v + } + if v, _ := identityAgentSettingsMap["user-reauthenticate-interval"]; v != nil { + identityAgentSettingsMapToReturn["user_reauthenticate_interval"] = v + } + if v, _ := identityAgentSettingsMap["authentication-settings"]; v != nil { + identityAgentSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := identityAgentSettingsMap["identity-agent-portal-settings"]; v != nil { + identityAgentSettingsMapToReturn["identity_agent_portal_settings"] = v + } + identityAwarenessSettingsMapToReturn["identity_agent_settings"] = []interface{}{identityAgentSettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["identity-collector"]; v != nil { + identityAwarenessSettingsMapToReturn["identity_collector"] = v + } + if v, ok := identityAwarenessSettingsMap["identity-collector-settings"]; ok { + + identityCollectorSettingsMap, ok := v.(map[string]interface{}) + if ok { + identityCollectorSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identityCollectorSettingsMap["authorized-clients"]; v != nil { + identityCollectorSettingsMapToReturn["authorized_clients"] = v + } + if v, _ := identityCollectorSettingsMap["authentication-settings"]; v != nil { + identityCollectorSettingsMapToReturn["authentication_settings"] = v + } + if v, _ := identityCollectorSettingsMap["client-access-permissions"]; v != nil { + identityCollectorSettingsMapToReturn["client_access_permissions"] = v + } + identityAwarenessSettingsMapToReturn["identity_collector_settings"] = []interface{}{identityCollectorSettingsMapToReturn} + } + } + if v, ok := identityAwarenessSettingsMap["identity-sharing-settings"]; ok { + + identitySharingSettingsMap, ok := v.(map[string]interface{}) + if ok { + identitySharingSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := identitySharingSettingsMap["share-with-other-gateways"]; v != nil { + identitySharingSettingsMapToReturn["share_with_other_gateways"] = v + } + if v, _ := identitySharingSettingsMap["receive-from-other-gateways"]; v != nil { + identitySharingSettingsMapToReturn["receive_from_other_gateways"] = v + } + if v, _ := identitySharingSettingsMap["receive-from"]; v != nil { + identitySharingSettingsMapToReturn["receive_from"] = v + } + identityAwarenessSettingsMapToReturn["identity_sharing_settings"] = []interface{}{identitySharingSettingsMapToReturn} + } + } + if v, ok := identityAwarenessSettingsMap["proxy-settings"]; ok { + + proxySettingsMap, ok := v.(map[string]interface{}) + if ok { + proxySettingsMapToReturn := make(map[string]interface{}) + + if v, _ := proxySettingsMap["detect-using-x-forward-for"]; v != nil { + proxySettingsMapToReturn["detect_using_x_forward_for"] = v + } + identityAwarenessSettingsMapToReturn["proxy_settings"] = []interface{}{proxySettingsMapToReturn} + } + } + if v := identityAwarenessSettingsMap["remote-access"]; v != nil { + identityAwarenessSettingsMapToReturn["remote_access"] = v + } + _ = d.Set("identity_awareness_settings", []interface{}{identityAwarenessSettingsMapToReturn}) + + } + } else { + _ = d.Set("identity_awareness_settings", nil) + } + + if v := gateway["ips-update-policy"]; v != nil { + _ = d.Set("ips_update_policy", v) + } + + if v := gateway["nat-hide-internal-interfaces"]; v != nil { + _ = d.Set("nat_hide_internal_interfaces", v) + } + + if gateway["nat-settings"] != nil { + + natSettingsMap := gateway["nat-settings"].(map[string]interface{}) + + natSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := natSettingsMap["auto-rule"]; v != nil { + natSettingsMapToReturn["auto_rule"] = strconv.FormatBool(v.(bool)) + } + if v, _ := natSettingsMap["ipv4-address"]; v != nil && v != "" { + natSettingsMapToReturn["ipv4_address"] = v + } + if v, _ := natSettingsMap["ipv6-address"]; v != nil && v != "" { + natSettingsMapToReturn["ipv6_address"] = v + } + if v, _ := natSettingsMap["hide-behind"]; v != nil { + natSettingsMapToReturn["hide_behind"] = v + } + if v, _ := natSettingsMap["install-on"]; v != nil { + natSettingsMapToReturn["install_on"] = v + } + if v, _ := natSettingsMap["method"]; v != nil { + natSettingsMapToReturn["method"] = v + } + _ = d.Set("nat_settings", natSettingsMapToReturn) + } else { + _ = d.Set("nat_settings", nil) + } + + if gateway["platform-portal-settings"] != nil { + + platformPortalSettingsMap, ok := gateway["platform-portal-settings"].(map[string]interface{}) + + if ok { + platformPortalSettingsMapToReturn := make(map[string]interface{}) + + if v, ok := platformPortalSettingsMap["portal-web-settings"]; ok { + + portalWebSettingsMap, ok := v.(map[string]interface{}) + if ok { + portalWebSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := portalWebSettingsMap["aliases"]; v != nil { + portalWebSettingsMapToReturn["aliases"] = v + } + if v, _ := portalWebSettingsMap["main-url"]; v != nil { + portalWebSettingsMapToReturn["main_url"] = v + } + platformPortalSettingsMapToReturn["portal_web_settings"] = []interface{}{portalWebSettingsMapToReturn} + } + } + if v, ok := platformPortalSettingsMap["certificate-settings"]; ok { + + certificateSettingsMap, ok := v.(map[string]interface{}) + if ok { + certificateSettingsMapToReturn := make(map[string]interface{}) + + if v, _ := certificateSettingsMap["base64-certificate"]; v != nil { + certificateSettingsMapToReturn["base64_certificate"] = v + } + if v, _ := certificateSettingsMap["base64-password"]; v != nil { + certificateSettingsMapToReturn["base64_password"] = v + } + platformPortalSettingsMapToReturn["certificate_settings"] = []interface{}{certificateSettingsMapToReturn} + } + } + if v, ok := platformPortalSettingsMap["accessibility"]; ok { + + accessibilityMap, ok := v.(map[string]interface{}) + if ok { + accessibilityMapToReturn := make(map[string]interface{}) + + if v, _ := accessibilityMap["allow-access-from"]; v != nil { + accessibilityMapToReturn["allow_access_from"] = v + } + if v, _ := accessibilityMap["internal-access-settings"]; v != nil { + accessibilityMapToReturn["internal_access_settings"] = v + } + platformPortalSettingsMapToReturn["accessibility"] = []interface{}{accessibilityMapToReturn} + } + } + _ = d.Set("platform_portal_settings", []interface{}{platformPortalSettingsMapToReturn}) + + } + } else { + _ = d.Set("platform_portal_settings", nil) } - // General - if v, ok := d.GetOk("tags"); ok { - gateway["tags"] = v.(*schema.Set).List() - } + if gateway["proxy-settings"] != nil { - if v, ok := d.GetOk("comments"); ok { - gateway["comments"] = v.(string) - } + proxySettingsMap := gateway["proxy-settings"].(map[string]interface{}) - if v, ok := d.GetOk("color"); ok { - gateway["color"] = v.(string) + proxySettingsMapToReturn := make(map[string]interface{}) + + if v, _ := proxySettingsMap["use-custom-proxy"]; v != nil { + proxySettingsMapToReturn["use_custom_proxy"] = strconv.FormatBool(v.(bool)) + } + if v, _ := proxySettingsMap["proxy-server"]; v != nil { + proxySettingsMapToReturn["proxy_server"] = v + } + if v, _ := proxySettingsMap["port"]; v != nil { + proxySettingsMapToReturn["port"] = v + } + _ = d.Set("proxy_settings", proxySettingsMapToReturn) + } else { + _ = d.Set("proxy_settings", nil) } - if v, ok := d.GetOk("ignore_warnings"); ok { - gateway["ignore-warnings"] = v + if v := gateway["qos"]; v != nil { + _ = d.Set("qos", v) } - log.Println("Create Simple Gateway - Map = ", gateway) + if gateway["usercheck-portal-settings"] != nil { - addGatewayRes, err := client.ApiCall("add-simple-gateway", gateway, client.GetSessionID(), true, client.IsProxyUsed()) - if err != nil || !addGatewayRes.Success { - if addGatewayRes.ErrorMsg != "" { - return fmt.Errorf(addGatewayRes.ErrorMsg) - } - return fmt.Errorf(err.Error()) - } + usercheckPortalSettingsMap, ok := gateway["usercheck-portal-settings"].(map[string]interface{}) - d.SetId(addGatewayRes.GetData()["uid"].(string)) + if ok { + usercheckPortalSettingsMapToReturn := make(map[string]interface{}) - return readManagementSimpleGateway(d, m) -} + if v := usercheckPortalSettingsMap["enabled"]; v != nil { + usercheckPortalSettingsMapToReturn["enabled"] = v + } + if v, ok := usercheckPortalSettingsMap["portal-web-settings"]; ok { -func readManagementSimpleGateway(d *schema.ResourceData, m interface{}) error { - client := m.(*checkpoint.ApiClient) + portalWebSettingsMap, ok := v.(map[string]interface{}) + if ok { + portalWebSettingsMapToReturn := make(map[string]interface{}) - payload := map[string]interface{}{ - "uid": d.Id(), - } + if v, _ := portalWebSettingsMap["aliases"]; v != nil { + portalWebSettingsMapToReturn["aliases"] = v + } + if v, _ := portalWebSettingsMap["main-url"]; v != nil { + portalWebSettingsMapToReturn["main_url"] = v + } + usercheckPortalSettingsMapToReturn["portal_web_settings"] = []interface{}{portalWebSettingsMapToReturn} + } + } + if v, ok := usercheckPortalSettingsMap["certificate-settings"]; ok { - showGatewayRes, err := client.ApiCall("show-simple-gateway", payload, client.GetSessionID(), true, client.IsProxyUsed()) - if err != nil { - return fmt.Errorf(err.Error()) - } - if !showGatewayRes.Success { - if objectNotFound(showGatewayRes.GetData()["code"].(string)) { - d.SetId("") - return nil - } - return fmt.Errorf(showGatewayRes.ErrorMsg) - } + certificateSettingsMap, ok := v.(map[string]interface{}) + if ok { + certificateSettingsMapToReturn := make(map[string]interface{}) - gateway := showGatewayRes.GetData() + if v, _ := certificateSettingsMap["base64-certificate"]; v != nil { + certificateSettingsMapToReturn["base64_certificate"] = v + } + if v, _ := certificateSettingsMap["base64-password"]; v != nil { + certificateSettingsMapToReturn["base64_password"] = v + } + usercheckPortalSettingsMapToReturn["certificate_settings"] = []interface{}{certificateSettingsMapToReturn} + } + } + if v, ok := usercheckPortalSettingsMap["accessibility"]; ok { - log.Println("Read Simple Gateway - Show JSON = ", gateway) + accessibilityMap, ok := v.(map[string]interface{}) + if ok { + accessibilityMapToReturn := make(map[string]interface{}) - if v := gateway["name"]; v != nil { - _ = d.Set("name", v) + if v, _ := accessibilityMap["allow-access-from"]; v != nil { + accessibilityMapToReturn["allow_access_from"] = v + } + if v, _ := accessibilityMap["internal-access-settings"]; v != nil { + accessibilityMapToReturn["internal_access_settings"] = v + } + usercheckPortalSettingsMapToReturn["accessibility"] = []interface{}{accessibilityMapToReturn} + } + } + _ = d.Set("usercheck_portal_settings", []interface{}{usercheckPortalSettingsMapToReturn}) + + } + } else { + _ = d.Set("usercheck_portal_settings", nil) } - if v := gateway["ipv4-address"]; v != nil { - _ = d.Set("ipv4_address", v) + if v := gateway["zero-phishing"]; v != nil { + _ = d.Set("zero_phishing", v) } - if v := gateway["ipv6-address"]; v != nil { - _ = d.Set("ipv6_address", v) + if v := gateway["zero-phishing-fqdn"]; v != nil { + _ = d.Set("zero_phishing_fqdn", v) } if v := gateway["interfaces"]; v != nil { @@ -2023,6 +3833,403 @@ func updateManagementSimpleGateway(d *schema.ResourceData, m interface{}) error gateway["ipv6-address"] = d.Get("ipv6_address") } + if d.HasChange("advanced_settings") { + + if v, ok := d.GetOk("advanced_settings"); ok { + + advancedSettingsList := v.([]interface{}) + + if len(advancedSettingsList) > 0 { + + advancedSettingsPayload := make(map[string]interface{}) + + if d.HasChange("advanced_settings.0.connection_persistence") { + advancedSettingsPayload["connection-persistence"] = d.Get("advanced_settings.0.connection_persistence").(string) + } + if d.HasChange("advanced_settings.0.sam") { + + samPayload := make(map[string]interface{}) + + if d.HasChange("advanced_settings.0.sam.0.forward_to_other_sam_servers") { + samPayload["forward-to-other-sam-servers"] = d.Get("advanced_settings.0.sam.0.forward_to_other_sam_servers") + } + if d.HasChange("advanced_settings.0.sam.0.use_early_versions") { + samPayload["use-early-versions"] = d.Get("advanced_settings.0.sam.0.use_early_versions") + } + if d.HasChange("advanced_settings.0.sam.0.purge_sam_file") { + samPayload["purge-sam-file"] = d.Get("advanced_settings.0.sam.0.purge_sam_file") + } + advancedSettingsPayload["sam"] = samPayload + } + gateway["advanced-settings"] = advancedSettingsPayload + } + } + } + + if v, ok := d.GetOkExists("enable_https_inspection"); ok { + gateway["enable-https-inspection"] = v.(bool) + } + + if d.HasChange("fetch_policy") { + if v, ok := d.GetOk("fetch_policy"); ok { + gateway["fetch_policy"] = v.(*schema.Set).List() + } else { + oldFetch_Policy, _ := d.GetChange("fetch_policy") + gateway["fetch-policy"] = map[string]interface{}{"remove": oldFetch_Policy.(*schema.Set).List()} + } + } + + if v, ok := d.GetOkExists("hit_count"); ok { + gateway["hit-count"] = v.(bool) + } + + if d.HasChange("https_inspection") { + + if v, ok := d.GetOk("https_inspection"); ok { + + httpsInspectionList := v.([]interface{}) + + if len(httpsInspectionList) > 0 { + + httpsInspectionPayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.bypass_on_failure") { + + bypassOnFailurePayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.bypass_on_failure.0.override_profile") { + bypassOnFailurePayload["override-profile"] = d.Get("https_inspection.0.bypass_on_failure.0.override_profile") + } + if d.HasChange("https_inspection.0.bypass_on_failure.0.value") { + bypassOnFailurePayload["value"] = d.Get("https_inspection.0.bypass_on_failure.0.value") + } + httpsInspectionPayload["bypass-on-failure"] = bypassOnFailurePayload + } + if d.HasChange("https_inspection.0.site_categorization_allow_mode") { + + siteCategorizationAllowModePayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.site_categorization_allow_mode.0.override_profile") { + siteCategorizationAllowModePayload["override-profile"] = d.Get("https_inspection.0.site_categorization_allow_mode.0.override_profile") + } + if d.HasChange("https_inspection.0.site_categorization_allow_mode.0.value") { + siteCategorizationAllowModePayload["value"] = d.Get("https_inspection.0.site_categorization_allow_mode.0.value").(string) + } + httpsInspectionPayload["site-categorization-allow-mode"] = siteCategorizationAllowModePayload + } + if d.HasChange("https_inspection.0.deny_untrusted_server_cert") { + + denyUntrustedServerCertPayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.deny_untrusted_server_cert.0.override_profile") { + denyUntrustedServerCertPayload["override-profile"] = d.Get("https_inspection.0.deny_untrusted_server_cert.0.override_profile") + } + if d.HasChange("https_inspection.0.deny_untrusted_server_cert.0.value") { + denyUntrustedServerCertPayload["value"] = d.Get("https_inspection.0.deny_untrusted_server_cert.0.value") + } + httpsInspectionPayload["deny-untrusted-server-cert"] = denyUntrustedServerCertPayload + } + if d.HasChange("https_inspection.0.deny_revoked_server_cert") { + + denyRevokedServerCertPayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.deny_revoked_server_cert.0.override_profile") { + denyRevokedServerCertPayload["override-profile"] = d.Get("https_inspection.0.deny_revoked_server_cert.0.override_profile") + } + if d.HasChange("https_inspection.0.deny_revoked_server_cert.0.value") { + denyRevokedServerCertPayload["value"] = d.Get("https_inspection.0.deny_revoked_server_cert.0.value") + } + httpsInspectionPayload["deny-revoked-server-cert"] = denyRevokedServerCertPayload + } + if d.HasChange("https_inspection.0.deny_expired_server_cert") { + + denyExpiredServerCertPayload := make(map[string]interface{}) + + if d.HasChange("https_inspection.0.deny_expired_server_cert.0.override_profile") { + denyExpiredServerCertPayload["override-profile"] = d.Get("https_inspection.0.deny_expired_server_cert.0.override_profile") + } + if d.HasChange("https_inspection.0.deny_expired_server_cert.0.value") { + denyExpiredServerCertPayload["value"] = d.Get("https_inspection.0.deny_expired_server_cert.0.value") + } + httpsInspectionPayload["deny-expired-server-cert"] = denyExpiredServerCertPayload + } + gateway["https-inspection"] = httpsInspectionPayload + } + } + } + + if v, ok := d.GetOkExists("identity_awareness"); ok { + gateway["identity-awareness"] = v.(bool) + } + + if d.HasChange("identity_awareness_settings") { + + if v, ok := d.GetOk("identity_awareness_settings"); ok { + + identityAwarenessSettingsList := v.([]interface{}) + + if len(identityAwarenessSettingsList) > 0 { + + identityAwarenessSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.browser_based_authentication") { + identityAwarenessSettingsPayload["browser-based-authentication"] = d.Get("identity_awareness_settings.0.browser_based_authentication").(bool) + } + if d.HasChange("identity_awareness_settings.0.browser_based_authentication_settings") { + + browserBasedAuthenticationSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.browser_based_authentication_settings.0.authentication_settings") { + browserBasedAuthenticationSettingsPayload["authentication-settings"] = d.Get("identity_awareness_settings.0.browser_based_authentication_settings.0.authentication_settings") + } + if d.HasChange("identity_awareness_settings.0.browser_based_authentication_settings.0.browser_based_authentication_portal_settings") { + browserBasedAuthenticationSettingsPayload["browser-based-authentication-portal-settings"] = d.Get("identity_awareness_settings.0.browser_based_authentication_settings.0.browser_based_authentication_portal_settings") + } + identityAwarenessSettingsPayload["browser-based-authentication-settings"] = browserBasedAuthenticationSettingsPayload + } + if d.HasChange("identity_awareness_settings.0.identity_agent") { + identityAwarenessSettingsPayload["identity-agent"] = d.Get("identity_awareness_settings.0.identity_agent").(bool) + } + if d.HasChange("identity_awareness_settings.0.identity_agent_settings") { + + identityAgentSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.identity_agent_settings.0.agents_interval_keepalive") { + identityAgentSettingsPayload["agents-interval-keepalive"] = d.Get("identity_awareness_settings.0.identity_agent_settings.0.agents_interval_keepalive") + } + if d.HasChange("identity_awareness_settings.0.identity_agent_settings.0.user_reauthenticate_interval") { + identityAgentSettingsPayload["user-reauthenticate-interval"] = d.Get("identity_awareness_settings.0.identity_agent_settings.0.user_reauthenticate_interval") + } + if d.HasChange("identity_awareness_settings.0.identity_agent_settings.0.authentication_settings") { + identityAgentSettingsPayload["authentication-settings"] = d.Get("identity_awareness_settings.0.identity_agent_settings.0.authentication_settings") + } + if d.HasChange("identity_awareness_settings.0.identity_agent_settings.0.identity_agent_portal_settings") { + identityAgentSettingsPayload["identity-agent-portal-settings"] = d.Get("identity_awareness_settings.0.identity_agent_settings.0.identity_agent_portal_settings") + } + identityAwarenessSettingsPayload["identity-agent-settings"] = identityAgentSettingsPayload + } + if d.HasChange("identity_awareness_settings.0.identity_collector") { + identityAwarenessSettingsPayload["identity-collector"] = d.Get("identity_awareness_settings.0.identity_collector").(bool) + } + if d.HasChange("identity_awareness_settings.0.identity_collector_settings") { + + identityCollectorSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.identity_collector_settings.0.authorized_clients") { + identityCollectorSettingsPayload["authorized-clients"] = d.Get("identity_awareness_settings.0.identity_collector_settings.0.authorized_clients").(*schema.Set).List() + } + if d.HasChange("identity_awareness_settings.0.identity_collector_settings.0.authentication_settings") { + identityCollectorSettingsPayload["authentication-settings"] = d.Get("identity_awareness_settings.0.identity_collector_settings.0.authentication_settings") + } + if d.HasChange("identity_awareness_settings.0.identity_collector_settings.0.client_access_permissions") { + identityCollectorSettingsPayload["client-access-permissions"] = d.Get("identity_awareness_settings.0.identity_collector_settings.0.client_access_permissions") + } + identityAwarenessSettingsPayload["identity-collector-settings"] = identityCollectorSettingsPayload + } + if d.HasChange("identity_awareness_settings.0.identity_sharing_settings") { + + identitySharingSettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.identity_sharing_settings.0.share_with_other_gateways") { + identitySharingSettingsPayload["share-with-other-gateways"] = d.Get("identity_awareness_settings.0.identity_sharing_settings.0.share_with_other_gateways") + } + if d.HasChange("identity_awareness_settings.0.identity_sharing_settings.0.receive_from_other_gateways") { + identitySharingSettingsPayload["receive-from-other-gateways"] = d.Get("identity_awareness_settings.0.identity_sharing_settings.0.receive_from_other_gateways") + } + if d.HasChange("identity_awareness_settings.0.identity_sharing_settings.0.receive_from") { + identitySharingSettingsPayload["receive-from"] = d.Get("identity_awareness_settings.0.identity_sharing_settings.0.receive_from").(*schema.Set).List() + } + identityAwarenessSettingsPayload["identity-sharing-settings"] = identitySharingSettingsPayload + } + if d.HasChange("identity_awareness_settings.0.proxy_settings") { + + proxySettingsPayload := make(map[string]interface{}) + + if d.HasChange("identity_awareness_settings.0.proxy_settings.0.detect_using_x_forward_for") { + proxySettingsPayload["detect-using-x-forward-for"] = d.Get("identity_awareness_settings.0.proxy_settings.0.detect_using_x_forward_for") + } + identityAwarenessSettingsPayload["proxy-settings"] = proxySettingsPayload + } + if d.HasChange("identity_awareness_settings.0.remote_access") { + identityAwarenessSettingsPayload["remote-access"] = d.Get("identity_awareness_settings.0.remote_access").(bool) + } + gateway["identity-awareness-settings"] = identityAwarenessSettingsPayload + } + } + } + + if ok := d.HasChange("ips_update_policy"); ok { + gateway["ips-update-policy"] = d.Get("ips_update_policy") + } + + if v, ok := d.GetOkExists("nat_hide_internal_interfaces"); ok { + gateway["nat-hide-internal-interfaces"] = v.(bool) + } + + if d.HasChange("nat_settings") { + + if _, ok := d.GetOk("nat_settings"); ok { + + res := make(map[string]interface{}) + + if v, ok := d.GetOk("nat_settings.auto_rule"); ok { + res["auto-rule"] = v + } + if v, ok := d.GetOk("nat_settings.ipv4_address"); ok { + res["ipv4-address"] = v.(string) + } + if v, ok := d.GetOk("nat_settings.ipv6_address"); ok { + res["ipv6-address"] = v.(string) + } + if d.HasChange("nat_settings.hide_behind") { + res["hide-behind"] = d.Get("nat_settings.hide_behind") + } + if d.HasChange("nat_settings.install_on") { + res["install-on"] = d.Get("nat_settings.install_on") + } + if d.HasChange("nat_settings.method") { + res["method"] = d.Get("nat_settings.method") + } + gateway["nat-settings"] = res + } + } + + if d.HasChange("platform_portal_settings") { + + if v, ok := d.GetOk("platform_portal_settings"); ok { + + platformPortalSettingsList := v.([]interface{}) + + if len(platformPortalSettingsList) > 0 { + + platformPortalSettingsPayload := make(map[string]interface{}) + + if d.HasChange("platform_portal_settings.0.portal_web_settings") { + + portalWebSettingsPayload := make(map[string]interface{}) + + if d.HasChange("platform_portal_settings.0.portal_web_settings.0.aliases") { + portalWebSettingsPayload["aliases"] = d.Get("platform_portal_settings.0.portal_web_settings.0.aliases").(*schema.Set).List() + } + if d.HasChange("platform_portal_settings.0.portal_web_settings.0.main_url") { + portalWebSettingsPayload["main-url"] = d.Get("platform_portal_settings.0.portal_web_settings.0.main_url").(string) + } + platformPortalSettingsPayload["portal-web-settings"] = portalWebSettingsPayload + } + if d.HasChange("platform_portal_settings.0.certificate_settings") { + + certificateSettingsPayload := make(map[string]interface{}) + + if d.HasChange("platform_portal_settings.0.certificate_settings.0.base64_certificate") { + certificateSettingsPayload["base64-certificate"] = d.Get("platform_portal_settings.0.certificate_settings.0.base64_certificate").(string) + } + if d.HasChange("platform_portal_settings.0.certificate_settings.0.base64_password") { + certificateSettingsPayload["base64-password"] = d.Get("platform_portal_settings.0.certificate_settings.0.base64_password").(string) + } + platformPortalSettingsPayload["certificate-settings"] = certificateSettingsPayload + } + if d.HasChange("platform_portal_settings.0.accessibility") { + + accessibilityPayload := make(map[string]interface{}) + + if d.HasChange("platform_portal_settings.0.accessibility.0.allow_access_from") { + accessibilityPayload["allow-access-from"] = d.Get("platform_portal_settings.0.accessibility.0.allow_access_from").(string) + } + if d.HasChange("platform_portal_settings.0.accessibility.0.internal_access_settings") { + accessibilityPayload["internal-access-settings"] = d.Get("platform_portal_settings.0.accessibility.0.internal_access_settings") + } + platformPortalSettingsPayload["accessibility"] = accessibilityPayload + } + gateway["platform-portal-settings"] = platformPortalSettingsPayload + } + } + } + + if d.HasChange("proxy_settings") { + + if _, ok := d.GetOk("proxy_settings"); ok { + + res := make(map[string]interface{}) + + if d.HasChange("proxy_settings.use_custom_proxy") { + res["use-custom-proxy"] = d.Get("proxy_settings.use_custom_proxy") + } + if d.HasChange("proxy_settings.proxy_server") { + res["proxy-server"] = d.Get("proxy_settings.proxy_server") + } + if d.HasChange("proxy_settings.port") { + res["port"] = d.Get("proxy_settings.port") + } + gateway["proxy-settings"] = res + } + } + + if v, ok := d.GetOkExists("qos"); ok { + gateway["qos"] = v.(bool) + } + + if d.HasChange("usercheck_portal_settings") { + + if v, ok := d.GetOk("usercheck_portal_settings"); ok { + + usercheckPortalSettingsList := v.([]interface{}) + + if len(usercheckPortalSettingsList) > 0 { + + usercheckPortalSettingsPayload := make(map[string]interface{}) + + if d.HasChange("usercheck_portal_settings.0.enabled") { + usercheckPortalSettingsPayload["enabled"] = d.Get("usercheck_portal_settings.0.enabled").(bool) + } + if d.HasChange("usercheck_portal_settings.0.portal_web_settings") { + + portalWebSettingsPayload := make(map[string]interface{}) + + if d.HasChange("usercheck_portal_settings.0.portal_web_settings.0.aliases") { + portalWebSettingsPayload["aliases"] = d.Get("usercheck_portal_settings.0.portal_web_settings.0.aliases").(*schema.Set).List() + } + if d.HasChange("usercheck_portal_settings.0.portal_web_settings.0.main_url") { + portalWebSettingsPayload["main-url"] = d.Get("usercheck_portal_settings.0.portal_web_settings.0.main_url").(string) + } + usercheckPortalSettingsPayload["portal-web-settings"] = portalWebSettingsPayload + } + if d.HasChange("usercheck_portal_settings.0.certificate_settings") { + + certificateSettingsPayload := make(map[string]interface{}) + + if d.HasChange("usercheck_portal_settings.0.certificate_settings.0.base64_certificate") { + certificateSettingsPayload["base64-certificate"] = d.Get("usercheck_portal_settings.0.certificate_settings.0.base64_certificate").(string) + } + if d.HasChange("usercheck_portal_settings.0.certificate_settings.0.base64_password") { + certificateSettingsPayload["base64-password"] = d.Get("usercheck_portal_settings.0.certificate_settings.0.base64_password").(string) + } + usercheckPortalSettingsPayload["certificate-settings"] = certificateSettingsPayload + } + if d.HasChange("usercheck_portal_settings.0.accessibility") { + + accessibilityPayload := make(map[string]interface{}) + + if d.HasChange("usercheck_portal_settings.0.accessibility.0.allow_access_from") { + accessibilityPayload["allow-access-from"] = d.Get("usercheck_portal_settings.0.accessibility.0.allow_access_from").(string) + } + if d.HasChange("usercheck_portal_settings.0.accessibility.0.internal_access_settings") { + accessibilityPayload["internal-access-settings"] = d.Get("usercheck_portal_settings.0.accessibility.0.internal_access_settings") + } + usercheckPortalSettingsPayload["accessibility"] = accessibilityPayload + } + gateway["usercheck-portal-settings"] = usercheckPortalSettingsPayload + } + } + } + + if v, ok := d.GetOkExists("zero_phishing"); ok { + gateway["zero-phishing"] = v.(bool) + } + + if ok := d.HasChange("zero_phishing_fqdn"); ok { + gateway["zero-phishing-fqdn"] = d.Get("zero_phishing_fqdn") + } + if d.HasChange("interfaces") { if v, ok := d.GetOk("interfaces"); ok { interfacesList := v.([]interface{}) diff --git a/checkpoint/resource_checkpoint_management_tacacs_group.go b/checkpoint/resource_checkpoint_management_tacacs_group.go index 3238850c..c21c95c4 100644 --- a/checkpoint/resource_checkpoint_management_tacacs_group.go +++ b/checkpoint/resource_checkpoint_management_tacacs_group.go @@ -98,7 +98,7 @@ func createManagementTacacsGroup(d *schema.ResourceData, m interface{}) error { tacacsGroupPayload["ignore-errors"] = v.(bool) } - log.Println("Create TacacsGroup - Map = ", tacacsGroupPayload) + log.Println("Create Tacacs Group - Map = ", tacacsGroupPayload) addTacacsGroupRes, err := client.ApiCall("add-tacacs-group", tacacsGroupPayload, client.GetSessionID(), true, client.IsProxyUsed()) if err != nil || !addTacacsGroupRes.Success { @@ -135,7 +135,7 @@ func readManagementTacacsGroup(d *schema.ResourceData, m interface{}) error { tacacsGroup := showTacacsGroupRes.GetData() - log.Println("Read TacacsGroup - Show JSON = ", tacacsGroup) + log.Println("Read Tacacs Group - Show JSON = ", tacacsGroup) if v := tacacsGroup["name"]; v != nil { _ = d.Set("name", v) @@ -181,14 +181,6 @@ func readManagementTacacsGroup(d *schema.ResourceData, m interface{}) error { _ = d.Set("comments", v) } - if v := tacacsGroup["ignore-warnings"]; v != nil { - _ = d.Set("ignore_warnings", v) - } - - if v := tacacsGroup["ignore-errors"]; v != nil { - _ = d.Set("ignore_errors", v) - } - return nil } @@ -240,7 +232,7 @@ func updateManagementTacacsGroup(d *schema.ResourceData, m interface{}) error { tacacsGroup["ignore-errors"] = v.(bool) } - log.Println("Update TacacsGroup - Map = ", tacacsGroup) + log.Println("Update Tacacs Group - Map = ", tacacsGroup) updateTacacsGroupRes, err := client.ApiCall("set-tacacs-group", tacacsGroup, client.GetSessionID(), true, client.IsProxyUsed()) if err != nil || !updateTacacsGroupRes.Success { @@ -262,7 +254,7 @@ func deleteManagementTacacsGroup(d *schema.ResourceData, m interface{}) error { "ignore-warnings": "true", } - log.Println("Delete TacacsGroup") + log.Println("Delete Tacacs Group") deleteTacacsGroupRes, err := client.ApiCall("delete-tacacs-group", tacacsGroupPayload, client.GetSessionID(), true, client.IsProxyUsed()) if err != nil || !deleteTacacsGroupRes.Success { diff --git a/checkpoint/resource_checkpoint_management_tacacs_group_test.go b/checkpoint/resource_checkpoint_management_tacacs_group_test.go new file mode 100644 index 00000000..41bf0241 --- /dev/null +++ b/checkpoint/resource_checkpoint_management_tacacs_group_test.go @@ -0,0 +1,123 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "os" + "strings" + "testing" +) + +func TestAccCheckpointManagementTacacsGroup_basic(t *testing.T) { + + var tacacsGroupMap map[string]interface{} + resourceName := "checkpoint_management_tacacs_group.test" + objName := "tfTestManagementTacacsGroup_" + acctest.RandString(6) + + context := os.Getenv("CHECKPOINT_CONTEXT") + if context != "web_api" { + t.Skip("Skipping management test") + } else if context == "" { + t.Skip("Env CHECKPOINT_CONTEXT must be specified to run this acc test") + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckpointManagementTacacsGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccManagementTacacsGroupConfig(objName, "my_t"), + Check: resource.ComposeTestCheckFunc( + testAccCheckCheckpointManagementTacacsGroupExists(resourceName, &tacacsGroupMap), + testAccCheckCheckpointManagementTacacsGroupAttributes(&tacacsGroupMap, objName, "my_t"), + ), + }, + }, + }) +} + +func testAccCheckpointManagementTacacsGroupDestroy(s *terraform.State) error { + + client := testAccProvider.Meta().(*checkpoint.ApiClient) + for _, rs := range s.RootModule().Resources { + if rs.Type != "checkpoint_management_tacacs_group" { + continue + } + if rs.Primary.ID != "" { + res, _ := client.ApiCall("show-tacacs-group", map[string]interface{}{"uid": rs.Primary.ID}, client.GetSessionID(), true, false) + if res.Success { + return fmt.Errorf("TacacsGroup object (%s) still exists", rs.Primary.ID) + } + } + return nil + } + return nil +} + +func testAccCheckCheckpointManagementTacacsGroupExists(resourceTfName string, res *map[string]interface{}) resource.TestCheckFunc { + return func(s *terraform.State) error { + + rs, ok := s.RootModule().Resources[resourceTfName] + if !ok { + return fmt.Errorf("Resource not found: %s", resourceTfName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("TacacsGroup ID is not set") + } + + client := testAccProvider.Meta().(*checkpoint.ApiClient) + + response, err := client.ApiCall("show-tacacs-group", map[string]interface{}{"uid": rs.Primary.ID}, client.GetSessionID(), true, false) + if !response.Success { + return err + } + + *res = response.GetData() + + return nil + } +} + +func testAccCheckCheckpointManagementTacacsGroupAttributes(tacacsGroupMap *map[string]interface{}, name string, members1 string) resource.TestCheckFunc { + return func(s *terraform.State) error { + + tacacsGroupName := (*tacacsGroupMap)["name"].(string) + if !strings.EqualFold(tacacsGroupName, name) { + return fmt.Errorf("name is %s, expected %s", name, tacacsGroupName) + } + membersJson := (*tacacsGroupMap)["members"].([]interface{}) + var membersIds = make([]string, 0) + if len(membersJson) > 0 { + for _, members := range membersJson { + membersTry1, ok := members.(map[string]interface{}) + if ok { + membersIds = append([]string{membersTry1["name"].(string)}, membersIds...) + } else { + membersTry2 := members.(string) + membersIds = append([]string{membersTry2}, membersIds...) + } + } + } + + TacacsGroupmembers1 := membersIds[0] + if TacacsGroupmembers1 != members1 { + return fmt.Errorf("members1 is %s, expected %s", members1, TacacsGroupmembers1) + } + + return nil + } +} + +func testAccManagementTacacsGroupConfig(name string, members1 string) string { + return fmt.Sprintf(` +resource "checkpoint_management_tacacs_group" "test" { + name = "%s" + members = ["%s"] +} +`, name, members1) +} diff --git a/checkpoint/resource_checkpoint_management_tacacs_server.go b/checkpoint/resource_checkpoint_management_tacacs_server.go index 00dcab35..32b3fc81 100644 --- a/checkpoint/resource_checkpoint_management_tacacs_server.go +++ b/checkpoint/resource_checkpoint_management_tacacs_server.go @@ -22,6 +22,7 @@ func resourceManagementTacacsServer() *schema.Resource { "secret_key": { Type: schema.TypeString, Optional: true, + Sensitive: true, Description: "The server's secret key. Required only when \"server-type\" was selected to be \"TACACS+\".", }, "server": { @@ -141,7 +142,7 @@ func createManagementTacacsServer(d *schema.ResourceData, m interface{}) error { tacacsServer["ignore-errors"] = v.(bool) } - log.Println("Create TacacsServer - Map = ", tacacsServer) + log.Println("Create Tacacs Server - Map = ", tacacsServer) addTacacsServerRes, err := client.ApiCall("add-tacacs-server", tacacsServer, client.GetSessionID(), true, client.IsProxyUsed()) if err != nil || !addTacacsServerRes.Success { @@ -184,10 +185,6 @@ func readManagementTacacsServer(d *schema.ResourceData, m interface{}) error { _ = d.Set("name", v) } - if v := tacacsServer["secret-key"]; v != nil { - _ = d.Set("secret_key", v) - } - if v := tacacsServer["server"]; v != nil { _ = d.Set("server", v) } @@ -232,14 +229,6 @@ func readManagementTacacsServer(d *schema.ResourceData, m interface{}) error { _ = d.Set("comments", v) } - if v := tacacsServer["ignore-warnings"]; v != nil { - _ = d.Set("ignore_warnings", v) - } - - if v := tacacsServer["ignore-errors"]; v != nil { - _ = d.Set("ignore_errors", v) - } - return nil } diff --git a/checkpoint/resource_checkpoint_management_tacacs_server_test.go b/checkpoint/resource_checkpoint_management_tacacs_server_test.go new file mode 100644 index 00000000..06ac0d34 --- /dev/null +++ b/checkpoint/resource_checkpoint_management_tacacs_server_test.go @@ -0,0 +1,109 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "os" + "strings" + "testing" +) + +func TestAccCheckpointManagementTacacsServer_basic(t *testing.T) { + + var tacacsServerMap map[string]interface{} + resourceName := "checkpoint_management_tacacs_server.test" + objName := "tfTestManagementTacacsServer_" + acctest.RandString(6) + + context := os.Getenv("CHECKPOINT_CONTEXT") + if context != "web_api" { + t.Skip("Skipping management test") + } else if context == "" { + t.Skip("Env CHECKPOINT_CONTEXT must be specified to run this acc test") + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckpointManagementTacacsServerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccManagementTacacsServerConfig(objName, "yoni"), + Check: resource.ComposeTestCheckFunc( + testAccCheckCheckpointManagementTacacsServerExists(resourceName, &tacacsServerMap), + testAccCheckCheckpointManagementTacacsServerAttributes(&tacacsServerMap, objName, "yoni"), + ), + }, + }, + }) +} + +func testAccCheckpointManagementTacacsServerDestroy(s *terraform.State) error { + + client := testAccProvider.Meta().(*checkpoint.ApiClient) + for _, rs := range s.RootModule().Resources { + if rs.Type != "checkpoint_management_tacacs_server" { + continue + } + if rs.Primary.ID != "" { + res, _ := client.ApiCall("show-tacacs-server", map[string]interface{}{"uid": rs.Primary.ID}, client.GetSessionID(), true, client.IsProxyUsed()) + if res.Success { + return fmt.Errorf("TacacsServer object (%s) still exists", rs.Primary.ID) + } + } + return nil + } + return nil +} + +func testAccCheckCheckpointManagementTacacsServerExists(resourceTfName string, res *map[string]interface{}) resource.TestCheckFunc { + return func(s *terraform.State) error { + + rs, ok := s.RootModule().Resources[resourceTfName] + if !ok { + return fmt.Errorf("Resource not found: %s", resourceTfName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("TacacsServer ID is not set") + } + + client := testAccProvider.Meta().(*checkpoint.ApiClient) + + response, err := client.ApiCall("show-tacacs-server", map[string]interface{}{"uid": rs.Primary.ID}, client.GetSessionID(), true, client.IsProxyUsed()) + if !response.Success { + return err + } + + *res = response.GetData() + + return nil + } +} + +func testAccCheckCheckpointManagementTacacsServerAttributes(tacacsServerMap *map[string]interface{}, name string, server string) resource.TestCheckFunc { + return func(s *terraform.State) error { + + tacacsServerName := (*tacacsServerMap)["name"].(string) + if !strings.EqualFold(tacacsServerName, name) { + return fmt.Errorf("name is %s, expected %s", name, tacacsServerName) + } + tacacsServerServerMap := (*tacacsServerMap)["server"].(map[string]interface{}) + tacacsServerServer := tacacsServerServerMap["name"].(string) + if !strings.EqualFold(tacacsServerServer, server) { + return fmt.Errorf("server is %s, expected %s", server, tacacsServerServer) + } + return nil + } +} + +func testAccManagementTacacsServerConfig(name string, server string) string { + return fmt.Sprintf(` +resource "checkpoint_management_tacacs_server" "test" { + name = "%s" + server = "%s" +} +`, name, server) +} diff --git a/checkpoint/resource_checkpoint_management_tag_test.go b/checkpoint/resource_checkpoint_management_tag_test.go new file mode 100644 index 00000000..22ce5109 --- /dev/null +++ b/checkpoint/resource_checkpoint_management_tag_test.go @@ -0,0 +1,126 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "os" + "strings" + "testing" +) + +func TestAccCheckpointManagementTag_basic(t *testing.T) { + + var tagMap map[string]interface{} + resourceName := "checkpoint_management_tag.test" + objName := "tfTestManagementTag_" + acctest.RandString(6) + + context := os.Getenv("CHECKPOINT_CONTEXT") + if context != "web_api" { + t.Skip("Skipping management test") + } else if context == "" { + t.Skip("Env CHECKPOINT_CONTEXT must be specified to run this acc test") + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckpointManagementTagDestroy, + Steps: []resource.TestStep{ + { + Config: testAccManagementTagConfig(objName, "tag1", "tag2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckCheckpointManagementTagExists(resourceName, &tagMap), + testAccCheckCheckpointManagementTagAttributes(&tagMap, objName, "tag1", "tag2"), + ), + }, + }, + }) +} + +func testAccCheckpointManagementTagDestroy(s *terraform.State) error { + + client := testAccProvider.Meta().(*checkpoint.ApiClient) + for _, rs := range s.RootModule().Resources { + if rs.Type != "checkpoint_management_tag" { + continue + } + if rs.Primary.ID != "" { + res, _ := client.ApiCall("show-tag", map[string]interface{}{"uid": rs.Primary.ID}, client.GetSessionID(), true, false) + if res.Success { + return fmt.Errorf("Tag object (%s) still exists", rs.Primary.ID) + } + } + return nil + } + return nil +} + +func testAccCheckCheckpointManagementTagExists(resourceTfName string, res *map[string]interface{}) resource.TestCheckFunc { + return func(s *terraform.State) error { + + rs, ok := s.RootModule().Resources[resourceTfName] + if !ok { + return fmt.Errorf("Resource not found: %s", resourceTfName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Tag ID is not set") + } + + client := testAccProvider.Meta().(*checkpoint.ApiClient) + + response, err := client.ApiCall("show-tag", map[string]interface{}{"uid": rs.Primary.ID}, client.GetSessionID(), true, false) + if !response.Success { + return err + } + + *res = response.GetData() + + return nil + } +} + +func testAccCheckCheckpointManagementTagAttributes(tagMap *map[string]interface{}, objName string, tags1 string, tags2 string) resource.TestCheckFunc { + return func(s *terraform.State) error { + + tagName := (*tagMap)["name"].(string) + if !strings.EqualFold(tagName, objName) { + return fmt.Errorf("name is %s, expected %s", objName, tagName) + } + tagsJson := (*tagMap)["tags"].([]interface{}) + var tagsIds = make([]string, 0) + if len(tagsJson) > 0 { + for _, tags := range tagsJson { + tagsTry1, ok := tags.(map[string]interface{}) + if ok { + tagsIds = append([]string{tagsTry1["name"].(string)}, tagsIds...) + } else { + tagsTry2 := tags.(string) + tagsIds = append([]string{tagsTry2}, tagsIds...) + } + } + } + + Tagtags1 := tagsIds[0] + if Tagtags1 != tags1 { + return fmt.Errorf("tags1 is %s, expected %s", tags1, Tagtags1) + } + Tagtags2 := tagsIds[1] + if Tagtags2 != tags2 { + return fmt.Errorf("tags2 is %s, expected %s", tags2, Tagtags2) + } + return nil + } +} + +func testAccManagementTagConfig(objName string, tags1 string, tags2 string) string { + return fmt.Sprintf(` +resource "checkpoint_management_tag" "test" { + name = "%s" + tags = ["%s","%s"] +} +`, objName, tags1, tags2) +} diff --git a/checkpoint/resource_checkpoint_management_threat_layer.go b/checkpoint/resource_checkpoint_management_threat_layer.go index ea36752e..91d48dee 100644 --- a/checkpoint/resource_checkpoint_management_threat_layer.go +++ b/checkpoint/resource_checkpoint_management_threat_layer.go @@ -59,6 +59,16 @@ func resourceManagementThreatLayer() *schema.Resource { Default: false, Description: "Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored.", }, + "ips_layer": { + Type: schema.TypeBool, + Computed: true, + Description: "N/A", + }, + "parent_layer": { + Type: schema.TypeString, + Computed: true, + Description: "N/A", + }, }, } } @@ -168,6 +178,14 @@ func readManagementThreatLayer(d *schema.ResourceData, m interface{}) error { _ = d.Set("comments", v) } + if v := threatLayer["ips-layer"]; v != nil { + _ = d.Set("ips_layer", v) + } + + if v := threatLayer["parent-layer"]; v != nil { + _ = d.Set("parent_layer", v) + } + return nil } diff --git a/checkpoint/resource_checkpoint_management_threat_layer_test.go b/checkpoint/resource_checkpoint_management_threat_layer_test.go new file mode 100644 index 00000000..41e6f324 --- /dev/null +++ b/checkpoint/resource_checkpoint_management_threat_layer_test.go @@ -0,0 +1,109 @@ +package checkpoint + +import ( + "fmt" + checkpoint "github.com/CheckPointSW/cp-mgmt-api-go-sdk/APIFiles" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "os" + "strings" + "testing" +) + +func TestAccCheckpointManagementThreatLayer_basic(t *testing.T) { + + var threatLayerMap map[string]interface{} + resourceName := "checkpoint_management_threat_layer.test" + objName := "tfTestManagementThreatLayer_" + acctest.RandString(6) + + context := os.Getenv("CHECKPOINT_CONTEXT") + if context != "web_api" { + t.Skip("Skipping management test") + } else if context == "" { + t.Skip("Env CHECKPOINT_CONTEXT must be specified to run this acc test") + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckpointManagementThreatLayerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccManagementThreatLayerConfig(objName, "blue"), + Check: resource.ComposeTestCheckFunc( + testAccCheckCheckpointManagementThreatLayerExists(resourceName, &threatLayerMap), + testAccCheckCheckpointManagementThreatLayerAttributes(&threatLayerMap, objName, "blue"), + ), + }, + }, + }) +} + +func testAccCheckpointManagementThreatLayerDestroy(s *terraform.State) error { + + client := testAccProvider.Meta().(*checkpoint.ApiClient) + for _, rs := range s.RootModule().Resources { + if rs.Type != "checkpoint_management_threat_layer" { + continue + } + if rs.Primary.ID != "" { + res, _ := client.ApiCall("show-threat-layer", map[string]interface{}{"uid": rs.Primary.ID}, client.GetSessionID(), true, false) + if res.Success { + return fmt.Errorf("Threat Layer object (%s) still exists", rs.Primary.ID) + } + } + return nil + } + return nil +} + +func testAccCheckCheckpointManagementThreatLayerExists(resourceTfName string, res *map[string]interface{}) resource.TestCheckFunc { + return func(s *terraform.State) error { + + rs, ok := s.RootModule().Resources[resourceTfName] + if !ok { + return fmt.Errorf("Resource not found: %s", resourceTfName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Threat Layer ID is not set") + } + + client := testAccProvider.Meta().(*checkpoint.ApiClient) + + response, err := client.ApiCall("show-threat-layer", map[string]interface{}{"uid": rs.Primary.ID}, client.GetSessionID(), true, false) + if !response.Success { + return err + } + + *res = response.GetData() + + return nil + } +} + +func testAccCheckCheckpointManagementThreatLayerAttributes(threatLayerMap *map[string]interface{}, objName string, color string) resource.TestCheckFunc { + return func(s *terraform.State) error { + + threatLayerName := (*threatLayerMap)["name"].(string) + if !strings.EqualFold(threatLayerName, objName) { + return fmt.Errorf("name is %s, expected %s", objName, threatLayerName) + } + threatLayerColor := (*threatLayerMap)["color"].(string) + if threatLayerColor != color { + return fmt.Errorf("color is %s, expected %s", threatLayerColor, color) + } + + return nil + } +} + +func testAccManagementThreatLayerConfig(objName string, color string) string { + return fmt.Sprintf(` +resource "checkpoint_management_threat_layer" "test" { + name = "%s" + color = "%s" +} +`, objName, color) +} diff --git a/website/checkpoint.erb b/website/checkpoint.erb index cc17cb65..dff92a60 100644 --- a/website/checkpoint.erb +++ b/website/checkpoint.erb @@ -460,6 +460,39 @@ > checkpoint_management_command_set_global_properties + > + checkpoint_management_administrator + + > + checkpoint_management_azure_ad + + > + checkpoint_management_lsv_profile + + > + checkpoint_management_tacacs_server + + > + checkpoint_management_tacacs_group + + > + checkpoint_management_tag + + > + checkpoint_management_threat_layer + + > + checkpoint_management_nutanix_data_center_server + + > + checkpoint_management_oracle_cloud_data_center_server + + > + checkpoint_management_radius_server + + > + checkpoint_management_radius_group + @@ -784,6 +817,42 @@ > checkpoint_management_global_domain + > + checkpoint_management_administrator + + > + checkpoint_management_azure_ad + + > + checkpoint_management_azure_ad_content + + > + checkpoint_management_lsv_profile + + > + checkpoint_management_tacacs_group + + > + checkpoint_management_tacacs_server + + > + checkpoint_management_tag + + > + checkpoint_management_threat_layer + + > + checkpoint_management_nutanix_data_center_server + + > + checkpoint_management_oracle_cloud_data_center_server + + > + checkpoint_management_radius_server + + > + checkpoint_management_radius_group + diff --git a/website/docs/d/checkpoint_management_administrator.html.markdown b/website/docs/d/checkpoint_management_administrator.html.markdown new file mode 100644 index 00000000..5941fb90 --- /dev/null +++ b/website/docs/d/checkpoint_management_administrator.html.markdown @@ -0,0 +1,57 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_administrator" +sidebar_current: "docs-checkpoint-data-source-checkpoint-management-administrator" +description: |- +Use this data source to get information on an existing Check Point Administrator. +--- + +# Data Source: checkpoint_management_administrator + +Use this data source to get information on an existing Check Point Administrator. + +## Example Usage + + +```hcl +resource "checkpoint_management_administrator" "admin" { + name = "example" + permissions_profile { + domain = "domain1" + profile = "Read Only All" + } + + multi_domain_profile = "domain level only" + password = "1233" + +} + +data "checkpoint_management_administrator" "data_admin" { + name = "${checkpoint_management_administrator.admin.name}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Optional) Object name. Should be unique in the domain. +* `uid` - (Optional) Object unique identifier. +* `authentication_method` - Authentication method. +* `email` - Administrator email. +* `expiration_date` +* `multi_domain_profile` - Administrator multi-domain profile. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `must_change_password` - True if administrator must change password on the next login. +* `permissions_profile` - Administrator permissions profile. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. permissions_profile blocks are documented below. +* `phone_number` - Administrator phone number. +* `radius_server` - RADIUS server object identified by the name or UID. Must be set when "authentication-method" was selected to be "RADIUS". Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `sic_name` - Name of the Secure Internal Connection Trust. +* `tacacs_server` - TACACS server object identified by the name or UID . Must be set when "authentication-method" was selected to be "TACACS". Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `tags` - Collection of tag objects identified by the name or UID. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. + +`permissions_profile` supports the following: + +* `domain` - The domain's profile. +* `profile` - Permission profile. \ No newline at end of file diff --git a/website/docs/d/checkpoint_management_azure_ad.html.markdown b/website/docs/d/checkpoint_management_azure_ad.html.markdown new file mode 100644 index 00000000..6df0da40 --- /dev/null +++ b/website/docs/d/checkpoint_management_azure_ad.html.markdown @@ -0,0 +1,42 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_azur_ad" +sidebar_current: "docs-checkpoint-data-source-checkpoint-management-azur-ad" +description: |- +Use this data source to get information on an existing Check Point Azure Ad. +--- + +# Data Source: checkpoint_management_azure_ad + +Use this data source to get information on an existing Check Point Azure Ad. + +## Example Usage + + +```hcl +resource "checkpoint_management_azure_ad" "azure_ad" { + name = "example" + password = "123" + user_authentication = "user-authentication" + username = "example" + application_id = "a8662b33-306f-42ba-9ffb-a0ac27c8903f" + application_key = "EjdJ2JcNGpw3[GV8:PMN_s2KH]JhtlpO" + directory_id = "19c063a8-3bee-4ea5-b984-e344asds37f7" +} + +data "checkpoint_management_azure_ad" "data_azure_ad" { + name = "${checkpoint_management_azure_ad.azure_ad.name}" +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Optional) Object name. +* `uid` - (Optional) Object unique identifier. +* `properties` - Azure AD connection properties. properties blocks are documented below. +* `tags` - Collection of tag objects identified by the name or UID. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. diff --git a/website/docs/d/checkpoint_management_azure_ad_content.html.markdown b/website/docs/d/checkpoint_management_azure_ad_content.html.markdown new file mode 100644 index 00000000..da0cbf83 --- /dev/null +++ b/website/docs/d/checkpoint_management_azure_ad_content.html.markdown @@ -0,0 +1,68 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_azure_ad_content" +sidebar_current: "docs-checkpoint-data-source-checkpoint-management-azure-ad-content" +description: |- +This resource allows you to execute Check Point Azure Ad Content. +--- + +# Data Source: checkpoint_management_azure_ad_content + +This resource allows you to execute Check Point Azure Ad Content. + +## Example Usage + + +```hcl +data "checkpoint_management_azure_ad_content" "azure_ad_content" { + azure_ad_name = "my_azureAD" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `azure_ad_name` - (Optional) Name of the Azure AD Server where to search for objects. +* `azure_ad_uid` - (Optional) Unique identifier of the Azure AD Server where to search for objects. +* `limit` - (Optional) The maximal number of returned results. +* `offset` - (Optional) Number of the results to initially skip. +* `order` - (Optional) Sorts the results by search criteria. Automatically sorts the results by Name, in the ascending order. order blocks are documented below. +* `uid_in_azure_ad` - (Optional) Return result matching the unique identifier of the object on the Azure AD Server. +* `filter` - (Optional) Return results matching the specified filter. filter blocks are documented below. + + +`order` supports the following: + +* `asc` - (Optional) Sorts results by the given field in ascending order. +* `desc` - (Optional) Sorts results by the given field in descending order. + + +`filter` supports the following: + +* `text` - (Optional) Return results containing the specified text value. +* `uri` - (Optional) Return results under the specified Data Center Object (identified by URI). +* `parent_uid_in_data_center` - (Optional) Return results under the specified Data Center Object (identified by UID). + +Output: + +* `from` - From which element number the query was done. +* `objects` - Remote objects views. objects blocks are documented below. +* `to` - To which element number the query was done. +* `total` - Total number of elements returned by the query. + + +`objects` supports the following: + +* `name_in_azure_ad` - Object name in the Azure AD. +* `uid_in_azure_ad` - Unique identifier of the object in the Azure AD. +* `azure_ad_object` - The imported management object (if exists). Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `name` - Object management name. +* `type_in_azure_ad` - Object type in Azure AD. +* `additional_properties` - Additional properties on the object. additional_properties blocks are documented below. + + +`additional_properties` supports the following: + +* `name` +* `value` \ No newline at end of file diff --git a/website/docs/d/checkpoint_management_lsv_profile.html.markdown b/website/docs/d/checkpoint_management_lsv_profile.html.markdown new file mode 100644 index 00000000..0727787b --- /dev/null +++ b/website/docs/d/checkpoint_management_lsv_profile.html.markdown @@ -0,0 +1,46 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_lsv_profile" +sidebar_current: "docs-checkpoint-data-source-checkpoint-management-lsv-profile" +description: |- +Use this data source to get information on an existing Check Point Lsv Profile. +--- + +# Data Source: checkpoint_management_lsv_profile + +Use this data source to get information on an existing Check Point Lsv Profile. + +## Example Usage + + +```hcl +resource "checkpoint_management_lsv_profile" "lsv_profile" { + name = "Lsv profile" + certificate_authority = "internal_ca" +} + + +data "checkpoint_management_lsv_profile" "data_lsv_profile" { + name = "${checkpoint_management_lsv_profile.lsv_profile.name}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Optional) Object name. Should be unique in the domain. +* `uid` - (Optional) Object unique identifier. +* `allowed_ip_addresses` - Collection of network objects identified by name or UID that represent IP addresses allowed in profile's VPN domain. +* `certificate_authority` - Trusted Certificate authority for establishing trust between VPN peers, identified by name or UID. +* `restrict_allowed_addresses` - Indicate whether the IP addresses allowed in the VPN Domain will be restricted or not, according to allowed-ip-addresses field. +* `tags` - Collection of tag objects identified by the name or UID. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `vpn_domain` - peers' VPN Domain properties. vpn_domain blocks are documented below. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. + + +`vpn_domain` supports the following: + +* `limit_peer_domain_size` - Use this parameter to limit the number of IP addresses in the VPN Domain of each peer according to the value in the max-allowed-addresses field. +* `max_allowed_addresses` - Maximum number of IP addresses in the VPN Domain of each peer. This value will be enforced only when limit-peer-domain-size field is set to true. Select a value between 1 and 256. Default value is 256. diff --git a/website/docs/d/checkpoint_management_nutanix_data_center_server.html.markdown b/website/docs/d/checkpoint_management_nutanix_data_center_server.html.markdown new file mode 100644 index 00000000..c7f6fa3d --- /dev/null +++ b/website/docs/d/checkpoint_management_nutanix_data_center_server.html.markdown @@ -0,0 +1,42 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_nutanix_data_center_server" +sidebar_current: "docs-checkpoint-Resource-checkpoint-management-nutanix-data-center-server" +description: |- Use this data source to get information on an existing Nutanix data center server. +--- + +# Data Source: checkpoint_management_nutanix_data_center_server + +Use this data source to get information on an existing Nutanix Data Center Server. + +## Example Usage + +```hcl +resource "checkpoint_management_nutanix_data_center_server" "testNutanix" { + name = "MY-NUTANIX" + hostname = "127.0.0.1" + username = "admin" + password = "admin" +} + +data "checkpoint_management_nutanix_data_center_server" "data_nutanix_data_center_server" { + name = "${checkpoint_management_nutanix_data_center_server.testNutanix.name}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Optional) Object name. +* `uid` - (Optional) Object unique identifier. +* `automatic_refresh` - Indicates whether the data center server's content is automatically updated. +* `data_center_type` - Data center type. +* `properties` - Data center properties. properties blocks are documented below. +* `tags` - Collection of tag objects identified by the name or UID. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. + + +`properties` supports the following: + +* `name` +* `value` \ No newline at end of file diff --git a/website/docs/d/checkpoint_management_oracle_cloud_data_center_server.html.markdown b/website/docs/d/checkpoint_management_oracle_cloud_data_center_server.html.markdown new file mode 100644 index 00000000..eade4fa5 --- /dev/null +++ b/website/docs/d/checkpoint_management_oracle_cloud_data_center_server.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_oracle_cloud_data_center_server" +sidebar_current: "docs-checkpoint-Resource-checkpoint-management-oracle-cloud-data-center-server" +description: |- Use this data source to get information on an existing Oracle Cloud data center server. +--- + +# Data Source: checkpoint_management_oracle_cloud_data_center_server + +Use this data source to get information on an existing Oracle Cloud Data Center Server. + +```hcl +resource "checkpoint_management_oracle_cloud_data_center_server" "testOracleCloud" { + name = "MY-ORACLE-CLOUD" + authentication_method = "key-authentication" + private_key = "0SLtLS1CRUdJTiBQUklWQVRFIEtS0FWtLS0tDQpNSUlFdkFJQkFEQU5CZ2txaGtpRzl3AAAAUUVGQUFTQ0JLWXdnZ1NpQWdFQUFvSUJBUURUdmVrK1laMmNSekVmDQp1QkNoMkFxS2hzUFcrQUhUajY4dE5VbVl4OUFTRXBsREhnMkF0bCtMRWRRWUFRSUtLMUZ5L1JHRitkK3RkWjUrDQpabmprN0hESTQ5V3Rib0xodWN3YjBpNU4xbEVKWHVhOHhEN0FROTJXQy9PdzhzVktPRlJGNVJhMmxSa0svRS8xDQpxeDhKYnRoMGdXdHg0NHBQaWJwU3crMTB0QUhHR2FTLzVwN3hNUXhzajZTOThwL1hnalg5NzN4VStZZ2dLNUx3DQp6WlkzSDQ3UVREcmpyZzhOVmpDSFU3b3IrcEpCbjdldGF0V3psK3BQcVd4ODZub2tjdG5abUQxcHNnWnkwTEdDDQpRYys5ejdURGhEOFhuVERwckxiRGZXRnZqOTVKSmc3Q1krd29zN05vSENEOG5RWjFZZURVQkJjUkVlZXJVRlhBDQpaZ1I3UGNCN0FnTUJBQUVDZ2dFQUdkUWxCZVFER3ROMXJaTXNERGRUU2RudDU3b2NWdXlac2grNW1PRVVMakF3DQptOXhTOUt3ZnlYeTZRaXlxb3JKQ3REa2trR2c0OHhWOFBrVDN1RTBUTzU0aDF1UmxJMjNMbjcvVmFzOUZnVlFmDQpQS1dLVmdwYjdFMWhtT2gwVFNmRDRwRnpETlh4SzhMaXYycWVxdTJTTlRGWVR1M2RBRWpNL3EyWERmdXJQN2tiDQprZ3FKRFBwd2g4RWRXMVg1VVAyVE9CVWxwQllDTndxUkFJQ1E3eWlzbW5xeFlZS3RKc21MK21IQ3JYM3hNRHVTDQp4NHJCVDUvcXVrdVc4MmwrbGZmU3ZTNGpsb0VhajJ2QmozSk1udy9lYlNucFplU3FENTFjOUZlOCtocU4rU3NoDQozTnc0QXVybE1RRG5vZy9STUF3QUR3KzBRUlIwNVdaWDhMVXllVTBVVVFLQmdRRHd6R2I0b25BWHlNeUNkbHB3DQpRRnFCR0pwQnlsWEJjSkZnMGpCd1JMV2tQL3VjWnNoZlFlbkFWbkRZZS9yQ0FnWWxSdFFOVFRvb3BFSjlGcGgyDQp6TkVzd1EwcnV4WjFrVm41U1hwS2dF4668KalUxT3dGa3R1WFlJcEtBNGk5dFoxT04zb1lqdVRtMUlzb2xWZXVTDQpqK3Mwd1o3ZDAyYTNXcDN1UXJ3TFUwVjdpUUtCZ1FEaEcrc2xsNDYveGxONldWWEs3RVpkOGFEcTlTNEU0aEQvDQpvTmUwS0dVcHhZYngyTnFWN1VLSEwzOE41eG5qNGllWGt2U1BnL0twVUpqUmtLN0xJMnZsNmlndUJkdW01VUR1DQp5dW4rL1dNcVdnb2p4anZBbmxsS2lIa0JRMTJ2UFRqcE9HSGIrY0RqVWxROGVnOThFOEJ0ZktUQjFkRlcxUnBlDQorMXY0aXR3RzR3S0JnQzJLeXpMZExnd2hpeVJsbEFkRTlKa1QrU0RXVHMvT0pZREZZQ25ycE5zU3l0aXl5OVRRDQpWNUJzQ04yNDNSMVNXcTAwTHlqdzRUNE1peEt6Y2xTTnVrWVhvUkVUU2xVa0QzdEpmVnFYMVUrTE1XY0c2T1dPDQpmZndaMWRHUWRkM2dPL3BLQ3Q2NHlvUkt0eWJHa0U1ZzcrQkRlbk9ENXhwb2hoUXBCUDJ6V3lIWkFvR0FURndqDQpGUHBuUXVoc3Nza1JFQ2U3NnV3bkVPeWdjcW1ZNkkzUC9kM2lDeHhsSFM3Wlh4Zy9oQW41aUdiSFlvVDV0ekh6DQpZYWQ1cmpPWDB5YklGRUpzdkc0RXVTL2xoYVNvdFJnQjdpeFg4aXJlMjZuSDVSd1IzL1dSVG50aWtTb3NYdmh3DQpRYVZqNS9pcWVHVlRVVnlGM3QzMEtZaDFYWVltVHVmbkY5VktzODhDZ1lCTTNVN2QwOU9MemhMZTh3cnp1dEpuDQpGdmRGWlhCRnhXRGwyNXdteElWTFdpM0kvaWg2QXN5YlRNNWMzbFpTTUVvcjJYeXJqNnFUNzZ6amQ2eGE2NlN3DQpXMEVyL2lEY3dWK244MHpuU3lPSW5lRThIVkh1SGtNYVpPeHkvVzdVWDFqL0RmUnJPZG1iS1NWN2NBV2dVTlBrDQpnd1V5RkM2OTRKTR41Vko0WXZEZU13PT0NCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=" + key_user = "ocid1.user.oc1..aaaaaaaad6n7rniiwgxehy6coo4ax2ti7pr5yr53cbdxdyp6sx6dhrttcz4a" + key_tenant = "ocid1.tenancy.oc1..aaaaaaaaft6hqvl367uh4e3pmdxnzmca6cxamwjfaag5lm7bnhuwu6ypajca" + key_region = "eu-frankfurt-1" +} + +data "checkpoint_management_oracle_cloud_data_center_server" "data_oracle_cloud_data_center_server" { + name = "${checkpoint_management_oracle_cloud_data_center_server.testOracleCloud.name}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Optional) Object name. +* `uid` - (Optional) Object unique identifier. +* `automatic_refresh` - Indicates whether the data center server's content is automatically updated. +* `data_center_type` - Data center type. +* `properties` - Data center properties. properties blocks are documented below. +* `tags` - Collection of tag objects identified by the name or UID. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. + + +`properties` supports the following: + +* `name` +* `value` + + + + + + diff --git a/website/docs/d/checkpoint_management_radius_group.html.markdown b/website/docs/d/checkpoint_management_radius_group.html.markdown new file mode 100644 index 00000000..905a4b0b --- /dev/null +++ b/website/docs/d/checkpoint_management_radius_group.html.markdown @@ -0,0 +1,45 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_radius_group" +sidebar_current: "docs-checkpoint-data-source-checkpoint-management-radius-group" +description: |- +Use this data source to get information on an existing Check Point Radius Group. +--- + +# Data Source: checkpoint_management_radius_group + +Use this data source to get information on an existing Check Point Radius Group. + +## Example Usage + + +```hcl +resource "checkpoint_management_host" "host" { + name = "My Host" + ipv4_address = "1.2.3.4" +} + +resource "checkpoint_management_radius_server" "radius_server" { + name = "New Radius Server" + server = "${checkpoint_management_host.host.name}" + shared_secret = "123" +} + +resource "checkpoint_management_radius_group" "radius_group" { + name = "New Radius Group" + members = ["${checkpoint_management_radius_server.radius_server.name}"] +} + +data "checkpoint_management_radius_group" "data_radius_group" { + name = "${checkpoint_management_radius_group.radius_group.name}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Optional) Object name. Should be unique in the domain. +* `uid` - (Optional) Object unique identifier. +* `members` - Collection of radius servers identified by the name or UID. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `tags` - Collection of tag objects identified by the name or UID. Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. diff --git a/website/docs/d/checkpoint_management_radius_server.html.markdown b/website/docs/d/checkpoint_management_radius_server.html.markdown new file mode 100644 index 00000000..395b8183 --- /dev/null +++ b/website/docs/d/checkpoint_management_radius_server.html.markdown @@ -0,0 +1,53 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_radius_server" +sidebar_current: "docs-checkpoint-data-source-checkpoint-management-radius-server" +description: |- +Use this data source to get information on an existing Check Point Radius Server. +--- + +# Data Source: checkpoint_management_radius_server + +Use this data source to get information on an existing Check Point Radius Server. + +## Example Usage + + +```hcl +resource "checkpoint_management_host" "host" { + name = "My Host" + ipv4_address = "1.2.3.4" +} + +resource "checkpoint_management_radius_server" "radius_server" { + name = "New Radius Server" + server = "${checkpoint_management_host.host.name}" + shared_secret = "123" +} + +data "checkpoint_management_radius_server" "data_radius_server" { + name = "${checkpoint_management_radius_server.radius_server.name}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Optional) Object name. Should be unique in the domain. +* `uid` - (Optional) Object unique identifier. +* `server` - The UID or Name of the host that is the RADIUS Server. +* `service` - The UID or Name of the Service to which the RADIUS server listens. +* `version` - The version can be either RADIUS Version 1.0, which is RFC 2138 compliant, and RADIUS Version 2.0 which is RFC 2865 compliant. +* `protocol` - The type of authentication protocol that will be used when authenticating the user to the RADIUS server. +* `priority` - The priority of the RADIUS Server in case it is a member of a RADIUS Group. +* `accounting` - Accounting settings. accounting blocks are documented below. +* `tags` - Collection of tag objects identified by the name or UID. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. + + +`accounting` supports the following: + +* `enable_ip_pool_management` - IP pool management, enables Accounting service. +* `accounting_service` - The UID or Name of the the accounting interface to notify the server when users login and logout which will then lock and release the IP addresses that the server allocated to those users. diff --git a/website/docs/d/checkpoint_management_simple_cluster.html.markdown b/website/docs/d/checkpoint_management_simple_cluster.html.markdown index e9203e21..d5b1e196 100644 --- a/website/docs/d/checkpoint_management_simple_cluster.html.markdown +++ b/website/docs/d/checkpoint_management_simple_cluster.html.markdown @@ -33,156 +33,625 @@ The following arguments are supported: * `name` - (Optional) Object name. * `uid` - (Optional) Object unique identifier. -* `ipv4_address` - IPv4 address. -* `ipv6_address` - IPv6 address. -* `cluster_mode` - Cluster mode. -* `interfaces` - Cluster interfaces. interfaces blocks are documented below. -* `members` - Cluster members. members blocks are documented below. -* `anti_bot` - Anti-Bot blade enabled. -* `anti_virus` - Anti-Virus blade enabled. +* `advanced_settings` - N/Aadvanced_settings blocks are documented below. +* `anti_bot` - Anti-Bot blade enabled. +* `anti_virus` - Anti-Virus blade enabled. * `application_control` - Application Control blade enabled. +* `application_control_and_url_filtering_settings` - Gateway Application Control and URL filtering settings.application_control_and_url_filtering_settings blocks are documented below. +* `cluster_mode` - Cluster mode. +* `cluster_settings` - ClusterXL and VRRP Settings.cluster_settings blocks are documented below. * `content_awareness` - Content Awareness blade enabled. -* `data_awareness` - Data Awareness blade enabled. +* `enable_https_inspection` - Enable HTTPS Inspection after defining an outbound inspection certificate.
To define the outbound certificate use outbound inspection certificate API. +* `fetch_policy` - Security management server(s) to fetch the policy from.fetch_policy blocks are documented below. +* `firewall` - Firewall blade enabled. +* `firewall_settings` - N/Afirewall_settings blocks are documented below. +* `geo_mode` - Cluster High Availability Geo mode.
This setting applies only to a cluster deployed in a cloud. Available when the cluster mode equals "cluster-xl-ha". +* `hardware` - Cluster platform hardware. +* `hit_count` - Hit count tracks the number of connections each rule matches. +* `https_inspection` - HTTPS inspection.https_inspection blocks are documented below. +* `identity_awareness` - Identity awareness blade enabled. +* `identity_awareness_settings` - Gateway Identity Awareness settings.identity_awareness_settings blocks are documented below. +* `interfaces` - Cluster interfaces.interfaces blocks are documented below. +* `ipv4_address` - IPv4 address. +* `ipv6_address` - IPv6 address. * `ips` - Intrusion Prevention System blade enabled. +* `ips_update_policy` - Specifies whether the IPS will be downloaded from the Management or directly to the Gateway. +* `members` - Cluster members list. Only new cluster member can be added. Adding existing gateway is not supported.members blocks are documented below. +* `nat_hide_internal_interfaces` - Hide internal networks behind the Gateway's external IP. +* `nat_settings` - NAT settings.nat_settings blocks are documented below. +* `os_name` - Cluster platform operating system. +* `platform_portal_settings` - Platform portal settings.platform_portal_settings blocks are documented below. +* `proxy_settings` - Proxy Server for Gateway.proxy_settings blocks are documented below. +* `qos` - QoS. +* `send_alerts_to_server` - Server(s) to send alerts to.send_alerts_to_server blocks are documented below. +* `send_logs_to_backup_server` - Backup server(s) to send logs to.send_logs_to_backup_server blocks are documented below. +* `send_logs_to_server` - Server(s) to send logs to.send_logs_to_server blocks are documented below. +* `tags` - Collection of tag identifiers.tags blocks are documented below. * `threat_emulation` - Threat Emulation blade enabled. +* `threat_extraction` - Threat Extraction blade enabled. +* `threat_prevention_mode` - The mode of Threat Prevention to use. When using Autonomous Threat Prevention, disabling the Threat Prevention blades is not allowed. * `url_filtering` - URL Filtering blade enabled. -* `firewall` - Firewall blade enabled. -* `firewall_settings` - Firewall settings. firewall_settings blocks are documented below. -* `vpn` - VPN blade enabled. -* `vpn_settings` - Cluster VPN settings. vpn_settings blocks are documented below. -* `dynamic_ip` - Dynamic IP address. +* `usercheck_portal_settings` - UserCheck portal settings.usercheck_portal_settings blocks are documented below. * `version` - Cluster platform version. -* `os_name` - Cluster Operating system name. -* `hardware` - Cluster platform hardware name. -* `one_time_password` - Secure Internal Communication one time password. -* `sic_name` - Secure Internal Communication name. -* `sic_state` - Secure Internal Communication state. -* `save_logs_locally` - Enable save logs locally. -* `send_alerts_to_server` - Collection of Server(s) to send alerts to identified by the name. -* `send_logs_to_backup_server` - Collection of Backup server(s) to send logs to identified by the name. -* `send_logs_to_server` - Collection of Server(s) to send logs to identified by the name. -* `logs_settings` - Logs settings. logs_settings blocks are documented below. -* `color` - Color of the object. -* `comments` - Comments string. -* `tags` - Collection of tags identified by name. +* `vpn` - VPN blade enabled. +* `vpn_settings` - Gateway VPN settings.vpn_settings blocks are documented below. +* `zero_phishing` - Zero Phishing blade enabled. +* `zero_phishing_fqdn` - Zero Phishing gateway FQDN. +* `show_portals_certificate` - Indicates whether to show the portals certificate value in the reply. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. +* `groups` - Collection of group identifiers.groups blocks are documented below. +* `ignore_warnings` - Apply changes ignoring warnings. +* `ignore_errors` - Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`advanced_settings` supports the following: + +* `connection_persistence` - Handling established connections when installing a new policy. +* `sam` - SAM.sam blocks are documented below. + + +`application_control_and_url_filtering_settings` supports the following: + +* `global_settings_mode` - Whether to override global settings or not. +* `override_global_settings` - override global settings object.override_global_settings blocks are documented below. + + +`cluster_settings` supports the following: + +* `member_recovery_mode` - In a High Availability cluster, each member is given a priority. The member with the highest priority serves as the gateway. If this gateway fails, control is passed to the member with the next highest priority. If that member fails, control is passed to the next, and so on. Upon gateway recovery, it is possible to: + Maintain current active Cluster Member (maintain-current-active) or + Switch to higher priority Cluster Member (according-to-priority). +* `state_synchronization` - Cluster State Synchronization settings.state_synchronization blocks are documented below. +* `track_changes_of_cluster_members` - Track changes in the status of Cluster Members. +* `use_virtual_mac` - Use Virtual MAC. By enabling Virtual MAC in ClusterXL High Availability New mode, or Load Sharing Unicast mode, all cluster members associate the same Virtual MAC address with All Cluster Virtual Interfaces and the Virtual IP address. + + +`firewall_settings` supports the following: + +* `auto_calculate_connections_hash_table_size_and_memory_pool` - N/A +* `auto_maximum_limit_for_concurrent_connections` - N/A +* `connections_hash_size` - N/A +* `maximum_limit_for_concurrent_connections` - N/A +* `maximum_memory_pool_size` - N/A +* `memory_pool_size` - N/A + + +`https_inspection` supports the following: + +* `bypass_on_failure` - Set to be true in order to bypass all requests (Fail-open) in case of internal system error.bypass_on_failure blocks are documented below. +* `site_categorization_allow_mode` - Set to 'background' in order to allowed requests until categorization is complete.site_categorization_allow_mode blocks are documented below. +* `deny_untrusted_server_cert` - Set to be true in order to drop traffic from servers with untrusted server certificate.deny_untrusted_server_cert blocks are documented below. +* `deny_revoked_server_cert` - Set to be true in order to drop traffic from servers with revoked server certificate (validate CRL).deny_revoked_server_cert blocks are documented below. +* `deny_expired_server_cert` - Set to be true in order to drop traffic from servers with expired server certificate.deny_expired_server_cert blocks are documented below. + + +`identity_awareness_settings` supports the following: + +* `browser_based_authentication` - Enable Browser Based Authentication source. +* `browser_based_authentication_settings` - Browser Based Authentication settings.browser_based_authentication_settings blocks are documented below. +* `identity_agent` - Enable Identity Agent source. +* `identity_agent_settings` - Identity Agent settings.identity_agent_settings blocks are documented below. +* `identity_collector` - Enable Identity Collector source. +* `identity_collector_settings` - Identity Collector settings.identity_collector_settings blocks are documented below. +* `identity_sharing_settings` - Identity sharing settings.identity_sharing_settings blocks are documented below. +* `proxy_settings` - Identity-Awareness Proxy settings.proxy_settings blocks are documented below. +* `remote_access` - Enable Remote Access Identity source. + `interfaces` supports the following: -* `name` - Interface name. -* `interface_type` - Cluster interface type. -* `ipv4_address` - IPv4 address. -* `ipv6_address` - IPv6 address. + +* `name` - Object name. Must be unique in the domain. +* `interface_type` - Cluster interface type. +* `ipv4_address` - IPv4 address. +* `ipv6_address` - IPv6 address. +* `network_mask` - IPv4 or IPv6 network mask. If both masks are required use ipv4-network-mask and ipv6-network-mask fields explicitly. Instead of providing mask itself it is possible to specify IPv4 or IPv6 mask length in mask-length field. If both masks length are required use ipv4-mask-length and ipv6-mask-length fields explicitly. * `ipv4_network_mask` - IPv4 network address. * `ipv6_network_mask` - IPv6 network address. * `ipv4_mask_length` - IPv4 network mask length. * `ipv6_mask_length` - IPv6 network mask length. -* `anti_spoofing` - Anti spoofing. -* `anti_spoofing_settings` - Anti spoofing settings. anti_spoofing_settings blocks are documented below. +* `anti_spoofing` - N/A +* `anti_spoofing_settings` - N/Aanti_spoofing_settings blocks are documented below. * `multicast_address` - Multicast IP Address. * `multicast_address_type` - Multicast Address Type. -* `security_zone` - Security zone. -* `security_zone_settings` - Security zone settings. security_zone_settings blocks are documented below. -* `topology` - Topology. -* `topology_settings` - Topology settings. topology_settings blocks are documented below. -* `topology_automatic_calculation` - Shows the automatic topology calculation.. -* `color` - Color of the object. Should be one of existing colors. -* `comments` - Comments string. +* `security_zone` - N/A +* `security_zone_settings` - N/Asecurity_zone_settings blocks are documented below. +* `tags` - Collection of tag identifiers.tags blocks are documented below. +* `topology` - N/A +* `topology_settings` - N/Atopology_settings blocks are documented below. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. +* `ignore_warnings` - Apply changes ignoring warnings. +* `ignore_errors` - Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`members` supports the following: + +* `name` - Object name. +* `interfaces` - Cluster Member network interfaces.interfaces blocks are documented below. +* `ipv4_address` - IPv4 address. +* `ipv6_address` - IPv6 address. +* `one_time_password` - N/A +* `tags` - Collection of tag identifiers.tags blocks are documented below. +* `priority` - In a High Availability New mode cluster each machine is given a priority. The highest priority machine serves as the gateway in normal circumstances. If this machine fails, control is passed to the next highest priority machine. If that machine fails, control is passed to the next machine, and so on. + In Load Sharing Unicast mode cluster, the highest priority is the pivot machine. + The values must be in a range from 1 to N, where N is number of cluster members. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. +* `ignore_warnings` - Apply changes ignoring warnings. +* `ignore_errors` - Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`nat_settings` supports the following: + +* `auto_rule` - Whether to add automatic address translation rules. +* `ipv4_address` - IPv4 address. +* `ipv6_address` - IPv6 address. +* `hide_behind` - Hide behind method. This parameter is forbidden in case "method" parameter is "static". +* `install_on` - Which gateway should apply the NAT translation. +* `method` - NAT translation method. + + +`platform_portal_settings` supports the following: + +* `portal_web_settings` - Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`proxy_settings` supports the following: + +* `use_custom_proxy` - Use custom proxy settings for this network object. +* `proxy_server` - N/A +* `port` - N/A + + +`usercheck_portal_settings` supports the following: + +* `enabled` - State of the web portal (enabled or disabled). The supported blades are: {'Application Control', 'URL Filtering', 'Data Loss Prevention', 'Anti Virus', 'Anti Bot', 'Threat Emulation', 'Threat Extraction', 'Data Awareness'}. +* `portal_web_settings` - Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`vpn_settings` supports the following: + +* `authentication` - Authentication.authentication blocks are documented below. +* `link_selection` - Link Selection.link_selection blocks are documented below. +* `maximum_concurrent_ike_negotiations` - N/A +* `maximum_concurrent_tunnels` - N/A +* `office_mode` - Office Mode. + Notation Wide Impact - Office Mode apply IPSec VPN Software Blade clients and to the Mobile Access Software Blade clients.office_mode blocks are documented below. +* `remote_access` - Remote Access.remote_access blocks are documented below. +* `vpn_domain` - Gateway VPN domain identified by the name or UID. +* `vpn_domain_exclude_external_ip_addresses` - Exclude the external IP addresses from the VPN domain of this Security Gateway. +* `vpn_domain_type` - Gateway VPN domain type. + + +`sam` supports the following: + +* `forward_to_other_sam_servers` - Forward SAM clients' requests to other SAM servers. +* `use_early_versions` - Use early versions compatibility mode.use_early_versions blocks are documented below. +* `purge_sam_file` - Purge SAM File.purge_sam_file blocks are documented below. + + +`override_global_settings` supports the following: + +* `fail_mode` - Fail mode - allow or block all requests. +* `website_categorization` - Website categorization object.website_categorization blocks are documented below. + + +`state_synchronization` supports the following: + +* `delayed` - Start synchronizing with delay of seconds, as defined by delayed-seconds, after connection initiation. Disabled when state-synchronization disabled. +* `delayed_seconds` - Start synchronizing X seconds after connection initiation + . The values must be in a range between 2 and 3600. +* `enabled` - Use State Synchronization. + + +`bypass_on_failure` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`site_categorization_allow_mode` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`deny_untrusted_server_cert` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`deny_revoked_server_cert` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`deny_expired_server_cert` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`browser_based_authentication_settings` supports the following: + +* `authentication_settings` - Authentication Settings for Browser Based Authentication.authentication_settings blocks are documented below. +* `browser_based_authentication_portal_settings` - Browser Based Authentication portal settings.browser_based_authentication_portal_settings blocks are documented below. + + +`identity_agent_settings` supports the following: + +* `agents_interval_keepalive` - Agents send keepalive period (minutes). +* `user_reauthenticate_interval` - Agent reauthenticate time interval (minutes). +* `authentication_settings` - Authentication Settings for Identity Agent.authentication_settings blocks are documented below. +* `identity_agent_portal_settings` - Identity Agent accessibility settings.identity_agent_portal_settings blocks are documented below. + + +`identity_collector_settings` supports the following: + +* `authorized_clients` - Authorized Clients.authorized_clients blocks are documented below. +* `authentication_settings` - Authentication Settings for Identity Collector.authentication_settings blocks are documented below. +* `client_access_permissions` - Identity Collector accessibility settings.client_access_permissions blocks are documented below. + + +`identity_sharing_settings` supports the following: + +* `share_with_other_gateways` - Enable identity sharing with other gateways. +* `receive_from_other_gateways` - Enable receiving identity from other gateways. +* `receive_from` - Gateway(s) to receive identity from.receive_from blocks are documented below. + + +`proxy_settings` supports the following: + +* `detect_using_x_forward_for` - Whether to use X-Forward-For HTTP header, which is added by the proxy server to keep track of the original source IP. + `anti_spoofing_settings` supports the following: + * `action` - If packets will be rejected (the Prevent option) or whether the packets will be monitored (the Detect option). +* `exclude_packets` - Don't check packets from excluded network. +* `excluded_network_name` - Excluded network name. +* `excluded_network_uid` - Excluded network UID. +* `spoof_tracking` - Spoof tracking. + `security_zone_settings` supports the following: + * `auto_calculated` - Security Zone is calculated according to where the interface leads to. * `specific_zone` - Security Zone specified manually. + `topology_settings` supports the following: + * `interface_leads_to_dmz` - Whether this interface leads to demilitarized zone (perimeter network). -* `ip_address_behind_this_interface` - Ip address behind this interface. * `specific_network` - Network behind this interface. -`members` supports the following: -* `name` - Object name. Should be unique in the domain.. -* `ip_address` - IPv4 or IPv6 address. -* `interfaces` - Cluster Member network interfaces. interfaces blocks are documented below. -* `one_time_password` - Secure Internal Communication one time password. -* `sic_name` - Secure Internal Communication name. -* `sic_message` - Secure Internal Communication state. `interfaces` supports the following: -* `name` - Interface name. -* `ipv4_address` - IPv4 address. -* `ipv6_address` - IPv6 address. + +* `name` - Object name. +* `anti_spoofing` - N/A +* `anti_spoofing_settings` - N/Aanti_spoofing_settings blocks are documented below. +* `ipv4_address` - IPv4 address. +* `ipv6_address` - IPv6 address. +* `network_mask` - IPv4 or IPv6 network mask. If both masks are required use ipv4-network-mask and ipv6-network-mask fields explicitly. Instead of providing mask itself it is possible to specify IPv4 or IPv6 mask length in mask-length field. If both masks length are required use ipv4-mask-length and ipv6-mask-length fields explicitly. * `ipv4_network_mask` - IPv4 network address. * `ipv6_network_mask` - IPv6 network address. * `ipv4_mask_length` - IPv4 network mask length. * `ipv6_mask_length` - IPv6 network mask length. +* `security_zone` - N/A +* `security_zone_settings` - N/Asecurity_zone_settings blocks are documented below. +* `tags` - Collection of tag identifiers.tags blocks are documented below. +* `topology` - N/A +* `topology_settings` - N/Atopology_settings blocks are documented below. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. +* `ignore_warnings` - Apply changes ignoring warnings. +* `ignore_errors` - Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. -`firewall_settings` supports the following: -* `auto_calculate_connections_hash_table_size_and_memory_pool` - Auto calculate connections hash table size and memory pool. -* `auto_maximum_limit_for_concurrent_connections` - Auto maximum limit for concurrent connections. -* `connections_hash_size` - Connections hash size. -* `maximum_limit_for_concurrent_connections` - Maximum limit for concurrent connections. -* `maximum_memory_pool_size` - Maximum memory pool size. -* `memory_pool_size` - Memory pool size. -`vpn_settings` supports the following: -* `authentication` - authentication blocks are documented below. -* `link_selection` - Link selection blocks are documented below. -* `maximum_concurrent_ike_negotiations` - Maximum concurrent ike negotiations. -* `maximum_concurrent_tunnels` - Maximum concurrent tunnels. -* `office_mode` - Office Mode. Notation Wide Impact - Office Mode apply IPSec VPN Software Blade clients and to the Mobile Access Software Blade clients. office_mode blocks are documented below. -* `remote_access` - remote_access blocks are documented below. -* `vpn_domain` - Gateway VPN domain identified by the name. -* `vpn_domain_type` - Gateway VPN domain type. +`portal_web_settings` supports the following: + +* `aliases` - List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - The certificate file encoded in Base64 with padding. + This file must be in the *.p12 format. +* `base64_password` - Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`portal_web_settings` supports the following: + +* `aliases` - List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - The certificate file encoded in Base64 with padding. + This file must be in the *.p12 format. +* `base64_password` - Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + `authentication` supports the following: -* `authentication_clients` - Collection of VPN Authentication clients identified by the name. + +* `authentication_clients` - Collection of VPN Authentication clients identified by the name or UID.authentication_clients blocks are documented below. + `link_selection` supports the following: -* `ip_selection` - IP selection. -* `dns_resolving_hostname` - DNS Resolving Hostname. Must be set when "ip-selection" was selected to be "dns-resolving-from-hostname". -* `ip_address` - IP Address. Must be set when "ip-selection" was selected to be "use-selected-address-from-topology" or "use-statically-nated-ip". + +* `dns_resolving_hostname` - DNS Resolving Hostname. Must be set when "ip-selection" was selected to be "dns-resolving-from-hostname". + `office_mode` supports the following: -* `mode` - Office Mode Permissions. When selected to be "off", all the other definitions are irrelevant. -* `group` - Group. Identified by name. Must be set when "office-mode-permissions" was selected to be "group". -* `allocate_ip_address_from` - Allocate IP address Method. Allocate IP address by sequentially trying the given methods until success. allocate_ip_address_from blocks are documented below. + +* `mode` - Office Mode Permissions. + When selected to be "off", all the other definitions are irrelevant. +* `group` - Group. Identified by name or UID. + Must be set when "office-mode-permissions" was selected to be "group". +* `allocate_ip_address_from` - Allocate IP address Method. + Allocate IP address by sequentially trying the given methods until success.allocate_ip_address_from blocks are documented below. * `support_multiple_interfaces` - Support connectivity enhancement for gateways with multiple external interfaces. * `perform_anti_spoofing` - Perform Anti-Spoofing on Office Mode addresses. -* `anti_spoofing_additional_addresses` - Additional IP Addresses for Anti-Spoofing. Identified by name. Must be set when "perform-anti-spoofings" is true. +* `anti_spoofing_additional_addresses` - Additional IP Addresses for Anti-Spoofing. + Identified by name or UID. + Must be set when "perform-anti-spoofings" is true. + + +`remote_access` supports the following: + +* `support_l2tp` - Support L2TP (relevant only when office mode is active). +* `l2tp_auth_method` - L2TP Authentication Method. + Must be set when "support-l2tp" is true. +* `l2tp_certificate` - L2TP Certificate. + Must be set when "l2tp-auth-method" was selected to be "certificate". + Insert "defaultCert" when you want to use the default certificate. +* `allow_vpn_clients_to_route_traffic` - Allow VPN clients to route traffic. +* `support_nat_traversal_mechanism` - Support NAT traversal mechanism (UDP encapsulation). +* `nat_traversal_service` - Allocated NAT traversal UDP service. Identified by name or UID. + Must be set when "support-nat-traversal-mechanism" is true. +* `support_visitor_mode` - Support Visitor Mode. +* `visitor_mode_service` - TCP Service for Visitor Mode. Identified by name or UID. + Must be set when "support-visitor-mode" is true. +* `visitor_mode_interface` - Interface for Visitor Mode. + Must be set when "support-visitor-mode" is true. + Insert IPV4 Address of existing interface or "All IPs" when you want all interfaces. + + +`use_early_versions` supports the following: + +* `enabled` - Use early versions compatibility mode. +* `compatibility_mode` - Early versions compatibility mode. + + +`purge_sam_file` supports the following: + +* `enabled` - Purge SAM File. +* `purge_when_size_reaches_to` - Purge SAM File When it Reaches to. + + +`website_categorization` supports the following: + +* `mode` - Website categorization mode. +* `custom_mode` - Custom mode object.custom_mode blocks are documented below. + + +`authentication_settings` supports the following: + +* `authentication_method` - Authentication method. +* `identity_provider` - Identity provider object identified by the name or UID. Must be set when "authentication-method" was selected to be "identity provider".identity_provider blocks are documented below. +* `radius` - Radius server object identified by the name or UID. Must be set when "authentication-method" was selected to be "radius". +* `users_directories` - Users directories.users_directories blocks are documented below. + + +`browser_based_authentication_portal_settings` supports the following: + +* `portal_web_settings` - Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`authentication_settings` supports the following: + +* `authentication_method` - Authentication method. +* `radius` - Radius server object identified by the name or UID. Must be set when "authentication-method" was selected to be "radius". +* `users_directories` - Users directories.users_directories blocks are documented below. + + +`identity_agent_portal_settings` supports the following: + +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`authorized_clients` supports the following: + +* `client` - Host / Network Group Name or UID. +* `client_secret` - Client Secret. + + +`authentication_settings` supports the following: + +* `users_directories` - Users directories.users_directories blocks are documented below. + + +`client_access_permissions` supports the following: + +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`anti_spoofing_settings` supports the following: + +* `action` - If packets will be rejected (the Prevent option) or whether the packets will be monitored (the Detect option). +* `exclude_packets` - Don't check packets from excluded network. +* `excluded_network_name` - Excluded network name. +* `excluded_network_uid` - Excluded network UID. +* `spoof_tracking` - Spoof tracking. + + +`security_zone_settings` supports the following: + +* `auto_calculated` - Security Zone is calculated according to where the interface leads to. +* `specific_zone` - Security Zone specified manually. + + +`topology_settings` supports the following: + +* `interface_leads_to_dmz` - Whether this interface leads to demilitarized zone (perimeter network). +* `specific_network` - Network behind this interface. + + +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + `allocate_ip_address_from` supports the following: + * `radius_server` - Radius server used to authenticate the user. * `use_allocate_method` - Use Allocate Method. -* `allocate_method` - Using either Manual (IP Pool) or Automatic (DHCP). Must be set when "use-allocate-method" is true. -* `manual_network` - Manual Network. Identified by name. Must be set when "allocate-method" was selected to be "manual". -* `dhcp_server` - DHCP Server. Identified by name. Must be set when "allocate-method" was selected to be "automatic". -* `virtual_ip_address` - Virtual IPV4 address for DHCP server replies. Must be set when "allocate-method" was selected to be "automatic". -* `dhcp_mac_address` - Calculated MAC address for DHCP allocation. Must be set when "allocate-method" was selected to be "automatic". -* `optional_parameters` - This configuration applies to all Office Mode methods except Automatic (using DHCP) and ipassignment.conf entries which contain this data. optional_parameters blocks are documented below. +* `allocate_method` - Using either Manual (IP Pool) or Automatic (DHCP). + Must be set when "use-allocate-method" is true. +* `manual_network` - Manual Network. Identified by name or UID. + Must be set when "allocate-method" was selected to be "manual". +* `dhcp_server` - DHCP Server. Identified by name or UID. + Must be set when "allocate-method" was selected to be "automatic". +* `virtual_ip_address` - Virtual IPV4 address for DHCP server replies. + Must be set when "allocate-method" was selected to be "automatic". +* `dhcp_mac_address` - Calculated MAC address for DHCP allocation. + Must be set when "allocate-method" was selected to be "automatic". +* `optional_parameters` - This configuration applies to all Office Mode methods except Automatic (using DHCP) and ipassignment.conf entries which contain this data.optional_parameters blocks are documented below. + + +`custom_mode` supports the following: + +* `social_networking_widgets` - Social networking widgets mode. +* `url_filtering` - URL filtering mode. + + +`users_directories` supports the following: + +* `external_user_profile` - External user profile. +* `internal_users` - Internal users. +* `users_from_external_directories` - Users from external directories. +* `specific` - LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`portal_web_settings` supports the following: + +* `aliases` - List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - The certificate file encoded in Base64 with padding. + This file must be in the *.p12 format. +* `base64_password` - Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`users_directories` supports the following: + +* `external_user_profile` - External user profile. +* `internal_users` - Internal users. +* `users_from_external_directories` - Users from external directories. +* `specific` - LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`users_directories` supports the following: + +* `external_user_profile` - External user profile. +* `internal_users` - Internal users. +* `users_from_external_directories` - Users from external directories. +* `specific` - LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + `optional_parameters` supports the following: + * `use_primary_dns_server` - Use Primary DNS Server. -* `primary_dns_server` - Primary DNS Server. Identified by name. Must be set when "use-primary-dns-server" is true and can not be set when "use-primary-dns-server" is false. +* `primary_dns_server` - Primary DNS Server. Identified by name or UID. + Must be set when "use-primary-dns-server" is true and can not be set when "use-primary-dns-server" is false. * `use_first_backup_dns_server` - Use First Backup DNS Server. -* `first_backup_dns_server` - First Backup DNS Server. Identified by name. Must be set when "use-first-backup-dns-server" is true and can not be set when "use-first-backup-dns-server" is false. +* `first_backup_dns_server` - First Backup DNS Server. Identified by name or UID. + Must be set when "use-first-backup-dns-server" is true and can not be set when "use-first-backup-dns-server" is false. * `use_second_backup_dns_server` - Use Second Backup DNS Server. -* `second_backup_dns_server` - Second Backup DNS Server. Identified by name. Must be set when "use-second-backup-dns-server" is true and can not be set when "use-second-backup-dns-server" is false. +* `second_backup_dns_server` - Second Backup DNS Server. Identified by name or UID. + Must be set when "use-second-backup-dns-server" is true and can not be set when "use-second-backup-dns-server" is false. * `dns_suffixes` - DNS Suffixes. * `use_primary_wins_server` - Use Primary WINS Server. -* `primary_wins_server` - Primary WINS Server. Identified by name. Must be set when "use-primary-wins-server" is true and can not be set when "use-primary-wins-server" is false. +* `primary_wins_server` - Primary WINS Server. Identified by name or UID. + Must be set when "use-primary-wins-server" is true and can not be set when "use-primary-wins-server" is false. * `use_first_backup_wins_server` - Use First Backup WINS Server. -* `first_backup_wins_server` - First Backup WINS Server. Identified by name. Must be set when "use-first-backup-wins-server" is true and can not be set when "use-first-backup-wins-server" is false. +* `first_backup_wins_server` - First Backup WINS Server. Identified by name or UID. + Must be set when "use-first-backup-wins-server" is true and can not be set when "use-first-backup-wins-server" is false. * `use_second_backup_wins_server` - Use Second Backup WINS Server. -* `second_backup_wins_server` - Second Backup WINS Server. Identified by name. Must be set when "use-second-backup-wins-server" is true and can not be set when "use-second-backup-wins-server" is false. -* `ip_lease_duration` - IP Lease Duration in Minutes. The value must be in the range 2-32767. +* `second_backup_wins_server` - Second Backup WINS Server. Identified by name or UID. + Must be set when "use-second-backup-wins-server" is true and can not be set when "use-second-backup-wins-server" is false. -`remote_access` supports the following: -* `support_l2tp` - Support L2TP (relevant only when office mode is active). -* `l2tp_auth_method` - L2TP Authentication Method. Must be set when "support-l2tp" is true. -* `l2tp_certificate` - L2TP Certificate. Must be set when "l2tp-auth-method" was selected to be "certificate". Insert "defaultCert" when you want to use the default certificate. -* `allow_vpn_clients_to_route_traffic` - Allow VPN clients to route traffic. -* `support_nat_traversal_mechanism` - Support NAT traversal mechanism (UDP encapsulation). -* `nat_traversal_service` - Allocated NAT traversal UDP service. Identified by name. Must be set when "support-nat-traversal-mechanism" is true. -* `support_visitor_mode` - Support Visitor Mode. -* `visitor_mode_service` - TCP Service for Visitor Mode. Identified by name. Must be set when "support-visitor-mode" is true. -* `visitor_mode_interface` - Interface for Visitor Mode. Must be set when "support-visitor-mode" is true. Insert IPV4 Address of existing interface or "All IPs" when you want all interfaces. \ No newline at end of file + +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. diff --git a/website/docs/d/checkpoint_management_simple_gateway.html.markdown b/website/docs/d/checkpoint_management_simple_gateway.html.markdown index 9b38db03..b12c3f27 100644 --- a/website/docs/d/checkpoint_management_simple_gateway.html.markdown +++ b/website/docs/d/checkpoint_management_simple_gateway.html.markdown @@ -32,163 +32,575 @@ The following arguments are supported: * `name` - (Optional) Object name. * `uid` - (Optional) Object unique identifier. -* `ipv4_address` - IPv4 address. -* `ipv6_address` - IPv6 address. -* `interfaces` - Gateway interfaces. interfaces blocks are documented below. -* `anti_bot` - Anti-Bot blade enabled. -* `anti_virus` - Anti-Virus blade enabled. +* `advanced_settings` - N/Aadvanced_settings blocks are documented below. +* `anti_bot` - Anti-Bot blade enabled. +* `anti_virus` - Anti-Virus blade enabled. * `application_control` - Application Control blade enabled. +* `application_control_and_url_filtering_settings` - Gateway Application Control and URL filtering settings.application_control_and_url_filtering_settings blocks are documented below. * `content_awareness` - Content Awareness blade enabled. +* `enable_https_inspection` - Enable HTTPS Inspection after defining an outbound inspection certificate.
To define the outbound certificate use outbound inspection certificate API. +* `fetch_policy` - Security management server(s) to fetch the policy from.fetch_policy blocks are documented below. +* `firewall` - Firewall blade enabled. +* `firewall_settings` - N/Afirewall_settings blocks are documented below. +* `hit_count` - Hit count tracks the number of connections each rule matches. +* `https_inspection` - HTTPS inspection.https_inspection blocks are documented below. * `icap_server` - ICAP Server enabled. +* `identity_awareness` - Identity awareness blade enabled. +* `identity_awareness_settings` - Gateway Identity Awareness settings.identity_awareness_settings blocks are documented below. +* `interfaces` - Network interfaces.interfaces blocks are documented below. +* `ipv4_address` - IPv4 address. +* `ipv6_address` - IPv6 address. * `ips` - Intrusion Prevention System blade enabled. +* `ips_update_policy` - Specifies whether the IPS will be downloaded from the Management or directly to the Gateway. +* `nat_hide_internal_interfaces` - Hide internal networks behind the Gateway's external IP. +* `nat_settings` - NAT settings.nat_settings blocks are documented below. +* `one_time_password` - N/A +* `os_name` - Gateway platform operating system. +* `platform_portal_settings` - Platform portal settings.platform_portal_settings blocks are documented below. +* `proxy_settings` - Proxy Server for Gateway.proxy_settings blocks are documented below. +* `qos` - QoS. +* `save_logs_locally` - Save logs locally on the gateway. +* `send_alerts_to_server` - Server(s) to send alerts to.send_alerts_to_server blocks are documented below. +* `send_logs_to_backup_server` - Backup server(s) to send logs to.send_logs_to_backup_server blocks are documented below. +* `send_logs_to_server` - Server(s) to send logs to.send_logs_to_server blocks are documented below. +* `tags` - Collection of tag identifiers.tags blocks are documented below. * `threat_emulation` - Threat Emulation blade enabled. * `threat_extraction` - Threat Extraction blade enabled. +* `threat_prevention_mode` - The mode of Threat Prevention to use. When using Autonomous Threat Prevention, disabling the Threat Prevention blades is not allowed. * `url_filtering` - URL Filtering blade enabled. -* `firewall` - Firewall blade enabled. -* `firewall_settings` - Firewall settings. firewall_settings blocks are documented below. -* `vpn` - VPN blade enabled. -* `vpn_settings` - Gateway VPN settings. vpn_settings blocks are documented below. -* `dynamic_ip` - Dynamic IP address. +* `usercheck_portal_settings` - UserCheck portal settings.usercheck_portal_settings blocks are documented below. * `version` - Gateway platform version. -* `os_name` - Operating system name. -* `hardware` - Gateway platform hardware name. -* `one_time_password` - Secure internal connection one time password. -* `sic_name` - Secure Internal Communication name. -* `sic_state` - Secure Internal Communication state. -* `save_logs_locally` - Enable save logs locally. -* `send_alerts_to_server` - Collection of Server(s) to send alerts to identified by the name. -* `send_logs_to_backup_server` - Collection of Backup server(s) to send logs to identified by the name. -* `send_logs_to_server` - Collection of Server(s) to send logs to identified by the name. -* `logs_settings` - Logs settings. logs_settings blocks are documented below. -* `color` - Color of the object. -* `comments` - Comments string. -* `tags` - Collection of tags identified by name. +* `vpn` - VPN blade enabled. +* `vpn_settings` - Gateway VPN settings.vpn_settings blocks are documented below. +* `zero_phishing` - Zero Phishing blade enabled. +* `zero_phishing_fqdn` - Zero Phishing gateway FQDN. +* `logs_settings` - Logs settings that apply to Quantum Security Gateways that run Gaia OS.logs_settings blocks are documented below. +* `show_portals_certificate` - Indicates whether to show the portals certificate value in the reply. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. +* `groups` - Collection of group identifiers.groups blocks are documented below. +* `ignore_errors` - Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`advanced_settings` supports the following: + +* `connection_persistence` - Handling established connections when installing a new policy. +* `sam` - SAM.sam blocks are documented below. + + +`application_control_and_url_filtering_settings` supports the following: + +* `global_settings_mode` - Whether to override global settings or not. +* `override_global_settings` - override global settings object.override_global_settings blocks are documented below. + + +`firewall_settings` supports the following: + +* `auto_calculate_connections_hash_table_size_and_memory_pool` - N/A +* `auto_maximum_limit_for_concurrent_connections` - N/A +* `connections_hash_size` - N/A +* `maximum_limit_for_concurrent_connections` - N/A +* `maximum_memory_pool_size` - N/A +* `memory_pool_size` - N/A + + +`https_inspection` supports the following: + +* `bypass_on_failure` - Set to be true in order to bypass all requests (Fail-open) in case of internal system error.bypass_on_failure blocks are documented below. +* `site_categorization_allow_mode` - Set to 'background' in order to allowed requests until categorization is complete.site_categorization_allow_mode blocks are documented below. +* `deny_untrusted_server_cert` - Set to be true in order to drop traffic from servers with untrusted server certificate.deny_untrusted_server_cert blocks are documented below. +* `deny_revoked_server_cert` - Set to be true in order to drop traffic from servers with revoked server certificate (validate CRL).deny_revoked_server_cert blocks are documented below. +* `deny_expired_server_cert` - Set to be true in order to drop traffic from servers with expired server certificate.deny_expired_server_cert blocks are documented below. + + +`identity_awareness_settings` supports the following: + +* `browser_based_authentication` - Enable Browser Based Authentication source. +* `browser_based_authentication_settings` - Browser Based Authentication settings.browser_based_authentication_settings blocks are documented below. +* `identity_agent` - Enable Identity Agent source. +* `identity_agent_settings` - Identity Agent settings.identity_agent_settings blocks are documented below. +* `identity_collector` - Enable Identity Collector source. +* `identity_collector_settings` - Identity Collector settings.identity_collector_settings blocks are documented below. +* `identity_sharing_settings` - Identity sharing settings.identity_sharing_settings blocks are documented below. +* `proxy_settings` - Identity-Awareness Proxy settings.proxy_settings blocks are documented below. +* `remote_access` - Enable Remote Access Identity source. + `interfaces` supports the following: -* `name` - Interface name. -* `ipv4_address` - IPv4 address. -* `ipv6_address` - IPv6 address. + +* `name` - Object name. Must be unique in the domain. +* `ipv4_address` - IPv4 address. +* `ipv6_address` - IPv6 address. +* `network_mask` - IPv4 or IPv6 network mask. If both masks are required use ipv4-network-mask and ipv6-network-mask fields explicitly. Instead of providing mask itself it is possible to specify IPv4 or IPv6 mask length in mask-length field. If both masks length are required use ipv4-mask-length and ipv6-mask-length fields explicitly. * `ipv4_network_mask` - IPv4 network address. * `ipv6_network_mask` - IPv6 network address. * `ipv4_mask_length` - IPv4 network mask length. * `ipv6_mask_length` - IPv6 network mask length. -* `anti_spoofing` - Anti spoofing. -* `anti_spoofing_settings` - Anti spoofing settings. anti_spoofing_settings blocks are documented below. -* `security_zone` - Security zone. -* `security_zone_settings` - Security zone settings. security_zone_settings blocks are documented below. -* `topology` - Topology. -* `topology_settings` - Topology settings. topology_settings blocks are documented below. -* `topology_automatic_calculation` - Shows the automatic topology calculation.. -* `color` - Color of the object. Should be one of existing colors. -* `comments` - Comments string. +* `anti_spoofing` - N/A +* `anti_spoofing_settings` - N/Aanti_spoofing_settings blocks are documented below. +* `security_zone` - N/A +* `security_zone_settings` - N/Asecurity_zone_settings blocks are documented below. +* `tags` - Collection of tag identifiers.tags blocks are documented below. +* `topology` - N/A +* `topology_settings` - N/Atopology_settings blocks are documented below. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. +* `ignore_errors` - Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`nat_settings` supports the following: + +* `auto_rule` - Whether to add automatic address translation rules. +* `ipv4_address` - IPv4 address. +* `ipv6_address` - IPv6 address. +* `hide_behind` - Hide behind method. This parameter is forbidden in case "method" parameter is "static". +* `install_on` - Which gateway should apply the NAT translation. +* `method` - NAT translation method. + + +`platform_portal_settings` supports the following: + +* `portal_web_settings` - Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`proxy_settings` supports the following: + +* `use_custom_proxy` - Use custom proxy settings for this network object. +* `proxy_server` - N/A +* `port` - N/A + + +`usercheck_portal_settings` supports the following: + +* `enabled` - State of the web portal (enabled or disabled). The supported blades are: {'Application Control', 'URL Filtering', 'Data Loss Prevention', 'Anti Virus', 'Anti Bot', 'Threat Emulation', 'Threat Extraction', 'Data Awareness'}. +* `portal_web_settings` - Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`vpn_settings` supports the following: + +* `authentication` - Authentication.authentication blocks are documented below. +* `link_selection` - Link Selection.link_selection blocks are documented below. +* `maximum_concurrent_ike_negotiations` - N/A +* `maximum_concurrent_tunnels` - N/A +* `office_mode` - Office Mode. + Notation Wide Impact - Office Mode apply IPSec VPN Software Blade clients and to the Mobile Access Software Blade clients.office_mode blocks are documented below. +* `remote_access` - Remote Access.remote_access blocks are documented below. +* `vpn_domain` - Gateway VPN domain identified by the name or UID. +* `vpn_domain_exclude_external_ip_addresses` - Exclude the external IP addresses from the VPN domain of this Security Gateway. +* `vpn_domain_type` - Gateway VPN domain type. + + +`logs_settings` supports the following: + +* `alert_when_free_disk_space_below` - Enable alert when free disk space is below threshold. +* `alert_when_free_disk_space_below_threshold` - Alert when free disk space below threshold. +* `alert_when_free_disk_space_below_type` - Alert when free disk space below type. +* `before_delete_keep_logs_from_the_last_days` - Enable before delete keep logs from the last days. +* `before_delete_keep_logs_from_the_last_days_threshold` - Before delete keep logs from the last days threshold. +* `before_delete_run_script` - Enable Before delete run script. +* `before_delete_run_script_command` - Before delete run script command. +* `delete_index_files_older_than_days` - Enable delete index files older than days. +* `delete_index_files_older_than_days_threshold` - Delete index files older than days threshold. +* `delete_index_files_when_index_size_above` - Enable delete index files when index size above. +* `delete_index_files_when_index_size_above_threshold` - Delete index files when index size above threshold. +* `delete_when_free_disk_space_below` - Enable delete when free disk space below. +* `delete_when_free_disk_space_below_threshold` - Delete when free disk space below threshold. +* `detect_new_citrix_ica_application_names` - Enable detect new Citrix ICA application names. +* `distribute_logs_between_all_active_servers` - Distribute logs between all active servers. +* `forward_logs_to_log_server` - Enable forward logs to log server. +* `forward_logs_to_log_server_name` - Forward logs to log server name. +* `forward_logs_to_log_server_schedule_name` - Forward logs to log server schedule name. +* `free_disk_space_metrics` - Free disk space metrics. +* `perform_log_rotate_before_log_forwarding` - Enable perform log rotate before log forwarding. +* `reject_connections_when_free_disk_space_below_threshold` - Enable reject connections when free disk space below threshold. +* `reserve_for_packet_capture_metrics` - Reserve for packet capture metrics. +* `reserve_for_packet_capture_threshold` - Reserve for packet capture threshold. +* `rotate_log_by_file_size` - Enable rotate log by file size. +* `rotate_log_file_size_threshold` - Log file size threshold. +* `rotate_log_on_schedule` - Enable rotate log on schedule. +* `rotate_log_schedule_name` - Rotate log schedule name. +* `stop_logging_when_free_disk_space_below` - Enable stop logging when free disk space below. +* `stop_logging_when_free_disk_space_below_threshold` - Stop logging when free disk space below threshold. +* `turn_on_qos_logging` - Enable turn on QoS Logging. +* `update_account_log_every` - Update account log in every amount of seconds. + + +`sam` supports the following: + +* `forward_to_other_sam_servers` - Forward SAM clients' requests to other SAM servers. +* `use_early_versions` - Use early versions compatibility mode.use_early_versions blocks are documented below. +* `purge_sam_file` - Purge SAM File.purge_sam_file blocks are documented below. + + +`override_global_settings` supports the following: + +* `fail_mode` - Fail mode - allow or block all requests. +* `website_categorization` - Website categorization object.website_categorization blocks are documented below. + + +`bypass_on_failure` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`site_categorization_allow_mode` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`deny_untrusted_server_cert` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`deny_revoked_server_cert` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`deny_expired_server_cert` supports the following: + +* `override_profile` - Override profile of global configuration. +* `value` - Override value.
Required only for 'override-profile' is True. + + +`browser_based_authentication_settings` supports the following: + +* `authentication_settings` - Authentication Settings for Browser Based Authentication.authentication_settings blocks are documented below. +* `browser_based_authentication_portal_settings` - Browser Based Authentication portal settings.browser_based_authentication_portal_settings blocks are documented below. + + +`identity_agent_settings` supports the following: + +* `agents_interval_keepalive` - Agents send keepalive period (minutes). +* `user_reauthenticate_interval` - Agent reauthenticate time interval (minutes). +* `authentication_settings` - Authentication Settings for Identity Agent.authentication_settings blocks are documented below. +* `identity_agent_portal_settings` - Identity Agent accessibility settings.identity_agent_portal_settings blocks are documented below. + + +`identity_collector_settings` supports the following: + +* `authorized_clients` - Authorized Clients.authorized_clients blocks are documented below. +* `authentication_settings` - Authentication Settings for Identity Collector.authentication_settings blocks are documented below. +* `client_access_permissions` - Identity Collector accessibility settings.client_access_permissions blocks are documented below. + + +`identity_sharing_settings` supports the following: + +* `share_with_other_gateways` - Enable identity sharing with other gateways. +* `receive_from_other_gateways` - Enable receiving identity from other gateways. +* `receive_from` - Gateway(s) to receive identity from.receive_from blocks are documented below. + + +`proxy_settings` supports the following: + +* `detect_using_x_forward_for` - Whether to use X-Forward-For HTTP header, which is added by the proxy server to keep track of the original source IP. + `anti_spoofing_settings` supports the following: + * `action` - If packets will be rejected (the Prevent option) or whether the packets will be monitored (the Detect option). +* `exclude_packets` - Don't check packets from excluded network. +* `excluded_network_name` - Excluded network name. +* `excluded_network_uid` - Excluded network UID. +* `spoof_tracking` - Spoof tracking. + `security_zone_settings` supports the following: + * `auto_calculated` - Security Zone is calculated according to where the interface leads to. * `specific_zone` - Security Zone specified manually. + `topology_settings` supports the following: + * `interface_leads_to_dmz` - Whether this interface leads to demilitarized zone (perimeter network). -* `ip_address_behind_this_interface` - Ip address behind this interface. * `specific_network` - Network behind this interface. -`firewall_settings` supports the following: -* `auto_calculate_connections_hash_table_size_and_memory_pool` - Auto calculate connections hash table size and memory pool. -* `auto_maximum_limit_for_concurrent_connections` - Auto maximum limit for concurrent connections. -* `connections_hash_size` - Connections hash size. -* `maximum_limit_for_concurrent_connections` - Maximum limit for concurrent connections. -* `maximum_memory_pool_size` - Maximum memory pool size. -* `memory_pool_size` - Memory pool size. -`vpn_settings` supports the following: -* `authentication` - authentication blocks are documented below. -* `link_selection` - Link selection blocks are documented below. -* `maximum_concurrent_ike_negotiations` - Maximum concurrent ike negotiations. -* `maximum_concurrent_tunnels` - Maximum concurrent tunnels. -* `office_mode` - Office Mode. Notation Wide Impact - Office Mode apply IPSec VPN Software Blade clients and to the Mobile Access Software Blade clients. office_mode blocks are documented below. -* `remote_access` - remote_access blocks are documented below. -* `vpn_domain` - Gateway VPN domain identified by the name. -* `vpn_domain_type` - Gateway VPN domain type. +`portal_web_settings` supports the following: + +* `aliases` - List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - The certificate file encoded in Base64 with padding. + This file must be in the *.p12 format. +* `base64_password` - Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`portal_web_settings` supports the following: + +* `aliases` - List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - The certificate file encoded in Base64 with padding. + This file must be in the *.p12 format. +* `base64_password` - Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + `authentication` supports the following: -* `authentication_clients` - Collection of VPN Authentication clients identified by the name. + +* `authentication_clients` - Collection of VPN Authentication clients identified by the name or UID.authentication_clients blocks are documented below. + `link_selection` supports the following: -* `ip_selection` - IP selection. -* `dns_resolving_hostname` - DNS Resolving Hostname. Must be set when "ip-selection" was selected to be "dns-resolving-from-hostname". -* `ip_address` - IP Address. Must be set when "ip-selection" was selected to be "use-selected-address-from-topology" or "use-statically-nated-ip". + +* `dns_resolving_hostname` - DNS Resolving Hostname. Must be set when "ip-selection" was selected to be "dns-resolving-from-hostname". + `office_mode` supports the following: -* `mode` - Office Mode Permissions. When selected to be "off", all the other definitions are irrelevant. -* `group` - Group. Identified by name. Must be set when "office-mode-permissions" was selected to be "group". -* `allocate_ip_address_from` - Allocate IP address Method. Allocate IP address by sequentially trying the given methods until success. allocate_ip_address_from blocks are documented below. + +* `mode` - Office Mode Permissions. + When selected to be "off", all the other definitions are irrelevant. +* `group` - Group. Identified by name or UID. + Must be set when "office-mode-permissions" was selected to be "group". +* `allocate_ip_address_from` - Allocate IP address Method. + Allocate IP address by sequentially trying the given methods until success.allocate_ip_address_from blocks are documented below. * `support_multiple_interfaces` - Support connectivity enhancement for gateways with multiple external interfaces. * `perform_anti_spoofing` - Perform Anti-Spoofing on Office Mode addresses. -* `anti_spoofing_additional_addresses` - Additional IP Addresses for Anti-Spoofing. Identified by name. Must be set when "perform-anti-spoofings" is true. +* `anti_spoofing_additional_addresses` - Additional IP Addresses for Anti-Spoofing. + Identified by name or UID. + Must be set when "perform-anti-spoofings" is true. + + +`remote_access` supports the following: + +* `support_l2tp` - Support L2TP (relevant only when office mode is active). +* `l2tp_auth_method` - L2TP Authentication Method. + Must be set when "support-l2tp" is true. +* `l2tp_certificate` - L2TP Certificate. + Must be set when "l2tp-auth-method" was selected to be "certificate". + Insert "defaultCert" when you want to use the default certificate. +* `allow_vpn_clients_to_route_traffic` - Allow VPN clients to route traffic. +* `support_nat_traversal_mechanism` - Support NAT traversal mechanism (UDP encapsulation). +* `nat_traversal_service` - Allocated NAT traversal UDP service. Identified by name or UID. + Must be set when "support-nat-traversal-mechanism" is true. +* `support_visitor_mode` - Support Visitor Mode. +* `visitor_mode_service` - TCP Service for Visitor Mode. Identified by name or UID. + Must be set when "support-visitor-mode" is true. +* `visitor_mode_interface` - Interface for Visitor Mode. + Must be set when "support-visitor-mode" is true. + Insert IPV4 Address of existing interface or "All IPs" when you want all interfaces. + + +`use_early_versions` supports the following: + +* `enabled` - Use early versions compatibility mode. +* `compatibility_mode` - Early versions compatibility mode. + + +`purge_sam_file` supports the following: + +* `enabled` - Purge SAM File. +* `purge_when_size_reaches_to` - Purge SAM File When it Reaches to. + + +`website_categorization` supports the following: + +* `mode` - Website categorization mode. +* `custom_mode` - Custom mode object.custom_mode blocks are documented below. + + +`authentication_settings` supports the following: + +* `authentication_method` - Authentication method. +* `identity_provider` - Identity provider object identified by the name or UID. Must be set when "authentication-method" was selected to be "identity provider".identity_provider blocks are documented below. +* `radius` - Radius server object identified by the name or UID. Must be set when "authentication-method" was selected to be "radius". +* `users_directories` - Users directories.users_directories blocks are documented below. + + +`browser_based_authentication_portal_settings` supports the following: + +* `portal_web_settings` - Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`authentication_settings` supports the following: + +* `authentication_method` - Authentication method. +* `radius` - Radius server object identified by the name or UID. Must be set when "authentication-method" was selected to be "radius". +* `users_directories` - Users directories.users_directories blocks are documented below. + + +`identity_agent_portal_settings` supports the following: + +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`authorized_clients` supports the following: + +* `client` - Host / Network Group Name or UID. +* `client_secret` - Client Secret. + + +`authentication_settings` supports the following: + +* `users_directories` - Users directories.users_directories blocks are documented below. + + +`client_access_permissions` supports the following: + +* `accessibility` - Configuration of the portal access settings.accessibility blocks are documented below. + + +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + `allocate_ip_address_from` supports the following: + * `radius_server` - Radius server used to authenticate the user. * `use_allocate_method` - Use Allocate Method. -* `allocate_method` - Using either Manual (IP Pool) or Automatic (DHCP). Must be set when "use-allocate-method" is true. -* `manual_network` - Manual Network. Identified by name. Must be set when "allocate-method" was selected to be "manual". -* `dhcp_server` - DHCP Server. Identified by name. Must be set when "allocate-method" was selected to be "automatic". -* `virtual_ip_address` - Virtual IPV4 address for DHCP server replies. Must be set when "allocate-method" was selected to be "automatic". -* `dhcp_mac_address` - Calculated MAC address for DHCP allocation. Must be set when "allocate-method" was selected to be "automatic". -* `optional_parameters` - This configuration applies to all Office Mode methods except Automatic (using DHCP) and ipassignment.conf entries which contain this data. optional_parameters blocks are documented below. +* `allocate_method` - Using either Manual (IP Pool) or Automatic (DHCP). + Must be set when "use-allocate-method" is true. +* `manual_network` - Manual Network. Identified by name or UID. + Must be set when "allocate-method" was selected to be "manual". +* `dhcp_server` - DHCP Server. Identified by name or UID. + Must be set when "allocate-method" was selected to be "automatic". +* `virtual_ip_address` - Virtual IPV4 address for DHCP server replies. + Must be set when "allocate-method" was selected to be "automatic". +* `dhcp_mac_address` - Calculated MAC address for DHCP allocation. + Must be set when "allocate-method" was selected to be "automatic". +* `optional_parameters` - This configuration applies to all Office Mode methods except Automatic (using DHCP) and ipassignment.conf entries which contain this data.optional_parameters blocks are documented below. + + +`custom_mode` supports the following: + +* `social_networking_widgets` - Social networking widgets mode. +* `url_filtering` - URL filtering mode. + + +`users_directories` supports the following: + +* `external_user_profile` - External user profile. +* `internal_users` - Internal users. +* `users_from_external_directories` - Users from external directories. +* `specific` - LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`portal_web_settings` supports the following: + +* `aliases` - List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - The certificate file encoded in Base64 with padding. + This file must be in the *.p12 format. +* `base64_password` - Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`users_directories` supports the following: + +* `external_user_profile` - External user profile. +* `internal_users` - Internal users. +* `users_from_external_directories` - Users from external directories. +* `specific` - LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`users_directories` supports the following: + +* `external_user_profile` - External user profile. +* `internal_users` - Internal users. +* `users_from_external_directories` - Users from external directories. +* `specific` - LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`accessibility` supports the following: + +* `allow_access_from` - Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + `optional_parameters` supports the following: + * `use_primary_dns_server` - Use Primary DNS Server. -* `primary_dns_server` - Primary DNS Server. Identified by name. Must be set when "use-primary-dns-server" is true and can not be set when "use-primary-dns-server" is false. +* `primary_dns_server` - Primary DNS Server. Identified by name or UID. + Must be set when "use-primary-dns-server" is true and can not be set when "use-primary-dns-server" is false. * `use_first_backup_dns_server` - Use First Backup DNS Server. -* `first_backup_dns_server` - First Backup DNS Server. Identified by name. Must be set when "use-first-backup-dns-server" is true and can not be set when "use-first-backup-dns-server" is false. +* `first_backup_dns_server` - First Backup DNS Server. Identified by name or UID. + Must be set when "use-first-backup-dns-server" is true and can not be set when "use-first-backup-dns-server" is false. * `use_second_backup_dns_server` - Use Second Backup DNS Server. -* `second_backup_dns_server` - Second Backup DNS Server. Identified by name. Must be set when "use-second-backup-dns-server" is true and can not be set when "use-second-backup-dns-server" is false. +* `second_backup_dns_server` - Second Backup DNS Server. Identified by name or UID. + Must be set when "use-second-backup-dns-server" is true and can not be set when "use-second-backup-dns-server" is false. * `dns_suffixes` - DNS Suffixes. * `use_primary_wins_server` - Use Primary WINS Server. -* `primary_wins_server` - Primary WINS Server. Identified by name. Must be set when "use-primary-wins-server" is true and can not be set when "use-primary-wins-server" is false. +* `primary_wins_server` - Primary WINS Server. Identified by name or UID. + Must be set when "use-primary-wins-server" is true and can not be set when "use-primary-wins-server" is false. * `use_first_backup_wins_server` - Use First Backup WINS Server. -* `first_backup_wins_server` - First Backup WINS Server. Identified by name. Must be set when "use-first-backup-wins-server" is true and can not be set when "use-first-backup-wins-server" is false. +* `first_backup_wins_server` - First Backup WINS Server. Identified by name or UID. + Must be set when "use-first-backup-wins-server" is true and can not be set when "use-first-backup-wins-server" is false. * `use_second_backup_wins_server` - Use Second Backup WINS Server. -* `second_backup_wins_server` - Second Backup WINS Server. Identified by name. Must be set when "use-second-backup-wins-server" is true and can not be set when "use-second-backup-wins-server" is false. -* `ip_lease_duration` - IP Lease Duration in Minutes. The value must be in the range 2-32767. +* `second_backup_wins_server` - Second Backup WINS Server. Identified by name or UID. + Must be set when "use-second-backup-wins-server" is true and can not be set when "use-second-backup-wins-server" is false. -`remote_access` supports the following: -* `support_l2tp` - Support L2TP (relevant only when office mode is active). -* `l2tp_auth_method` - L2TP Authentication Method. Must be set when "support-l2tp" is true. -* `l2tp_certificate` - L2TP Certificate. Must be set when "l2tp-auth-method" was selected to be "certificate". Insert "defaultCert" when you want to use the default certificate. -* `allow_vpn_clients_to_route_traffic` - Allow VPN clients to route traffic. -* `support_nat_traversal_mechanism` - Support NAT traversal mechanism (UDP encapsulation). -* `nat_traversal_service` - Allocated NAT traversal UDP service. Identified by name. Must be set when "support-nat-traversal-mechanism" is true. -* `support_visitor_mode` - Support Visitor Mode. -* `visitor_mode_service` - TCP Service for Visitor Mode. Identified by name. Must be set when "support-visitor-mode" is true. -* `visitor_mode_interface` - Interface for Visitor Mode. Must be set when "support-visitor-mode" is true. Insert IPV4 Address of existing interface or "All IPs" when you want all interfaces. -`logs_settings` supports the following: -* `free_disk_space_metrics` - Free disk space metrics. -* `accept_syslog_messages` - Enable accept syslog messages. -* `alert_when_free_disk_space_below` - Enable alert when free disk space is below threshold. -* `alert_when_free_disk_space_below_threshold` - Alert when free disk space below threshold. -* `alert_when_free_disk_space_below_type` - Alert when free disk space below type. -* `before_delete_keep_logs_from_the_last_days` - Enable before delete keep logs from the last days. -* `before_delete_keep_logs_from_the_last_days_threshold` - Before delete keep logs from the last days threshold. -* `before_delete_run_script` - Enable Before delete run script. -* `before_delete_run_script_command` - Before delete run script command. -* `delete_index_files_older_than_days` - Enable delete index files older than days. -* `delete_index_files_older_than_days_threshold` - Delete index files older than days threshold. -* `delete_when_free_disk_space_below` - Enable delete when free disk space below. -* `delete_when_free_disk_space_below_threshold` - Delete when free disk space below threshold. -* `detect_new_citrix_ica_application_names` - Enable detect new citrix ica application names. -* `enable_log_indexing` - Enable log indexing. -* `forward_logs_to_log_server` - Enable forward logs to log server. -* `forward_logs_to_log_server_name` - Forward logs to log server name. -* `forward_logs_to_log_server_schedule_name` - Forward logs to log server schedule name. -* `rotate_log_by_file_size` - Enable rotate log by file size. -* `rotate_log_file_size_threshold` - Log file size threshold. -* `rotate_log_on_schedule` - Enable rotate log on schedule. -* `rotate_log_schedule_name` - Rotate log schedule name. -* `stop_logging_when_free_disk_space_below` - Enable stop logging when free disk space below. -* `stop_logging_when_free_disk_space_below_threshold` - Stop logging when free disk space below threshold. -* `turn_on_qos_logging` - Enable turn on qos logging. -* `update_account_log_every` - Update account log in every amount of seconds. \ No newline at end of file +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - Controls portal access settings for interfaces that are part of a VPN Encryption Domain. diff --git a/website/docs/d/checkpoint_management_tacacs_server.html.markdown b/website/docs/d/checkpoint_management_tacacs_server.html.markdown new file mode 100644 index 00000000..d8819d6b --- /dev/null +++ b/website/docs/d/checkpoint_management_tacacs_server.html.markdown @@ -0,0 +1,71 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_tacacs_server" +sidebar_current: "docs-checkpoint-data-source-checkpoint-management-tacacs-server" +description: |- +Use this data source to get information on an existing Check Point Tacacs Server. +--- + +# Data Source: checkpoint_management_tacacs_server + +Use this data source to get information on an existing Check Point Tacacs Server. + +## Example Usage + + +```hcl +resource "checkpoint_management_host" "host" { + name = "My Host" + ipv4_address = "1.2.3.4" +} + +resource "checkpoint_management_tacacs_server" "tacacs_server" { + name = "My Tacacs Server" + server = "1.2.3.4" +} + +data "checkpoint_management_tacacs_server" "data_tacacs_server" { + name = "${checkpoint_management_tacacs_server.tacacs_server.name}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Optional) Object name. Should be unique in the domain. +* `uid` - (Optional) Object unique identifier. +* `encryption` - Is there a secret key defined on the server. Must be set true when "server-type" was selected to be "TACACS+". +* `groups` - Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `priority` - The priority of the TACACS Server in case it is a member of a TACACS Group. +* `server` - The UID or Name of the host that is the TACACS Server. server blocks are documented below. +* `server_type` - Server type, TACACS or TACACS+. +* `service` - Server service, only relevant when "server-type" is TACACS. service blocks are documented below. + +`server` supports the following: + +* `name` - Object name. Must be unique in the domain. +* `uid` - Object unique identifier. + + +`service` supports the following: + +* `name` - Object name. Must be unique in the domain. +* `uid` - Object unique identifier. +* `aggressive_aging` - Sets short (aggressive) timeouts for idle connections. aggressive_aging blocks are documented below. +* `groups` - Level of details in the output corresponds to the number of details for search. This table shows the level of details in the Standard level. +* `keep_connections_open_after_policy_installation` - Keep connections open after policy has been installed even if they are not allowed under the new policy. This overrides the settings in the Connection Persistence page. If you change this property, the change will not affect open connections, but only future connections. +* `match_for_any` - Indicates whether this service is used when 'Any' is set as the rule's service and there are several service objects with the same source port and protocol. +* `port` - The number of the port used to provide this service. +* `session_timeout` - Time (in seconds) before the session times out. +* `source_port` - Port number for the client side service. If specified, only those Source port Numbers will be Accepted, Dropped, or Rejected during packet inspection. Otherwise, the source port is not inspected. +* `sync_connections_on_cluster` - Enables state-synchronized High Availability or Load Sharing on a ClusterXL or OPSEC-certified cluster. +* `use_default_session_timeout` - Use default virtual session timeout. + + +`aggressive_aging` supports the following: + +* `default_timeout` - Default aggressive aging timeout in seconds. +* `enabled` +* `timeout` - Aggressive aging timeout in seconds. +* `use_default_timeout` \ No newline at end of file diff --git a/website/docs/d/checkpoint_management_threat_layer.html.markdown b/website/docs/d/checkpoint_management_threat_layer.html.markdown new file mode 100644 index 00000000..eddf9beb --- /dev/null +++ b/website/docs/d/checkpoint_management_threat_layer.html.markdown @@ -0,0 +1,34 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_threat_layer" +sidebar_current: "docs-checkpoint-data-source-checkpoint-management-threat-layer" +description: |- +Use this data source to get information on an existing Check Point Threat Layer. +--- + +# Data Source: checkpoint_management_threat_layer + +Use this data source to get information on an existing Check Point Threat Layer. + +## Example Usage + + +```hcl +resource "checkpoint_management_threat_layer" "example" { + name = "New Layer 1" +} + +data "checkpoint_management_threat_layer" "data_threat_layer" { + name = "${checkpoint_management_threat_layer.example.name}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Optional) Object name. Should be unique in the domain. +* `uid` - (Optional) Object unique identifier. +* `tags` - Collection of tag identifiers.tags blocks are documented below. +* `color` - Color of the object. Should be one of existing colors. +* `comments` - Comments string. \ No newline at end of file diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index c344fdb5..1a88afe9 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -100,6 +100,7 @@ The following arguments are supported: the `CHECKPOINT_SESSION_NAME` environment variable. * `cloud_mgmt_id` - (Optional) Smart-1 Cloud management UID. this can also be defined via the `CHECKPOINT_CLOUD_MGMT_ID` environment variable. +* `session_description` - (Optional) A description of the session's purpose. this can also be defined via the `CHECKPOINT_SESSION_DESCRIPTION` environment variable. ## Authentication @@ -172,6 +173,7 @@ $ export CHECKPOINT_SESSION_FILE_NAME="sid.json" $ export CHECKPOINT_PROXY_HOST="1.2.3.4" $ export CHECKPOINT_PROXY_PORT="123" $ export CHECKPOINT_CLOUD_MGMT_ID="de9a9b08-c7c7-436e-a64a-a54136301701" +$ export CHECKPOINT_SESSION_DESCRIPTION="session description" ``` Usage with api key: @@ -188,6 +190,7 @@ $ export CHECKPOINT_SESSION_FILE_NAME="sid.json" $ export CHECKPOINT_PROXY_HOST="1.2.3.4" $ export CHECKPOINT_PROXY_PORT="123" $ export CHECKPOINT_CLOUD_MGMT_ID="de9a9b08-c7c7-436e-a64a-a54136301701" +$ export CHECKPOINT_SESSION_DESCRIPTION="session description" ``` Then configure the Check Point Provider as following: @@ -259,7 +262,7 @@ $ terraform apply && publish && logout_from_session ### Discard -Please use the following for Discard: +Please use the following for discard: ```bash $ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-checkpoint/commands/discard @@ -268,9 +271,9 @@ $ mv discard $GOPATH/src/github.com/terraform-providers/terraform-provider-check $ discard ``` -### approve_session +### Approve session -Please use the following for approve_session: +Please use the following for approve session: ```bash $ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-checkpoint/commands/approve_session @@ -279,9 +282,9 @@ $ mv approve_session $GOPATH/src/github.com/terraform-providers/terraform-provid $ approve_session "SESSION_UID" ``` -### reject_session +### Reject session -Please use the following for reject_session: +Please use the following for reject session: ```bash $ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-checkpoint/commands/reject_session @@ -290,9 +293,9 @@ $ mv reject_session $GOPATH/src/github.com/terraform-providers/terraform-provide $ reject_session "SESSION_UID" "REJECT_REASON" ``` -### submit_session +### Submit session -Please use the following for submit_session: +Please use the following for submit session: ```bash $ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-checkpoint/commands/submit_session diff --git a/website/docs/r/checkpoint_management_administrator.html.markdown b/website/docs/r/checkpoint_management_administrator.html.markdown new file mode 100644 index 00000000..0e5f71f2 --- /dev/null +++ b/website/docs/r/checkpoint_management_administrator.html.markdown @@ -0,0 +1,67 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_administrator" +sidebar_current: "docs-checkpoint-resource-checkpoint-management-administrator" +description: |- +This resource allows you to add/update/delete Check Point Administrator. +--- + +# Resource: checkpoint_management_host + +This resource allows you to add/update/delete Check Point Administrator. + +## Example Usage: MDS + + +```hcl +resource "checkpoint_management_administrator" "admin" { + name = "example" + permissions_profile { + domain = "domain1" + profile = "Read Only All" + } + + multi_domain_profile = "domain level only" + password = "1233" + +} + +``` + +## Example Usage: SMC + + +```hcl +resource "checkpoint_management_administrator" "admin" { + name = "example" + permissions_profile { + domain = "SMC User" + profile = "Read Only All" + } + password = "1233" + +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Object name. Should be unique in the domain. +* `password` - (Required) Administrator password. +* `authentication_method` - (Required) Authentication method. +* `permission_profile` - (Required) Administrator permissions profile. Permissions profile should not be provided when multi-domain-profile is set to "Multi-Domain Super User" or "Domain Super User". In SMC, permissions_profile with single object, domain must be "SMC User". +* `email` - (Optional) Administrator email. +* `expiration_date` - (Optional) Format: YYYY-MM-DD, YYYY-mm-ddThh:mm:ss. +* `multi_domain_profile` - (Optional) Administrator multi-domain profile. Only in MDS. +* `must_change_password` - (Optional) True if administrator must change password on the next login. +* `password_hash` (Optional) Administrator password hash. +* `phone_number` - (Optional) Administrator phone number. +* `radius_server` - (Optional) RADIUS server object identified by the name or UID. Must be set when "authentication-method" was selected to be "RADIUS". +* `tacacs_server` - (Optional) TACACS server object identified by the name or UID. Must be set when "authentication-method" was selected to be "TACACS". +* `tags` - (Optional) Collection of tag identifiers. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. +* `sic_name` - Name of the Secure Internal Connection Trust. \ No newline at end of file diff --git a/website/docs/r/checkpoint_management_azure_ad.html.markdown b/website/docs/r/checkpoint_management_azure_ad.html.markdown new file mode 100644 index 00000000..cbc0443f --- /dev/null +++ b/website/docs/r/checkpoint_management_azure_ad.html.markdown @@ -0,0 +1,49 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_azure_ad" +sidebar_current: "docs-checkpoint-resource-checkpoint-management-azure-ad" +description: |- +This resource allows you to execute Check Point Azure Ad. +--- + +# Resource: checkpoint_management_azure_ad + +This resource allows you to execute Check Point Azure Ad. + +## Example Usage + + +```hcl +resource "checkpoint_management_azure_ad" "example" { + name = "example" + password = "123" + user_authentication = "user-authentication" + username = "example" + application_id = "a8662b33-306f-42ba-9ffb-a0ac27c8903f" + application_key = "EjdJ2JcNGpw3[GV8:PMN_s2KH]JhtlpO" + directory_id = "19c063a8-3bee-4ea5-b984-e344asds37f7" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Object name. +* `authentication_method` - (Required) user-authentication
Uses the Azure AD User to authenticate.
service-principal-authentication
Uses the Service Principal to authenticate. +* `password` - (Required) Password of the Azure account.

Required for authentication-method:

user-authentication. +* `username` - (Required) An Azure Active Directory user Format
<username>@<domain>.

Required for authentication-method:

user-authentication. +* `application_id` - (Required) The Application ID of the Service Principal, in UUID format.

Required for authentication-method:

service-principal-authentication. +* `application_key` - (Required) The key created for the Service Principal.

Required for authentication-method:

service-principal-authentication. +* `directory_id` - (Required) The Directory ID of the Azure AD, in UUID format.

Required for authentication-method:

service-principal-authentication. +* `tags` - (Optional) Collection of tag identifiers.tags blocks are documented below. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. +* `properties` - Azure AD connection properties. properties blocks are documented below. + +`properties` supports the following: + +* `name` +* `value` \ No newline at end of file diff --git a/website/docs/r/checkpoint_management_lsv_profile.html.markdown b/website/docs/r/checkpoint_management_lsv_profile.html.markdown new file mode 100644 index 00000000..84669a8d --- /dev/null +++ b/website/docs/r/checkpoint_management_lsv_profile.html.markdown @@ -0,0 +1,42 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_lsv_profile" +sidebar_current: "docs-checkpoint-resource-checkpoint-management-lsv-profile" +description: |- +This resource allows you to add/update/delete Check Point Lsv Profile. +--- + +# Resource: checkpoint_management_lsv_profile + +This resource allows you to add/update/delete Check Point Lsv Profile. + +## Example Usage + + +```hcl +resource "checkpoint_management_lsv_profile" "example" { + name = "Lsv profile" + certificate_authority = "internal_ca" +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Object name. Should be unique in the domain. +* `certificate_authority` - (Required) Trusted Certificate authority for establishing trust between VPN peers, identified by name or UID. +* `allowed_ip_addresses` - (Optional) Collection of network objects identified by name or UID that represent IP addresses allowed in profile's VPN domain. +* `restrict_allowed_addresses` - (Optional) Indicate whether the IP addresses allowed in the VPN Domain will be restricted or not, according to allowed-ip-addresses field. +* `tags` - (Optional) Collection of tag identifiers. +* `vpn_domain` - (Optional) peers' VPN Domain properties. vpn_domain blocks are documented below. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + +`vpn_domain` supports the following: + +* `limit_peer_domain_size` - (Optional) Use this parameter to limit the number of IP addresses in the VPN Domain of each peer according to the value in the max-allowed-addresses field. +* `max_allowed_addresses` - (Optional) Maximum number of IP addresses in the VPN Domain of each peer. This value will be enforced only when limit-peer-domain-size field is set to true. Select a value between 1 and 256. Default value is 256. diff --git a/website/docs/r/checkpoint_management_nutanix_data_center_server.html.markdown b/website/docs/r/checkpoint_management_nutanix_data_center_server.html.markdown new file mode 100644 index 00000000..efdf3412 --- /dev/null +++ b/website/docs/r/checkpoint_management_nutanix_data_center_server.html.markdown @@ -0,0 +1,46 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_nutanix_data_center_server" +sidebar_current: "docs-checkpoint-Resource-checkpoint-management-nutanix-data-center-server" +description: |- This resource allows you to execute Check Point nutanix data center server. +--- + +# Resource: checkpoint_management_nutanix_data_center_server + +This resource allows you to execute Check Point Nutanix Data Center Server. + +## Example Usage + +```hcl +resource "checkpoint_management_nutanix_data_center_server" "testNutanix" { + name = "MY-NUTANIX" + hostname = "127.0.0.1" + username = "admin" + password = "admin" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Object name. +* `hostname` - (Required) IP Address or hostname of the Nutanix Prism server. +* `username` - (Required) Username of the Nutanix Prism server. +* `password` - (Required) Password of the Nutanix Prism server. +* `certificate_fingerprint` - (Optional) Specify the SHA-1 or SHA-256 fingerprint of the Data Center Server's certificate. +* `unsafe_auto_accept` - (Optional) When set to false, the current Data Center Server's certificate should be trusted, either by providing the certificate-fingerprint argument or by relying on a previously trusted certificate of this hostname. When set to true, trust the current Data Center Server's certificate as-is. +* `tags` - (Optional) Collection of tag identifiers. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. +* `data_center_type` - Data center type. +* `automatic_refresh` - Indicates whether the data center server's content is automatically updated. +* `properties` - Data center properties. properties blocks are documented beloe. + + +`properties` supports the following: + +* `name` +* `value` \ No newline at end of file diff --git a/website/docs/r/checkpoint_management_oracle_cloud_data_center_server.html.markdown b/website/docs/r/checkpoint_management_oracle_cloud_data_center_server.html.markdown new file mode 100644 index 00000000..b9f35f9c --- /dev/null +++ b/website/docs/r/checkpoint_management_oracle_cloud_data_center_server.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_oracle_cloud_data_center_server" +sidebar_current: "docs-checkpoint-Resource-checkpoint-management-oracle-cloud-data-center-server" +description: |- This resource allows you to execute Check Point oracle cloud data center server. +--- + +# Resource: checkpoint_management_oracle_cloud_data_center_server + +This resource allows you to execute Check Point Oracle Cloud Data Center Server. + +## Example Usage + +```hcl +resource "checkpoint_management_oracle_cloud_data_center_server" "testOracleCloud" { + name = "MY-ORACLE-CLOUD" + authentication_method = "key-authentication" + private_key = "0SLtLS1CRUdJTiBQUklWQVRFIEtS0FWtLS0tDQpNSUlFdkFJQkFEQU5CZ2txaGtpRzl3AAAAUUVGQUFTQ0JLWXdnZ1NpQWdFQUFvSUJBUURUdmVrK1laMmNSekVmDQp1QkNoMkFxS2hzUFcrQUhUajY4dE5VbVl4OUFTRXBsREhnMkF0bCtMRWRRWUFRSUtLMUZ5L1JHRitkK3RkWjUrDQpabmprN0hESTQ5V3Rib0xodWN3YjBpNU4xbEVKWHVhOHhEN0FROTJXQy9PdzhzVktPRlJGNVJhMmxSa0svRS8xDQpxeDhKYnRoMGdXdHg0NHBQaWJwU3crMTB0QUhHR2FTLzVwN3hNUXhzajZTOThwL1hnalg5NzN4VStZZ2dLNUx3DQp6WlkzSDQ3UVREcmpyZzhOVmpDSFU3b3IrcEpCbjdldGF0V3psK3BQcVd4ODZub2tjdG5abUQxcHNnWnkwTEdDDQpRYys5ejdURGhEOFhuVERwckxiRGZXRnZqOTVKSmc3Q1krd29zN05vSENEOG5RWjFZZURVQkJjUkVlZXJVRlhBDQpaZ1I3UGNCN0FnTUJBQUVDZ2dFQUdkUWxCZVFER3ROMXJaTXNERGRUU2RudDU3b2NWdXlac2grNW1PRVVMakF3DQptOXhTOUt3ZnlYeTZRaXlxb3JKQ3REa2trR2c0OHhWOFBrVDN1RTBUTzU0aDF1UmxJMjNMbjcvVmFzOUZnVlFmDQpQS1dLVmdwYjdFMWhtT2gwVFNmRDRwRnpETlh4SzhMaXYycWVxdTJTTlRGWVR1M2RBRWpNL3EyWERmdXJQN2tiDQprZ3FKRFBwd2g4RWRXMVg1VVAyVE9CVWxwQllDTndxUkFJQ1E3eWlzbW5xeFlZS3RKc21MK21IQ3JYM3hNRHVTDQp4NHJCVDUvcXVrdVc4MmwrbGZmU3ZTNGpsb0VhajJ2QmozSk1udy9lYlNucFplU3FENTFjOUZlOCtocU4rU3NoDQozTnc0QXVybE1RRG5vZy9STUF3QUR3KzBRUlIwNVdaWDhMVXllVTBVVVFLQmdRRHd6R2I0b25BWHlNeUNkbHB3DQpRRnFCR0pwQnlsWEJjSkZnMGpCd1JMV2tQL3VjWnNoZlFlbkFWbkRZZS9yQ0FnWWxSdFFOVFRvb3BFSjlGcGgyDQp6TkVzd1EwcnV4WjFrVm41U1hwS2dF4668KalUxT3dGa3R1WFlJcEtBNGk5dFoxT04zb1lqdVRtMUlzb2xWZXVTDQpqK3Mwd1o3ZDAyYTNXcDN1UXJ3TFUwVjdpUUtCZ1FEaEcrc2xsNDYveGxONldWWEs3RVpkOGFEcTlTNEU0aEQvDQpvTmUwS0dVcHhZYngyTnFWN1VLSEwzOE41eG5qNGllWGt2U1BnL0twVUpqUmtLN0xJMnZsNmlndUJkdW01VUR1DQp5dW4rL1dNcVdnb2p4anZBbmxsS2lIa0JRMTJ2UFRqcE9HSGIrY0RqVWxROGVnOThFOEJ0ZktUQjFkRlcxUnBlDQorMXY0aXR3RzR3S0JnQzJLeXpMZExnd2hpeVJsbEFkRTlKa1QrU0RXVHMvT0pZREZZQ25ycE5zU3l0aXl5OVRRDQpWNUJzQ04yNDNSMVNXcTAwTHlqdzRUNE1peEt6Y2xTTnVrWVhvUkVUU2xVa0QzdEpmVnFYMVUrTE1XY0c2T1dPDQpmZndaMWRHUWRkM2dPL3BLQ3Q2NHlvUkt0eWJHa0U1ZzcrQkRlbk9ENXhwb2hoUXBCUDJ6V3lIWkFvR0FURndqDQpGUHBuUXVoc3Nza1JFQ2U3NnV3bkVPeWdjcW1ZNkkzUC9kM2lDeHhsSFM3Wlh4Zy9oQW41aUdiSFlvVDV0ekh6DQpZYWQ1cmpPWDB5YklGRUpzdkc0RXVTL2xoYVNvdFJnQjdpeFg4aXJlMjZuSDVSd1IzL1dSVG50aWtTb3NYdmh3DQpRYVZqNS9pcWVHVlRVVnlGM3QzMEtZaDFYWVltVHVmbkY5VktzODhDZ1lCTTNVN2QwOU9MemhMZTh3cnp1dEpuDQpGdmRGWlhCRnhXRGwyNXdteElWTFdpM0kvaWg2QXN5YlRNNWMzbFpTTUVvcjJYeXJqNnFUNzZ6amQ2eGE2NlN3DQpXMEVyL2lEY3dWK244MHpuU3lPSW5lRThIVkh1SGtNYVpPeHkvVzdVWDFqL0RmUnJPZG1iS1NWN2NBV2dVTlBrDQpnd1V5RkM2OTRKTR41Vko0WXZEZU13PT0NCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=" + key_user = "ocid1.user.oc1..aaaaaaaad6n7rniiwgxehy6coo4ax2ti7pr5yr53cbdxdyp6sx6dhrttcz4a" + key_tenant = "ocid1.tenancy.oc1..aaaaaaaaft6hqvl367uh4e3pmdxnzmca6cxamwjfaag5lm7bnhuwu6ypajca" + key_region = "eu-frankfurt-1" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Object name. Must be unique in the domain. +* `authentication_method` - (Required) key-authentication uses the Service Account private key file to authenticate. vm-instance-authentication uses VM Instance to authenticate. This option requires the Security Management Server deployed in Oracle Cloud, and running in a dynamic group with the required permissions. +* `private_key` - (Required) An Oracle Cloud API key PEM file, encoded in base64. Required for authentication-method: key-authentication. +* `key_user` - (Required) An Oracle Cloud user id associated with key. Required for authentication-method: key-authentication. +* `key_tenant` - (Required) An Oracle Cloud tenancy id where the key was created. Required for authentication-method: key-authentication. +* `key_region` - (Required) An Oracle Cloud region for where to create scanner. Required for authentication-method: key-authentication. +* `tags` - (Optional) Collection of tag identifiers. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. +* `automatic_refresh` - Indicates whether the data center server's content is automatically updated. +* `data_center_type` - Data center type. +* `properties` - Data center properties. properties blocks are documented below. + + +`properties` supports the following: + +* `name` +* `value` \ No newline at end of file diff --git a/website/docs/r/checkpoint_management_radius_group.html.markdown b/website/docs/r/checkpoint_management_radius_group.html.markdown new file mode 100644 index 00000000..0432a8d3 --- /dev/null +++ b/website/docs/r/checkpoint_management_radius_group.html.markdown @@ -0,0 +1,45 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_radius_group" +sidebar_current: "docs-checkpoint-resource-checkpoint-management-radius-group" +description: |- +This resource allows you to add/update/delete Check Point Radius Group. +--- + +# Resource: checkpoint_management_radius_group + +This resource allows you to add/update/delete Check Point Radius Group. + +## Example Usage + + +```hcl +resource "checkpoint_management_host" "host" { + name = "My Host" + ipv4_address = "1.2.3.4" +} + +resource "checkpoint_management_radius_server" "radius_server" { + name = "New Radius Server" + server = "${checkpoint_management_host.host.name}" + shared_secret = "123" +} + +resource "checkpoint_management_radius_group" "radius_group" { + name = "New Radius Group" + members = ["${checkpoint_management_radius_server.radius_server.name}"] +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Object name. Must be unique in the domain. +* `members` - (Optional) Collection of radius servers identified by the name or UID. +* `tags` - (Optional) Collection of tag identifiers. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. diff --git a/website/docs/r/checkpoint_management_radius_server.html.markdown b/website/docs/r/checkpoint_management_radius_server.html.markdown new file mode 100644 index 00000000..1594768c --- /dev/null +++ b/website/docs/r/checkpoint_management_radius_server.html.markdown @@ -0,0 +1,52 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_radius_server" +sidebar_current: "docs-checkpoint-resource-checkpoint-management-radius-server" +description: |- +This resource allows you to add/update/delete Check Point Radius Server. +--- + +# Resource: checkpoint_management_radius_server + +This resource allows you to add/update/delete Check Point Radius Server. + +## Example Usage + + +```hcl +resource "checkpoint_management_host" "host" { + name = "My Host" + ipv4_address = "1.2.3.4" +} + +resource "checkpoint_management_radius_server" "example" { + name = "New Radius Server" + server = "${checkpoint_management_host.host.name}" + shared_secret = "123" +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Object name. Should be unique in the domain. +* `server` - (Required) The UID or Name of the host that is the RADIUS Server. +* `shared_secret` - (Required) The secret between the RADIUS server and the Security Gateway. +* `service` - (Optional) The UID or Name of the Service to which the RADIUS server listens. +* `version` - (Optional) The version can be either RADIUS Version 1.0, which is RFC 2138 compliant, and RADIUS Version 2.0 which is RFC 2865 compliant. +* `protocol` - (Optional) The type of authentication protocol that will be used when authenticating the user to the RADIUS server. +* `priority` - (Optional) The priority of the RADIUS Server in case it is a member of a RADIUS Group. +* `accounting` - (Optional) Accounting settings. accounting blocks are documented below. +* `tags` - (Optional) Collection of tag identifiers. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`accounting` supports the following: + +* `enable_ip_pool_management` - (Optional) IP pool management, enables Accounting service. +* `accounting_service` - (Optional) The UID or Name of the the accounting interface to notify the server when users login and logout which will then lock and release the IP addresses that the server allocated to those users. diff --git a/website/docs/r/checkpoint_management_simple_cluster.html.markdown b/website/docs/r/checkpoint_management_simple_cluster.html.markdown index c3034318..c61495e9 100644 --- a/website/docs/r/checkpoint_management_simple_cluster.html.markdown +++ b/website/docs/r/checkpoint_management_simple_cluster.html.markdown @@ -6,7 +6,7 @@ description: |- This resource allows you to execute Check Point Simple Cluster. --- -# Resource: checkpoint_management_simple_cluster +# checkpoint_management_simple_cluster This resource allows you to execute Check Point Simple Cluster. @@ -14,12 +14,14 @@ This resource allows you to execute Check Point Simple Cluster. ```hcl -resource "checkpoint_management_simple_cluster" "cluster" { - name = "mycluster" - ipv4_address = "1.2.3.4" - version = "R81" - hardware = "Open server" - send_logs_to_server = ["logserver"] +resource "checkpoint_management_simple_cluster" "example" { + name = "cluster1" + color = "yellow" + version = "R80.30" + os_name = "Gaia" + cluster_mode = "cluster-xl-ha" + firewall = true + ipv4_address = "17.23.5.1" } ``` @@ -28,159 +30,625 @@ resource "checkpoint_management_simple_cluster" "cluster" { The following arguments are supported: * `name` - (Required) Object name. -* `ipv4_address` - (Optional) IPv4 address. -* `ipv6_address` - (Optional) IPv6 address. -* `cluster_mode` - (Optional) Cluster mode. -* `interfaces` - (Optional) Cluster interfaces. interfaces blocks are documented below. -* `members` - (Optional) Cluster members. members blocks are documented below. +* `advanced_settings` - (Optional) N/Aadvanced_settings blocks are documented below. * `anti_bot` - (Optional) Anti-Bot blade enabled. * `anti_virus` - (Optional) Anti-Virus blade enabled. -* `application_control` - (Optional) Application Control blade enabled. -* `content_awareness` - (Optional) Content Awareness blade enabled. -* `data_awareness` - (Optional) Data Awareness blade enabled. -* `ips` - (Optional) Intrusion Prevention System blade enabled. -* `threat_emulation` - (Optional) Threat Emulation blade enabled. -* `url_filtering` - (Optional) URL Filtering blade enabled. -* `firewall` - (Optional) Firewall blade enabled. -* `firewall_settings` - (Optional) Firewall settings. firewall_settings blocks are documented below. -* `vpn` - (Optional) VPN blade enabled. -* `vpn_settings` - (Optional) Cluster VPN settings. vpn_settings blocks are documented below. -* `dynamic_ip` - (Computed) Dynamic IP address. -* `version` - (Optional) Cluster platform version. -* `os_name` - (Optional) Cluster Operating system name. -* `hardware` - (Optional) Cluster platform hardware name. -* `one_time_password` - (Optional) Secure Internal Communication one time password. -* `sic_name` - (Computed) Secure Internal Communication name. -* `sic_state` - (Computed) Secure Internal Communication state. -* `save_logs_locally` - (Optional) Enable save logs locally. -* `send_alerts_to_server` - (Optional) Collection of Server(s) to send alerts to identified by the name. -* `send_logs_to_backup_server` - (Optional) Collection of Backup server(s) to send logs to identified by the name. -* `send_logs_to_server` - (Optional) Collection of Server(s) to send logs to identified by the name. -* `logs_settings` - (Optional) Logs settings. logs_settings blocks are documented below. -* `color` - (Optional) Color of the object. +* `application_control` - (Optional) Application Control blade enabled. +* `application_control_and_url_filtering_settings` - (Optional) Gateway Application Control and URL filtering settings.application_control_and_url_filtering_settings blocks are documented below. +* `cluster_mode` - (Optional) Cluster mode. +* `cluster_settings` - (Optional) ClusterXL and VRRP Settings.cluster_settings blocks are documented below. +* `content_awareness` - (Optional) Content Awareness blade enabled. +* `enable_https_inspection` - (Optional) Enable HTTPS Inspection after defining an outbound inspection certificate.
To define the outbound certificate use outbound inspection certificate API. +* `fetch_policy` - (Optional) Security management server(s) to fetch the policy from.fetch_policy blocks are documented below. +* `firewall` - (Optional) Firewall blade enabled. +* `firewall_settings` - (Optional) N/Afirewall_settings blocks are documented below. +* `geo_mode` - (Optional) Cluster High Availability Geo mode.
This setting applies only to a cluster deployed in a cloud. Available when the cluster mode equals "cluster-xl-ha". +* `hardware` - (Optional) Cluster platform hardware. +* `hit_count` - (Optional) Hit count tracks the number of connections each rule matches. +* `https_inspection` - (Optional) HTTPS inspection.https_inspection blocks are documented below. +* `identity_awareness` - (Optional) Identity awareness blade enabled. +* `identity_awareness_settings` - (Optional) Gateway Identity Awareness settings.identity_awareness_settings blocks are documented below. +* `interfaces` - (Optional) Cluster interfaces.interfaces blocks are documented below. +* `ipv4_address` - (Optional) IPv4 address. +* `ipv6_address` - (Optional) IPv6 address. +* `ips` - (Optional) Intrusion Prevention System blade enabled. +* `ips_update_policy` - (Optional) Specifies whether the IPS will be downloaded from the Management or directly to the Gateway. +* `members` - (Optional) Cluster members list. Only new cluster member can be added. Adding existing gateway is not supported.members blocks are documented below. +* `nat_hide_internal_interfaces` - (Optional) Hide internal networks behind the Gateway's external IP. +* `nat_settings` - (Optional) NAT settings.nat_settings blocks are documented below. +* `os_name` - (Optional) Cluster platform operating system. +* `platform_portal_settings` - (Optional) Platform portal settings.platform_portal_settings blocks are documented below. +* `proxy_settings` - (Optional) Proxy Server for Gateway.proxy_settings blocks are documented below. +* `qos` - (Optional) QoS. +* `send_alerts_to_server` - (Optional) Server(s) to send alerts to.send_alerts_to_server blocks are documented below. +* `send_logs_to_backup_server` - (Optional) Backup server(s) to send logs to.send_logs_to_backup_server blocks are documented below. +* `send_logs_to_server` - (Optional) Server(s) to send logs to.send_logs_to_server blocks are documented below. +* `tags` - (Optional) Collection of tag identifiers.tags blocks are documented below. +* `threat_emulation` - (Optional) Threat Emulation blade enabled. +* `threat_extraction` - (Optional) Threat Extraction blade enabled. +* `threat_prevention_mode` - (Optional) The mode of Threat Prevention to use. When using Autonomous Threat Prevention, disabling the Threat Prevention blades is not allowed. +* `url_filtering` - (Optional) URL Filtering blade enabled. +* `usercheck_portal_settings` - (Optional) UserCheck portal settings.usercheck_portal_settings blocks are documented below. +* `version` - (Optional) Cluster platform version. +* `vpn` - (Optional) VPN blade enabled. +* `vpn_settings` - (Optional) Gateway VPN settings.vpn_settings blocks are documented below. +* `zero_phishing` - (Optional) Zero Phishing blade enabled. +* `zero_phishing_fqdn` - (Optional) Zero Phishing gateway FQDN. +* `show_portals_certificate` - (Optional) Indicates whether to show the portals certificate value in the reply. +* `color` - (Optional) Color of the object. Should be one of existing colors. * `comments` - (Optional) Comments string. -* `tags` - (Optional) Collection of tags identified by name. +* `groups` - (Optional) Collection of group identifiers.groups blocks are documented below. * `ignore_warnings` - (Optional) Apply changes ignoring warnings. -* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`advanced_settings` supports the following: + +* `connection_persistence` - (Optional) Handling established connections when installing a new policy. +* `sam` - (Optional) SAM.sam blocks are documented below. + + +`application_control_and_url_filtering_settings` supports the following: + +* `global_settings_mode` - (Optional) Whether to override global settings or not. +* `override_global_settings` - (Optional) override global settings object.override_global_settings blocks are documented below. + + +`cluster_settings` supports the following: + +* `member_recovery_mode` - (Optional) In a High Availability cluster, each member is given a priority. The member with the highest priority serves as the gateway. If this gateway fails, control is passed to the member with the next highest priority. If that member fails, control is passed to the next, and so on. Upon gateway recovery, it is possible to: +Maintain current active Cluster Member (maintain-current-active) or +Switch to higher priority Cluster Member (according-to-priority). +* `state_synchronization` - (Optional) Cluster State Synchronization settings.state_synchronization blocks are documented below. +* `track_changes_of_cluster_members` - (Optional) Track changes in the status of Cluster Members. +* `use_virtual_mac` - (Optional) Use Virtual MAC. By enabling Virtual MAC in ClusterXL High Availability New mode, or Load Sharing Unicast mode, all cluster members associate the same Virtual MAC address with All Cluster Virtual Interfaces and the Virtual IP address. + + +`firewall_settings` supports the following: + +* `auto_calculate_connections_hash_table_size_and_memory_pool` - (Optional) N/A +* `auto_maximum_limit_for_concurrent_connections` - (Optional) N/A +* `connections_hash_size` - (Optional) N/A +* `maximum_limit_for_concurrent_connections` - (Optional) N/A +* `maximum_memory_pool_size` - (Optional) N/A +* `memory_pool_size` - (Optional) N/A + + +`https_inspection` supports the following: + +* `bypass_on_failure` - (Optional) Set to be true in order to bypass all requests (Fail-open) in case of internal system error.bypass_on_failure blocks are documented below. +* `site_categorization_allow_mode` - (Optional) Set to 'background' in order to allowed requests until categorization is complete.site_categorization_allow_mode blocks are documented below. +* `deny_untrusted_server_cert` - (Optional) Set to be true in order to drop traffic from servers with untrusted server certificate.deny_untrusted_server_cert blocks are documented below. +* `deny_revoked_server_cert` - (Optional) Set to be true in order to drop traffic from servers with revoked server certificate (validate CRL).deny_revoked_server_cert blocks are documented below. +* `deny_expired_server_cert` - (Optional) Set to be true in order to drop traffic from servers with expired server certificate.deny_expired_server_cert blocks are documented below. + + +`identity_awareness_settings` supports the following: + +* `browser_based_authentication` - (Optional) Enable Browser Based Authentication source. +* `browser_based_authentication_settings` - (Optional) Browser Based Authentication settings.browser_based_authentication_settings blocks are documented below. +* `identity_agent` - (Optional) Enable Identity Agent source. +* `identity_agent_settings` - (Optional) Identity Agent settings.identity_agent_settings blocks are documented below. +* `identity_collector` - (Optional) Enable Identity Collector source. +* `identity_collector_settings` - (Optional) Identity Collector settings.identity_collector_settings blocks are documented below. +* `identity_sharing_settings` - (Optional) Identity sharing settings.identity_sharing_settings blocks are documented below. +* `proxy_settings` - (Optional) Identity-Awareness Proxy settings.proxy_settings blocks are documented below. +* `remote_access` - (Optional) Enable Remote Access Identity source. + `interfaces` supports the following: -* `name` - (Optional) Interface name. + +* `name` - (Optional) Object name. Must be unique in the domain. * `interface_type` - (Optional) Cluster interface type. * `ipv4_address` - (Optional) IPv4 address. * `ipv6_address` - (Optional) IPv6 address. -* `ipv4_network_mask` - (Optional) IPv4 network address. -* `ipv6_network_mask` - (Optional) IPv6 network address. -* `ipv4_mask_length` - (Optional) IPv4 network mask length. -* `ipv6_mask_length` - (Optional) IPv4 network mask length. -* `anti_spoofing` - (Optional) Anti spoofing. -* `anti_spoofing_settings` - (Optional) Anti spoofing settings. anti_spoofing_settings blocks are documented below. -* `multicast_address` - (Optional) Multicast IP Address. -* `multicast_address_type` - (Optional) Multicast Address Type. -* `security_zone` - (Optional) Security zone. -* `security_zone_settings` - (Optional) Security zone settings. security_zone_settings blocks are documented below. -* `topology` - (Optional) Topology. -* `topology_settings` - (Optional) Topology settings. topology_settings blocks are documented below. -* `topology_automatic_calculation` - (Computed) Shows the automatic topology calculation.. -* `topology` - (Optional) Topology. +* `network_mask` - (Optional) IPv4 or IPv6 network mask. If both masks are required use ipv4-network-mask and ipv6-network-mask fields explicitly. Instead of providing mask itself it is possible to specify IPv4 or IPv6 mask length in mask-length field. If both masks length are required use ipv4-mask-length and ipv6-mask-length fields explicitly. +* `ipv4_network_mask` - (Optional) IPv4 network address. +* `ipv6_network_mask` - (Optional) IPv6 network address. +* `ipv4_mask_length` - (Optional) IPv4 network mask length. +* `ipv6_mask_length` - (Optional) IPv6 network mask length. +* `anti_spoofing` - (Optional) N/A +* `anti_spoofing_settings` - (Optional) N/Aanti_spoofing_settings blocks are documented below. +* `multicast_address` - (Optional) Multicast IP Address. +* `multicast_address_type` - (Optional) Multicast Address Type. +* `security_zone` - (Optional) N/A +* `security_zone_settings` - (Optional) N/Asecurity_zone_settings blocks are documented below. +* `tags` - (Optional) Collection of tag identifiers.tags blocks are documented below. +* `topology` - (Optional) N/A +* `topology_settings` - (Optional) N/Atopology_settings blocks are documented below. * `color` - (Optional) Color of the object. Should be one of existing colors. * `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`members` supports the following: + +* `name` - (Optional) Object name. +* `interfaces` - (Optional) Cluster Member network interfaces.interfaces blocks are documented below. +* `ipv4_address` - (Optional) IPv4 address. +* `ipv6_address` - (Optional) IPv6 address. +* `one_time_password` - (Optional) N/A +* `tags` - (Optional) Collection of tag identifiers.tags blocks are documented below. +* `priority` - (Optional) In a High Availability New mode cluster each machine is given a priority. The highest priority machine serves as the gateway in normal circumstances. If this machine fails, control is passed to the next highest priority machine. If that machine fails, control is passed to the next machine, and so on. +In Load Sharing Unicast mode cluster, the highest priority is the pivot machine. +The values must be in a range from 1 to N, where N is number of cluster members. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`nat_settings` supports the following: + +* `auto_rule` - (Optional) Whether to add automatic address translation rules. +* `ipv4_address` - (Optional) IPv4 address. +* `ipv6_address` - (Optional) IPv6 address. +* `hide_behind` - (Optional) Hide behind method. This parameter is forbidden in case "method" parameter is "static". +* `install_on` - (Optional) Which gateway should apply the NAT translation. +* `method` - (Optional) NAT translation method. + + +`platform_portal_settings` supports the following: + +* `portal_web_settings` - (Optional) Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - (Optional) Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. + + +`proxy_settings` supports the following: + +* `use_custom_proxy` - (Optional) Use custom proxy settings for this network object. +* `proxy_server` - (Optional) N/A +* `port` - (Optional) N/A + + +`usercheck_portal_settings` supports the following: + +* `enabled` - (Optional) State of the web portal (enabled or disabled). The supported blades are: {'Application Control', 'URL Filtering', 'Data Loss Prevention', 'Anti Virus', 'Anti Bot', 'Threat Emulation', 'Threat Extraction', 'Data Awareness'}. +* `portal_web_settings` - (Optional) Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - (Optional) Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. + + +`vpn_settings` supports the following: + +* `authentication` - (Optional) Authentication.authentication blocks are documented below. +* `link_selection` - (Optional) Link Selection.link_selection blocks are documented below. +* `maximum_concurrent_ike_negotiations` - (Optional) N/A +* `maximum_concurrent_tunnels` - (Optional) N/A +* `office_mode` - (Optional) Office Mode. +Notation Wide Impact - Office Mode apply IPSec VPN Software Blade clients and to the Mobile Access Software Blade clients.office_mode blocks are documented below. +* `remote_access` - (Optional) Remote Access.remote_access blocks are documented below. +* `vpn_domain` - (Optional) Gateway VPN domain identified by the name or UID. +* `vpn_domain_exclude_external_ip_addresses` - (Optional) Exclude the external IP addresses from the VPN domain of this Security Gateway. +* `vpn_domain_type` - (Optional) Gateway VPN domain type. + + +`sam` supports the following: + +* `forward_to_other_sam_servers` - (Optional) Forward SAM clients' requests to other SAM servers. +* `use_early_versions` - (Optional) Use early versions compatibility mode.use_early_versions blocks are documented below. +* `purge_sam_file` - (Optional) Purge SAM File.purge_sam_file blocks are documented below. + + +`override_global_settings` supports the following: + +* `fail_mode` - (Optional) Fail mode - allow or block all requests. +* `website_categorization` - (Optional) Website categorization object.website_categorization blocks are documented below. + + +`state_synchronization` supports the following: + +* `delayed` - (Optional) Start synchronizing with delay of seconds, as defined by delayed-seconds, after connection initiation. Disabled when state-synchronization disabled. +* `delayed_seconds` - (Optional) Start synchronizing X seconds after connection initiation +. The values must be in a range between 2 and 3600. +* `enabled` - (Optional) Use State Synchronization. + + +`bypass_on_failure` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`site_categorization_allow_mode` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`deny_untrusted_server_cert` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`deny_revoked_server_cert` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`deny_expired_server_cert` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`browser_based_authentication_settings` supports the following: + +* `authentication_settings` - (Optional) Authentication Settings for Browser Based Authentication.authentication_settings blocks are documented below. +* `browser_based_authentication_portal_settings` - (Optional) Browser Based Authentication portal settings.browser_based_authentication_portal_settings blocks are documented below. + + +`identity_agent_settings` supports the following: + +* `agents_interval_keepalive` - (Optional) Agents send keepalive period (minutes). +* `user_reauthenticate_interval` - (Optional) Agent reauthenticate time interval (minutes). +* `authentication_settings` - (Optional) Authentication Settings for Identity Agent.authentication_settings blocks are documented below. +* `identity_agent_portal_settings` - (Optional) Identity Agent accessibility settings.identity_agent_portal_settings blocks are documented below. + + +`identity_collector_settings` supports the following: + +* `authorized_clients` - (Optional) Authorized Clients.authorized_clients blocks are documented below. +* `authentication_settings` - (Optional) Authentication Settings for Identity Collector.authentication_settings blocks are documented below. +* `client_access_permissions` - (Optional) Identity Collector accessibility settings.client_access_permissions blocks are documented below. + + +`identity_sharing_settings` supports the following: + +* `share_with_other_gateways` - (Optional) Enable identity sharing with other gateways. +* `receive_from_other_gateways` - (Optional) Enable receiving identity from other gateways. +* `receive_from` - (Optional) Gateway(s) to receive identity from.receive_from blocks are documented below. + + +`proxy_settings` supports the following: + +* `detect_using_x_forward_for` - (Optional) Whether to use X-Forward-For HTTP header, which is added by the proxy server to keep track of the original source IP. + `anti_spoofing_settings` supports the following: -* `action` - (Optional) If packets will be rejected (the Prevent option) or whether the packets will be monitored (the Detect option). + +* `action` - (Optional) If packets will be rejected (the Prevent option) or whether the packets will be monitored (the Detect option). +* `exclude_packets` - (Optional) Don't check packets from excluded network. +* `excluded_network_name` - (Optional) Excluded network name. +* `excluded_network_uid` - (Optional) Excluded network UID. +* `spoof_tracking` - (Optional) Spoof tracking. + `security_zone_settings` supports the following: -* `auto_calculated` - (Optional) Security Zone is calculated according to where the interface leads to. -* `specific_zone` - (Optional) Security Zone specified manually. + +* `auto_calculated` - (Optional) Security Zone is calculated according to where the interface leads to. +* `specific_zone` - (Optional) Security Zone specified manually. + `topology_settings` supports the following: -* `interface_leads_to_dmz` - (Optional) Whether this interface leads to demilitarized zone (perimeter network). -* `ip_address_behind_this_interface` - (Optional) Ip address behind this interface. -* `specific_network` - (Optional) Network behind this interface. -`members` supports the following: -* `name` - (Optional) Object name. Should be unique in the domain.. -* `ip_address` - (Optional) IPv4 or IPv6 address. -* `interfaces` - (Optional) Cluster Member network interfaces. interfaces blocks are documented below. -* `one_time_password` - (Optional) Secure Internal Communication one time password. -* `sic_name` - (Computed) Secure Internal Communication name. -* `sic_message` - (Computed) Secure Internal Communication state. +* `interface_leads_to_dmz` - (Optional) Whether this interface leads to demilitarized zone (perimeter network). +* `specific_network` - (Optional) Network behind this interface. + `interfaces` supports the following: -* `name` - (Optional) Interface name. + +* `name` - (Optional) Object name. +* `anti_spoofing` - (Optional) N/A +* `anti_spoofing_settings` - (Optional) N/Aanti_spoofing_settings blocks are documented below. * `ipv4_address` - (Optional) IPv4 address. * `ipv6_address` - (Optional) IPv6 address. -* `ipv4_network_mask` - (Optional) IPv4 network address. -* `ipv6_network_mask` - (Optional) IPv6 network address. -* `ipv4_mask_length` - (Optional) IPv4 network mask length. -* `ipv6_mask_length` - (Optional) IPv6 network mask length. +* `network_mask` - (Optional) IPv4 or IPv6 network mask. If both masks are required use ipv4-network-mask and ipv6-network-mask fields explicitly. Instead of providing mask itself it is possible to specify IPv4 or IPv6 mask length in mask-length field. If both masks length are required use ipv4-mask-length and ipv6-mask-length fields explicitly. +* `ipv4_network_mask` - (Optional) IPv4 network address. +* `ipv6_network_mask` - (Optional) IPv6 network address. +* `ipv4_mask_length` - (Optional) IPv4 network mask length. +* `ipv6_mask_length` - (Optional) IPv6 network mask length. +* `security_zone` - (Optional) N/A +* `security_zone_settings` - (Optional) N/Asecurity_zone_settings blocks are documented below. +* `tags` - (Optional) Collection of tag identifiers.tags blocks are documented below. +* `topology` - (Optional) N/A +* `topology_settings` - (Optional) N/Atopology_settings blocks are documented below. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. -`firewall_settings` supports the following: -* `auto_calculate_connections_hash_table_size_and_memory_pool` - (Optional) Auto calculate connections hash table size and memory pool. -* `auto_maximum_limit_for_concurrent_connections` - (Optional) Auto maximum limit for concurrent connections. -* `connections_hash_size` - (Optional) Connections hash size. -* `maximum_limit_for_concurrent_connections` - (Optional) Maximum limit for concurrent connections. -* `maximum_memory_pool_size` - (Optional) Maximum memory pool size. -* `memory_pool_size` - (Optional) Memory pool size. -`vpn_settings` supports the following: -* `authentication` - (Optional) authentication blocks are documented below. -* `link_selection` - (Optional) Link selection blocks are documented below. -* `maximum_concurrent_ike_negotiations` - (Optional) Maximum concurrent ike negotiations. -* `maximum_concurrent_tunnels` - (Optional) Maximum concurrent tunnels. -* `office_mode` - (Optional) Office Mode. Notation Wide Impact - Office Mode apply IPSec VPN Software Blade clients and to the Mobile Access Software Blade clients. office_mode blocks are documented below. -* `remote_access` - (Optional) remote_access blocks are documented below. -* `vpn_domain` - (Optional) Gateway VPN domain identified by the name. -* `vpn_domain_type` - (Optional) Gateway VPN domain type. +`portal_web_settings` supports the following: + +* `aliases` - (Optional) List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - (Optional) The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - (Optional) The certificate file encoded in Base64 with padding. +This file must be in the *.p12 format. +* `base64_password` - (Optional) Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`portal_web_settings` supports the following: + +* `aliases` - (Optional) List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - (Optional) The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - (Optional) The certificate file encoded in Base64 with padding. +This file must be in the *.p12 format. +* `base64_password` - (Optional) Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + `authentication` supports the following: -* `authentication_clients` - (Optional) Collection of VPN Authentication clients identified by the name. + +* `authentication_clients` - (Optional) Collection of VPN Authentication clients identified by the name or UID.authentication_clients blocks are documented below. + `link_selection` supports the following: -* `ip_selection` - (Optional) IP selection. + * `dns_resolving_hostname` - (Optional) DNS Resolving Hostname. Must be set when "ip-selection" was selected to be "dns-resolving-from-hostname". -* `ip_address` - (Optional) IP Address. Must be set when "ip-selection" was selected to be "use-selected-address-from-topology" or "use-statically-nated-ip". + `office_mode` supports the following: -* `mode` - (Optional) Office Mode Permissions. When selected to be "off", all the other definitions are irrelevant. -* `group` - (Optional) Group. Identified by name. Must be set when "office-mode-permissions" was selected to be "group". -* `allocate_ip_address_from` - (Optional) Allocate IP address Method. Allocate IP address by sequentially trying the given methods until success. allocate_ip_address_from blocks are documented below. -* `support_multiple_interfaces` - (Optional) Support connectivity enhancement for gateways with multiple external interfaces. -* `perform_anti_spoofing` - (Optional) Perform Anti-Spoofing on Office Mode addresses. -* `anti_spoofing_additional_addresses` - (Optional) Additional IP Addresses for Anti-Spoofing. Identified by name. Must be set when "perform-anti-spoofings" is true. + +* `mode` - (Optional) Office Mode Permissions. +When selected to be "off", all the other definitions are irrelevant. +* `group` - (Optional) Group. Identified by name or UID. +Must be set when "office-mode-permissions" was selected to be "group". +* `allocate_ip_address_from` - (Optional) Allocate IP address Method. +Allocate IP address by sequentially trying the given methods until success.allocate_ip_address_from blocks are documented below. +* `support_multiple_interfaces` - (Optional) Support connectivity enhancement for gateways with multiple external interfaces. +* `perform_anti_spoofing` - (Optional) Perform Anti-Spoofing on Office Mode addresses. +* `anti_spoofing_additional_addresses` - (Optional) Additional IP Addresses for Anti-Spoofing. +Identified by name or UID. +Must be set when "perform-anti-spoofings" is true. + + +`remote_access` supports the following: + +* `support_l2tp` - (Optional) Support L2TP (relevant only when office mode is active). +* `l2tp_auth_method` - (Optional) L2TP Authentication Method. +Must be set when "support-l2tp" is true. +* `l2tp_certificate` - (Optional) L2TP Certificate. +Must be set when "l2tp-auth-method" was selected to be "certificate". +Insert "defaultCert" when you want to use the default certificate. +* `allow_vpn_clients_to_route_traffic` - (Optional) Allow VPN clients to route traffic. +* `support_nat_traversal_mechanism` - (Optional) Support NAT traversal mechanism (UDP encapsulation). +* `nat_traversal_service` - (Optional) Allocated NAT traversal UDP service. Identified by name or UID. +Must be set when "support-nat-traversal-mechanism" is true. +* `support_visitor_mode` - (Optional) Support Visitor Mode. +* `visitor_mode_service` - (Optional) TCP Service for Visitor Mode. Identified by name or UID. +Must be set when "support-visitor-mode" is true. +* `visitor_mode_interface` - (Optional) Interface for Visitor Mode. +Must be set when "support-visitor-mode" is true. +Insert IPV4 Address of existing interface or "All IPs" when you want all interfaces. + + +`use_early_versions` supports the following: + +* `enabled` - (Optional) Use early versions compatibility mode. +* `compatibility_mode` - (Optional) Early versions compatibility mode. + + +`purge_sam_file` supports the following: + +* `enabled` - (Optional) Purge SAM File. +* `purge_when_size_reaches_to` - (Optional) Purge SAM File When it Reaches to. + + +`website_categorization` supports the following: + +* `mode` - (Optional) Website categorization mode. +* `custom_mode` - (Optional) Custom mode object.custom_mode blocks are documented below. + + +`authentication_settings` supports the following: + +* `authentication_method` - (Optional) Authentication method. +* `identity_provider` - (Optional) Identity provider object identified by the name or UID. Must be set when "authentication-method" was selected to be "identity provider".identity_provider blocks are documented below. +* `radius` - (Optional) Radius server object identified by the name or UID. Must be set when "authentication-method" was selected to be "radius". +* `users_directories` - (Optional) Users directories.users_directories blocks are documented below. + + +`browser_based_authentication_portal_settings` supports the following: + +* `portal_web_settings` - (Optional) Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - (Optional) Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. + + +`authentication_settings` supports the following: + +* `authentication_method` - (Optional) Authentication method. +* `radius` - (Optional) Radius server object identified by the name or UID. Must be set when "authentication-method" was selected to be "radius". +* `users_directories` - (Optional) Users directories.users_directories blocks are documented below. + + +`identity_agent_portal_settings` supports the following: + +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. + + +`authorized_clients` supports the following: + +* `client` - (Optional) Host / Network Group Name or UID. +* `client_secret` - (Optional) Client Secret. + + +`authentication_settings` supports the following: + +* `users_directories` - (Optional) Users directories.users_directories blocks are documented below. + + +`client_access_permissions` supports the following: + +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. + + +`anti_spoofing_settings` supports the following: + +* `action` - (Optional) If packets will be rejected (the Prevent option) or whether the packets will be monitored (the Detect option). +* `exclude_packets` - (Optional) Don't check packets from excluded network. +* `excluded_network_name` - (Optional) Excluded network name. +* `excluded_network_uid` - (Optional) Excluded network UID. +* `spoof_tracking` - (Optional) Spoof tracking. + + +`security_zone_settings` supports the following: + +* `auto_calculated` - (Optional) Security Zone is calculated according to where the interface leads to. +* `specific_zone` - (Optional) Security Zone specified manually. + + +`topology_settings` supports the following: + +* `interface_leads_to_dmz` - (Optional) Whether this interface leads to demilitarized zone (perimeter network). +* `specific_network` - (Optional) Network behind this interface. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + `allocate_ip_address_from` supports the following: -* `radius_server` - (Optional) Radius server used to authenticate the user. -* `use_allocate_method` - (Optional) Use Allocate Method. -* `allocate_method` - (Optional) Using either Manual (IP Pool) or Automatic (DHCP). Must be set when "use-allocate-method" is true. -* `manual_network` - (Optional) Manual Network. Identified by name. Must be set when "allocate-method" was selected to be "manual". -* `dhcp_server` - (Optional) DHCP Server. Identified by name. Must be set when "allocate-method" was selected to be "automatic". -* `virtual_ip_address` - (Optional) Virtual IPV4 address for DHCP server replies. Must be set when "allocate-method" was selected to be "automatic". -* `dhcp_mac_address` - (Optional) Calculated MAC address for DHCP allocation. Must be set when "allocate-method" was selected to be "automatic". -* `optional_parameters` - (Optional) This configuration applies to all Office Mode methods except Automatic (using DHCP) and ipassignment.conf entries which contain this data. optional_parameters blocks are documented below. + +* `radius_server` - (Optional) Radius server used to authenticate the user. +* `use_allocate_method` - (Optional) Use Allocate Method. +* `allocate_method` - (Optional) Using either Manual (IP Pool) or Automatic (DHCP). +Must be set when "use-allocate-method" is true. +* `manual_network` - (Optional) Manual Network. Identified by name or UID. +Must be set when "allocate-method" was selected to be "manual". +* `dhcp_server` - (Optional) DHCP Server. Identified by name or UID. +Must be set when "allocate-method" was selected to be "automatic". +* `virtual_ip_address` - (Optional) Virtual IPV4 address for DHCP server replies. +Must be set when "allocate-method" was selected to be "automatic". +* `dhcp_mac_address` - (Optional) Calculated MAC address for DHCP allocation. +Must be set when "allocate-method" was selected to be "automatic". +* `optional_parameters` - (Optional) This configuration applies to all Office Mode methods except Automatic (using DHCP) and ipassignment.conf entries which contain this data.optional_parameters blocks are documented below. + + +`custom_mode` supports the following: + +* `social_networking_widgets` - (Optional) Social networking widgets mode. +* `url_filtering` - (Optional) URL filtering mode. + + +`users_directories` supports the following: + +* `external_user_profile` - (Optional) External user profile. +* `internal_users` - (Optional) Internal users. +* `users_from_external_directories` - (Optional) Users from external directories. +* `specific` - (Optional) LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`portal_web_settings` supports the following: + +* `aliases` - (Optional) List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - (Optional) The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - (Optional) The certificate file encoded in Base64 with padding. +This file must be in the *.p12 format. +* `base64_password` - (Optional) Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`users_directories` supports the following: + +* `external_user_profile` - (Optional) External user profile. +* `internal_users` - (Optional) Internal users. +* `users_from_external_directories` - (Optional) Users from external directories. +* `specific` - (Optional) LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`users_directories` supports the following: + +* `external_user_profile` - (Optional) External user profile. +* `internal_users` - (Optional) Internal users. +* `users_from_external_directories` - (Optional) Users from external directories. +* `specific` - (Optional) LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + `optional_parameters` supports the following: -* `use_primary_dns_server` - (Optional) Use Primary DNS Server. -* `primary_dns_server` - (Optional) Primary DNS Server. Identified by name. Must be set when "use-primary-dns-server" is true and can not be set when "use-primary-dns-server" is false. -* `use_first_backup_dns_server` - (Optional) Use First Backup DNS Server. -* `first_backup_dns_server` - (Optional) First Backup DNS Server. Identified by name. Must be set when "use-first-backup-dns-server" is true and can not be set when "use-first-backup-dns-server" is false. -* `use_second_backup_dns_server` - (Optional) Use Second Backup DNS Server. -* `second_backup_dns_server` - (Optional) Second Backup DNS Server. Identified by name. Must be set when "use-second-backup-dns-server" is true and can not be set when "use-second-backup-dns-server" is false. -* `dns_suffixes` - (Optional) DNS Suffixes. -* `use_primary_wins_server` - (Optional) Use Primary WINS Server. -* `primary_wins_server` - (Optional) Primary WINS Server. Identified by name. Must be set when "use-primary-wins-server" is true and can not be set when "use-primary-wins-server" is false. -* `use_first_backup_wins_server` - (Optional) Use First Backup WINS Server. -* `first_backup_wins_server` - (Optional) First Backup WINS Server. Identified by name. Must be set when "use-first-backup-wins-server" is true and can not be set when "use-first-backup-wins-server" is false. -* `use_second_backup_wins_server` - (Optional) Use Second Backup WINS Server. -* `second_backup_wins_server` - (Optional) Second Backup WINS Server. Identified by name. Must be set when "use-second-backup-wins-server" is true and can not be set when "use-second-backup-wins-server" is false. -* `ip_lease_duration` - (Optional) IP Lease Duration in Minutes. The value must be in the range 2-32767. -`remote_access` supports the following: -* `support_l2tp` - (Optional) Support L2TP (relevant only when office mode is active). -* `l2tp_auth_method` - (Optional) L2TP Authentication Method. Must be set when "support-l2tp" is true. -* `l2tp_certificate` - (Optional) L2TP Certificate. Must be set when "l2tp-auth-method" was selected to be "certificate". Insert "defaultCert" when you want to use the default certificate. -* `allow_vpn_clients_to_route_traffic` - (Optional) Allow VPN clients to route traffic. -* `support_nat_traversal_mechanism` - (Optional) Support NAT traversal mechanism (UDP encapsulation). -* `nat_traversal_service` - (Optional) Allocated NAT traversal UDP service. Identified by name. Must be set when "support-nat-traversal-mechanism" is true. -* `support_visitor_mode` - (Optional) Support Visitor Mode. -* `visitor_mode_service` - (Optional) TCP Service for Visitor Mode. Identified by name. Must be set when "support-visitor-mode" is true. -* `visitor_mode_interface` - (Optional) Interface for Visitor Mode. Must be set when "support-visitor-mode" is true. Insert IPV4 Address of existing interface or "All IPs" when you want all interfaces. \ No newline at end of file +* `use_primary_dns_server` - (Optional) Use Primary DNS Server. +* `primary_dns_server` - (Optional) Primary DNS Server. Identified by name or UID. +Must be set when "use-primary-dns-server" is true and can not be set when "use-primary-dns-server" is false. +* `use_first_backup_dns_server` - (Optional) Use First Backup DNS Server. +* `first_backup_dns_server` - (Optional) First Backup DNS Server. Identified by name or UID. +Must be set when "use-first-backup-dns-server" is true and can not be set when "use-first-backup-dns-server" is false. +* `use_second_backup_dns_server` - (Optional) Use Second Backup DNS Server. +* `second_backup_dns_server` - (Optional) Second Backup DNS Server. Identified by name or UID. +Must be set when "use-second-backup-dns-server" is true and can not be set when "use-second-backup-dns-server" is false. +* `dns_suffixes` - (Optional) DNS Suffixes. +* `use_primary_wins_server` - (Optional) Use Primary WINS Server. +* `primary_wins_server` - (Optional) Primary WINS Server. Identified by name or UID. +Must be set when "use-primary-wins-server" is true and can not be set when "use-primary-wins-server" is false. +* `use_first_backup_wins_server` - (Optional) Use First Backup WINS Server. +* `first_backup_wins_server` - (Optional) First Backup WINS Server. Identified by name or UID. +Must be set when "use-first-backup-wins-server" is true and can not be set when "use-first-backup-wins-server" is false. +* `use_second_backup_wins_server` - (Optional) Use Second Backup WINS Server. +* `second_backup_wins_server` - (Optional) Second Backup WINS Server. Identified by name or UID. +Must be set when "use-second-backup-wins-server" is true and can not be set when "use-second-backup-wins-server" is false. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. diff --git a/website/docs/r/checkpoint_management_simple_gateway.html.markdown b/website/docs/r/checkpoint_management_simple_gateway.html.markdown index 276e5d27..34a3be14 100644 --- a/website/docs/r/checkpoint_management_simple_gateway.html.markdown +++ b/website/docs/r/checkpoint_management_simple_gateway.html.markdown @@ -6,7 +6,7 @@ description: |- This resource allows you to execute Check Point Simple Gateway. --- -# Resource: checkpoint_management_simple_gateway +# checkpoint_management_simple_gateway This resource allows you to execute Check Point Simple Gateway. @@ -14,11 +14,9 @@ This resource allows you to execute Check Point Simple Gateway. ```hcl -resource "checkpoint_management_simple_gateway" "gateway" { - name = "mygateway" - ipv4_address = "1.2.3.4" - version = "R81" - send_logs_to_server = ["mylogserver"] +resource "checkpoint_management_simple_gateway" "example" { + name = "gw1" + ipv4_address = "192.0.2.1" } ``` @@ -27,143 +25,171 @@ resource "checkpoint_management_simple_gateway" "gateway" { The following arguments are supported: * `name` - (Required) Object name. -* `ipv4_address` - (Optional) IPv4 address. -* `ipv6_address` - (Optional) IPv6 address. -* `interfaces` - (Optional) Gateway interfaces. interfaces blocks are documented below. +* `advanced_settings` - (Optional) N/Aadvanced_settings blocks are documented below. * `anti_bot` - (Optional) Anti-Bot blade enabled. * `anti_virus` - (Optional) Anti-Virus blade enabled. -* `application_control` - (Optional) Application Control blade enabled. -* `content_awareness` - (Optional) Content Awareness blade enabled. -* `icap_server` - (Optional) ICAP Server enabled. -* `ips` - (Optional) Intrusion Prevention System blade enabled. -* `threat_emulation` - (Optional) Threat Emulation blade enabled. -* `threat_extraction` - (Optional) Threat Extraction blade enabled. -* `url_filtering` - (Optional) URL Filtering blade enabled. -* `firewall` - (Optional) Firewall blade enabled. -* `firewall_settings` - (Optional) Firewall settings. firewall_settings blocks are documented below. -* `vpn` - (Optional) VPN blade enabled. -* `vpn_settings` - (Optional) Gateway VPN settings. vpn_settings blocks are documented below. -* `dynamic_ip` - (Computed) Dynamic IP address. -* `version` - (Optional) Gateway platform version. -* `os_name` - (Optional) Operating system name. -* `hardware` - (Computed) Gateway platform hardware name. -* `one_time_password` - (Optional) Secure internal connection one time password. -* `sic_name` - (Computed) Secure Internal Communication name. -* `sic_state` - (Computed) Secure Internal Communication state. -* `save_logs_locally` - (Optional) Enable save logs locally. -* `send_alerts_to_server` - (Optional) Collection of Server(s) to send alerts to identified by the name. -* `send_logs_to_backup_server` - (Optional) Collection of Backup server(s) to send logs to identified by the name. -* `send_logs_to_server` - (Optional) Collection of Server(s) to send logs to identified by the name. -* `logs_settings` - (Optional) Logs settings. logs_settings blocks are documented below. -* `color` - (Optional) Color of the object. +* `application_control` - (Optional) Application Control blade enabled. +* `application_control_and_url_filtering_settings` - (Optional) Gateway Application Control and URL filtering settings.application_control_and_url_filtering_settings blocks are documented below. +* `content_awareness` - (Optional) Content Awareness blade enabled. +* `enable_https_inspection` - (Optional) Enable HTTPS Inspection after defining an outbound inspection certificate.
To define the outbound certificate use outbound inspection certificate API. +* `fetch_policy` - (Optional) Security management server(s) to fetch the policy from.fetch_policy blocks are documented below. +* `firewall` - (Optional) Firewall blade enabled. +* `firewall_settings` - (Optional) N/Afirewall_settings blocks are documented below. +* `hit_count` - (Optional) Hit count tracks the number of connections each rule matches. +* `https_inspection` - (Optional) HTTPS inspection.https_inspection blocks are documented below. +* `icap_server` - (Optional) ICAP Server enabled. +* `identity_awareness` - (Optional) Identity awareness blade enabled. +* `identity_awareness_settings` - (Optional) Gateway Identity Awareness settings.identity_awareness_settings blocks are documented below. +* `interfaces` - (Optional) Network interfaces.interfaces blocks are documented below. +* `ipv4_address` - (Optional) IPv4 address. +* `ipv6_address` - (Optional) IPv6 address. +* `ips` - (Optional) Intrusion Prevention System blade enabled. +* `ips_update_policy` - (Optional) Specifies whether the IPS will be downloaded from the Management or directly to the Gateway. +* `nat_hide_internal_interfaces` - (Optional) Hide internal networks behind the Gateway's external IP. +* `nat_settings` - (Optional) NAT settings.nat_settings blocks are documented below. +* `one_time_password` - (Optional) N/A +* `os_name` - (Optional) Gateway platform operating system. +* `platform_portal_settings` - (Optional) Platform portal settings.platform_portal_settings blocks are documented below. +* `proxy_settings` - (Optional) Proxy Server for Gateway.proxy_settings blocks are documented below. +* `qos` - (Optional) QoS. +* `save_logs_locally` - (Optional) Save logs locally on the gateway. +* `send_alerts_to_server` - (Optional) Server(s) to send alerts to.send_alerts_to_server blocks are documented below. +* `send_logs_to_backup_server` - (Optional) Backup server(s) to send logs to.send_logs_to_backup_server blocks are documented below. +* `send_logs_to_server` - (Optional) Server(s) to send logs to.send_logs_to_server blocks are documented below. +* `tags` - (Optional) Collection of tag identifiers.tags blocks are documented below. +* `threat_emulation` - (Optional) Threat Emulation blade enabled. +* `threat_extraction` - (Optional) Threat Extraction blade enabled. +* `threat_prevention_mode` - (Optional) The mode of Threat Prevention to use. When using Autonomous Threat Prevention, disabling the Threat Prevention blades is not allowed. +* `url_filtering` - (Optional) URL Filtering blade enabled. +* `usercheck_portal_settings` - (Optional) UserCheck portal settings.usercheck_portal_settings blocks are documented below. +* `version` - (Optional) Gateway platform version. +* `vpn` - (Optional) VPN blade enabled. +* `vpn_settings` - (Optional) Gateway VPN settings.vpn_settings blocks are documented below. +* `zero_phishing` - (Optional) Zero Phishing blade enabled. +* `zero_phishing_fqdn` - (Optional) Zero Phishing gateway FQDN. +* `logs_settings` - (Optional) Logs settings that apply to Quantum Security Gateways that run Gaia OS.logs_settings blocks are documented below. +* `show_portals_certificate` - (Optional) Indicates whether to show the portals certificate value in the reply. +* `color` - (Optional) Color of the object. Should be one of existing colors. * `comments` - (Optional) Comments string. -* `tags` - (Optional) Collection of tags identified by name. -* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `groups` - (Optional) Collection of group identifiers.groups blocks are documented below. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. + + +`advanced_settings` supports the following: + +* `connection_persistence` - (Optional) Handling established connections when installing a new policy. +* `sam` - (Optional) SAM.sam blocks are documented below. + + +`application_control_and_url_filtering_settings` supports the following: + +* `global_settings_mode` - (Optional) Whether to override global settings or not. +* `override_global_settings` - (Optional) override global settings object.override_global_settings blocks are documented below. + + +`firewall_settings` supports the following: + +* `auto_calculate_connections_hash_table_size_and_memory_pool` - (Optional) N/A +* `auto_maximum_limit_for_concurrent_connections` - (Optional) N/A +* `connections_hash_size` - (Optional) N/A +* `maximum_limit_for_concurrent_connections` - (Optional) N/A +* `maximum_memory_pool_size` - (Optional) N/A +* `memory_pool_size` - (Optional) N/A + + +`https_inspection` supports the following: + +* `bypass_on_failure` - (Optional) Set to be true in order to bypass all requests (Fail-open) in case of internal system error.bypass_on_failure blocks are documented below. +* `site_categorization_allow_mode` - (Optional) Set to 'background' in order to allowed requests until categorization is complete.site_categorization_allow_mode blocks are documented below. +* `deny_untrusted_server_cert` - (Optional) Set to be true in order to drop traffic from servers with untrusted server certificate.deny_untrusted_server_cert blocks are documented below. +* `deny_revoked_server_cert` - (Optional) Set to be true in order to drop traffic from servers with revoked server certificate (validate CRL).deny_revoked_server_cert blocks are documented below. +* `deny_expired_server_cert` - (Optional) Set to be true in order to drop traffic from servers with expired server certificate.deny_expired_server_cert blocks are documented below. + + +`identity_awareness_settings` supports the following: + +* `browser_based_authentication` - (Optional) Enable Browser Based Authentication source. +* `browser_based_authentication_settings` - (Optional) Browser Based Authentication settings.browser_based_authentication_settings blocks are documented below. +* `identity_agent` - (Optional) Enable Identity Agent source. +* `identity_agent_settings` - (Optional) Identity Agent settings.identity_agent_settings blocks are documented below. +* `identity_collector` - (Optional) Enable Identity Collector source. +* `identity_collector_settings` - (Optional) Identity Collector settings.identity_collector_settings blocks are documented below. +* `identity_sharing_settings` - (Optional) Identity sharing settings.identity_sharing_settings blocks are documented below. +* `proxy_settings` - (Optional) Identity-Awareness Proxy settings.proxy_settings blocks are documented below. +* `remote_access` - (Optional) Enable Remote Access Identity source. + `interfaces` supports the following: -* `name` - (Optional) Interface name. + +* `name` - (Optional) Object name. Must be unique in the domain. * `ipv4_address` - (Optional) IPv4 address. * `ipv6_address` - (Optional) IPv6 address. -* `ipv4_network_mask` - (Optional) IPv4 network address. -* `ipv6_network_mask` - (Optional) IPv6 network address. -* `ipv4_mask_length` - (Optional) IPv4 network mask length. -* `ipv6_mask_length` - (Optional) IPv6 network mask length. -* `anti_spoofing` - (Optional) Anti spoofing. -* `anti_spoofing_settings` - (Optional) Anti spoofing settings. anti_spoofing_settings blocks are documented below. -* `security_zone` - (Optional) Security zone. -* `security_zone_settings` - (Optional) Security zone settings. security_zone_settings blocks are documented below. -* `topology` - (Optional) Topology. -* `topology_settings` - (Optional) Topology settings. topology_settings blocks are documented below. -* `topology_automatic_calculation` - (Computed) Shows the automatic topology calculation.. +* `network_mask` - (Optional) IPv4 or IPv6 network mask. If both masks are required use ipv4-network-mask and ipv6-network-mask fields explicitly. Instead of providing mask itself it is possible to specify IPv4 or IPv6 mask length in mask-length field. If both masks length are required use ipv4-mask-length and ipv6-mask-length fields explicitly. +* `ipv4_network_mask` - (Optional) IPv4 network address. +* `ipv6_network_mask` - (Optional) IPv6 network address. +* `ipv4_mask_length` - (Optional) IPv4 network mask length. +* `ipv6_mask_length` - (Optional) IPv6 network mask length. +* `anti_spoofing` - (Optional) N/A +* `anti_spoofing_settings` - (Optional) N/Aanti_spoofing_settings blocks are documented below. +* `security_zone` - (Optional) N/A +* `security_zone_settings` - (Optional) N/Asecurity_zone_settings blocks are documented below. +* `tags` - (Optional) Collection of tag identifiers.tags blocks are documented below. +* `topology` - (Optional) N/A +* `topology_settings` - (Optional) N/Atopology_settings blocks are documented below. * `color` - (Optional) Color of the object. Should be one of existing colors. * `comments` - (Optional) Comments string. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. -`anti_spoofing_settings` supports the following: -* `action` - (Optional) If packets will be rejected (the Prevent option) or whether the packets will be monitored (the Detect option). -`security_zone_settings` supports the following: -* `auto_calculated` - (Optional) Security Zone is calculated according to where the interface leads to. -* `specific_zone` - (Optional) Security Zone specified manually. +`nat_settings` supports the following: -`topology_settings` supports the following: -* `interface_leads_to_dmz` - (Optional) Whether this interface leads to demilitarized zone (perimeter network). -* `ip_address_behind_this_interface` - (Optional) Ip address behind this interface. -* `specific_network` - (Optional) Network behind this interface. +* `auto_rule` - (Optional) Whether to add automatic address translation rules. +* `ipv4_address` - (Optional) IPv4 address. +* `ipv6_address` - (Optional) IPv6 address. +* `hide_behind` - (Optional) Hide behind method. This parameter is forbidden in case "method" parameter is "static". +* `install_on` - (Optional) Which gateway should apply the NAT translation. +* `method` - (Optional) NAT translation method. -`firewall_settings` supports the following: -* `auto_calculate_connections_hash_table_size_and_memory_pool` - (Optional) Auto calculate connections hash table size and memory pool. -* `auto_maximum_limit_for_concurrent_connections` - (Optional) Auto maximum limit for concurrent connections. -* `connections_hash_size` - (Optional) Connections hash size. -* `maximum_limit_for_concurrent_connections` - (Optional) Maximum limit for concurrent connections. -* `maximum_memory_pool_size` - (Optional) Maximum memory pool size. -* `memory_pool_size` - (Optional) Memory pool size. -`vpn_settings` supports the following: -* `authentication` - (Optional) authentication blocks are documented below. -* `link_selection` - (Optional) Link selection blocks are documented below. -* `maximum_concurrent_ike_negotiations` - (Optional) Maximum concurrent ike negotiations. -* `maximum_concurrent_tunnels` - (Optional) Maximum concurrent tunnels. -* `office_mode` - (Optional) Office Mode. Notation Wide Impact - Office Mode apply IPSec VPN Software Blade clients and to the Mobile Access Software Blade clients. office_mode blocks are documented below. -* `remote_access` - (Optional) remote_access blocks are documented below. -* `vpn_domain` - (Optional) Gateway VPN domain identified by the name. -* `vpn_domain_type` - (Optional) Gateway VPN domain type. +`platform_portal_settings` supports the following: -`authentication` supports the following: -* `authentication_clients` - (Optional) Collection of VPN Authentication clients identified by the name. +* `portal_web_settings` - (Optional) Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - (Optional) Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. -`link_selection` supports the following: -* `ip_selection` - (Optional) IP selection. -* `dns_resolving_hostname` - (Optional) DNS Resolving Hostname. Must be set when "ip-selection" was selected to be "dns-resolving-from-hostname". -* `ip_address` - (Optional) IP Address. Must be set when "ip-selection" was selected to be "use-selected-address-from-topology" or "use-statically-nated-ip". -`office_mode` supports the following: -* `mode` - (Optional) Office Mode Permissions. When selected to be "off", all the other definitions are irrelevant. -* `group` - (Optional) Group. Identified by name. Must be set when "office-mode-permissions" was selected to be "group". -* `allocate_ip_address_from` - (Optional) Allocate IP address Method. Allocate IP address by sequentially trying the given methods until success. allocate_ip_address_from blocks are documented below. -* `support_multiple_interfaces` - (Optional) Support connectivity enhancement for gateways with multiple external interfaces. -* `perform_anti_spoofing` - (Optional) Perform Anti-Spoofing on Office Mode addresses. -* `anti_spoofing_additional_addresses` - (Optional) Additional IP Addresses for Anti-Spoofing. Identified by name. Must be set when "perform-anti-spoofings" is true. +`proxy_settings` supports the following: -`allocate_ip_address_from` supports the following: -* `radius_server` - (Optional) Radius server used to authenticate the user. -* `use_allocate_method` - (Optional) Use Allocate Method. -* `allocate_method` - (Optional) Using either Manual (IP Pool) or Automatic (DHCP). Must be set when "use-allocate-method" is true. -* `manual_network` - (Optional) Manual Network. Identified by name. Must be set when "allocate-method" was selected to be "manual". -* `dhcp_server` - (Optional) DHCP Server. Identified by name. Must be set when "allocate-method" was selected to be "automatic". -* `virtual_ip_address` - (Optional) Virtual IPV4 address for DHCP server replies. Must be set when "allocate-method" was selected to be "automatic". -* `dhcp_mac_address` - (Optional) Calculated MAC address for DHCP allocation. Must be set when "allocate-method" was selected to be "automatic". -* `optional_parameters` - (Optional) This configuration applies to all Office Mode methods except Automatic (using DHCP) and ipassignment.conf entries which contain this data. optional_parameters blocks are documented below. +* `use_custom_proxy` - (Optional) Use custom proxy settings for this network object. +* `proxy_server` - (Optional) N/A +* `port` - (Optional) N/A -`optional_parameters` supports the following: -* `use_primary_dns_server` - (Optional) Use Primary DNS Server. -* `primary_dns_server` - (Optional) Primary DNS Server. Identified by name. Must be set when "use-primary-dns-server" is true and can not be set when "use-primary-dns-server" is false. -* `use_first_backup_dns_server` - (Optional) Use First Backup DNS Server. -* `first_backup_dns_server` - (Optional) First Backup DNS Server. Identified by name. Must be set when "use-first-backup-dns-server" is true and can not be set when "use-first-backup-dns-server" is false. -* `use_second_backup_dns_server` - (Optional) Use Second Backup DNS Server. -* `second_backup_dns_server` - (Optional) Second Backup DNS Server. Identified by name. Must be set when "use-second-backup-dns-server" is true and can not be set when "use-second-backup-dns-server" is false. -* `dns_suffixes` - (Optional) DNS Suffixes. -* `use_primary_wins_server` - (Optional) Use Primary WINS Server. -* `primary_wins_server` - (Optional) Primary WINS Server. Identified by name. Must be set when "use-primary-wins-server" is true and can not be set when "use-primary-wins-server" is false. -* `use_first_backup_wins_server` - (Optional) Use First Backup WINS Server. -* `first_backup_wins_server` - (Optional) First Backup WINS Server. Identified by name. Must be set when "use-first-backup-wins-server" is true and can not be set when "use-first-backup-wins-server" is false. -* `use_second_backup_wins_server` - (Optional) Use Second Backup WINS Server. -* `second_backup_wins_server` - (Optional) Second Backup WINS Server. Identified by name. Must be set when "use-second-backup-wins-server" is true and can not be set when "use-second-backup-wins-server" is false. -* `ip_lease_duration` - (Optional) IP Lease Duration in Minutes. The value must be in the range 2-32767. -`remote_access` supports the following: -* `support_l2tp` - (Optional) Support L2TP (relevant only when office mode is active). -* `l2tp_auth_method` - (Optional) L2TP Authentication Method. Must be set when "support-l2tp" is true. -* `l2tp_certificate` - (Optional) L2TP Certificate. Must be set when "l2tp-auth-method" was selected to be "certificate". Insert "defaultCert" when you want to use the default certificate. -* `allow_vpn_clients_to_route_traffic` - (Optional) Allow VPN clients to route traffic. -* `support_nat_traversal_mechanism` - (Optional) Support NAT traversal mechanism (UDP encapsulation). -* `nat_traversal_service` - (Optional) Allocated NAT traversal UDP service. Identified by name. Must be set when "support-nat-traversal-mechanism" is true. -* `support_visitor_mode` - (Optional) Support Visitor Mode. -* `visitor_mode_service` - (Optional) TCP Service for Visitor Mode. Identified by name. Must be set when "support-visitor-mode" is true. -* `visitor_mode_interface` - (Optional) Interface for Visitor Mode. Must be set when "support-visitor-mode" is true. Insert IPV4 Address of existing interface or "All IPs" when you want all interfaces. +`usercheck_portal_settings` supports the following: + +* `enabled` - (Optional) State of the web portal (enabled or disabled). The supported blades are: {'Application Control', 'URL Filtering', 'Data Loss Prevention', 'Anti Virus', 'Anti Bot', 'Threat Emulation', 'Threat Extraction', 'Data Awareness'}. +* `portal_web_settings` - (Optional) Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - (Optional) Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. + + +`vpn_settings` supports the following: + +* `authentication` - (Optional) Authentication.authentication blocks are documented below. +* `link_selection` - (Optional) Link Selection.link_selection blocks are documented below. +* `maximum_concurrent_ike_negotiations` - (Optional) N/A +* `maximum_concurrent_tunnels` - (Optional) N/A +* `office_mode` - (Optional) Office Mode. +Notation Wide Impact - Office Mode apply IPSec VPN Software Blade clients and to the Mobile Access Software Blade clients.office_mode blocks are documented below. +* `remote_access` - (Optional) Remote Access.remote_access blocks are documented below. +* `vpn_domain` - (Optional) Gateway VPN domain identified by the name or UID. +* `vpn_domain_exclude_external_ip_addresses` - (Optional) Exclude the external IP addresses from the VPN domain of this Security Gateway. +* `vpn_domain_type` - (Optional) Gateway VPN domain type. + `logs_settings` supports the following: -* `alert_when_free_disk_space_below` - (Optional) Enable alert when free disk space is below threshold. -* `alert_when_free_disk_space_below_metrics` - (Optional) Free disk space metrics. + +* `alert_when_free_disk_space_below` - (Optional) Enable alert when free disk space is below threshold. * `alert_when_free_disk_space_below_threshold` - (Optional) Alert when free disk space below threshold. * `alert_when_free_disk_space_below_type` - (Optional) Alert when free disk space below type. * `before_delete_keep_logs_from_the_last_days` - (Optional) Enable before delete keep logs from the last days. @@ -172,21 +198,402 @@ The following arguments are supported: * `before_delete_run_script_command` - (Optional) Before delete run script command. * `delete_index_files_older_than_days` - (Optional) Enable delete index files older than days. * `delete_index_files_older_than_days_threshold` - (Optional) Delete index files older than days threshold. -* `delete_index_files_when_index_size_above` - (Optional) Enable delete index files when index size is above. -* `delete_index_files_when_index_size_above_threshold` - (Optional) Delete index files when index size is above threshold. +* `delete_index_files_when_index_size_above` - (Optional) Enable delete index files when index size above. +* `delete_index_files_when_index_size_above_threshold` - (Optional) Delete index files when index size above threshold. * `delete_when_free_disk_space_below` - (Optional) Enable delete when free disk space below. * `delete_when_free_disk_space_below_threshold` - (Optional) Delete when free disk space below threshold. -* `detect_new_citrix_ica_application_names` - (Optional) Enable detect new citrix ica application names. -* `enable_log_indexing` - (Optional) Enable log indexing. -* `forward_logs_to_log_server` - (Optional) Enable forward logs to log server. -* `perform_log_rotate_before_log_forwarding` - (Optional) Enable perform log rotate before log forwarding. -* `reject_connections_when_free_disk_space_below_threshold` - (Optional) Enable reject connections when free disk space below threshold. -* `reserve_for_packet_capture_metrics` - (Optional) Reserve for packet capture metrics. -* `reserve_for_packet_capture_threshold` - (Optional) Reserve for packet capture threshold. +* `detect_new_citrix_ica_application_names` - (Optional) Enable detect new Citrix ICA application names. +* `distribute_logs_between_all_active_servers` - (Optional) Distribute logs between all active servers. +* `forward_logs_to_log_server` - (Optional) Enable forward logs to log server. +* `forward_logs_to_log_server_name` - (Optional) Forward logs to log server name. +* `forward_logs_to_log_server_schedule_name` - (Optional) Forward logs to log server schedule name. +* `free_disk_space_metrics` - (Optional) Free disk space metrics. +* `perform_log_rotate_before_log_forwarding` - (Optional) Enable perform log rotate before log forwarding. +* `reject_connections_when_free_disk_space_below_threshold` - (Optional) Enable reject connections when free disk space below threshold. +* `reserve_for_packet_capture_metrics` - (Optional) Reserve for packet capture metrics. +* `reserve_for_packet_capture_threshold` - (Optional) Reserve for packet capture threshold. * `rotate_log_by_file_size` - (Optional) Enable rotate log by file size. * `rotate_log_file_size_threshold` - (Optional) Log file size threshold. -* `rotate_log_on_schedule` - (Optional) Enable rotate log on schedule. +* `rotate_log_on_schedule` - (Optional) Enable rotate log on schedule. +* `rotate_log_schedule_name` - (Optional) Rotate log schedule name. * `stop_logging_when_free_disk_space_below` - (Optional) Enable stop logging when free disk space below. * `stop_logging_when_free_disk_space_below_threshold` - (Optional) Stop logging when free disk space below threshold. -* `turn_on_qos_logging` - (Optional) Enable turn on qos loggig. -* `update_account_log_every` - (Optional) Update account log in every amount of seconds. +* `turn_on_qos_logging` - (Optional) Enable turn on QoS Logging. +* `update_account_log_every` - (Optional) Update account log in every amount of seconds. + + +`sam` supports the following: + +* `forward_to_other_sam_servers` - (Optional) Forward SAM clients' requests to other SAM servers. +* `use_early_versions` - (Optional) Use early versions compatibility mode.use_early_versions blocks are documented below. +* `purge_sam_file` - (Optional) Purge SAM File.purge_sam_file blocks are documented below. + + +`override_global_settings` supports the following: + +* `fail_mode` - (Optional) Fail mode - allow or block all requests. +* `website_categorization` - (Optional) Website categorization object.website_categorization blocks are documented below. + + +`bypass_on_failure` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`site_categorization_allow_mode` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`deny_untrusted_server_cert` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`deny_revoked_server_cert` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`deny_expired_server_cert` supports the following: + +* `override_profile` - (Optional) Override profile of global configuration. +* `value` - (Optional) Override value.
Required only for 'override-profile' is True. + + +`browser_based_authentication_settings` supports the following: + +* `authentication_settings` - (Optional) Authentication Settings for Browser Based Authentication.authentication_settings blocks are documented below. +* `browser_based_authentication_portal_settings` - (Optional) Browser Based Authentication portal settings.browser_based_authentication_portal_settings blocks are documented below. + + +`identity_agent_settings` supports the following: + +* `agents_interval_keepalive` - (Optional) Agents send keepalive period (minutes). +* `user_reauthenticate_interval` - (Optional) Agent reauthenticate time interval (minutes). +* `authentication_settings` - (Optional) Authentication Settings for Identity Agent.authentication_settings blocks are documented below. +* `identity_agent_portal_settings` - (Optional) Identity Agent accessibility settings.identity_agent_portal_settings blocks are documented below. + + +`identity_collector_settings` supports the following: + +* `authorized_clients` - (Optional) Authorized Clients.authorized_clients blocks are documented below. +* `authentication_settings` - (Optional) Authentication Settings for Identity Collector.authentication_settings blocks are documented below. +* `client_access_permissions` - (Optional) Identity Collector accessibility settings.client_access_permissions blocks are documented below. + + +`identity_sharing_settings` supports the following: + +* `share_with_other_gateways` - (Optional) Enable identity sharing with other gateways. +* `receive_from_other_gateways` - (Optional) Enable receiving identity from other gateways. +* `receive_from` - (Optional) Gateway(s) to receive identity from.receive_from blocks are documented below. + + +`proxy_settings` supports the following: + +* `detect_using_x_forward_for` - (Optional) Whether to use X-Forward-For HTTP header, which is added by the proxy server to keep track of the original source IP. + + +`anti_spoofing_settings` supports the following: + +* `action` - (Optional) If packets will be rejected (the Prevent option) or whether the packets will be monitored (the Detect option). +* `exclude_packets` - (Optional) Don't check packets from excluded network. +* `excluded_network_name` - (Optional) Excluded network name. +* `excluded_network_uid` - (Optional) Excluded network UID. +* `spoof_tracking` - (Optional) Spoof tracking. + + +`security_zone_settings` supports the following: + +* `auto_calculated` - (Optional) Security Zone is calculated according to where the interface leads to. +* `specific_zone` - (Optional) Security Zone specified manually. + + +`topology_settings` supports the following: + +* `interface_leads_to_dmz` - (Optional) Whether this interface leads to demilitarized zone (perimeter network). +* `specific_network` - (Optional) Network behind this interface. + + +`portal_web_settings` supports the following: + +* `aliases` - (Optional) List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - (Optional) The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - (Optional) The certificate file encoded in Base64 with padding. +This file must be in the *.p12 format. +* `base64_password` - (Optional) Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`portal_web_settings` supports the following: + +* `aliases` - (Optional) List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - (Optional) The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - (Optional) The certificate file encoded in Base64 with padding. +This file must be in the *.p12 format. +* `base64_password` - (Optional) Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`authentication` supports the following: + +* `authentication_clients` - (Optional) Collection of VPN Authentication clients identified by the name or UID.authentication_clients blocks are documented below. + + +`link_selection` supports the following: + +* `dns_resolving_hostname` - (Optional) DNS Resolving Hostname. Must be set when "ip-selection" was selected to be "dns-resolving-from-hostname". + + +`office_mode` supports the following: + +* `mode` - (Optional) Office Mode Permissions. +When selected to be "off", all the other definitions are irrelevant. +* `group` - (Optional) Group. Identified by name or UID. +Must be set when "office-mode-permissions" was selected to be "group". +* `allocate_ip_address_from` - (Optional) Allocate IP address Method. +Allocate IP address by sequentially trying the given methods until success.allocate_ip_address_from blocks are documented below. +* `support_multiple_interfaces` - (Optional) Support connectivity enhancement for gateways with multiple external interfaces. +* `perform_anti_spoofing` - (Optional) Perform Anti-Spoofing on Office Mode addresses. +* `anti_spoofing_additional_addresses` - (Optional) Additional IP Addresses for Anti-Spoofing. +Identified by name or UID. +Must be set when "perform-anti-spoofings" is true. + + +`remote_access` supports the following: + +* `support_l2tp` - (Optional) Support L2TP (relevant only when office mode is active). +* `l2tp_auth_method` - (Optional) L2TP Authentication Method. +Must be set when "support-l2tp" is true. +* `l2tp_certificate` - (Optional) L2TP Certificate. +Must be set when "l2tp-auth-method" was selected to be "certificate". +Insert "defaultCert" when you want to use the default certificate. +* `allow_vpn_clients_to_route_traffic` - (Optional) Allow VPN clients to route traffic. +* `support_nat_traversal_mechanism` - (Optional) Support NAT traversal mechanism (UDP encapsulation). +* `nat_traversal_service` - (Optional) Allocated NAT traversal UDP service. Identified by name or UID. +Must be set when "support-nat-traversal-mechanism" is true. +* `support_visitor_mode` - (Optional) Support Visitor Mode. +* `visitor_mode_service` - (Optional) TCP Service for Visitor Mode. Identified by name or UID. +Must be set when "support-visitor-mode" is true. +* `visitor_mode_interface` - (Optional) Interface for Visitor Mode. +Must be set when "support-visitor-mode" is true. +Insert IPV4 Address of existing interface or "All IPs" when you want all interfaces. + + +`use_early_versions` supports the following: + +* `enabled` - (Optional) Use early versions compatibility mode. +* `compatibility_mode` - (Optional) Early versions compatibility mode. + + +`purge_sam_file` supports the following: + +* `enabled` - (Optional) Purge SAM File. +* `purge_when_size_reaches_to` - (Optional) Purge SAM File When it Reaches to. + + +`website_categorization` supports the following: + +* `mode` - (Optional) Website categorization mode. +* `custom_mode` - (Optional) Custom mode object.custom_mode blocks are documented below. + + +`authentication_settings` supports the following: + +* `authentication_method` - (Optional) Authentication method. +* `identity_provider` - (Optional) Identity provider object identified by the name or UID. Must be set when "authentication-method" was selected to be "identity provider".identity_provider blocks are documented below. +* `radius` - (Optional) Radius server object identified by the name or UID. Must be set when "authentication-method" was selected to be "radius". +* `users_directories` - (Optional) Users directories.users_directories blocks are documented below. + + +`browser_based_authentication_portal_settings` supports the following: + +* `portal_web_settings` - (Optional) Configuration of the portal web settings.portal_web_settings blocks are documented below. +* `certificate_settings` - (Optional) Configuration of the portal certificate settings.certificate_settings blocks are documented below. +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. + + +`authentication_settings` supports the following: + +* `authentication_method` - (Optional) Authentication method. +* `radius` - (Optional) Radius server object identified by the name or UID. Must be set when "authentication-method" was selected to be "radius". +* `users_directories` - (Optional) Users directories.users_directories blocks are documented below. + + +`identity_agent_portal_settings` supports the following: + +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. + + +`authorized_clients` supports the following: + +* `client` - (Optional) Host / Network Group Name or UID. +* `client_secret` - (Optional) Client Secret. + + +`authentication_settings` supports the following: + +* `users_directories` - (Optional) Users directories.users_directories blocks are documented below. + + +`client_access_permissions` supports the following: + +* `accessibility` - (Optional) Configuration of the portal access settings.accessibility blocks are documented below. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`allocate_ip_address_from` supports the following: + +* `radius_server` - (Optional) Radius server used to authenticate the user. +* `use_allocate_method` - (Optional) Use Allocate Method. +* `allocate_method` - (Optional) Using either Manual (IP Pool) or Automatic (DHCP). +Must be set when "use-allocate-method" is true. +* `manual_network` - (Optional) Manual Network. Identified by name or UID. +Must be set when "allocate-method" was selected to be "manual". +* `dhcp_server` - (Optional) DHCP Server. Identified by name or UID. +Must be set when "allocate-method" was selected to be "automatic". +* `virtual_ip_address` - (Optional) Virtual IPV4 address for DHCP server replies. +Must be set when "allocate-method" was selected to be "automatic". +* `dhcp_mac_address` - (Optional) Calculated MAC address for DHCP allocation. +Must be set when "allocate-method" was selected to be "automatic". +* `optional_parameters` - (Optional) This configuration applies to all Office Mode methods except Automatic (using DHCP) and ipassignment.conf entries which contain this data.optional_parameters blocks are documented below. + + +`custom_mode` supports the following: + +* `social_networking_widgets` - (Optional) Social networking widgets mode. +* `url_filtering` - (Optional) URL filtering mode. + + +`users_directories` supports the following: + +* `external_user_profile` - (Optional) External user profile. +* `internal_users` - (Optional) Internal users. +* `users_from_external_directories` - (Optional) Users from external directories. +* `specific` - (Optional) LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`portal_web_settings` supports the following: + +* `aliases` - (Optional) List of URL aliases that are redirected to the main portal URL.aliases blocks are documented below. +* `main_url` - (Optional) The main URL for the web portal. + + +`certificate_settings` supports the following: + +* `base64_certificate` - (Optional) The certificate file encoded in Base64 with padding. +This file must be in the *.p12 format. +* `base64_password` - (Optional) Password (encoded in Base64 with padding) for the certificate file. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`users_directories` supports the following: + +* `external_user_profile` - (Optional) External user profile. +* `internal_users` - (Optional) Internal users. +* `users_from_external_directories` - (Optional) Users from external directories. +* `specific` - (Optional) LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`users_directories` supports the following: + +* `external_user_profile` - (Optional) External user profile. +* `internal_users` - (Optional) Internal users. +* `users_from_external_directories` - (Optional) Users from external directories. +* `specific` - (Optional) LDAP AU objects identified by the name or UID. Must be set when "users-from-external-directories" was selected to be "specific".specific blocks are documented below. + + +`accessibility` supports the following: + +* `allow_access_from` - (Optional) Allowed access to the web portal (based on interfaces, or security policy). +* `internal_access_settings` - (Optional) Configuration of the additional portal access settings for internal interfaces only.internal_access_settings blocks are documented below. + + +`optional_parameters` supports the following: + +* `use_primary_dns_server` - (Optional) Use Primary DNS Server. +* `primary_dns_server` - (Optional) Primary DNS Server. Identified by name or UID. +Must be set when "use-primary-dns-server" is true and can not be set when "use-primary-dns-server" is false. +* `use_first_backup_dns_server` - (Optional) Use First Backup DNS Server. +* `first_backup_dns_server` - (Optional) First Backup DNS Server. Identified by name or UID. +Must be set when "use-first-backup-dns-server" is true and can not be set when "use-first-backup-dns-server" is false. +* `use_second_backup_dns_server` - (Optional) Use Second Backup DNS Server. +* `second_backup_dns_server` - (Optional) Second Backup DNS Server. Identified by name or UID. +Must be set when "use-second-backup-dns-server" is true and can not be set when "use-second-backup-dns-server" is false. +* `dns_suffixes` - (Optional) DNS Suffixes. +* `use_primary_wins_server` - (Optional) Use Primary WINS Server. +* `primary_wins_server` - (Optional) Primary WINS Server. Identified by name or UID. +Must be set when "use-primary-wins-server" is true and can not be set when "use-primary-wins-server" is false. +* `use_first_backup_wins_server` - (Optional) Use First Backup WINS Server. +* `first_backup_wins_server` - (Optional) First Backup WINS Server. Identified by name or UID. +Must be set when "use-first-backup-wins-server" is true and can not be set when "use-first-backup-wins-server" is false. +* `use_second_backup_wins_server` - (Optional) Use Second Backup WINS Server. +* `second_backup_wins_server` - (Optional) Second Backup WINS Server. Identified by name or UID. +Must be set when "use-second-backup-wins-server" is true and can not be set when "use-second-backup-wins-server" is false. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. + + +`internal_access_settings` supports the following: + +* `undefined` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'Undefined'. +* `dmz` - (Optional) Controls portal access settings for internal interfaces, whose topology is set to 'DMZ'. +* `vpn` - (Optional) Controls portal access settings for interfaces that are part of a VPN Encryption Domain. diff --git a/website/docs/r/checkpoint_management_threat_layer.html.markdown b/website/docs/r/checkpoint_management_threat_layer.html.markdown new file mode 100644 index 00000000..3e08c0d4 --- /dev/null +++ b/website/docs/r/checkpoint_management_threat_layer.html.markdown @@ -0,0 +1,32 @@ +--- +layout: "checkpoint" +page_title: "checkpoint_management_threat_layer" +sidebar_current: "docs-checkpoint-resource-checkpoint-management-threat-layer" +description: |- +This resource allows you to add/update/delete Check Point Threat Layer. +--- + +# Resource: checkpoint_management_threat_layer + +This resource allows you to add/update/delete Check Point Threat Layer. + +## Example Usage + + +```hcl +resource "checkpoint_management_threat_layer" "example" { + name = "New Layer 1" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Object name. +* `tags` - (Optional) Collection of tag identifiers.tags blocks are documented below. +* `color` - (Optional) Color of the object. Should be one of existing colors. +* `comments` - (Optional) Comments string. +* `ignore_warnings` - (Optional) Apply changes ignoring warnings. +* `ignore_errors` - (Optional) Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. +* `add_default_rule` - (Optional) Indicates whether to include a default rule in the new layer.