Security improvements in T EX Live Norbert Preining T EX Live - - PowerPoint PPT Presentation

security improvements in t ex live
SMART_READER_LITE
LIVE PREVIEW

Security improvements in T EX Live Norbert Preining T EX Live - - PowerPoint PPT Presentation

Security improvements in T EX Live Norbert Preining T EX Live Team Tug 2016, Toronto T EX Live security 2 Overview status up to (and including) 2015 possible attack vectors integrity and authenticity verification


slide-1
SLIDE 1

Security improvements in T EX Live

Norbert Preining

T EX Live Team Tug 2016, Toronto

slide-2
SLIDE 2

T EX Live security – 2

Overview

▶ status up to (and including) 2015 ▶ possible attack vectors ▶ integrity and authenticity ▶ verification architecture ▶ (non-)distributing GnuGP (and alternatives) ▶ Problems ▶ user experience ▶ key management

slide-3
SLIDE 3

T EX Live security – 3

Status up to 2015

▶ container checksum (md5) is available in the tlpdb

name 12many ... containersize 2100 containermd5 ..... doccontainersize 375404 doccontainermd5 .... ...

▶ but …

  • nly used to restart an interrupted installation

not for tlmgr update nor for normal installation!

slide-4
SLIDE 4

T EX Live security – 3

Status up to 2015

▶ container checksum (md5) is available in the tlpdb

name 12many ... containersize 2100 containermd5 ..... doccontainersize 375404 doccontainermd5 .... ...

▶ but … only used to restart an interrupted installation

not for tlmgr update nor for normal installation!

slide-5
SLIDE 5

T EX Live security – 3

Status up to 2015

▶ container checksum (md5) is available in the tlpdb

name 12many ... containersize 2100 containermd5 ..... doccontainersize 375404 doccontainermd5 .... ...

▶ but … only used to restart an interrupted installation

not for tlmgr update nor for normal installation!

slide-6
SLIDE 6

T EX Live security – 4

Do we need better security?

slide-7
SLIDE 7

T EX Live security – 5

Possible attack vector I

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ enjoy …

Since no checks are done, this is easily possible! Verification of checksums (md5) In tlcritical for a few months before TL2016 was released, but not pushed out to 2015.

slide-8
SLIDE 8

T EX Live security – 5

Possible attack vector I

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ enjoy …

Since no checks are done, this is easily possible! Verification of checksums (md5) In tlcritical for a few months before TL2016 was released, but not pushed out to 2015.

slide-9
SLIDE 9

T EX Live security – 5

Possible attack vector I

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ enjoy …

Since no checks are done, this is easily possible! Verification of checksums (md5) In tlcritical for a few months before TL2016 was released, but not pushed out to 2015.

slide-10
SLIDE 10

T EX Live security – 5

Possible attack vector I

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ enjoy …

Since no checks are done, this is easily possible! Verification of checksums (md5) In tlcritical for a few months before TL2016 was released, but not pushed out to 2015.

slide-11
SLIDE 11

T EX Live security – 5

Possible attack vector I

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ enjoy …

Since no checks are done, this is easily possible! Verification of checksums (md5) In tlcritical for a few months before TL2016 was released, but not pushed out to 2015.

slide-12
SLIDE 12

T EX Live security – 6

Possible attack vectors II

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ adjust the container that the MD5 sum does not change

(possible!)

▶ enjoy …

No counter measures up to T EX Live 2015!

slide-13
SLIDE 13

T EX Live security – 6

Possible attack vectors II

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ adjust the container that the MD5 sum does not change

(possible!)

▶ enjoy …

No counter measures up to T EX Live 2015!

slide-14
SLIDE 14

T EX Live security – 6

Possible attack vectors II

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ adjust the container that the MD5 sum does not change

(possible!)

▶ enjoy …

No counter measures up to T EX Live 2015!

slide-15
SLIDE 15

T EX Live security – 6

Possible attack vectors II

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ adjust the container that the MD5 sum does not change

(possible!)

▶ enjoy …

