Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 5870379

Browse files
author
Lori Krell
authored
Merge pull request #2455 from magento-architects/ok_security_guidelines
Added Security section
2 parents 4c25a33 + 85ddab1 commit 5870379

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

guides/v2.2/coding-standards/technical-guidelines.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,64 @@ class SampleEventObserverThatModifiesInputs
703703
{:start="14.2"}
704704
14.2. Events used SHOULD be observed as specifically as possible. A `global` subscription to an event SHOULD NOT be used when the area impacted is just `frontend`.
705705

706+
## 15. Security
707+
708+
15.1. Use prepared statements for SQL queries.
709+
710+
15.2. Broken Authentication protection.
711+
712+
15.2.1. Where possible, implement multi-factor authentication to prevent automated, credential stuffing, brute force, and stolen credential re-use attacks.
713+
714+
15.2.2. Do not ship or deploy with any default credentials, particularly for admin users.
715+
716+
15.2.3. Implement weak-password checks, such as testing new or changed passwords against a list of the [top 10000 worst passwords](https://github.com/danielmiessler/SecLists/tree/master/Passwords).
717+
718+
15.2.4. Align password length, complexity, and rotation policies with [NIST 800-63 B's guidelines in section 5.1.1 for Memorized Secrets](https://pages.nist.gov/800-63-3/sp800-63b.html#memsecret) or other modern, evidence-based password policies.
719+
720+
15.2.5. Ensure registration, credential recovery, and API pathways are hardened against account enumeration attacks by using the same messages for all outcomes.
721+
722+
15.2.6. Limit or increasingly delay failed login attempts. Log all failures and alert administrators when credential stuffing, brute force, or other attacks are detected.
723+
724+
15.2.7. Use a server-side, secure, built-in session manager that generates a new random session ID with high entropy after login. Session IDs should not be in the URL, be securely stored and invalidated after logout, idle, and absolute timeouts.
725+
726+
15.3. XSS protection.
727+
728+
15.3.1. Sanitize input; escape output.
729+
730+
15.3.2. Follow [templates XSS security guidelines](https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/templates/template-security.html) for escaping output.
731+
732+
15.3.3. Incoming data should be casted to the expected type. String data should be validated/sanitized.
733+
734+
15.3.4. Incoming string data length should be checked.
735+
736+
15.3.5. Special characters, like null byte characters, should be dropped from Incoming string data.
737+
738+
15.4. A module that introduces Admin Panel functionality should have ACL.
739+
740+
15.5. Misconfiguration protection.
741+
742+
15.5.1. Do not include/require unused libraries/frameworks.
743+
744+
15.5.2. A segmented application architecture that provides effective, secure separation between components or tenants, with segmentation, containerization, or cloud security groups (ACLs).
745+
746+
15.5.3. Sending security directives to clients, e.g. [Security Headers](https://www.owasp.org/index.php/OWASP_Secure_Headers_Project).
747+
748+
15.6. Sensitive Data Exposure protection.
749+
750+
15.6.1. Exceptions/Notices/Warnings should be caught and logged.
751+
752+
15.6.2. No error output should be displayed to user, some standard message should appear instead.
753+
754+
15.6.3. Logs should not be excessive, e.g. PDO exception contains MySQL credentials that should not be logged.
755+
756+
15.7. CSRF protection.
757+
758+
15.7.1. CSRF tokens mechanism should be utilized.
759+
760+
15.7.2. All data manipulation requests should be made with POST requests.
761+
762+
15.8. Frequently update the third-party libraries used in the project/component to eliminate known vulnerabilities.
763+
706764
<!-- LINKS: DEFINITIONS AND ADDRESSES -->
707765

708766
[RFC2119]: https://tools.ietf.org/html/rfc2119

0 commit comments

Comments
 (0)