I've faced the issue when changes for ips sensor entries (at least, for "os" "severity" "application" & "exampt_ip" variables) in "fortios_ips_sensor" terraform resource don't record into the terraform state file.
What's going wrong.
At apply stage terraform says:
After "apply", the terraform state contains the same values as they were before "apply" command:
"module": **********,
"mode": "managed",
"type": "fortios_ips_sensor",
"name": **********
"provider": **********,
"instances": [
{
"index_key": "test",
"schema_version": 0,
"attributes": {
"block_malicious_url": "enable",
"comment": "This is a test IPS sensor",
"dynamic_sort_subtable": "false",
"entries": [
{
"action": "pass",
"application": "all",
"cve": [],
"default_action": "pass",
"default_status": "enable",
"exempt_ip": [ <---------- This exampt_ip had to be deleted during the last apply, but it still exist
{
"dst_ip": "10.0.1.0 255.255.255.224",
"id": 1,
"src_ip": "10.0.1.10 255.255.255.255"
},
{
"dst_ip": "10.0.1.13 255.255.255.255",
"id": 2,
"src_ip": "10.0.13.16 255.255.255.240"
}
],
"id": 1,
"last_modified": "",
"location": "all",
"log": "enable",
"log_attack_context": "enable",
"log_packet": "disable",
"os": "Linux BSD", <----------- Must be changed to "BSD Linux"
"protocol": "all",
"quarantine": "none",
"quarantine_expiry": "1h",
"quarantine_log": "disable",
"rate_count": 0,
"rate_duration": 60,
"rate_mode": "continuous",
"rate_track": "none",
"rule": [],
"severity": "all",
"status": "enable",
"vuln_type": [
{
"id": 11
},
{
"id": 12
}
]
},
{
"action": "reset",
"application": "Oracle MSSQL MySQL DB2 PostgreSQL", <------- Must be changed to "DB2 MSSQL MySQL Oracle PostgreSQL"
"cve": [],
"default_action": "pass",
"default_status": "enable",
"exempt_ip": [],
"id": 2,
"last_modified": "",
"location": "server",
"log": "enable",
"log_attack_context": "enable",
"log_packet": "disable",
"os": "Linux",
"protocol": "MSSQL SSH SSL",
"quarantine": "attacker",
"quarantine_expiry": "1h",
"quarantine_log": "enable",
"rate_count": 0,
"rate_duration": 60,
"rate_mode": "continuous",
"rate_track": "none",
"rule": [],
"severity": "high critical", <--------- Must be changed to "critical high"
"status": "enable",
"vuln_type": []
}
I tried to use update_if_exist = true, but regretfully, nothing happened. Is it a bug or I missed something? Thanks in advance
Hi there,
I've faced the issue when changes for ips sensor entries (at least, for "os" "severity" "application" & "exampt_ip" variables) in "fortios_ips_sensor" terraform resource don't record into the terraform state file.
Terraform: 1.15.5
Provider: 1.24.1
FortiOS: 7.4.12
What's going wrong.
At apply stage terraform says:
After "apply", the terraform state contains the same values as they were before "apply" command:
I tried to use update_if_exist = true, but regretfully, nothing happened. Is it a bug or I missed something? Thanks in advance