No counter measures up to T EX Live 2015!

slide-16
SLIDE 16

T EX Live security – 6

Possible attack vectors II

▶ compromise one ctan mirror ▶ exchange pdftex binary with one shipping a crypto-virus ▶ adjust the container that the MD5 sum does not change

(possible!)

▶ enjoy …

No counter measures up to T EX Live 2015!

slide-17
SLIDE 17

T EX Live security – 7

Possible attack vector III

▶ compromise one ctan mirror (or setup one yourself, get good

connections and many users)

▶ exchange pdftex binary as before ▶ adjust the checksum in the tlpdb file ▶ enjoy …

No counter measures up to T EX Live 2015!

slide-18
SLIDE 18

T EX Live security – 7

Possible attack vector III

▶ compromise one ctan mirror (or setup one yourself, get good

connections and many users)

▶ exchange pdftex binary as before ▶ adjust the checksum in the tlpdb file ▶ enjoy …

No counter measures up to T EX Live 2015!

slide-19
SLIDE 19

T EX Live security – 7

Possible attack vector III

▶ compromise one ctan mirror (or setup one yourself, get good

connections and many users)

▶ exchange pdftex binary as before ▶ adjust the checksum in the tlpdb file ▶ enjoy …

No counter measures up to T EX Live 2015!

slide-20
SLIDE 20

T EX Live security – 7

Possible attack vector III

▶ compromise one ctan mirror (or setup one yourself, get good

connections and many users)

▶ exchange pdftex binary as before ▶ adjust the checksum in the tlpdb file ▶ enjoy …

No counter measures up to T EX Live 2015!

slide-21
SLIDE 21

T EX Live security – 7

Possible attack vector III

▶ compromise one ctan mirror (or setup one yourself, get good

connections and many users)

▶ exchange pdftex binary as before ▶ adjust the checksum in the tlpdb file ▶ enjoy …

No counter measures up to T EX Live 2015!

slide-22
SLIDE 22

T EX Live security – 8

Integrity and authenticity

Integrity

Need to check the integrity of the downloaded packages – prevent tampering. md5 is not strong, can be tampered – switch to sha512

Authenticity

Verify that the packages are actually the ones from us (T EX Live Team). Cryptographic signatures

slide-23
SLIDE 23

T EX Live security – 8

Integrity and authenticity

Integrity

Need to check the integrity of the downloaded packages – prevent tampering. md5 is not strong, can be tampered – switch to sha512

Authenticity

Verify that the packages are actually the ones from us (T EX Live Team). Cryptographic signatures

slide-24
SLIDE 24

T EX Live security – 8

Integrity and authenticity

Integrity

Need to check the integrity of the downloaded packages – prevent tampering. md5 is not strong, can be tampered – switch to sha512

Authenticity

Verify that the packages are actually the ones from us (T EX Live Team). Cryptographic signatures

slide-25
SLIDE 25

T EX Live security – 8

Integrity and authenticity

Integrity

Need to check the integrity of the downloaded packages – prevent tampering. md5 is not strong, can be tampered – switch to sha512

Authenticity

Verify that the packages are actually the ones from us (T EX Live Team). Cryptographic signatures

slide-26
SLIDE 26

T EX Live security – 8

Integrity and authenticity

Integrity

Need to check the integrity of the downloaded packages – prevent tampering. md5 is not strong, can be tampered – switch to sha512

Authenticity

Verify that the packages are actually the ones from us (T EX Live Team). Cryptographic signatures

slide-27
SLIDE 27

T EX Live security – 8

Integrity and authenticity

Integrity

Need to check the integrity of the downloaded packages – prevent tampering. md5 is not strong, can be tampered – switch to sha512

Authenticity

Verify that the packages are actually the ones from us (T EX Live Team). Cryptographic signatures

slide-28
SLIDE 28

T EX Live security – 9

Verification architecture – overview

tlmgr downloads remote texlive.tlpdb tlmgr verifies authenticity of the tlpdb tlmgr checks integrity of containers tlmgr installs package new partially new

