What are the specific clickjacking prevention requirements for Lightning Web Components?
Answer
To prevent clickjacking in Lightning Web Components:
1. Ensure components are not unnecessarily exposed. Sub-components of a main component should not be exposed.
2. Create new components with `"isexposed"` set to `false` and delete the old ones.
3. Avoid using CSS directives like `"position: absolute"` or `"position: fixed"` unless the component is not exposed outside the namespace or its visibility is restricted to specific pages owned by the namespace.
What are the specific clickjacking prevention requirements for Lightning Web Components?
Recommended Answer Update
To prevent clickjacking in Lightning Web Components:
1. Ensure components aren't unnecessarily exposed. Sub-components of a main component shouldn't be exposed.
2. Create new components with `"isExposed"` set to `false` and delete the old ones.
3. Avoid using CSS directives like `"position: absolute"` or `"position: fixed"` unless the component isn't exposed outside the namespace or its visibility is restricted to specific pages owned by the namespace.
Reasoning
The main improvements focused on making the language more conversational and concise while preserving all existing technical content. Changed 'are not' to 'aren't' and 'should not' to 'shouldn't' to follow the conversational tone guidelines. Changed 'is not exposed' to 'isn't exposed' for consistency. These changes make the FAQ more readable while maintaining all the original security guidance.
Regarding the related security rule AvoidLmcIsExposedTrue: This rule directly relates to the FAQ content because it specifically addresses the security concern of Lightning Message Channel components being unnecessarily exposed (isExposed=true). The FAQ discusses setting 'isexposed' to false and avoiding unnecessary component exposure, which aligns perfectly with what this security rule detects and prevents. The FAQ's guidance about creating components with isExposed set to false directly corresponds to the security practice this rule enforces.