From 8a3a155f01415e110adf1aad32f54e778c0026d5 Mon Sep 17 00:00:00 2001 From: Oli Passey Date: Thu, 19 Dec 2024 16:59:12 +0000 Subject: [PATCH 1/3] Create .env --- .env | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..54026cf --- /dev/null +++ b/.env @@ -0,0 +1,18 @@ +# Azure/SharePoint Credentials +AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +AZURE_CLIENT_SECRET=SECRET +AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +EXCEL_FILE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +USER_EMAIL=x@xx.xxx + +# SMTP Settings +SMTP_SERVER=email-smtp.eu-west-1.amazonaws.com +SMTP_PORT=587 +SMTP_USERNAME=USER +SMTP_PASSWORD=PASSWORD +FROM_EMAIL=no-reply@domain.tld +FROM_NAME=Azure Secret Expiry Bot +TO_EMAIL=x@xx.xxx + +# Teams Webhook Settings +TEAMS_WEBHOOK_URL=your-teams-webhook-url From 027f023ff534d84207c69ba6d21d1ad6ccd935b7 Mon Sep 17 00:00:00 2001 From: Oli Passey Date: Thu, 19 Dec 2024 17:49:11 +0000 Subject: [PATCH 2/3] Update README.md --- README.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 23a7ec2..6706f44 100644 --- a/README.md +++ b/README.md @@ -1 +1,35 @@ -# AzAppRegistrationExpiry \ No newline at end of file +# AzAppRegistrationExpiry + +A simple python app to warn of upcoming App Registration Secret / Password Expiry on Azure Entra ID. + +## Installation + +Requires Python 3.12 +Install requirements from requirements.txt + +```bash +pip install -r requirements.txt +``` + +## Usage + +Amend the credentials in .env to match your environment. +You will need to create an App Registration with API Permissions: +- Application.ReadWrite.All +- Files.ReadWrite.All +- Sites.ReadWrite.All +- User.Read +- User.Read.All + +Create an Excel Sheet within Business OneDrive and add the ID to the .env file +Add SMTP Sending details to .env (AWS Simple E-Mail Service was used in development) + + +```python +python main.py +``` + +## Contributing + +Pull requests are welcome. For major changes, please open an issue first +to discuss what you would like to change. From 4a6b5b464eb9100e32bbbcab942c6e98ef0c40cf Mon Sep 17 00:00:00 2001 From: Oli Passey Date: Thu, 19 Dec 2024 17:51:12 +0000 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6706f44..23ddbc5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You will need to create an App Registration with API Permissions: - User.Read - User.Read.All -Create an Excel Sheet within Business OneDrive and add the ID to the .env file +Create an Excel Sheet within Business OneDrive and add the ID to the .env file (sourcedoc=xxx in the URL) Add SMTP Sending details to .env (AWS Simple E-Mail Service was used in development)