slide-29
SLIDE 29

T EX Live security – 9

Verification architecture – overview

tlmgr downloads remote texlive.tlpdb tlmgr verifies authenticity of the tlpdb tlmgr checks integrity of containers tlmgr installs package new partially new

slide-30
SLIDE 30

T EX Live security – 9

Verification architecture – overview

tlmgr downloads remote texlive.tlpdb tlmgr verifies authenticity of the tlpdb tlmgr checks integrity of containers tlmgr installs package new partially new

slide-31
SLIDE 31

T EX Live security – 9

Verification architecture – overview

tlmgr downloads remote texlive.tlpdb tlmgr verifies authenticity of the tlpdb tlmgr checks integrity of containers tlmgr installs package new partially new

slide-32
SLIDE 32

T EX Live security – 9

Verification architecture – overview

tlmgr downloads remote texlive.tlpdb tlmgr verifies authenticity of the tlpdb tlmgr checks integrity of containers tlmgr installs package new partially new

slide-33
SLIDE 33

T EX Live security – 9

Verification architecture – overview

tlmgr downloads remote texlive.tlpdb tlmgr verifies authenticity of the tlpdb tlmgr checks integrity of containers tlmgr installs package new partially new

slide-34
SLIDE 34

T EX Live security – 10

Verification of authenticity

texlive.tlpdb name 00texlive.config ... name 12many containerchecksum ... ... name 2up containerchecksum ... ... texlive.tlpdb.sha512 <128 hex digits> texlive.tlpdb texlive.tlpdb.sha512.asc —–BEGIN PGP SIGNATURE—– iQEVAwUBVyAV9kzhh3... r2mB9xEnR4o2SRBDNI... ... —–END PGP SIGNATURE—–

slide-35
SLIDE 35

T EX Live security – 10

Verification of authenticity

texlive.tlpdb name 00texlive.config ... name 12many containerchecksum ... ... name 2up containerchecksum ... ... texlive.tlpdb.sha512 <128 hex digits> texlive.tlpdb texlive.tlpdb.sha512.asc —–BEGIN PGP SIGNATURE—– iQEVAwUBVyAV9kzhh3... r2mB9xEnR4o2SRBDNI... ... —–END PGP SIGNATURE—–

slide-36
SLIDE 36

T EX Live security – 10

Verification of authenticity

texlive.tlpdb name 00texlive.config ... name 12many containerchecksum ... ... name 2up containerchecksum ... ... texlive.tlpdb.sha512 <128 hex digits> texlive.tlpdb texlive.tlpdb.sha512.asc —–BEGIN PGP SIGNATURE—– iQEVAwUBVyAV9kzhh3... r2mB9xEnR4o2SRBDNI... ... —–END PGP SIGNATURE—–

slide-37
SLIDE 37

T EX Live security – 10

Verification of authenticity

texlive.tlpdb name 00texlive.config ... name 12many containerchecksum ... ... name 2up containerchecksum ... ... texlive.tlpdb.sha512 <128 hex digits> texlive.tlpdb texlive.tlpdb.sha512.asc —–BEGIN PGP SIGNATURE—– iQEVAwUBVyAV9kzhh3... r2mB9xEnR4o2SRBDNI... ... —–END PGP SIGNATURE—–

slide-38
SLIDE 38

T EX Live security – 11

Signing key

pub 2048R/06BAB6BC 2016-03-19 Key fingerprint = C78B 82D8 C795 12F7 9CC0 D7C8 0D5E 5D91 06BA B6BC uid TeX Live Distribution <tex-live@tug.org> sig 3 06BAB6BC 2016-03-19 TeX Live Distribution <tex-live@tug.org> sig 3 06BAB6BC 2016-03-19 TeX Live Distribution <tex-live@tug.org> sig 860CDC13 2016-03-20 Norbert Preining <norbert@preining.info> sig 30D155AD 2016-03-20 Karl Berry <karl@freefriends.org>

▶ signed by Karl and my key (mine is also in the Debian keyring) ▶ actual signing subkey is used, main key is offline

