Q1. What is clickjacking?
Clickjacking, also known as a “UI redress attack”, is when an attacker uses multiple transparent or opaque layers to trick a user into clicking on a button or link to another page when they were intending to click on the top level page. Thus, the attacker is “hijacking” clicks meant for their page and routing them to another page, most likely owned by another application, domain, or both. If it is still not clear to you then I am attaching a video URL that will explain it in a much better way.
Q2. How to stop clickjacking in the AEM using Apache2 Server?
Q3. What is the syntax of this configuration?
Header set X-Frame-Options: “sameorigin”
Q4. Where do we find this configuration?
- Uncomment this setting and restart your Apache2 server.
- Copy and paste this setting in apche2.conf file, uncomment it, and restart your Apache server.
In my case, I copied and pasted this setting in apche2.conf file, uncommented it and restarted my Apche2 server.
Q5. Apache Server is throwing error when restarting after this configuration?
Q6. How to enable Headers.mod in Apache2 server?
For enabling this module you have a headers.load file present in mods-available directory in your Apache2 server. In my case, it is present at /etc/apche2/mods-available. Just do one thing, create a softlink in your mods-enabled folder. If you are an Ubuntu user execute this command-
ln -s /etc/apache2/mods-available/header.load /etc/apache2/mods-enabled/headers.load
Q7. How to check whether it’s working or not?
After restarting your Apache2 server, just hit a non cached page via Apache2 Server. Open debugger and check the response header. You will see X-Frame-Options header field, as shown below
If you get this option on your page it means your configuration is working.