Diff of the two buildlogs: -- --- b1/build.log 2025-01-02 06:29:00.331568683 +0000 +++ b2/build.log 2025-01-02 06:31:59.495404011 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Wed Jan 1 18:27:27 -12 2025 -I: pbuilder-time-stamp: 1735799247 +I: Current time: Thu Jan 2 20:29:09 +14 2025 +I: pbuilder-time-stamp: 1735799349 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration @@ -29,52 +29,84 @@ dpkg-source: info: applying 03-fix-library-path.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/31962/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/28776/tmp/hooks/D01_modify_environment starting +debug: Running on virt32b. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Jan 2 06:29 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/28776/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/28776/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3 ' - DISTRIBUTION='trixie' - HOME='/root' - HOST_ARCH='armhf' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="37" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.37(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=4 ' + DIRSTACK=() + DISTRIBUTION=trixie + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='54cdb0ebce0448f9958e5d931eb203db' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='31962' - PS1='# ' - PS2='> ' + INVOCATION_ID=b537737b387c49f78e1533a0c3e8fd9e + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=28776 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.y8WJBb4f/pbuilderrc_QOyj --distribution trixie --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.y8WJBb4f/b1 --logfile b1/build.log ruby-secure-headers_6.3.2-2.dsc' - SUDO_GID='114' - SUDO_UID='108' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.y8WJBb4f/pbuilderrc_hzXW --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.y8WJBb4f/b2 --logfile b2/build.log ruby-secure-headers_6.3.2-2.dsc' + SUDO_GID=112 + SUDO_UID=106 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux virt64a 6.1.0-28-arm64 #1 SMP Debian 6.1.119-1 (2024-11-22) aarch64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-28-armmp-lpae #1 SMP Debian 6.1.119-1 (2024-11-22) armv7l GNU/Linux I: ls -l /bin lrwxrwxrwx 1 root root 7 Nov 22 14:40 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/31962/tmp/hooks/D02_print_environment finished +I: user script /srv/workspace/pbuilder/28776/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -282,7 +314,7 @@ Get: 158 http://deb.debian.org/debian trixie/main armhf ruby-rspec-mocks all 3.13.0c0e0m0s1-2 [81.3 kB] Get: 159 http://deb.debian.org/debian trixie/main armhf ruby-rspec all 3.13.0c0e0m0s1-2 [5184 B] Get: 160 http://deb.debian.org/debian trixie/main armhf ruby-useragent all 0.16.8-1.1 [12.0 kB] -Fetched 43.8 MB in 1s (36.7 MB/s) +Fetched 43.8 MB in 1s (43.4 MB/s) Preconfiguring packages ... Selecting previously unselected package libpython3.12-minimal:armhf. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19679 files and directories currently installed.) @@ -815,8 +847,8 @@ Setting up tzdata (2024b-4) ... Current default time zone: 'Etc/UTC' -Local time is now: Thu Jan 2 06:28:20 UTC 2025. -Universal Time is now: Thu Jan 2 06:28:20 UTC 2025. +Local time is now: Thu Jan 2 06:30:53 UTC 2025. +Universal Time is now: Thu Jan 2 06:30:53 UTC 2025. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up autotools-dev (20220109.1) ... @@ -958,7 +990,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/ruby-secure-headers-6.3.2/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../ruby-secure-headers_6.3.2-2_source.changes +I: user script /srv/workspace/pbuilder/28776/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for trixie +I: user script /srv/workspace/pbuilder/28776/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/ruby-secure-headers-6.3.2/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../ruby-secure-headers_6.3.2-2_source.changes dpkg-buildpackage: info: source package ruby-secure-headers dpkg-buildpackage: info: source version 6.3.2-2 dpkg-buildpackage: info: source distribution unstable @@ -991,7 +1027,7 @@ │ ruby-secure-headers: Installing files and building extensions for ruby3.1 │ └──────────────────────────────────────────────────────────────────────────────┘ -/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20250101-4603-yp4axw/gemspec +/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20250102-10082-gteo88/gemspec Failed to load /dev/null because it doesn't contain valid YAML hash WARNING: license value 'Apache Public License 2.0' is invalid. Use a license identifier from http://spdx.org/licenses or 'Nonstandard' for a nonstandard license, @@ -1004,7 +1040,7 @@ Name: secure_headers Version: 6.3.2 File: secure_headers-6.3.2.gem -/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-secure-headers/usr/share/rubygems-integration/all /tmp/d20250101-4603-yp4axw/secure_headers-6.3.2.gem +/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-secure-headers/usr/share/rubygems-integration/all /tmp/d20250102-10082-gteo88/secure_headers-6.3.2.gem Failed to load /dev/null because it doesn't contain valid YAML hash /build/reproducible-path/ruby-secure-headers-6.3.2/debian/ruby-secure-headers/usr/share/rubygems-integration/all/gems/secure_headers-6.3.2/lib/secure_headers.rb /build/reproducible-path/ruby-secure-headers-6.3.2/debian/ruby-secure-headers/usr/share/rubygems-integration/all/gems/secure_headers-6.3.2/lib/secure_headers/configuration.rb @@ -1061,52 +1097,30 @@ [Coveralls] Set up the SimpleCov formatter. [Coveralls] Using SimpleCov's default settings. -Randomized with seed 61592 +Randomized with seed 25024 -SecureHeaders::ViewHelpers - raises an error when using hashed content without precomputed hashes - raises an error when using hashed content with precomputed hashes, but none for the given file - adds known hash values to the corresponding headers when the helper is used - avoids calling content_security_policy_nonce internally - raises an error when using previously unknown hashed content with precomputed hashes for a given file - -SecureHeaders::ClearSiteData - validate_config! - succeeds for `true` config - succeeds for Array of Strings config - fails for Array of non-String config - succeeds for opt-out config - succeeds for empty config - succeeds for `nil` config - fails for other types of config - make_header - returns nil with empty config - returns specified types - returns nil with opt-out config - returns all types with `true` config - returns nil with nil config - make_header_value - returns a string of quoted values that are comma separated +with an invalid configuration + raises an exception when not configured with a Hash + raises an exception when configured without a boolean(true or OPT_OUT)/Hash + raises an exception when configured with false + raises an exception when SameSite strict and lax enforcement modes are configured with booleans + raises an exception when SameSite strict and none enforcement modes are configured with booleans + raises an exception when SameSite lax and strict enforcement modes are configured with booleans + raises an exception when SameSite is not configured with a Hash + raises an exception when both only and except filters are provided to SameSite configurations + raises an exception when both lax and strict only filters are provided to SameSite configurations + raises an exception when both only and except filters are provided + raises an exception when both lax and strict only filters are provided to SameSite configurations + raises an exception when SameSite none and strict enforcement modes are configured with booleans + raises an exception when SameSite lax and strict enforcement modes are configured with booleans + raises an exception when SameSite none and lax enforcement modes are configured with booleans + raises an exception when SameSite lax and none enforcement modes are configured with booleans SecureHeaders::Cookie + prevents duplicate flagging of attributes does not tamper with cookies when using OPT_OUT is used applies httponly, secure, and samesite by default - prevents duplicate flagging of attributes preserves existing attributes - SameSite cookies - does not flag cookies as SameSite=Lax when excluded - does not flag cookies as SameSite=None when excluded - flags SameSite=Lax - flags SameSite=Lax when configured with a boolean - flags SameSite=None when configured with a boolean - does not flag cookies as SameSite=Strict when excluded - samesite: true sets all cookies to samesite=lax - flags SameSite=None - flags SameSite=Strict - flags SameSite=Strict when configured with a boolean - flags properly when both lax and strict are configured - flags SameSite=Strict when configured with a boolean - ignores configuration if the cookie is already flagged Secure cookies when configured with a boolean flags cookies as Secure @@ -1114,275 +1128,297 @@ flags cookies as Secure when whitelisted does not flag cookies as Secure when excluded HttpOnly cookies - when configured with a Hash - flags cookies as HttpOnly when whitelisted - does not flag cookies as HttpOnly when excluded when configured with a boolean flags cookies as HttpOnly + when configured with a Hash + does not flag cookies as HttpOnly when excluded + flags cookies as HttpOnly when whitelisted + SameSite cookies + flags SameSite=Strict + flags SameSite=Lax when configured with a boolean + flags SameSite=None when configured with a boolean + flags SameSite=Lax + samesite: true sets all cookies to samesite=lax + does not flag cookies as SameSite=Lax when excluded + flags SameSite=None + does not flag cookies as SameSite=None when excluded + flags SameSite=Strict when configured with a boolean + flags SameSite=Strict when configured with a boolean + flags properly when both lax and strict are configured + ignores configuration if the cookie is already flagged + does not flag cookies as SameSite=Strict when excluded -SecureHeaders::XDownloadOptions - is expected to eq ["X-Download-Options", "noopen"] - is expected to eq ["X-Download-Options", "noopen"] +SecureHeaders::ReferrerPolicy + is expected to eq ["Referrer-Policy", "origin-when-cross-origin, strict-origin-when-cross-origin"] + is expected to eq ["Referrer-Policy", "no-referrer"] + is expected to eq ["Referrer-Policy", "origin-when-cross-origin"] invalid configuration values - accepts noopen + doesn't accept invalid values + doesn't accept invalid types + valid configuration values + accepts 'no-referrer' + accepts 'strict-origin' + accepts 'unsafe-url' + accepts 'origin' + accepts 'same-origin' + accepts 'strict-origin-when-cross-origin' accepts nil - doesn't accept anything besides noopen - -SecureHeaders::XXssProtection - is expected to eq ["X-XSS-Protection", "1; mode=block"] - is expected to eq ["X-XSS-Protection", "1; mode=block; report=https://www.secure.com/reports"] - with invalid configuration - should raise an error when providing a string that is not valid - when using a hash value - should allow string values ('1' or '0' are the only valid strings) - should raise an error if an invalid key is supplied - should raise an error if mode != block - should raise an error if no value key is supplied + accepts 'origin-when-cross-origin' + accepts 'no-referrer-when-downgrade' + accepts array of policy values SecureHeaders::ContentSecurityPolicy - #name - when in report-only mode - is expected to eq "Content-Security-Policy-Report-Only" - when in enforce mode - is expected to eq "Content-Security-Policy" #value - does not add a boolean directive if the value is false - minifies source expressions based on overlapping wildcards - removes http/s schemes from hosts - supports style-src-attr directive + deprecates and escapes semicolons in directive source lists + supports script-src-attr directive + supports style-src-elem directive does not add a directive if the value is nil - does add a boolean directive if the value is true - does not emit a warning when using frame-src - creates maximally strict sandbox policy when passed no sandbox token values - does not remove schemes from report-uri values - creates sandbox policy when passed valid sandbox token values - allows script and style as a require-sri-src + does not build directives with a value of OPT_OUT (and bypasses directive requirements) + supports style-src-attr directive deduplicates any source expressions + discards 'none' values if any other source expressions are present creates maximally strict sandbox policy when passed true + does add a boolean directive if the value is true uses a safe but non-breaking default value - does not build directives with a value of OPT_OUT (and bypasses directive requirements) - supports script-src-attr directive - does not add a directive if the value is an empty array (or all nil) + removes nil from source lists + does not add a boolean directive if the value is false + creates maximally strict sandbox policy when passed no sandbox token values + minifies source expressions based on overlapping wildcards + does not emit a warning when using frame-src + does not remove schemes when :preserve_schemes is true + supports script-src-elem directive + removes http/s schemes from hosts deprecates and escapes semicolons in directive source lists - includes navigate-to - supports style-src-elem directive - includes prefetch-src + creates sandbox policy when passed valid sandbox token values allows script as a require-sri-src + does not remove schemes from report-uri values + discards source expressions (besides unsafe-* and non-host source values) when * is present supports strict-dynamic and opting out of the appended 'unsafe-inline' - discards 'none' values if any other source expressions are present - supports strict-dynamic allows style as a require-sri-src - supports script-src-elem directive - discards source expressions (besides unsafe-* and non-host source values) when * is present - removes nil from source lists - does not remove schemes when :preserve_schemes is true - deprecates and escapes semicolons in directive source lists + allows script and style as a require-sri-src + does not add a directive if the value is an empty array (or all nil) + supports strict-dynamic + includes prefetch-src + includes navigate-to + #name + when in enforce mode + is expected to eq "Content-Security-Policy" + when in report-only mode + is expected to eq "Content-Security-Policy-Report-Only" SecureHeaders::XContentTypeOptions #value is expected to eq ["X-Content-Type-Options", "nosniff"] is expected to eq ["X-Content-Type-Options", "nosniff"] invalid configuration values - accepts nosniff accepts nil doesn't accept anything besides no-sniff + accepts nosniff -with an invalid configuration - raises an exception when SameSite lax and strict enforcement modes are configured with booleans - raises an exception when not configured with a Hash - raises an exception when SameSite lax and none enforcement modes are configured with booleans - raises an exception when configured with false - raises an exception when both only and except filters are provided - raises an exception when both only and except filters are provided to SameSite configurations - raises an exception when configured without a boolean(true or OPT_OUT)/Hash - raises an exception when both lax and strict only filters are provided to SameSite configurations - raises an exception when SameSite lax and strict enforcement modes are configured with booleans - raises an exception when SameSite is not configured with a Hash - raises an exception when SameSite strict and lax enforcement modes are configured with booleans - raises an exception when SameSite strict and none enforcement modes are configured with booleans - raises an exception when SameSite none and lax enforcement modes are configured with booleans - raises an exception when both lax and strict only filters are provided to SameSite configurations - raises an exception when SameSite none and strict enforcement modes are configured with booleans +SecureHeaders::XDownloadOptions + is expected to eq ["X-Download-Options", "noopen"] + is expected to eq ["X-Download-Options", "noopen"] + invalid configuration values + doesn't accept anything besides noopen + accepts nil + accepts noopen -SecureHeaders::StrictTransportSecurity +SecureHeaders::ViewHelpers + avoids calling content_security_policy_nonce internally + adds known hash values to the corresponding headers when the helper is used + raises an error when using hashed content with precomputed hashes, but none for the given file + raises an error when using previously unknown hashed content with precomputed hashes for a given file + raises an error when using hashed content without precomputed hashes + +SecureHeaders::XFrameOptions #value - is expected to eq ["Strict-Transport-Security", "max-age=1234; includeSubdomains; preload"] - is expected to eq ["Strict-Transport-Security", "max-age=631138519"] - with an invalid configuration - with a string argument - raises an exception with an invalid max-age - raises an exception if max-age is not supplied - raises an exception with an invalid format + is expected to eq ["X-Frame-Options", "DENY"] + is expected to eq ["X-Frame-Options", "sameorigin"] + with invalid configuration + allows SAMEORIGIN + allows ALLOW-FROM* + does not allow garbage + allows DENY + +SecureHeaders::XXssProtection + is expected to eq ["X-XSS-Protection", "1; mode=block"] + is expected to eq ["X-XSS-Protection", "1; mode=block; report=https://www.secure.com/reports"] + with invalid configuration + should raise an error when providing a string that is not valid + when using a hash value + should raise an error if an invalid key is supplied + should allow string values ('1' or '0' are the only valid strings) + should raise an error if mode != block + should raise an error if no value key is supplied SecureHeaders::Middleware + uses named overrides respects overrides sets the headers - uses named overrides + cookies + sets the secure cookie flag correctly on interleaved http/https requests + flags cookies with a combination of SameSite configurations + disables secure cookies for non-https requests + flags cookies from configuration cookies allows opting out of cookie protection with OPT_OUT alone cookies should be flagged flags cookies as secure cookies should not be flagged does not flags cookies as secure - cookies - flags cookies from configuration - sets the secure cookie flag correctly on interleaved http/https requests - disables secure cookies for non-https requests - flags cookies with a combination of SameSite configurations -SecureHeaders::ReferrerPolicy - is expected to eq ["Referrer-Policy", "origin-when-cross-origin"] - is expected to eq ["Referrer-Policy", "no-referrer"] - is expected to eq ["Referrer-Policy", "origin-when-cross-origin, strict-origin-when-cross-origin"] +SecureHeaders::PolicyManagement + #validate_config! + accepts OPT_OUT as a script-src value + rejects anything not of the form allow-* as a sandbox value + rejects anything not of the form type/subtype as a plugin-type value + performs light validation on source lists + accepts true as a sandbox policy + allows report_only to be set in a report-only config + accepts all keys + rejects unknown directives / config + requires :preserve_schemes to be a truthy value + requires a :script_src value + requires a :default_src value + doesn't allow report_only to be set in a non-report-only config + requires :block_all_mixed_content to be a boolean value + allows nil values + requires all source lists to be an array of strings + accepts anything of the form allow-* as a sandbox value + requires :report_only to be a truthy value + requires :upgrade_insecure_requests to be a boolean value + accepts anything of the form type/subtype as a plugin-type value + #combine_policies + overrides the report_only flag + raises an error if appending to a OPT_OUT policy + overrides the :block_all_mixed_content flag + combines the default-src value with the override if the directive was unconfigured + combines directives where the original value is nil and the hash is frozen + does not combine the default-src value for directives that don't fall back to default sources + +SecureHeaders::StrictTransportSecurity + #value + is expected to eq ["Strict-Transport-Security", "max-age=631138519"] + is expected to eq ["Strict-Transport-Security", "max-age=1234; includeSubdomains; preload"] + with an invalid configuration + with a string argument + raises an exception with an invalid max-age + raises an exception if max-age is not supplied + raises an exception with an invalid format + +SecureHeaders::ExpectCertificateTransparency + is expected to eq "max-age=1234, report-uri=\"https://report-uri.io/expect-ct\"" + is expected to eq "enforce, max-age=1234, report-uri=\"https://report-uri.io/expect-ct\"" + is expected to eq "enforce, max-age=1234" + is expected to eq "max-age=1234" + is expected to eq "max-age=1234" + with an invalid configuration + raises an exception with an invalid enforce value + raises an exception with an invalid max-age + raises an exception when configuration isn't a hash + raises an exception when max-age is not provided + +SecureHeaders::XPermittedCrossDomainPolicies + is expected to eq ["X-Permitted-Cross-Domain-Policies", "none"] + is expected to eq ["X-Permitted-Cross-Domain-Policies", "master-only"] valid configuration values - accepts 'origin-when-cross-origin' - accepts 'strict-origin' - accepts 'same-origin' - accepts 'unsafe-url' - accepts 'strict-origin-when-cross-origin' + accepts 'by-ftp-filename' + accepts 'master-only' + accepts 'all' accepts nil - accepts 'no-referrer-when-downgrade' - accepts 'no-referrer' - accepts array of policy values - accepts 'origin' - invalid configuration values + accepts 'by-content-type' + invlaid configuration values doesn't accept invalid values - doesn't accept invalid types -SecureHeaders::XFrameOptions - #value - is expected to eq ["X-Frame-Options", "sameorigin"] - is expected to eq ["X-Frame-Options", "DENY"] - with invalid configuration - allows ALLOW-FROM* - allows SAMEORIGIN - does not allow garbage - allows DENY +SecureHeaders::ClearSiteData + make_header + returns nil with nil config + returns nil with empty config + returns specified types + returns nil with opt-out config + returns all types with `true` config + make_header_value + returns a string of quoted values that are comma separated + validate_config! + succeeds for `true` config + succeeds for empty config + fails for Array of non-String config + succeeds for `nil` config + succeeds for Array of Strings config + succeeds for opt-out config + fails for other types of config SecureHeaders - raises a AlreadyConfiguredError if trying to configure and default has already been set - raises a NotYetConfiguredError if trying to opt-out of unconfigured headers raises and ArgumentError when referencing an override that has not been set + raises a NotYetConfiguredError if trying to opt-out of unconfigured headers raises a NotYetConfiguredError if default has not been set + raises a AlreadyConfiguredError if trying to configure and default has already been set #header_hash_for - allows you to opt out entirely - allows you to override opting out - allows you to override X-Frame-Options settings - does not set the HSTS header if request is over HTTP produces a hash of headers with default config - Overrides the current default config if default config changes during request + allows you to override opting out allows you to opt out of individual headers via API + does not set the HSTS header if request is over HTTP + allows you to opt out entirely Carries options over when using overrides + allows you to override X-Frame-Options settings + Overrides the current default config if default config changes during request content security policy - appends a nonce to the script-src when used appends a nonce to a missing script-src value + appends a nonce to the script-src when used + does not support the deprecated `report_only: true` format appends a value to csp directive - overrides individual directives - appends a hash to a missing script-src value supports named appends overrides non-existant directives + overrides individual directives + appends a hash to a missing script-src value Raises an error if csp_report_only is used with `report_only: false` - does not support the deprecated `report_only: true` format setting two headers - allows appending to the enforced policy - allows overriding the report only policy - allows you to opt-out of enforced CSP - allows appending to the report only policy + sets identical values when the configs are the same sets different headers when the configs are different + allows appending to the report only policy + allows appending to both policies + allows appending to the enforced policy allows overriding both policies - sets identical values when the configs are the same allows overriding the enforced policy - allows appending to both policies + allows overriding the report only policy + allows you to opt-out of enforced CSP when inferring which config to modify - updates both headers if both are configured updates the report only header when configured + updates both headers if both are configured updates the enforced header when configured validation - validates your xcto config upon configuration - validates your csp config upon configuration - validates your referrer_policy config upon configuration - validates your x_permitted_cross_domain_policies config upon configuration - validates your x_xss config upon configuration - validates your xfo config upon configuration raises errors for unknown directives - validates your xdo config upon configuration + validates your x_xss config upon configuration validates your cookies config upon configuration + validates your xdo config upon configuration + validates your referrer_policy config upon configuration + validates your x_permitted_cross_domain_policies config upon configuration + validates your xcto config upon configuration validates your clear site data config upon configuration validates your hsts config upon configuration - -SecureHeaders::PolicyManagement - #validate_config! - requires :report_only to be a truthy value - accepts OPT_OUT as a script-src value - accepts true as a sandbox policy - requires all source lists to be an array of strings - requires :block_all_mixed_content to be a boolean value - allows report_only to be set in a report-only config - accepts anything of the form type/subtype as a plugin-type value - rejects anything not of the form allow-* as a sandbox value - requires :upgrade_insecure_requests to be a boolean value - requires a :default_src value - rejects unknown directives / config - requires :preserve_schemes to be a truthy value - allows nil values - requires a :script_src value - rejects anything not of the form type/subtype as a plugin-type value - accepts all keys - performs light validation on source lists - doesn't allow report_only to be set in a non-report-only config - accepts anything of the form allow-* as a sandbox value - #combine_policies - overrides the report_only flag - combines directives where the original value is nil and the hash is frozen - overrides the :block_all_mixed_content flag - raises an error if appending to a OPT_OUT policy - does not combine the default-src value for directives that don't fall back to default sources - combines the default-src value with the override if the directive was unconfigured + validates your xfo config upon configuration + validates your csp config upon configuration SecureHeaders::Configuration + dup results in a copy of the default config + has an 'noop' override + allows me to be explicit too gives cookies a default config - deprecates the secure_cookies configuration + has a default config stores an override - allows me to be explicit too + deprecates the secure_cookies configuration allows OPT_OUT - has a default config - dup results in a copy of the default config - has an 'noop' override - #named_append - raises when an override with the given name exists - raises on configuring an existing append #override - raises on configuring an existing override raises when a named append with the given name exists + raises on configuring an existing override + #named_append + raises on configuring an existing append + raises when an override with the given name exists -SecureHeaders::XPermittedCrossDomainPolicies - is expected to eq ["X-Permitted-Cross-Domain-Policies", "master-only"] - is expected to eq ["X-Permitted-Cross-Domain-Policies", "none"] - valid configuration values - accepts 'master-only' - accepts nil - accepts 'by-ftp-filename' - accepts 'by-content-type' - accepts 'all' - invlaid configuration values - doesn't accept invalid values - -SecureHeaders::ExpectCertificateTransparency - is expected to eq "max-age=1234" - is expected to eq "max-age=1234" - is expected to eq "max-age=1234, report-uri=\"https://report-uri.io/expect-ct\"" - is expected to eq "enforce, max-age=1234" - is expected to eq "enforce, max-age=1234, report-uri=\"https://report-uri.io/expect-ct\"" - with an invalid configuration - raises an exception when configuration isn't a hash - raises an exception with an invalid max-age - raises an exception with an invalid enforce value - raises an exception when max-age is not provided - -Finished in 0.5134 seconds (files took 1.06 seconds to load) +Finished in 0.555 seconds (files took 1.14 seconds to load) 240 examples, 0 failures -Randomized with seed 61592 +Randomized with seed 25024 [Coveralls] Outside the CI environment, not sending data. @@ -1413,12 +1449,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/28776/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/28776/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/31962 and its subdirectories -I: Current time: Wed Jan 1 18:28:56 -12 2025 -I: pbuilder-time-stamp: 1735799336 +I: removing directory /srv/workspace/pbuilder/28776 and its subdirectories +I: Current time: Thu Jan 2 20:31:55 +14 2025 +I: pbuilder-time-stamp: 1735799515