(in case of breach of tug server we can revoke the sub-key)

slide-39
SLIDE 39

T EX Live security – 12

Verification of authenticity II

Why not sign directly?

▶ speed up of verification (factor 10) ▶ (because this is how I copied it from Debian)

might not be needed (0.01s versus 0.1s)?

Why sha512?

▶ currently considered uncompromisable (in contrast to md5) ▶ will hopefully hold for several years

(other options sha256 etc)

slide-40
SLIDE 40

T EX Live security – 12

Verification of authenticity II

Why not sign directly?

▶ speed up of verification (factor 10) ▶ (because this is how I copied it from Debian)

might not be needed (0.01s versus 0.1s)?

Why sha512?

▶ currently considered uncompromisable (in contrast to md5) ▶ will hopefully hold for several years

(other options sha256 etc)

slide-41
SLIDE 41

T EX Live security – 12

Verification of authenticity II

Why not sign directly?

▶ speed up of verification (factor 10) ▶ (because this is how I copied it from Debian)

might not be needed (0.01s versus 0.1s)?

Why sha512?

▶ currently considered uncompromisable (in contrast to md5) ▶ will hopefully hold for several years

(other options sha256 etc)

slide-42
SLIDE 42

T EX Live security – 12

Verification of authenticity II

Why not sign directly?

▶ speed up of verification (factor 10) ▶ (because this is how I copied it from Debian)

might not be needed (0.01s versus 0.1s)?

Why sha512?

▶ currently considered uncompromisable (in contrast to md5) ▶ will hopefully hold for several years

(other options sha256 etc)

slide-43
SLIDE 43

T EX Live security – 12

Verification of authenticity II

Why not sign directly?

▶ speed up of verification (factor 10) ▶ (because this is how I copied it from Debian)

might not be needed (0.01s versus 0.1s)?

Why sha512?

▶ currently considered uncompromisable (in contrast to md5) ▶ will hopefully hold for several years

(other options sha256 etc)

slide-44
SLIDE 44

T EX Live security – 12

Verification of authenticity II

Why not sign directly?

▶ speed up of verification (factor 10) ▶ (because this is how I copied it from Debian)

might not be needed (0.01s versus 0.1s)?

Why sha512?

▶ currently considered uncompromisable (in contrast to md5) ▶ will hopefully hold for several years

(other options sha256 etc)

slide-45
SLIDE 45

T EX Live security – 13

Check of integrity

Check the sha512 checksum of the containers against the (verified) information in the texlive.tlpdb.

Comments

▶ Why sufficient? — texlive.tlpdb gives authenticated

information

▶ We actually check also the size (might delete that one!)

slide-46
SLIDE 46

T EX Live security – 13

Check of integrity

Check the sha512 checksum of the containers against the (verified) information in the texlive.tlpdb.

Comments

▶ Why sufficient?

— texlive.tlpdb gives authenticated information

▶ We actually check also the size (might delete that one!)

slide-47
SLIDE 47

T EX Live security – 13

Check of integrity

Check the sha512 checksum of the containers against the (verified) information in the texlive.tlpdb.

Comments

▶ Why sufficient? — texlive.tlpdb gives authenticated

information

▶ We actually check also the size (might delete that one!)

slide-48
SLIDE 48

T EX Live security – 13

Check of integrity

Check the sha512 checksum of the containers against the (verified) information in the texlive.tlpdb.

Comments

▶ Why sufficient? — texlive.tlpdb gives authenticated

information

▶ We actually check also the size (might delete that one!)

slide-49
SLIDE 49

T EX Live security – 14

(Non-)distributing of GnuPG

Why not include GnuPG into T EX Live?

▶ We don’t want to support (and compile it)

(but could go into private space like xz and wget!)

▶ Export and import restrictions, Waasenaar Agreement

Export might be ok nowadays, but there are many counries the strictly forbid import of cryptographic software (India, France is a bit unclear, …) tug does not want to get involved in legal battles (not funny) when sending dvds to India or other countries.

slide-50
SLIDE 50

