Skip to content

Use Network Isolation-compatible package feeds - #7297

Open
lbussell wants to merge 6 commits into
dotnet:nightlyfrom
lbussell:netiso-package-feeds
Open

Use Network Isolation-compatible package feeds#7297
lbussell wants to merge 6 commits into
dotnet:nightlyfrom
lbussell:netiso-package-feeds

Conversation

@lbussell

@lbussell lbussell commented Jul 22, 2026

Copy link
Copy Markdown
Member

#7295 is not sufficient to unblock builds under network isolation. The pipeline injects the policies no matter what is specified.

This PR:

  • opts in to network isolation
  • adopts package mirrors that are compatible with network isolation while attempting to preserve the base images' original package feeds in the final published images.

Related:

Internal documentation specifying recommended mirrors: Adoption of Central Feed Services

For chisel, we can't use the binaries without canonical/chisel#135. Instead, this PR clones chisel from a pinned commit, patches it, and builds/runs it from source.

lbussell added 3 commits July 23, 2026 09:27
Temporarily substitute approved mirrors during package installation and restore distro-provided sources before each layer completes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a88bab3b-0187-4b71-88ec-23aac86b2ea4
Match the Debian archive prefix before the security suffix so Network Isolation-compatible mirrors serve both package and security metadata.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a88bab3b-0187-4b71-88ec-23aac86b2ea4
Opt the unofficial nightly pipeline into CFSClean, CFSClean2, and CFSClean3 while retaining Permissive for scoped feed remediation testing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a88bab3b-0187-4b71-88ec-23aac86b2ea4
@lbussell
lbussell force-pushed the netiso-package-feeds branch from ad2e8e8 to 7ee706a Compare July 23, 2026 16:42
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a88bab3b-0187-4b71-88ec-23aac86b2ea4
@lbussell
lbussell force-pushed the netiso-package-feeds branch from 7ee706a to 57aa040 Compare July 23, 2026 16:49
lbussell added 2 commits July 23, 2026 14:56
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a88bab3b-0187-4b71-88ec-23aac86b2ea4
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a88bab3b-0187-4b71-88ec-23aac86b2ea4
@lbussell
lbussell marked this pull request as ready for review July 24, 2026 21:22
@lbussell
lbussell requested a review from a team as a code owner July 24, 2026 21:22
RUN __netiso_apt_srcs="$(find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \))" \
&& __netiso_backup_dir="$(mktemp -d)" \
&& for f in $__netiso_apt_srcs; do cp -a --parents "$f" "$__netiso_backup_dir" || exit 1; done \
&& for f in $__netiso_apt_srcs; do sed -E -i 's#([[:space:]/])archive\.ubuntu\.com/ubuntu([[:space:]/-]|$)#\1azure.archive.ubuntu.com/ubuntu\2#g' "$f" || exit 1; done \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This rewrites archive.ubuntu.com but not security.ubuntu.com. Is there a risk that an attempt could be made to hit security.ubuntu.com?

Comment on lines +11 to +12
set ubuntuAptFeed to VARIABLES["apt-mirror|ubuntu|x64|from"] ^
set ubuntuAptMirror to VARIABLES["apt-mirror|ubuntu|x64|to"] ^

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is hardcoding the architecture.

Comment on lines +64 to +66
RUN apt-get update \
&& apt-get install -y --no-install-recommends file \
&& rm -rf /var/lib/apt/lists/*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Presumably this will be hitting deb.debian.org, not the Azure URL.


WORKDIR /src/chisel

ENV CHISEL_BIN="go run ./cmd/chisel"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we also need approved package feeds for Go? This ends up downloading modules.

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