Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Added Guides Security section

Damian Legawiecccf2da8fefc1
diff --git a/SECURITY.md b/SECURITY.md
index b478cf4d30..9b3ff34114 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -1,17 +1 @@
-# Security Policy
-
-## Supported Versions
-
-| Version | Supported |
-| ------- | ------------------ |
-| 4.2.x | :white_check_mark: |
-| 4.1.x | :white_check_mark: |
-| 4.0.x | :white_check_mark: |
-| 3.7.x | :white_check_mark: |
-| 3.6.x | :white_check_mark: |
-| < 3.6 | :x: |
-
-## Reporting a Vulnerability
-
-**Do not open up a GitHub issue if the bug is a security vulnerability**.
-Instead please report any vulnerabilities at [email protected]
+Please see [Spree Guides Security section](https://guides.spreecommerce.org/developer/security/security.html).
diff --git a/guides/src/content/developer/security/api.md b/guides/src/content/developer/security/api.md
new file mode 100644
index 0000000000..bee91d1e85
--- /dev/null
+++ b/guides/src/content/developer/security/api.md
@@ -0,0 +1,13 @@
+---
+title: API
+section: security
+order: 3
+---
+
+## REST API v1
+
+The REST API behaves slightly differently than a standard user. First, an admin has to create the access key before any user can query the REST API. This includes generating the key for the admin him/herself. This is not the case if `Spree::Api::Config[:requires_authentication]` is set to `false`.
+
+In cases where `Spree::Api::Config[:requires_authentication]` is set to `false`, read-only requests in the API will be possible for all users. For actions that modify data within Spree, a user will need to have an API key and then their user record would need to have permission to perform those actions.
+
+It is up to you to communicate that key. As an added measure, this authentication has to occur on every request made through the REST API as no session or cookies are created or stored for the REST API.
diff --git a/guides/src/content/developer/security/authentication_and_authorization.md b/guides/src/content/developer/security/authentication_and_authorization.md
new file mode 100644
index 0000000000..a71ce27049
--- /dev/null
+++ b/guides/src/content/developer/security/authentication_and_authorization.md
@@ -0,0 +1,34 @@
+---
+title: Authentication and Authorization
+section: security
+order: 2
+---
+
+## Authentication
+
+If you install spree_auth_devise when setting up your app, we use a third party authentication library for Ruby known as [Devise](https://github.com/plataformatec/devise). This library provides a host of useful functionality that is in turn available to Spree, including the following features:
+
+* Authentication
+* Strong password encryption (with the ability to specify your own algorithms)
+* "Remember Me" cookies
+* "Forgot my password" emails
+* Token-based/oAuth 2.0 access (for REST API)
+
+### Devise Configuration
+
+<alert kind="note">
+A default Spree install comes with the [Spree Auth Devise](https://github.com/spree/spree_auth_devise) gem, which provides authentication for Spree using Devise. This section of the guide covers the default setup. If you're using your own authentication, please consult the manual for that authentication engine.
+</alert>
+
+We have configured Devise to handle only what is needed to authenticate with a Spree site. The following details cover the default configurations:
+
+* Passwords are stored in the database encrypted with the salt.
+* User authentication is done through the database query.
+* User registration is enabled and the user's login is available immediately (no validation emails).
+* There is a remember me and password recovery tool built in and enabled through Devise.
+
+These configurations represent a reasonable starting point for a typical e-commerce site. Devise can be configured extensively to allow for a different feature set but that is currently beyond the scope of this document. Developers are encouraged to visit the [Devise wiki](https://github.com/plataformatec/devise/wiki) for more details.
+
+### Authorization
+
+Please refer to [Permissions Customization guide](/developer/customization/permissions.html) for more information.
diff --git a/guides/src/content/developer/security/pci_compliance.md b/guides/src/content/developer/security/pci_compliance.md
new file mode 100644
index 0000000000..9496ca658f
--- /dev/null
+++ b/guides/src/content/developer/security/pci_compliance.md
@@ -0,0 +1,21 @@
+---
+title: PCI Compliance
+section: security
+order: 1
+---
+
+## Overview
+
+All store owners wishing to process credit card transactions should be familiar with [PCI Compliance](http://en.wikipedia.org/wiki/Pci_compliance). [Spree Gateway Stripe itnegration](https://github.com/spree/spree_gateway) and [Spree Braintree vzero](https://github.com/spree-contrib/spree_braintree_vzero) are PCI-compliant.
+
+## Transmit Exactly Once
+
+Spree uses extreme caution in its handling of credit cards. In production mode, credit card data is transmitted to Spree via SSL. The data is immediately relayed to your chosen payment gateway and then discarded. The credit card data is never stored in the database (not even temporarily) and it exists in memory on the server for only a fraction of a second before it is discarded.
+
+Spree does store the last four digits of the credit card and the expiration month and date. You could easily customize Spree further if you wanted and opt out of storing even that little bit of information.
+
+## 3-D Secure and Strong Customer Authenthication support
+
+[Spree Gateway Stripe itnegration](https://github.com/spree/spree_gateway) supports [Strong Customer Authentication (SCA)](https://stripe.com/en-pl/guides/strong-customer-authentication) out of the box. Remember to use `Stripe Elements` gateway with `Payment Intents` option enabled.
+
+[Spree Braintree vzero](https://github.com/spree-contrib/spree_braintree_vzero) extension supports [3D Secure 2.0](https://developers.braintreepayments.com/guides/3d-secure/overview).
diff --git a/guides/src/content/developer/security/security.md b/guides/src/content/developer/security/security.md
new file mode 100644
index 0000000000..c001a38fd0
--- /dev/null
+++ b/guides/src/content/developer/security/security.md
@@ -0,0 +1,39 @@
+---
+title: Security
+order: 0
+---
+
+## Overview
+
+Proper application design, intelligent programming, and secure infrastructure are all essential in creating a secure e-commerce store using any software (Spree included). The Spree team has done its best to provide you with the tools to create a secure and profitable web presence, but it is up to you to take these tools and put them in good practice. We highly recommend reading and understanding the [Rails Security Guide](http://guides.rubyonrails.org/security.html).
+
+## Supported Versions
+
+This is a list of all Spree versions currently being supported by the Spree team.
+
+| Version | Supported? | Release date | EOL date |
+| ------- | ------------------ | ------------ | -------- |
+| 4.2 | **Yes** | 23.02.2021 | 23.02.2023 |
+| 4.1 | **Yes** | 02.03.2020 | 02.03.2022 |
+| 4.0 | **Yes** | 09.10.2019 | 09.10.2021 |
+| 3.7 | **Yes** | 04.02.2019 | 04.02.2021 |
+| 3.6 | No | 12.06.2018 | 12.06.2020 |
+| 3.5 | No | 12.06.2018 | 12.06.2020 |
+| 3.4 | No | 12.10.2017 | 12.12.2019 |
+| 3.3 | No | 22.08.2017 | 24.01.2019 |
+| 3.2 | No | 17.03.2017 | 24.01.2019 |
+| 3.1 | No | 15.06.2016 | 24.01.2019 |
+
+If you're using an older version [please upgrade](/developer/upgrades/upgrade_guides.html). Having trouble upgrading? [Contact us for support](https://spreecommerce.org/contact/).
+
+## Reporting Security Issues
+
+Please do not announce potential security vulnerabilities in public. We have a dedicated email address [[email protected]](mailto:[email protected]). We will work quickly to determine the severity of the issue and provide a fix for the appropriate versions. We will credit you with the discovery of this patch by naming you in a blog post.
+
+If you would like to provide a patch yourself for the security issue **do not open a pull request for it**. Instead, create a commit on your fork of Spree and run this command:
+
+```bash
+git format-patch HEAD~1..HEAD --stdout > patch.txt
+```
+
+This command will generate a file called `patch.txt` with your changes. Please email a description of the patch along with the patch itself to our [dedicated email address](mailto:[email protected]).
diff --git a/guides/src/content/developer/tutorials/security.md b/guides/src/content/developer/tutorials/security.md
deleted file mode 100644
index 88e5cc0430..0000000000
--- a/guides/src/content/developer/tutorials/security.md
+++ /dev/null
@@ -1,69 +0,0 @@
----
-title: Security
-section: advanced
----
-
-## Overview
-
-Proper application design, intelligent programming, and secure infrastructure are all essential in creating a secure e-commerce store using any software (Spree included). The Spree team has done its best to provide you with the tools to create a secure and profitable web presence, but it is up to you to take these tools and put them in good practice. We highly recommend reading and understanding the [Rails Security Guide](http://guides.rubyonrails.org/security.html).
-
-## Reporting Security Issues
-
-Please do not announce potential security vulnerabilities in public. We have a [dedicated email address](mailto:[email protected]). We will work quickly to determine the severity of the issue and provide a fix for the appropriate versions. We will credit you with the discovery of this patch by naming you in a blog post.
-
-If you would like to provide a patch yourself for the security issue **do not open a pull request for it**. Instead, create a commit on your fork of Spree and run this command:
-
-```bash
-git format-patch HEAD~1..HEAD --stdout > patch.txt
-```
-
-This command will generate a file called `patch.txt` with your changes. Please email a description of the patch along with the patch itself to our [dedicated email address](mailto:[email protected]).
-
-## Authentication
-
-If you install spree_auth_devise when setting up your app, we use a third party authentication library for Ruby known as [Devise](https://github.com/plataformatec/devise). This library provides a host of useful functionality that is in turn available to Spree, including the following features:
-
-* Authentication
-* Strong password encryption (with the ability to specify your own algorithms)
-* "Remember Me" cookies
-* "Forgot my password" emails
-* Token-based/oAuth 2.0 access (for REST API)
-
-### Devise Configuration
-
-<alert kind="note">
-A default Spree install comes with the [spree_auth_devise](https://github.com/spree/spree_auth_devise) gem, which provides authentication for Spree using Devise. This section of the guide covers the default setup. If you're using your own authentication, please consult the manual for that authentication engine.
-</alert>
-
-We have configured Devise to handle only what is needed to authenticate with a Spree site. The following details cover the default configurations:
-
-* Passwords are stored in the database encrypted with the salt.
-* User authentication is done through the database query.
-* User registration is enabled and the user's login is available immediately (no validation emails).
-* There is a remember me and password recovery tool built in and enabled through Devise.
-
-These configurations represent a reasonable starting point for a typical e-commerce site. Devise can be configured extensively to allow for a different feature set but that is currently beyond the scope of this document. Developers are encouraged to visit the [Devise wiki](https://github.com/plataformatec/devise/wiki) for more details.
-
-### REST API v1
-
-The REST API behaves slightly differently than a standard user. First, an admin has to create the access key before any user can query the REST API. This includes generating the key for the admin him/herself. This is not the case if `Spree::Api::Config[:requires_authentication]` is set to `false`.
-
-In cases where `Spree::Api::Config[:requires_authentication]` is set to `false`, read-only requests in the API will be possible for all users. For actions that modify data within Spree, a user will need to have an API key and then their user record would need to have permission to perform those actions.
-
-It is up to you to communicate that key. As an added measure, this authentication has to occur on every request made through the REST API as no session or cookies are created or stored for the REST API.
-
-### Authorization
-
-Please refer to [Permissions Customization guide](/developer/customization/permissions.html) for more information.
-
-## Credit Card Data
-
-### PCI Compliance
-
-All store owners wishing to process credit card transactions should be familiar with [PCI Compliance](http://en.wikipedia.org/wiki/Pci_compliance). [Spree Gateway Stripe itnegration](https://github.com/spree/spree_gateway) and [Spree Braintree vzero](https://github.com/spree-contrib/spree_braintree_vzero) are PCI-compliant.
-
-### Transmit Exactly Once
-
-Spree uses extreme caution in its handling of credit cards. In production mode, credit card data is transmitted to Spree via SSL. The data is immediately relayed to your chosen payment gateway and then discarded. The credit card data is never stored in the database (not even temporarily) and it exists in memory on the server for only a fraction of a second before it is discarded.
-
-Spree does store the last four digits of the credit card and the expiration month and date. You could easily customize Spree further if you wanted and opt out of storing even that little bit of information.