T EX Live security – 14

(Non-)distributing of GnuPG

Why not include GnuPG into T EX Live?

▶ We don’t want to support (and compile it)

(but could go into private space like xz and wget!)

▶ Export and import restrictions, Waasenaar Agreement

Export might be ok nowadays, but there are many counries the strictly forbid import of cryptographic software (India, France is a bit unclear, …) tug does not want to get involved in legal battles (not funny) when sending dvds to India or other countries.

slide-51
SLIDE 51

T EX Live security – 14

(Non-)distributing of GnuPG

Why not include GnuPG into T EX Live?

▶ We don’t want to support (and compile it)

(but could go into private space like xz and wget!)

▶ Export and import restrictions, Waasenaar Agreement

Export might be ok nowadays, but there are many counries the strictly forbid import of cryptographic software (India, France is a bit unclear, …) tug does not want to get involved in legal battles (not funny) when sending dvds to India or other countries.

slide-52
SLIDE 52

T EX Live security – 14

(Non-)distributing of GnuPG

Why not include GnuPG into T EX Live?

▶ We don’t want to support (and compile it)

(but could go into private space like xz and wget!)

▶ Export and import restrictions, Waasenaar Agreement

Export might be ok nowadays, but there are many counries the strictly forbid import of cryptographic software (India, France is a bit unclear, …) tug does not want to get involved in legal battles (not funny) when sending dvds to India or other countries.

slide-53
SLIDE 53

T EX Live security – 15

Alternative for T EX Live

tlmgr –repository http://www.preining.info/tlgpg/ install tlgpg

▶ installs binaries into tlpkg/installer/gpg/ ▶ GnuPG binaries for Windows and Mac (both archs) ▶ already supported by tlu on Mac ▶ most big distributions have GnuPG (1 or 2) installed (both fine) ▶ the T

EX Live infrastructure already checks for the above location

▶ not affiliated with tug (smile) ▶ maybe could be hosted at dante or some other server?

slide-54
SLIDE 54

T EX Live security – 15

Alternative for T EX Live

tlmgr –repository http://www.preining.info/tlgpg/ install tlgpg

▶ installs binaries into tlpkg/installer/gpg/ ▶ GnuPG binaries for Windows and Mac (both archs) ▶ already supported by tlu on Mac ▶ most big distributions have GnuPG (1 or 2) installed (both fine) ▶ the T

EX Live infrastructure already checks for the above location

▶ not affiliated with tug (smile) ▶ maybe could be hosted at dante or some other server?

slide-55
SLIDE 55

T EX Live security – 16

Problems

Computing sha512 checksums

▶ we use Digest::SHA perl module, but this is not available on

  • lder MacOS (shipping 10 years old Perl!)

▶ Perl/Lua implementation is far too slow (minutes!) ▶ Solution: try Digest::SHA, openssl, sha512sum, and shasum,

  • ne is hopefully available

Users’ complains

reduce visibility of warnings/information shown, try to provide a unspectacular introduction of the feature

slide-56
SLIDE 56

T EX Live security – 16

Problems

Computing sha512 checksums

▶ we use Digest::SHA perl module

, but this is not available on

  • lder MacOS (shipping 10 years old Perl!)

▶ Perl/Lua implementation is far too slow (minutes!) ▶ Solution: try Digest::SHA, openssl, sha512sum, and shasum,

  • ne is hopefully available

Users’ complains

reduce visibility of warnings/information shown, try to provide a unspectacular introduction of the feature

slide-57
SLIDE 57

T EX Live security – 16

Problems

Computing sha512 checksums

▶ we use Digest::SHA perl module, but this is not available on

  • lder MacOS (shipping 10 years old Perl!)

▶ Perl/Lua implementation is far too slow (minutes!) ▶ Solution: try Digest::SHA, openssl, sha512sum, and shasum,

  • ne is hopefully available

Users’ complains

reduce visibility of warnings/information shown, try to provide a unspectacular introduction of the feature

slide-58
SLIDE 58

T EX Live security – 16

