astro-shield

Astro integration to enhance your website's security with SubResource Integrity hashes, Content-Security-Policy headers, and other techniques.

MIT License

Downloads
2.2K
Stars
36
Committers
1

Bot releases are hidden (Show)

astro-shield - 1.3.6 Latest Release

Published by castarco 6 months ago

Fixes

  • This release fixes an issue present in generated CSP directives : #76

Autogenerated Changelog

Full Changelog: https://github.com/kindspells/astro-shield/compare/1.3.5...1.3.6

astro-shield - 1.3.5

Published by castarco 6 months ago

Security

  • Limit postinstall scripts for the development repository. In principle, this doesn't directly affect the distributed code of this library, but it helps to reduce some supply chain risks.

Autogenerated Changelog

Full Changelog: https://github.com/kindspells/astro-shield/compare/1.3.4...1.3.5

astro-shield - 1.3.4

Published by castarco 7 months ago

Security improvements

  • The script matcher now is able to detect malformed closing tags (containing "pseudo-attributes" that shouldn't be there according to the spec). This lets Astro-Shield to be more effective at removing a wider range of malicious injected scripts from dynamically generated content.
  • Some regular expressions have been reworked to mitigate the possibility polynomial or exponential execution time. This helps to prevent the possibility of DoS attacks via specially crafted strings intended to blow up the execution time of parsing code.

Autogenerated Changelog

Full Changelog: https://github.com/kindspells/astro-shield/compare/1.3.3...1.3.4

astro-shield - 1.3.3

Published by castarco 7 months ago

Minor fixes

  • The previous release (1.3.2) introduced a minor warning message that, although not really problematic, was quite annoying. That was fixed.

Autogenerated Changelog

Full Changelog: https://github.com/kindspells/astro-shield/compare/1.3.2...1.3.3

astro-shield - 1.3.2

Published by castarco 7 months ago

Fixes

  • In previous releases, the introduction of allow-lists introduced a strange regression causing the generation of an inconsistent hashes module. This has been fixed now.

Security

  • This release contains important security fixes. It is advisable to upgrade as soon as possible.

Autogenerated Changelog

Full Changelog: https://github.com/kindspells/astro-shield/compare/1.3.1...1.3.2

astro-shield - 1.3.1

Published by castarco 7 months ago

Development

  • Configure monorepo

Documentation

Autogenerated Changelog

Full Changelog: https://github.com/kindspells/astro-shield/compare/1.3.0...1.3.1

astro-shield - 1.3.0

Published by castarco 7 months ago

Security Fixes

If you were using Astro-Shield 1.2.0, it is quite relevant to upgrade to this new 1.3.0 version.

In this release we introduce many mitigations to some risks that were accidentally introduced in the past release with the new CSP headers generation for SSR content.

  • Now it will be mandatory to explicitly allow-list any cross-origin resource that might be loaded from dynamically generated pages. This is necessary to avoid the possibility that Astro-Shield accidentally "signs" malicious injected scripts or stylesheets.
  • It will also be possible to disallow SRI hashes generation for inline scripts or stylesheets, although we still allow them by default (we could change the default behavior in future releases, but we didn't want to introduce too many disruptive changes in a single release). The reason to disallow inline scripts in SSR content is the same as for the previous point, to protect the site against potential injections.

Other Changes

  • We introduced a new way to define the SRI configuration, while keeping the old way for now (with warning messages about future deprecation).

Autogenerated Changelog

Full Changelog: https://github.com/KindSpells/astro-shield/compare/1.2.0...1.3.0

astro-shield - 1.2.0

Published by castarco 7 months ago

New Features

  • Now it is possible to generate CSP headers for SSR (dynamic) pages

Minor improvements

  • Improved some warning and error messages
  • The hashes module generation now creates intermediate directories in case they don't exist, avoiding some annoying problems.

Development

  • The code is now prepared for other improvements on the security headers front.

Autogenerated Changelog

Full Changelog: https://github.com/KindSpells/astro-shield/compare/1.1.0...1.2.0

astro-shield - 1.1.0

Published by castarco 7 months ago

Fixes

  • Improved warning and error messages
  • Improved documentation to cover edge cases and their workarounds

Performance

  • Improved caching logic for static assets processing

Autogenerated Changelog

Full Changelog: https://github.com/KindSpells/astro-shield/compare/1.0.1...1.1.0

astro-shield - 1.0.1

Published by castarco 7 months ago

Fixes

  • Fixed a regression in the package release pipeline

Autogenerated Changelog

Full Changelog: https://github.com/KindSpells/astro-shield/compare/1.0.0...1.0.1

astro-shield - 1.0.0

Published by castarco 7 months ago

New Features

  • Middleware support! : Now it is possible for astro-shield to install a middleware that adds SRI hashes to dynamically generated pages, and not just static pages as until today.

Performance

  • We introduced better caching to reduce the amount of network calls that astro-shield has to perform when generating SRI hashes for cross-origin resources.

Development

  • New end-to-end tests: We introduced new e2e tests to ensure the quality and stability of this integration.
  • Higher testing coverage: We increased the testing coverage requirements for this library.

Autogenerated Changelong

Full Changelog: https://github.com/KindSpells/astro-shield/compare/0.5.1...1.0.0

astro-shield - 0.5.1

Published by castarco 8 months ago

Changes

  • Fix documentation

Autogenerated Changelog

Full Changelog: https://github.com/KindSpells/astro-shield/compare/0.5.0...0.5.1

astro-shield - 0.5.0

Published by castarco 8 months ago

Breaking Changes

  • The package was renamed to @kindspells/astro-shield
  • The internal integration label was set to @kindspells/astro-shield

New Features

  • Now it generates per-page SRI hashes, so we can use them to generate smaller CSP headers.

Autogenerated Changelog

Full Changelog: https://github.com/KindSpells/astro-shield/compare/0.4.2...0.5.0

astro-shield - 0.4.2

Published by castarco 8 months ago

Development Process Improvements

This release only improves how we release new versions of this package. From now on, all releases will be done from our Github Actions pipelines.

This will ensure that we are able to establish the provenance of that release, said in other words: this allows us to guarantee that the published package comes from a specific commit of this repository, without any alteration.

This guarantee is key for code supply chains security, and it will help with regulations and certifications compliance.

Autogenerated Changelog

Full Changelog: https://github.com/KindSpells/astro-sri-csp/compare/0.4.1...0.4.2

Provenance Attestations

astro-shield - 0.4.2

Published by castarco 8 months ago

Development Process Improvements

This release only improves how we release new versions of this package. From now on, all releases will be done from our Github Actions pipelines.

This will ensure that we are able to establish the provenance of that release, said in other words: this allows us to guarantee that the published package comes from a specific commit of this repository, without any alteration.

This guarantee is key for code supply chains security, and it will help with regulations and certifications compliance.

Auto-Generated Changelog

Full Changelog: https://github.com/KindSpells/astro-sri-csp/compare/0.4.1...0.4.2

astro-shield - 0.4.1

Published by castarco 8 months ago

Improvements

  • Now this lib generates the crossorigin="anonymous" attribute for <script>, <style>, and <link rel="stylesheet"> elements when they refer to external cross-origin resources, to avoid credentials leaks.
astro-shield - 0.4.0

Published by castarco 8 months ago

Development improvements

  • Added new tests
  • Added CI pipeline to run tests publicly
  • Added local git hooks to avoid pushing broken code

Improvements

  • Improved <script> matchers to cover more uncommon cases
  • Improved <style> matchers to cover more uncommon cases
  • Improved <link rel="stylesheet"> matches to cover more uncommon cases

Fixes

  • Use "private" type for the integration return type, to ensure that we won't have type mismatches because of Astro updates.
astro-shield - 0.3.0

Published by castarco 8 months ago

Improvements

  • Generate SRI hashes for "external" scripts and styles (by external we mean not inlined, independently of whether they are remote or server from the same origin)
  • Clarified documentation
astro-shield - 0.2.1

Published by castarco 8 months ago

Improvements

  • Now there is no need to pass the dist path to the integration function
  • Better documentation
  • Better types

Breaking Changes

  • Now parameters are passed as an options object instead of individual ordered values
astro-shield - 0.1.7 - First Public Release

Published by castarco 8 months ago

What does this lib does?

  • Transforms Astro's generated HTML files to add Subresource Integrity hashes to inlined scripts and styles.
  • Generates a JS module that exports the list of script and styles hashes, so they can be used to generate CSP headers.