34 C
Dubai
Saturday, April 26, 2025
Home Blog Page 14

Optimize Antispam Settings in Microsoft 365

Let’s see how to optimize anti-spam settings in Microsoft 365. Anti-spam settings can be modified from the protection portal of Microsoft 365. By default, this service is available for all Exchange online users.

Login to https://security.microsoft.com

Inbound Policy

Spam Properties –  Increase Spam Core – Turned on below.

  • Number of IP Addresses in URL
  • URL to biz or info websites
  • URL Redirect to other Port

Spam Properties –  Mark as Spam  – Turned on below.

  • Embed tags in HTML
  • JavaScript or VBScript in HTML
  • Form Tags in HTML
  • Frame or IFrame Tags in HTML
  • Web bugs in HTML
  • Object tags in HTML
  • Apply sensitive words list.
  • SPF Record Hard fail
  • Conditional Sender ID filtering – Hard Fail.
  • NDR Backscatter.
.
.
.

Default Spam Filter Policy – Edit Policy –

Spam and Bulk actions –

  • Spam
  • High Confidence Spam
  • Phishing Email
  • Bulk Email

All Set to – Move Message to Junk Email Folder

So that all sort of emails are in the junk. As this specific org doesn’t want to release email from quarantine. Please set as per the organization needs.

.

Outbound Policy

.
.
.
.

So far these settings have worked out for me very well , have applied the same in few office 365 tenants.

Deploy Bitnami WordPress using Docker Compose in Azure App Service

Docker Compose is a powerful tool for defining and running multi-container Docker applications, and it can be used to deploy applications on Azure App Service. With Docker Compose, you can define a complete application stack, including containers for the application itself, its dependencies, and any other services needed to function. By using Docker Compose to define the application stack, you can ensure that the application runs consistently across different environments, making it easier to move the application between different cloud providers or between development, staging, and production environments.

Simplified Deployment: Docker Compose provides a simple way to define and deploy multi-container applications, making deploying and managing Bitnami WordPress in App Service easier.

Consistent Environment: Docker Compose ensures that Bitnami WordPress and its dependencies run in a consistent environment, regardless of the underlying host operating system or hardware.

Portability: Docker Compose enables you to define the application stack in a portable way, allowing you to move the application between different environments or cloud providers easily.

Scalability: Docker Compose makes it easy to scale the Bitnami WordPress deployment by adding or removing containers as needed, enabling the application to handle increased traffic or workload.

Isolation: Docker Compose allows you to isolate the Bitnami WordPress application and its dependencies from the host operating system and other applications, improving security and stability.

Easy Updates: Docker Compose lets you easily update the Bitnami WordPress application and its dependencies to the latest version without affecting other applications running on the same host.

Resource Efficiency: Docker Compose enables you to optimize resource utilization by running multiple containers on the same host, reducing costs and improving performance.

.

Paste this yaml file in the config location of the Azure App service and save it.

version: '2'
services:
  mariadb:
    image: docker.io/bitnami/mariadb:latest
    volumes:
      - 'mariadb_data:/bitnami/mariadb'
    environment:
      - MARIADB_USER=bn_wordpress
      - MARIADB_ROOT_PASSWORD=bn_123
      - MARIADB_PASSWORD=bn_123
      - MARIADB_DATABASE=bitnami_wordpress
  wordpress:
    image: docker.io/bitnami/wordpress:latest
    ports:
      - '80:8080'
      - '443:8443'
    volumes:
      - 'wordpress_data:/bitnami/wordpress'
    depends_on:
      - mariadb
    environment:
      - WORDPRESS_USERNAME=wp.admin
      - WORDPRESS_PASSWORD=Password123
      - WORDPRESS_DATABASE_HOST=mariadb
      - WORDPRESS_DATABASE_PORT_NUMBER=3306
      - WORDPRESS_DATABASE_USER=bn_wordpress
      - WORDPRESS_DATABASE_NAME=bitnami_wordpress
      - WORDPRESS_DATABASE_PASSWORD=bn_123
      - WORDPRESS_PLUGINS=all
volumes:
  mariadb_data:
    driver: local
  wordpress_data:
    driver: local

.

.

.

Login with the credentials specified in the YAML file.

Custom Bitlocker Role to Read Recovery Keys in Azure

Custom Bit locker Role to Read Recovery Keys only through administrative units. So that the frontline team can access recover keys only and not do anything else with the devices.