Problems

Computing sha512 checksums

▶ we use Digest::SHA perl module, but this is not available on

  • lder MacOS (shipping 10 years old Perl!)

▶ Perl/Lua implementation is far too slow (minutes!) ▶ Solution: try Digest::SHA, openssl, sha512sum, and shasum,

  • ne is hopefully available

Users’ complains

reduce visibility of warnings/information shown, try to provide a unspectacular introduction of the feature

slide-59
SLIDE 59

T EX Live security – 16

Problems

Computing sha512 checksums

▶ we use Digest::SHA perl module, but this is not available on

  • lder MacOS (shipping 10 years old Perl!)

▶ Perl/Lua implementation is far too slow (minutes!) ▶ Solution: try Digest::SHA, openssl, sha512sum, and shasum,

  • ne is hopefully available

Users’ complains

reduce visibility of warnings/information shown, try to provide a unspectacular introduction of the feature

slide-60
SLIDE 60

T EX Live security – 16

Problems

Computing sha512 checksums

▶ we use Digest::SHA perl module, but this is not available on

  • lder MacOS (shipping 10 years old Perl!)

▶ Perl/Lua implementation is far too slow (minutes!) ▶ Solution: try Digest::SHA, openssl, sha512sum, and shasum,

  • ne is hopefully available

Users’ complains

reduce visibility of warnings/information shown, try to provide a unspectacular introduction of the feature

slide-61
SLIDE 61

T EX Live security – 17

User experience – changes in the interface

Aim: nearly no user visible change

[~] tlmgr update --list --repository http://localhost/tlnet/ tlmgr: package repository http://localhost/tlnet/ (verified) ...

If not GnuPG is found the output is:

[~] tlmgr update --list --repository http://localhost/tlnet/ tlmgr: package repository http://localhost/tlnet/ (not verified) ...

Similar for multiple repositories

slide-62
SLIDE 62

T EX Live security – 17

User experience – changes in the interface

Aim: nearly no user visible change

[~] tlmgr update --list --repository http://localhost/tlnet/ tlmgr: package repository http://localhost/tlnet/ (verified) ...

If not GnuPG is found the output is:

[~] tlmgr update --list --repository http://localhost/tlnet/ tlmgr: package repository http://localhost/tlnet/ (not verified) ...

Similar for multiple repositories

slide-63
SLIDE 63

T EX Live security – 17

User experience – changes in the interface

Aim: nearly no user visible change

[~] tlmgr update --list --repository http://localhost/tlnet/ tlmgr: package repository http://localhost/tlnet/ (verified) ...

If not GnuPG is found the output is:

[~] tlmgr update --list --repository http://localhost/tlnet/ tlmgr: package repository http://localhost/tlnet/ (not verified) ...

Similar for multiple repositories

slide-64
SLIDE 64

T EX Live security – 18

Key management

Aim: support alternative repositories

▶ tlmgr key action added ▶ allows listing, adding, removing of keys ▶ already in use (koma script, TeX JP, …)

slide-65
SLIDE 65

T EX Live security – 19

Further plans

not many …

▶ download checksum from TUG for extra protection? ▶ directly sign – reduce one download? ▶ do not check file size (useless overhead)? ▶ … your suggestions?

Thanks for your attention

slide-66
SLIDE 66

T EX Live security – 19

Further plans

not many …

▶ download checksum from TUG for extra protection? ▶ directly sign – reduce one download? ▶ do not check file size (useless overhead)? ▶ … your suggestions?

Thanks for your attention

slide-67
SLIDE 67

T EX Live security – 19

Further plans

not many …

▶ download checksum from TUG for extra protection? ▶ directly sign – reduce one download? ▶ do not check file size (useless overhead)? ▶ … your suggestions?

Thanks for your attention

slide-68
SLIDE 68

T EX Live security – 19

Further plans

not many …

▶ download checksum from TUG for extra protection? ▶ directly sign – reduce one download? ▶ do not check file size (useless overhead)? ▶ … your suggestions?

Thanks for your attention