Skip to content

Commit 768de21

Browse files
authored
Revert "feat(Cloud Databases): Update Database Password Complexity Validation…" (#5880)
This reverts commit 03009cb.
1 parent 556dab7 commit 768de21

14 files changed

+144
-167
lines changed

.secrets.baseline

+24-40
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.mod|go.sum|.*.map|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2024-12-12T19:51:17Z",
6+
"generated_at": "2024-12-08T16:17:06Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -842,35 +842,27 @@
842842
"type": "Base64 High Entropy String",
843843
"verified_result": null
844844
},
845-
{
846-
"hashed_secret": "1f7e33de15e22de9d2eaf502df284ed25ca40018",
847-
"is_secret": false,
848-
"is_verified": false,
849-
"line_number": 1581,
850-
"type": "Secret Keyword",
851-
"verified_result": null
852-
},
853845
{
854846
"hashed_secret": "1f614c2eb6b3da22d89bd1b9fd47d7cb7c8fc670",
855847
"is_secret": false,
856848
"is_verified": false,
857-
"line_number": 3550,
849+
"line_number": 3540,
858850
"type": "Secret Keyword",
859851
"verified_result": null
860852
},
861853
{
862854
"hashed_secret": "7abfce65b8504403afc25c9790f358d513dfbcc6",
863855
"is_secret": false,
864856
"is_verified": false,
865-
"line_number": 3563,
857+
"line_number": 3553,
866858
"type": "Secret Keyword",
867859
"verified_result": null
868860
},
869861
{
870862
"hashed_secret": "0c2d85bf9a9b1579b16f220a4ea8c3d62b2e24b1",
871863
"is_secret": false,
872864
"is_verified": false,
873-
"line_number": 3604,
865+
"line_number": 3594,
874866
"type": "Secret Keyword",
875867
"verified_result": null
876868
}
@@ -2138,30 +2130,30 @@
21382130
"hashed_secret": "deab23f996709b4e3d14e5499d1cc2de677bfaa8",
21392131
"is_secret": false,
21402132
"is_verified": false,
2141-
"line_number": 1311,
2133+
"line_number": 1373,
21422134
"type": "Secret Keyword",
21432135
"verified_result": null
21442136
},
21452137
{
21462138
"hashed_secret": "20a25bac21219ffff1904bde871ded4027eca2f8",
21472139
"is_secret": false,
21482140
"is_verified": false,
2149-
"line_number": 1912,
2141+
"line_number": 1974,
21502142
"type": "Secret Keyword",
21512143
"verified_result": null
21522144
},
21532145
{
21542146
"hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f",
21552147
"is_secret": false,
21562148
"is_verified": false,
2157-
"line_number": 1931,
2149+
"line_number": 1993,
21582150
"type": "Secret Keyword",
21592151
"verified_result": null
21602152
}
21612153
],
21622154
"ibm/service/database/resource_ibm_database_edb_test.go": [
21632155
{
2164-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2156+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
21652157
"is_secret": false,
21662158
"is_verified": false,
21672159
"line_number": 278,
@@ -2171,7 +2163,7 @@
21712163
],
21722164
"ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go": [
21732165
{
2174-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2166+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
21752167
"is_secret": false,
21762168
"is_verified": false,
21772169
"line_number": 773,
@@ -2181,7 +2173,7 @@
21812173
],
21822174
"ibm/service/database/resource_ibm_database_elasticsearch_test.go": [
21832175
{
2184-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2176+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
21852177
"is_secret": false,
21862178
"is_verified": false,
21872179
"line_number": 819,
@@ -2191,7 +2183,7 @@
21912183
],
21922184
"ibm/service/database/resource_ibm_database_etcd_test.go": [
21932185
{
2194-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2186+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
21952187
"is_secret": false,
21962188
"is_verified": false,
21972189
"line_number": 209,
@@ -2201,15 +2193,15 @@
22012193
],
22022194
"ibm/service/database/resource_ibm_database_mongodb_enterprise_test.go": [
22032195
{
2204-
"hashed_secret": "74f75c4c7dc7e33193565dc5c56b7ab6f72db4df",
2196+
"hashed_secret": "8cbbbfad0206e5953901f679b0d26d583c4f5ffe",
22052197
"is_secret": false,
22062198
"is_verified": false,
22072199
"line_number": 253,
22082200
"type": "Secret Keyword",
22092201
"verified_result": null
22102202
},
22112203
{
2212-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2204+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
22132205
"is_secret": false,
22142206
"is_verified": false,
22152207
"line_number": 318,
@@ -2227,7 +2219,7 @@
22272219
"verified_result": null
22282220
},
22292221
{
2230-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2222+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
22312223
"is_secret": false,
22322224
"is_verified": false,
22332225
"line_number": 179,
@@ -2237,7 +2229,7 @@
22372229
],
22382230
"ibm/service/database/resource_ibm_database_mongodb_test.go": [
22392231
{
2240-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2232+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
22412233
"is_secret": false,
22422234
"is_verified": false,
22432235
"line_number": 213,
@@ -2247,7 +2239,7 @@
22472239
],
22482240
"ibm/service/database/resource_ibm_database_mysql_test.go": [
22492241
{
2250-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2242+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
22512243
"is_secret": false,
22522244
"is_verified": false,
22532245
"line_number": 251,
@@ -2265,7 +2257,7 @@
22652257
"verified_result": null
22662258
},
22672259
{
2268-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2260+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
22692261
"is_secret": false,
22702262
"is_verified": false,
22712263
"line_number": 568,
@@ -2275,7 +2267,7 @@
22752267
],
22762268
"ibm/service/database/resource_ibm_database_rabbitmq_test.go": [
22772269
{
2278-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2270+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
22792271
"is_secret": false,
22802272
"is_verified": false,
22812273
"line_number": 224,
@@ -2285,7 +2277,7 @@
22852277
],
22862278
"ibm/service/database/resource_ibm_database_redis_test.go": [
22872279
{
2288-
"hashed_secret": "6c6728efbf3da1eadeb8c21e829d70f6dfd4bf8d",
2280+
"hashed_secret": "2317aa72dafa0a07f05af47baa2e388f95dcf6f3",
22892281
"is_secret": false,
22902282
"is_verified": false,
22912283
"line_number": 280,
@@ -2311,7 +2303,7 @@
23112303
"verified_result": null
23122304
},
23132305
{
2314-
"hashed_secret": "92ec408a50ecf51d35e7d26656a9372e50c06a07",
2306+
"hashed_secret": "d67007844d8f7fbc45ea3b27c4bea0bffafb53a0",
23152307
"is_secret": false,
23162308
"is_verified": false,
23172309
"line_number": 30,
@@ -2327,23 +2319,15 @@
23272319
"verified_result": null
23282320
},
23292321
{
2330-
"hashed_secret": "2ca8c980f5947600f2749adb4f177fd357d2df53",
2331-
"is_secret": false,
2332-
"is_verified": false,
2333-
"line_number": 46,
2334-
"type": "Secret Keyword",
2335-
"verified_result": null
2336-
},
2337-
{
2338-
"hashed_secret": "64034663b9f3ba170ea9281f5e833f93b55f91a1",
2322+
"hashed_secret": "dad6fac3e5b6be7bb6f274970b4c50739a7e26ee",
23392323
"is_secret": false,
23402324
"is_verified": false,
23412325
"line_number": 62,
23422326
"type": "Secret Keyword",
23432327
"verified_result": null
23442328
},
23452329
{
2346-
"hashed_secret": "74f75c4c7dc7e33193565dc5c56b7ab6f72db4df",
2330+
"hashed_secret": "8cbbbfad0206e5953901f679b0d26d583c4f5ffe",
23472331
"is_secret": false,
23482332
"is_verified": false,
23492333
"line_number": 70,
@@ -2370,15 +2354,15 @@
23702354
"hashed_secret": "1f5e25be9b575e9f5d39c82dfd1d9f4d73f1975c",
23712355
"is_secret": false,
23722356
"is_verified": false,
2373-
"line_number": 166,
2357+
"line_number": 165,
23742358
"type": "Secret Keyword",
23752359
"verified_result": null
23762360
},
23772361
{
23782362
"hashed_secret": "e03932ac8a17ed1819fe161fd253bf323e0e3ec9",
23792363
"is_secret": false,
23802364
"is_verified": false,
2381-
"line_number": 175,
2365+
"line_number": 174,
23822366
"type": "Secret Keyword",
23832367
"verified_result": null
23842368
}

ibm/service/database/resource_ibm_database.go

+5-10
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func ResourceIBMDatabaseInstance() *schema.Resource {
215215
Type: schema.TypeString,
216216
Optional: true,
217217
ValidateFunc: validation.All(
218-
validation.StringLenBetween(15, 72),
218+
validation.StringLenBetween(15, 32),
219219
DatabaseUserPasswordValidator("database"),
220220
),
221221
Sensitive: true,
@@ -1908,7 +1908,7 @@ func resourceIBMDatabaseInstanceUpdate(context context.Context, d *schema.Resour
19081908
if group.CPU != nil && group.CPU.Allocation*nodeCount != currentGroup.CPU.Allocation {
19091909
groupScaling.CPU = &clouddatabasesv5.GroupScalingCPU{AllocationCount: core.Int64Ptr(int64(group.CPU.Allocation * nodeCount))}
19101910
}
1911-
if group.HostFlavor != nil {
1911+
if group.HostFlavor != nil && group.HostFlavor.ID != currentGroup.HostFlavor.ID {
19121912
groupScaling.HostFlavor = &clouddatabasesv5.GroupScalingHostFlavor{ID: core.StringPtr(group.HostFlavor.ID)}
19131913
}
19141914

@@ -3295,8 +3295,7 @@ func (u *DatabaseUser) ValidatePassword() (err error) {
32953295

32963296
var allowedCharacters = regexp.MustCompile(fmt.Sprintf("^(?:[a-zA-Z0-9]|%s)+$", specialCharPattern))
32973297
var beginWithSpecialChar = regexp.MustCompile(fmt.Sprintf("^(?:%s)", specialCharPattern))
3298-
var containsLower = regexp.MustCompile("[a-z]")
3299-
var containsUpper = regexp.MustCompile("[A-Z]")
3298+
var containsLetter = regexp.MustCompile("[a-zA-Z]")
33003299
var containsNumber = regexp.MustCompile("[0-9]")
33013300
var containsSpecialChar = regexp.MustCompile(fmt.Sprintf("(?:%s)", specialCharPattern))
33023301

@@ -3310,12 +3309,8 @@ func (u *DatabaseUser) ValidatePassword() (err error) {
33103309
"password must not begin with a special character (%s)", specialChars))
33113310
}
33123311

3313-
if !containsLower.MatchString(u.Password) {
3314-
errs = append(errs, errors.New("password must contain at least one lower case letter"))
3315-
}
3316-
3317-
if !containsUpper.MatchString(u.Password) {
3318-
errs = append(errs, errors.New("password must contain at least one upper case letter"))
3312+
if !containsLetter.MatchString(u.Password) {
3313+
errs = append(errs, errors.New("password must contain at least one letter"))
33193314
}
33203315

33213316
if !containsNumber.MatchString(u.Password) {

ibm/service/database/resource_ibm_database_edb_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func testAccCheckIBMDatabaseInstanceEDBBasic(databaseResourceGroup string, name
185185
service = "databases-for-enterprisedb"
186186
plan = "standard"
187187
location = "%[3]s"
188-
adminpassword = "secure-Password12345"
188+
adminpassword = "password12345678"
189189
group {
190190
group_id = "member"
191191
host_flavor {
@@ -199,7 +199,7 @@ func testAccCheckIBMDatabaseInstanceEDBBasic(databaseResourceGroup string, name
199199
tags = ["one:two"]
200200
users {
201201
name = "user123"
202-
password = "secure-Password12345"
202+
password = "password12345678"
203203
}
204204
allowlist {
205205
address = "172.168.1.2/32"
@@ -226,7 +226,7 @@ func testAccCheckIBMDatabaseInstanceEDBFullyspecified(databaseResourceGroup stri
226226
service = "databases-for-enterprisedb"
227227
plan = "standard"
228228
location = "%[3]s"
229-
adminpassword = "secure-Password12345"
229+
adminpassword = "password12345678"
230230
group {
231231
group_id = "member"
232232
host_flavor {
@@ -240,11 +240,11 @@ func testAccCheckIBMDatabaseInstanceEDBFullyspecified(databaseResourceGroup stri
240240
tags = ["one:two"]
241241
users {
242242
name = "user123"
243-
password = "secure-Password12345"
243+
password = "password12345678"
244244
}
245245
users {
246246
name = "user124"
247-
password = "secure-Password12345"
247+
password = "password12345678"
248248
}
249249
allowlist {
250250
address = "172.168.1.2/32"
@@ -275,7 +275,7 @@ func testAccCheckIBMDatabaseInstanceEDBReduced(databaseResourceGroup string, nam
275275
service = "databases-for-enterprisedb"
276276
plan = "standard"
277277
location = "%[3]s"
278-
adminpassword = "secure-Password12345"
278+
adminpassword = "password12345678"
279279
group {
280280
group_id = "member"
281281
host_flavor {

0 commit comments

Comments
 (0)