microsoft.directory/bitlockerKeys/key/read

Remote Backend State for Terraform stored in Azure Storage

Let’s see how to create a remote state in a storage account for terraform So that Azure DevOps Pipelines can utilize them.

Create a Storage Account

Leave things default

Leave things default

Enable Versioning for blobs.


Create Storage Account

Create Container named tfstatefiles

Created Service Connections

Update terraform with backend.tf

Terraform – Visual Studio Marketplace

Install Terraform DevOps Extensions

Make sure it runs on Azure Pipelines agent – like ubuntu

Apply

if you are using .tfvars

You can see the state file gets locked

File Server Folder,Groups,Permissions Script

Download Script

What the script Does –

Task 1 –

  • It Creates Folder
  • It creates an Active Directory Group Folder_R  (Read Groups)
  • It creates an Active Directory Group Folder_W  (Write Groups)
  • Notes Field Updated with Service Request
  • Managed By Field is Updated with the folder owner
image

Yo have the Groups Created.

image

Notes Updated in the Group

image

Sets the Managed By Attribute

image

Current Folder Permission –

image

Task 2 –

  • Removes Root Folder Inheritance
  • Remove Access of BUILTIN\Users from the Folder
  • Places a Deny Permission for FolderName_W Groups so they cannot delete the root folder.
  • Add OWNER RIGHTS
  • Provides Read permission on the folder for FolderName_R group.
  • Provides Write permission on the folder for FolderName_W group.
image
image

Things to be updated in the Script –

  • Folder Paths

Do Proper Testing. Permissions are Scary. Use it wisely with proper Knowledge of the environment.

Run it on LAB before being run on production.

Download Script

Download Script

  • Using SamAccount Name to Remove Folders from FileServer

  • Invoking Scripts from Different Servers

Deploy Azure App Service and MySQL with Private DNS Zone using Reusable Terraform Modules

We will deploy the resources below using Terraform reusable modules utilizing the Azure landing zone concept, part of the Cloud Adoption Framework (CAF). In this setup, we are talking about only infra resources; if you are new to Terraform, the same concept has been explained using the Azure Portal; I have spoken about Azure Management Groups and Subscription Planning in this link – Azure Management Groups and Subscriptions Design.

Azure landing zone design that accounts for scale, security governance, networking, and identity, which enables seamless application migration, modernization, and innovation at the enterprise scale in Azure. This approach considers all platform resources like infrastructure (Iaas) or platform as a service.

Benefits of Azure Landing Zones –

  • Good Governance ( Like you can place a policy in the overall environment that no internet-exposing storage accounts can be provisioned)
  • Security (Improved Security controls, Network segmentation, Identity management, Service Principals, Managed Identities)
  • Scalability (Multi Datacenter or Improving the design with Virtual WAN should be seamless)
  • Cost Savings (Segregated billing with subscriptions – Overall Control or like can apply Hybrid benefit using policies)

As the requirement to start from small, Azure Firewall or Azure Application Gateway is not consumed in this design

  • Resources Provisioned –

1. Virtual Networks ( 10.51.0.0/16)
2. Linux App Service Plan
3. Linux App Service with PHP 8.0
4. Virtual Network
5. Private DNS Zone

Modules are convenient to place into folders and reuse resource configurations with Terraform for multiple deployments.
Also, changing/upgrading specific resource configurations becomes easier.

Git Hub Repo link –

azure365pro/azure-hub-spoke-terraform (github.com)

Needed Resources –

  • Terraforms latest version is installed.
terraform -version
  • az CLI is installed / az login is completed
az login
  • Git is installed to clone the repository

Let’s clone the repository

git clone "https://github.com/azure365pro/azure-hub-spoke-terraform"

Get inside the repo

cd  .\azure-hub-spoke-terraform\

Rename

main-app-mysql-example.tf to main-app-mysql.tf
uncomment the main-app-mysql.tf file

Remove main.tf

Run Terraform init to create a local tfstate

terraform init

Make sure you are running on the right subscription. If you have access to multiple subscriptions

terraform plan

Now terraform apply command is used to create the resources.

terraform apply

Now terraform destroy command is used to clean up the resources.

terraform destroy

Running the same with Azure DevOps Releases with Muti Stage Approvals

In release pipelines, we utilize stages, triggers, approvers, and deployment options.

Verify Stage with run init/plan

Prod Stage with run init/plan / apply

× How can I help you?