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

[build] Refactor URLs used with dget #13302

Closed
wants to merge 2 commits into from

Conversation

guillaumelambert
Copy link
Contributor

@guillaumelambert guillaumelambert commented Jan 8, 2023

  • Use HTTPS in all dget URLs

dget retrieves sources and signatures to build deb packages from a URL poiting to a DSC file.
The use of HTTPS is preferable to identify server endpoints and avoid potential MITM attacks.

  • Use debian DSC file rather than launchpad for bash 5.1-2 and net-smp 5.9 & 5.7.3

All other calls to dget use debian URLs rather than launchpad.
It is logical since the target is to produce deb packages for debian systems and not Ubuntu.

Relates issue
#13281
Related PR
#13288

Which release branch to backport (provide reason below if selected)

all releases using these URLs

Description for the changelog

[build] Refactor URLs used with dget

A picture of a cute animal (not mandatory but encouraged)

   .___,   
___('v')___
`"-\._./-"'
    ^ ^   

@guillaumelambert
Copy link
Contributor Author

@saiarcot895 FYI

All other calls to dget use debian URLs rather than launchpad.
It is logical since the target is to produce deb packages for debian
systems and not Ubuntu.

Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
dget retrieves sources and signatures to build deb packages
from a URL poiting to a DSC file.
The use of HTTPS is preferable to identify server endpoints
and avoid potential MITM attacks.

Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
guillaumelambert added a commit to guillaumelambert/sonic-buildimage that referenced this pull request Jan 13, 2023
- create an a apt alternate configuration directory during 'make init'
- use 'apt-get source' instead of dget in makefiles
- adapt packages versions accordingly in rules/XX.mk files

SONiC images compilation is currently designed to be performed with a
non-root user under Ubuntu systems.
As a result, there is no guarantee that debian repos are declared in
/etc/apt/sources.list on the Ubuntu host system used.
Although for this reason 'apt-get source' can not be directly used
(out of the box) to that purpose, the build process recompiles packages
for various GNU+Linux Debian distributions.
And the packages sources used are retrieved from more or less official
repositories since the current solution in SONiC is to use dget and URLs
from various locations.
As discussed in the following URL
https://serverfault.com/questions/447457/use-apt-get-source-on-a-debian-repo-without-using-etc-apt-source-list
this is the simplest solution but it has several drawbacks from a
maintenance and security standpoint, for example :
* maintaining manually these URLS since they can be removed by external
  sites owners
sonic-net#13281
* potential loose authentication of packages sources
sonic-net#13302

A more complex solution is prosposed (on the same URL) and adress these
drawbacks by using an alternate apt configuration directory that is writable
by non-root user. It allows here to:
* identify packages sources with official Debian Keyring GPG signatures
* use 'apt-get source <pkgsrc_name>' to retrieve packages without maintaining
  several specific URLs
* in a next step use 'apt-cache showsrc <pkgsrc_name>' to retrieve a
  list of available versions to ckeck packages availability during the
  'make init' phase

Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
@guillaumelambert
Copy link
Contributor Author

guillaumelambert commented Jan 16, 2023

superseded by #13381

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.

1 participant