Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| devsummit:201309:security [2013/09/26 09:55] – DagErlingSmørgrav | devsummit:201309:security [2021/04/25 10:00] (current) – Move to DevSummit namespace. JethroNederhof | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| | [[/ | | [[/ | ||
| | %%DagErlingSm%%ørgrav | %%VuXML%% / auditing | | | %%DagErlingSm%%ørgrav | %%VuXML%% / auditing | | ||
| - | | [[/ | ||
| ==== Results ==== | ==== Results ==== | ||
| - | //(Add a list or attach slides detailing | + | {{devsummit/201309/security/ |
| + | |||
| + | ===== /dev/random ===== | ||
| + | |||
| + | MM absent. | ||
| + | sysctl to choose rng adaptor committed -- mostly for HW support. yarrow as fallback | ||
| + | Also support for other RNG HW which only input to yarrow | ||
| + | 10.x fix known bugs -- passing in part of struct that is mostly zeros on 64bit | ||
| + | Pawel' | ||
| + | New: Statistical analysis by benl: 4bits entropy per devices conservative estimate[*]. | ||
| + | Important: feed data into yarrow v. early in boot. Need good entropy very early on -- eg. generation of ssh keys on first boot | ||
| + | Current initrandom script to feed data into yarrow is ' | ||
| + | [*] [[/ | ||
| + | Mark Murray will implement fotuna but not for 10.x | ||
| + | Embedded systems will probably pre-generate keys. Some have very few devices. | ||
| + | |||
| + | Edward Snowden -- v. high probability of backdoors in some (HW) RNGs. Including elliptic curve generator included in NIST. | ||
| + | rdrand in ivbridge not implemented by Intel... | ||
| + | Cannot trust HW RNGs to provide good entropy directly. | ||
| + | This means partial revert of some work on rdrand and padlock -- everything will feed into yarrow or fortuna in future. | ||
| + | Fortuna doesn' | ||
| + | Estimating entropy remaining to system was %%SotA%% 15 years ago; not the best way now. | ||
| + | Fortuna designed s.t. even if you can influence input, delay before this affects output long enough to make attacks infeasible (3 weeks) | ||
| + | Generation of ssh keys on install -- bsdinstaller to save entropy / generate keys as last thing | ||
| + | Installing system and cloning image? | ||
| + | |||
| + | ===== Mitigation -- Sofian ===== | ||
| + | |||
| + | Comparison with other operating systems: what can be added in short term, what can be added eventually. | ||
| + | |||
| + | Mitigation: techniques used to counter exploitation. | ||
| + | Implement at binary level, at router level, in network stack etc. | ||
| + | |||
| + | %%OpenBSD%% has Address Space Layer Randomization | ||
| + | |||
| + | We don't have randomization in code, data, linker, libc, heap, stack. | ||
| + | |||
| + | sysctl kern.elf{64, | ||
| + | |||
| + | sbz patch adds 2 new sysctl: kern.stackgap_random and bsd.security.mmap_random | ||
| + | Add disabled by default with aim to enable by default for 11.x | ||
| + | |||
| + | Other potential: SSP Stack Smash Protector | ||
| + | Capsicum | ||
| + | |||
| + | Libc mitigation: randomize address of ldbase | ||
| + | |||
| + | %%NetBSD%% has bacs implementation we could investigate | ||
| + | |||
| + | Finer grained activation? | ||
| + | |||
| + | SSP: mostly for ports | ||
| + | |||
| + | focusses on avoiding stack based overflows. | ||
| + | Committed to base in 2008. | ||
| + | Really simple to do for ports, but many corner cases. | ||
| + | |||
| + | ldscript to pull in libssp_nonshared contains symbols for i386 -- this works; now able to enable by default. | ||
| + | |||
| + | ===== Package Signing -- bapt ===== | ||
| + | |||
| + | Had two fairly intense sessions in Cambridge. | ||
| + | |||
| + | pkgng has simple signature on pkg check | ||
| + | Don't want certificate on builders -- signature should be on hash by signing server | ||
| + | Adminstratively need to be able to choose which signatures to trust | ||
| + | / | ||
| + | pkgng internal code implemented. | ||
| + | pkg signed by revoked signature will be rejected. | ||
| + | Don't have signing servers to test with. | ||
| + | Don't have code for signing server (who is responsible? | ||
| + | Need to add signing checks to / | ||
| + | Is close, need boxes setup soon in cluster so we can test. | ||
| + | |||
| + | SO to provide (even a temp) key for testing within days | ||
| + | |||
| + | Should we use /etc/keys rather than /etc/pkg to store keys in generally? | ||
| + | Subdirectories for different purposes / | ||
| + | |||
| + | freebsd-update will try and merge changes under /etc -- mark keys as not to be modified. | ||
| + | |||
| + | //Break for Lunch// | ||
| + | |||
| + | ===== VuXML/audit -- Things we might like to do ===== | ||
| + | |||
| + | %%VuXML%% by Jacques Vidrine | ||
| + | |||
| + | XML schema for expressing information about pkg vulnerabilities. | ||
| + | to scan system and tell you if you have vulnerable pkgs installed. | ||
| + | |||
| + | portaudit has cronjob to condense %%VuXML%% to one-line summaries rather than reading directly | ||
| + | |||
| + | %%VuXML%% -- list of affected ports and packages by name, ranges -- which version number. | ||
| + | Ref django vuln: py26-django and py27-django are exactly the same port except for some compilation options. | ||
| + | py{26, | ||
| + | |||
| + | Opposite problem with perl, emacs, php, mysql which are effectively branches of an original port | ||
| + | %%VuXML%% can miss a package if it was renamed | ||
| + | |||
| + | pkg audit -X can use vuxml -- this should be the default | ||
| + | CVE numbers. | ||
| + | The can get it wrong... | ||
| + | |||
| + | Interesting part: Vulnerable software and versions on NVD website. | ||
| + | We often get %%VuXML%% wrong eg. mixing up gt and ge on version numbers. | ||
| + | |||
| + | Problem matching version mubers: if we backport fix to eg 1.4.7 we'll call it 1.4.7_1 | ||
| + | Can add additional fields to CPE naming spec. Can add a revision number for a port. | ||
| + | |||
| + | We need to record the CPE in ports and packages. | ||
| + | defining CPE_VENDOR and derive other parts from PORTNAME etc. Similarly to MASTERSITES | ||
| + | |||
| + | (With staging for eg. an %%SourceForge%% port need almost no more than to set the port name and that it needs autotools and review the | ||
| + | generated plist) | ||
| + | |||
| + | Need to incorporate CPE into portaudit etc. Check license terms for compatibility. | ||
| + | |||
| + | Fields in spec arrande in order of how commonly the occur. | ||
| + | 1st field /a => application. | ||
| + | |||
| + | Step 1: Add CPEs in ports. | ||
| + | Need to do this ASAP -- needs to be available before a vulnerability is discovered. | ||
| + | |||
| + | Will need a fallback mechanism for pkgs that don't have a CPE assigned. | ||
| + | |||
| + | The other problem with %%VuXML%% -- should we add %%FreeBSD%% SAs to %%VuXML%%? | ||
| + | %%FreBSD%% Update for uname components will not update the kernel version so the version apparently doesn' | ||
| + | Should we add / | ||
| + | Also should update both kernel and world together for best results. | ||
| + | Should be OK so long as most people update together. | ||
| + | Don't want to report new version until you reboot into new kernel. | ||
| + | Good reasons for not updating version unless kernel changes | ||
| + | |||
| + | Could make fake packages for kernel, world etc. (Not pkg specific necessarily) | ||
| + | packaged base system? | ||
| + | Means we can just use pkg audit to cover the base system. | ||
| + | |||
| + | Equivalnet | ||
| + | Linux also has / | ||
| + | |||
| + | The audit tool should look at sysctl kern.bootfile. | ||
| + | between updating and rebooting. | ||
| + | / | ||
| + | %%FreeBSD%% update means mtime on kernel will be time kernel was installed. | ||
| + | |||
| + | / | ||
| + | |||
| + | Looking for ideas. | ||
| + | |||
| + | Can't rely on eg. SVN metadata in uname -a -- it won't always be present. | ||
| + | |||
| + | We need to validate the userland as well as the kernel. | ||
| + | We don't want a separate version for userland and kernel. | ||
| + | |||
| + | Info in %%VuXML%% needs to be sufficient that we can run an older kernel when the userland needs to be update. | ||
| + | |||
| + | Concrete suggestions ? Can rely on what the kernel reports? | ||
| + | |||
| + | Record a version in each binary? | ||
| + | |||
| + | Reasonable to assume the userland is consistent. | ||
| + | |||
| + | Avoid /etc as that implies admin action to update the version | ||
| + | |||
| + | Have a separate binary (bin/ | ||
| + | Could use a shell-script so it's accessible from other architectures | ||
| + | |||
| + | In the root -- /.version | ||
| + | |||
| + | or a shell script in / | ||
| + | or write it in a way that is easily parseable. | ||
| + | |||
| + | Colin Percival -- " | ||
| + | |||
| + | ---- | ||
| + | |||
| + | {{tag> | ||