Skip to content

Commit 97f254f

Browse files
authored
Merge pull request #698 from microsoft/geearl/7547-credential-lifetime-hotfix-3
Geearl/7547 credential lifetime hotfix 3
2 parents 97252b1 + 2dee8ee commit 97f254f

File tree

15 files changed

+43
-13
lines changed

15 files changed

+43
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ functional-tests: extract-env ## Run functional tests to check the processing pi
6565
@./scripts/functional-tests.sh
6666

6767
run-migration: ## Migrate from BICEP to Terraform
68-
python ./scripts/merge-databases.py
68+
python ./scripts/merge-databases.py

docs/deployment/deployment.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ ENABLE_CUSTOMER_USAGE_ATTRIBUTION <br>CUSTOMER_USAGE_ATTRIBUTION_ID | No | By de
8181
ENABLE_DEV_CODE | No | Defaults to `false`. It is not recommended to enable this flag, it is for development testing scenarios only.
8282
APPLICATION_TITLE | No | Defaults to "". Providing a value for this parameter will replace the Information Assistant's title in the black banner at the top of the UX.
8383
MAX_CSV_FILE_SIZE | Yes | Defaults to 20. This value limits the size of CSV files in MBs that will be supported for upload in the Tabular Data Assistant UX feature.
84+
PASSWORD_LIFETIME | No | Defaults to 365. The number of days that passwords associated with created identities are set to expire after creation. Change this setting if needed to conform to you policy requirements
85+
8486

8587
## Log into Azure using the Azure CLI
8688

docs/images/app_registration.png

82.1 KB
Loading
79.9 KB
Loading

docs/knownissues.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,18 @@ Image search is currently only supported with regions that support dense caption
206206
### Solution
207207
These are only in the Logic App Preview Designer. Switching to the Generally Available Designer will resolve these errors. They are purely visual errors in the Preview Designer and have no impact on how the Logic App functions.
208208
209-
![Image of Logic App Error](./images/sharepoint-preview-designer-known-issue.png)
209+
![Image of Logic App Error](./images/sharepoint-preview-designer-known-issue.png)
210+
211+
---
212+
213+
## Error: CredentialInvalidLifetimeAsPerAppPolicy: Credential lifetime exceeds the max value allowed as per assigned
214+
### Solution
215+
Your organization's policy places a limit on the lifetime of an identities password. In your copy of Local.env there is a setting called PASSWORD_LIFETIME. This value is used when creating or updating the identity password and has a default value of the number of days the password will exist before expiring. Change this value to a number of days that your organization allows.
216+
217+
To view the value after deploying go the Microsoft Entra ID page from the Azure Portal home page. Then search your tenant for infoasst_mgmt_access_<your-5-character-suffix> as shown in the image below.
218+
219+
![Image of Entra App Registration](./images/credential-lifespan.png)
220+
221+
Next click on the App Registration value, and then the page will open for that applciuation registration. Then select Clients & Secrets from the left menu. You will then see the expiry date of the password that was applied through Terraform.
222+
223+
![Image of Entra App Registration](./images/app_registration.png)

infra/core/aad/entra.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ resource "azuread_application_password" "aad_mgmt_app_password" {
3434
count = var.isInAutomation ? 0 : 1
3535
application_id = azuread_application.aad_mgmt_app[0].id
3636
display_name = "infoasst-mgmt"
37+
end_date_relative = "${var.password_lifetime * 24}h"
3738
}
3839

3940
resource "azuread_service_principal" "aad_mgmt_sp" {

infra/core/aad/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,8 @@ variable "aadMgmtServicePrincipalId" {
3131
variable "aadMgmtClientSecret" {
3232
type = string
3333
sensitive = true
34+
}
35+
36+
variable "password_lifetime" {
37+
type = number
3438
}

infra/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module "entraObjects" {
3030
aadMgmtClientId = var.aadMgmtClientId
3131
aadMgmtServicePrincipalId = var.aadMgmtServicePrincipalId
3232
aadMgmtClientSecret = var.aadMgmtClientSecret
33+
password_lifetime = var.password_lifetime
3334
}
3435

3536
module "logging" {

infra/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,14 @@ variable "enableDevCode" {
497497
type = bool
498498
default = false
499499
}
500+
500501
variable "maxCsvFileSize" {
501502
type = string
502503
default = "20"
504+
}
505+
506+
variable "password_lifetime" {
507+
type = number
508+
default = 365
509+
description = "The number of days used as the lifetime for passwords"
503510
}

scripts/environments/local.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,7 @@ export ENABLE_DEV_CODE=false
145145

146146
# If you are deploying the solution with the ability to use the Tabular Data Assistant feature, you can set the following values to configure max file size of csv files to be uploaded.
147147
export MAX_CSV_FILE_SIZE="20" #default is 20MB
148+
149+
# A value used in terraform deployment to set the expiry of passwords measure in days.
150+
# Change this setting if needed to conform to you policy requirements
151+
export PASSWORD_LIFETIME=365

0 commit comments

Comments
 (0)