Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulumi: SRE DNS filtering #1566

Merged

Conversation

jemrobinson
Copy link
Member

@jemrobinson jemrobinson commented Aug 22, 2023

✅ Checklist

  • You have given your pull request a meaningful title (e.g. Enable foobar integration rather than 515 foobar).
  • You are targeting the appropriate branch. If you're not certain which one this is, it should be develop.
  • Your branch is up-to-date with the target branch (it probably was when you started, but it may have changed since then).
  • You have marked this pull request as a draft and added '[WIP]' to the title if needed (if you're not yet ready to merge).
  • You have formatted your code using appropriate automated tools (for example ./tests/AutoFormat_Powershell.ps1 -TargetPath <path to file or directory> for Powershell).

⤴️ Summary

  • The easiest way to change the DNS servers for all resources in a virtual network is to change the VNet DHCP settings
  • This means that the DNS server
    • must already exist when the virtual network is created
    • cannot belong to the virtual network
  • Currently this is done by using the SHM DC as the DNS server but since we want to phase this out this PR instead does the following:
    • create a new DNS resource group at the beginning of SRE creation
    • this contains:
      • a virtual network with a single subnet
      • an NSG for that subnet which only allows inbound traffic from this SRE
      • a self-contained container instance (i.e. one that is configured only using environment variables or secrets-mounted-as-files and doesn't need mounted storage)
      • the private DNS zone that used to belong to the SRE
  • With this in place, the SRE virtual network can be peered to the DNS virtual network and use the container as the default DNS server

🌂 Related issues

Closes #1504

🔬 Tests

DNS lookup restrictions are working

Screenshot 2023-08-25 at 17 13 16
  • Cannot access unauthorised TXT record
  • Cannot resolve Google
  • Cannot resolve Google via Azure platform DNS
  • Can resolve SRE nexus server
  • Can resolve Ubuntu keyserver

@jemrobinson jemrobinson changed the title [WIP] SRE DNS filtering SRE DNS filtering Aug 24, 2023
@jemrobinson jemrobinson marked this pull request as ready for review August 24, 2023 20:57
@jemrobinson jemrobinson requested a review from a team August 24, 2023 20:58
@jemrobinson jemrobinson changed the title SRE DNS filtering Pulumi: SRE DNS filtering Aug 24, 2023
@jemrobinson jemrobinson mentioned this pull request Aug 25, 2023
5 tasks
@jemrobinson jemrobinson force-pushed the 1504-dns-filtering branch 3 times, most recently from 0f83f60 to 8e8118a Compare August 25, 2023 16:09
@jemrobinson jemrobinson force-pushed the 1504-dns-filtering branch 2 times, most recently from 1fd4a68 to bb289e3 Compare August 29, 2023 11:53
Copy link
Member

@JimMadge JimMadge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few questions mostly.

data_safe_haven/functions/miscellaneous.py Outdated Show resolved Hide resolved
data_safe_haven/pulumi/components/sre_dns_server.py Outdated Show resolved Hide resolved
data_safe_haven/pulumi/components/sre_dns_server.py Outdated Show resolved Hide resolved
data_safe_haven/pulumi/components/sre_dns_server.py Outdated Show resolved Hide resolved
typings/bcrypt/__init__.pyi Outdated Show resolved Hide resolved
typings/bcrypt/__init__.pyi Outdated Show resolved Hide resolved
@jemrobinson jemrobinson force-pushed the 1504-dns-filtering branch 2 times, most recently from fa492d7 to 774372e Compare August 30, 2023 08:23
@jemrobinson jemrobinson force-pushed the 1504-dns-filtering branch 2 times, most recently from 8267929 to 1562a19 Compare August 30, 2023 08:30
@JimMadge JimMadge merged commit cacd39d into alan-turing-institute:python-migration Aug 30, 2023
6 checks passed
@jemrobinson jemrobinson deleted the 1504-dns-filtering branch April 19, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants