Azure OIDC IP Automation for GitHub Enterprise
Our organization leverages Azure Entra ID to manage federated authentication for critical services, including AWS SSO and our self-hosted GitHub Enterprise i...
Our organization leverages Azure Entra ID to manage federated authentication for critical services, including AWS SSO and our self-hosted GitHub Enterprise instance. We faced a persistent operational challenge where developer access to GitHub Enterprise was frequently blocked. The root cause was the dynamic and non-region-specific nature of the IP addresses used by Azure’s OIDC service, which conflicted with our AWS WAF security rules.
To resolve this, I developed a fully automated solution to dynamically update our WAF rules with Azure’s current IP ranges, ensuring seamless and secure access.
The solution extends our existing Infrastructure as Code (IaC) setup, which is managed in AWS CDK (TypeScript). The core of the project is a Python-based AWS Lambda function that runs when the AWS Pipeline executes.
The automation process works as follows:
<a> tags, and extract the specific URL for the latest JSON file containing the IP address list.AzureCloud service, ensuring we only whitelist the necessary ranges.A key technical hurdle was bypassing the connection blocking on Microsoft’s download page. The server rejected standard programmatic requests, which I resolved by correctly configuring the User-Agent header in my Python script to mimic a legitimate browser session.
Crafting the JQ query was also a valuable learning experience. The complexity of the JSON data required a precise filter to isolate the correct IP ranges without being overly permissive, thereby strengthening my skills in advanced data manipulation.
The result is a robust, serverless function that guarantees our WAF rules are always synchronized with Azure’s active IP addresses.
Our organization leverages Azure Entra ID to manage federated authentication for critical services, including AWS SSO and our self-hosted GitHub Enterprise i...
In our AWS Organization, we relied on a central GitLab instance for shared CI/CD tooling. A key feature was the use of ephemeral, dynamically-created GitLab ...
For a major tech conference, I was tasked with designing and building a self-service tool that allowed attendees to provision their own secure, customized EC...
Hi, I’m Sam! Welcome to my portfolio. I created this site to document and showcase my journey in AWS by building practical, hands-on solutions.