Skip to content

Commit

Permalink
feat(Cloud Databases): Database user password complexity validation (#…
Browse files Browse the repository at this point in the history
…4931)

* feat(Cloud Databases): Database user password complexity validation
* update tests to conform to new complexity rules
* fix password validation edgecases
* add test case for password beginning with special char
* fix regexp
* refactor of db users
* delete and create ops manager users when updating
* validate adminpassword, update docs
  • Loading branch information
alexhemard authored Nov 29, 2023
1 parent 527e569 commit dc6d1a9
Show file tree
Hide file tree
Showing 17 changed files with 678 additions and 332 deletions.
118 changes: 88 additions & 30 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.mod|go.sum|.*.map|^.secrets.baseline$",
"lines": null
},
"generated_at": "2023-11-22T09:50:41Z",
"generated_at": "2023-11-29T02:05:13Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -760,23 +760,23 @@
"hashed_secret": "731438016c5ab94431f61820f35e3ae5f8ad6004",
"is_secret": false,
"is_verified": false,
"line_number": 416,
"line_number": 417,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "12da2e35d6b50c902c014f1ab9e3032650368df7",
"is_secret": false,
"is_verified": false,
"line_number": 422,
"line_number": 423,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "813274ccae5b6b509379ab56982d862f7b5969b6",
"is_secret": false,
"is_verified": false,
"line_number": 1127,
"line_number": 1134,
"type": "Base64 High Entropy String",
"verified_result": null
}
Expand Down Expand Up @@ -864,15 +864,15 @@
"hashed_secret": "c8b6f5ef11b9223ac35a5663975a466ebe7ebba9",
"is_secret": false,
"is_verified": false,
"line_number": 1806,
"line_number": 1807,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "8abf4899c01104241510ba87685ad4de76b0c437",
"is_secret": false,
"is_verified": false,
"line_number": 1812,
"line_number": 1813,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2056,38 +2056,38 @@
"hashed_secret": "deab23f996709b4e3d14e5499d1cc2de677bfaa8",
"is_secret": false,
"is_verified": false,
"line_number": 1357,
"line_number": 1334,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "20a25bac21219ffff1904bde871ded4027eca2f8",
"is_secret": false,
"is_verified": false,
"line_number": 1944,
"line_number": 1923,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f",
"is_secret": false,
"is_verified": false,
"line_number": 1963,
"line_number": 1942,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "1f5e25be9b575e9f5d39c82dfd1d9f4d73f1975c",
"is_secret": false,
"is_verified": false,
"line_number": 2203,
"line_number": 2155,
"type": "Secret Keyword",
"verified_result": null
}
],
"ibm/service/database/resource_ibm_database_cassandra_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 731,
Expand All @@ -2097,7 +2097,7 @@
],
"ibm/service/database/resource_ibm_database_edb_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 205,
Expand All @@ -2107,7 +2107,7 @@
],
"ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 823,
Expand All @@ -2117,7 +2117,7 @@
],
"ibm/service/database/resource_ibm_database_elasticsearch_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 778,
Expand All @@ -2127,7 +2127,7 @@
],
"ibm/service/database/resource_ibm_database_etcd_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 213,
Expand All @@ -2137,15 +2137,15 @@
],
"ibm/service/database/resource_ibm_database_mongodb_enterprise_test.go": [
{
"hashed_secret": "68ab9ef0953865fef0558010a9f7afcef110d5b8",
"hashed_secret": "8cbbbfad0206e5953901f679b0d26d583c4f5ffe",
"is_secret": false,
"is_verified": false,
"line_number": 271,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 336,
Expand All @@ -2163,7 +2163,7 @@
"verified_result": null
},
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 189,
Expand All @@ -2173,7 +2173,7 @@
],
"ibm/service/database/resource_ibm_database_mongodb_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 214,
Expand All @@ -2183,7 +2183,7 @@
],
"ibm/service/database/resource_ibm_database_mysql_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 150,
Expand All @@ -2193,15 +2193,15 @@
],
"ibm/service/database/resource_ibm_database_postgresql_test.go": [
{
"hashed_secret": "e407cbe1c64cadb886be6f42907e2dd1c06ca080",
"hashed_secret": "728e83f156932be9b1dc48a5c3f7a3bfbeeb08ce",
"is_secret": false,
"is_verified": false,
"line_number": 490,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 658,
Expand All @@ -2211,7 +2211,7 @@
],
"ibm/service/database/resource_ibm_database_rabbitmq_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 223,
Expand All @@ -2221,14 +2221,72 @@
],
"ibm/service/database/resource_ibm_database_redis_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 272,
"type": "Secret Keyword",
"verified_result": null
}
],
"ibm/service/database/resource_ibm_database_test.go": [
{
"hashed_secret": "c237978e1983e0caf1c3a84f1c2e72a7fb2981f2",
"is_secret": false,
"is_verified": false,
"line_number": 19,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "d67007844d8f7fbc45ea3b27c4bea0bffafb53a0",
"is_secret": false,
"is_verified": false,
"line_number": 27,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "279fb854eb9fa001b4629518a45c921cfad6d697",
"is_secret": false,
"is_verified": false,
"line_number": 35,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "dad6fac3e5b6be7bb6f274970b4c50739a7e26ee",
"is_secret": false,
"is_verified": false,
"line_number": 59,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "8cbbbfad0206e5953901f679b0d26d583c4f5ffe",
"is_secret": false,
"is_verified": false,
"line_number": 67,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "f5ecb30890399c7b1d1781583478aaa9d0b0c89d",
"is_secret": false,
"is_verified": false,
"line_number": 91,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "6da9eab371358a331c59a76d80a0ffcd589fe3c9",
"is_secret": false,
"is_verified": false,
"line_number": 101,
"type": "Secret Keyword",
"verified_result": null
}
],
"ibm/service/directlink/resource_ibm_dl_provider_gateway_test.go": [
{
"hashed_secret": "a184c8ba0974f2e1da4ca1d71f54e1cf40604335",
Expand Down Expand Up @@ -2758,7 +2816,7 @@
"hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f",
"is_secret": false,
"is_verified": false,
"line_number": 1315,
"line_number": 1326,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -3774,23 +3832,23 @@
"hashed_secret": "f855f5027fd8fdb2df3f6a6f1cf858fffcbedb0c",
"is_secret": false,
"is_verified": false,
"line_number": 96615,
"line_number": 96613,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "5fb0fa884132a8724a8d7cba55853737e442adbd",
"is_secret": false,
"is_verified": false,
"line_number": 119404,
"line_number": 119402,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "1e5c2f367f02e47a8c160cda1cd9d91decbac441",
"is_secret": false,
"is_verified": false,
"line_number": 151612,
"line_number": 151610,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -4267,15 +4325,15 @@
],
"website/docs/r/database.html.markdown": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
"is_secret": false,
"is_verified": false,
"line_number": 494,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e407cbe1c64cadb886be6f42907e2dd1c06ca080",
"hashed_secret": "ddf75a48487b387b1dc328ac0a942377b377c556",
"is_secret": false,
"is_verified": false,
"line_number": 559,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func testAccCheckIbmCodeEngineDomainMappingDestroy(s *terraform.State) error {
func decodeBase64EnvVar(base64Text string, envVar string) string {
decodedText, err := base64.StdEncoding.DecodeString(base64Text)
if err != nil {
fmt.Printf("Error decoding environment variable %s: %s", envVar, err)
// fmt.Errorf("Error decoding environment variable %s: %s", envVar, err)
return ""
}
return string(decodedText)
Expand Down
Loading

0 comments on commit dc6d1a9

Please sign in to comment.