# Manual Security Center for Shopware 6

> Manual for the Security Center: first check, findings and steps to fix them, two-factor login, country block, change log, privacy and all settings.

Quelle / Source: https://stoneandwater.online/en/manual-security-center.html

## What the plugin does

The Security Center regularly checks your shop for skimmers, malware, changed files, weak accesses, critical changes to settings and known vulnerabilities. Every anomaly is stored as a finding with a level, an explanation and steps to fix it.
In addition, the plugin protects the administration login: with two-factor login, a country block, a list of allowed addresses, a login log and a log of all critical changes.
A check, not a promise of protection: the check reports anomalies and changes. It does not prevent an attack and does not find every piece of malware. Every finding should be reviewed before it is confirmed.
Shopware 6.6 and 6.7: the plugin runs on both versions, in German and English, with dark mode. Up to version 1.5 it was called Security Scanner.

## First steps

- Install and activate the plugin via the Plugin Suite.
- Open the Security Center under Extensions and check the licence.
- Click Check now in the overview. The first check records the initial state.
- Go through the findings of the first check: weak passwords, known vulnerabilities and exposed files already show up in the first run.
- Work through the Recommended setup list in the overview: two-factor login, notification, headers and whatever else is missing.

## Activate the licence

The licence is assigned via the Plugin Suite and checked automatically on first opening. Without a valid licence the plugin shows the licence view where you enter the key. Without a licence no check runs and the login protection does not apply: nobody is locked out by an expired licence.

## The first check and the initial state

During the first check the plugin remembers a checksum for every file and the current value of critical settings. That is the initial state. From the second check on, every deviation is reported: new, changed and deleted files, new administrators, changed payment methods.
The initial state should be clean. If you suspect the shop has already been changed, first look at the findings of the malware and original comparison areas, which work without an initial state.
Under Settings, Directories the initial state can be discarded with Record again, for example after a server move.

## Overview and security score

The overview shows the security score from 0 to 100, the open findings by level, the last check and the number of files checked. The score drops with every open finding, more so for high levels. Confirmed and resolved findings do not count.
Recommended setup lists the protective features that are not set up yet. Switch on activates a feature immediately, Set up takes you to the right place. Hide whatever this shop does not need.
Score history shows the score at the end of the most recent checks, 30 at most. The curve starts with the second check and is also part of the PDF report.
Below are the foreign scripts of the storefront, the latest administration logins, the quarantine and the latest checks. PDF report downloads the current state as a PDF.

## Reading and confirming findings

Every finding has a level: High needs attention immediately, Medium should be reviewed soon, Low is a weakness without acute danger, Notice is for information.
Details shows what was found, the recommendation and all data on the finding. If the finding is fine, click Confirm. It then counts as reviewed and only comes back when something changes. Once the cause is removed, the next check closes the finding on its own.
After a Shopware or plugin update many files change. Confirm all file changes accepts them in one step. Several findings can be confirmed together via the selection.

## Steps to fix a finding

The details of a finding list numbered steps to fix it. The same steps appear in the e-mail and in the PDF report.
For vulnerabilities the plugin distinguishes where the affected package comes from: Shopware itself, a package Shopware ships, a plugin or your own project. That decides whether a Shopware update, a plugin update or a command such as composer update helps. The command is in the finding, ready to copy.
Several vulnerabilities with the same cause are grouped into one finding, for example all Symfony packages that one Shopware update fixes together.

## The check areas

- Files: new, changed and deleted files, PHP in media folders, malware patterns.
- Original comparison: the Shopware core files are compared with the original of the installed version.
- Database: scripts in product texts, snippets and settings.
- Accesses: administrators, integrations, access keys and payment methods.
- Settings: domains, payment methods, mailer, tracking, webhooks, flows and roles with before and now.
- Configuration: environment, debug mode and secret keys.
- Passwords and keys: weak and old passwords, unused keys, administrators without a second factor.
- Updates and vulnerabilities: security advisories for Shopware, PHP and packages, available plugin updates.
- View from outside: publicly reachable files, headers, certificate, SPF and DMARC.
- Storefront: scripts and forms pointing to foreign addresses.
- Logins: many failed attempts, login from a new network.
- Abuse: clusters of payments, registrations, password requests and orders.

## Viewing, comparing and quarantining files

For findings on files the details offer these tools:
- View file: shows the content, suspicious places are marked.
- Compare with original: puts a Shopware core file next to the original and shows the changed lines.
- Restore original: replaces a changed core file with the original of the installed version. The previous version is kept as a copy in quarantine.
- Move to quarantine: moves the file out of the shop into a protected folder. In the overview it can be restored or deleted permanently.

Files under vendor, config and bin cannot be quarantined, so the shop does not break. Restoring the original helps here.

## Immediate measures

For findings on accesses the matching measures are right in the finding: Lock user logs the user out everywhere and deactivates them, Lock integration withdraws the access, Deactivate payment method removes it from the checkout. You cannot lock your own user.

## Setting security headers

If the view from outside reports missing headers, the finding offers the button Set headers now. You get the same under Settings, Storefront protection. On every page the plugin only adds what is missing: protection against wrong type detection, protection against embedding in foreign pages, a referrer policy and, over https, the instruction to open the shop encrypted only. Whatever Shopware or the server already sets remains untouched.

## AI assessment

Under Settings, AI interface you store provider, key and model and check the connection with Test connection. After that the details of a finding offer the AI assessment button. The AI rates the finding as harmless, worth checking or critical and names steps. The assessment is a second opinion, not a decision.
Only the data of that one finding is sent, plus an excerpt for files. If the AI Product Advisor is installed, its key is used as well.

## Setting up two-factor login

- In the Login protection tab click Set up next to the user.
- Scan the QR code with an authenticator app, for example Google Authenticator, Microsoft Authenticator or 1Password.
- Enter the six-digit code from the app and confirm.
- Store the eight recovery codes safely. Each one works once.

From then on the administration login page asks for the code after user name and password. The password is checked first, then the code. After five wrong codes the login is locked for 15 minutes. Integrations with an API key keep logging in without a code.

## Login only from allowed addresses

Under Settings, Logins switch on Login only from allowed addresses and enter one IP address or network per line, for example 203.0.113.10 or 203.0.113.0/24. IPv6 is supported.
When saving, the plugin checks whether your current address is in the list. If not, nothing is saved. A list that is switched on but empty locks nobody out.

## Login only from allowed countries

Under Settings, Logins switch on Restrict login by country, choose the mode (allow only these countries or block these countries) and add the countries. The block only applies to logging in to the administration with user name and password, not to the storefront and not to integrations.
When saving, the plugin checks whether your own country would still be allowed. An address from the list of allowed addresses may log in regardless of the country.
The mapping of addresses to countries comes from DB-IP (db-ip.com, licence CC BY 4.0). The plugin downloads the data to your server once a month and looks it up there. It is not accurate in every case: VPN and mobile networks abroad may differ. Behind a proxy or CDN Shopware must know the real address of the visitor, the Login protection tab points this out.

## If nobody can log in any more

On the server in the shop directory this command removes the second factor for all users and switches off the address list and the country block:
bin/console staw:security:login-reset
With a user name after it, it only applies to that user. Without console access an empty file is enough:
var/staw-security-scan/disable-login-protection
As long as the file exists, code, address list and country block are suspended.

## Login log

The plugin logs successful and failed administration logins with user and address. Ten failed attempts from one address within 15 minutes and a login from a previously unknown network are reported as findings. Entries are deleted after the configured number of days.

## Sessions and inactive administrators

The Login protection tab shows the number of open sessions per user. Log out everywhere ends all sessions of that user, for example after a lost device.
An administrator who has not logged in for longer than the configured number of days is reported as a finding. Counting starts from the moment the plugin began observing logins. The default is 180 days, 0 switches the report off.

## Checking passwords against data leaks

With Match new passwords against data leaks switched on, the plugin checks every newly set admin password against the collection of known data leaks of Have I Been Pwned. The first five characters of a checksum of the password are transmitted, the comparison itself happens on your server. The password and the full checksum do not leave the server.
If the password appears in a data leak, a finding of level High is created. It closes as soon as the user sets a different password. The default is off because a third-party service is involved.

## Change log

The Log tab shows who changed what and when: users, roles, integrations, payment and shipping methods, domains, flows, webhooks, plugins and settings. Every entry names time, user or integration, address, the affected entry and the names of the changed fields. The content of the fields is not stored.
Entries are deleted after the configured number of days, the default is 90 days. The log can be switched off under Settings, Logins.

## Traps for attackers

Automated attack tools look for pages that do not exist in a Shopware shop, such as /wp-admin or /phpmyadmin. With traps switched on, the plugin blocks such an address for the configured time, the default is 60 minutes. The Login protection tab lists the blocked addresses and lifts a block on request.
The traps apply to addresses the web server passes on to Shopware. Requests for .php files or files such as /.env are answered by the web server itself on many servers and then never reach the plugin. Behind a proxy or CDN Shopware must know the real address of the visitor, otherwise the block would hit the proxy.

## Content Security Policy for the storefront

A Content Security Policy tells the browser which addresses it may load scripts from. An injected skimmer from a foreign address is then not executed.
- Report only: the browser still loads everything but reports every address outside the list. The overview shows the reported addresses.
- Enter addresses that belong to the shop under Allowed addresses.
- Enforce: only once no legitimate addresses are reported any more.

The default is Off. Test the checkout with all payment methods before enforcing.

## Notifications and reports

After every check the plugin reports new findings from the chosen level by e-mail, including the steps to fix them. Every finding is reported once. With Report resolved findings switched on, the next report also names what has been resolved since the last one.
In addition a webhook can be entered, for example for Slack or Microsoft Teams, and a weekly summary with the state of all open findings. Both can be checked with a test message.
The PDF report in the overview summarises the score, its history, open findings with steps and the latest checks. Under Settings, Report by e-mail you store your own sender name and logo, for example as an agency for your clients. Times are shown in the user's time zone.

## Schedule, running without a cron job and instant check

The full check runs on a schedule via Shopware's scheduled tasks, by default daily at 3 am. The most reliable setup is a cron job on the server that runs the scheduled tasks and the message queue.
Check without cron job: if the scheduled tasks do not start the check, the plugin runs it itself. This starts no earlier than three hours after the due time, as soon as someone opens the shop or the administration, and runs in short sections after the page has been delivered. The configured hour does not apply in this case. The overview points this out, and the list of checks says Without cron job. It can be switched off under Settings, Schedule.
Self-monitoring: if no check runs for two days anyway, for example because the shop has no visitors, the overview warns and one e-mail is sent.
The instant check reacts to critical changes: new administrators, integrations, plugins and changed payment methods are checked and reported seconds later.

## Privacy: what is stored and what goes out

All data lives in the database and in the directory var/staw-security-scan of your shop. Personal data here mainly means IP addresses and user names of administrators:
- Login log: user name, IP address, time, success and browser identifier of every administration login. Deleted after 30 days, configurable, can be switched off.
- Change log: time, user or integration, IP address, affected entry and names of the changed fields. Deleted after 90 days, configurable, can be switched off.
- Traps: the IP address of a blocked visitor for the duration of the block, 60 minutes by default. Off by default.
- Two-factor login: per user the secret for the codes, the checksums of the recovery codes and the networks they last logged in from.
- Findings: may contain user names and IP addresses, for example for many failed attempts. The plugin does not record individual storefront customers, the abuse check only counts clusters.

Only these requests go out:
- packagist.org: the names of the public packages for matching against security advisories. Private packages are not named.
- GitHub: checksums and originals of the Shopware core.
- db-ip.com: the country data once a month, only with the country block switched on. The lookup happens on your server, no IP address is transmitted.
- Have I Been Pwned: the first five characters of a checksum of new admin passwords, only if the check is switched on.
- AI provider: the data of one finding and an excerpt for files, only if set up and only when clicking AI assessment.
- Webhook: title and target of new findings to the address you entered.
- Your own domains: for the view from outside and the storefront check.

Legal basis: the logs serve the security of the shop, which is usually a legitimate interest under Art. 6(1)(f) GDPR. Administrators are affected and, for the traps, visitors as well. Add the processing to your record of processing activities.
Suggested text for the privacy policy if the traps are switched on:
To protect our shop against automated attacks we detect requests that specifically look for vulnerabilities. In this case we store the IP address of the requester for up to 60 minutes and block access for that time. The legal basis is our legitimate interest in the security of our service (Art. 6(1)(f) GDPR). The data is not passed on to third parties.
For administrators a note in the internal documentation or in the contract with the agency is usually enough. The text is a suggestion and not legal advice, adjust the duration to your setting.

## Limits of the check

The scanner runs inside the shop itself. An attacker with full access to the server can switch it off or bypass it. It does not replace a firewall, updates or backups. Malware that follows no known pattern and was present before the first check can remain undetected unless it sits in the Shopware core.

## Permissions in the admin

The plugin is visible to users who may manage extensions. Such a user sets up two-factor login for themselves and for others.

## Uninstalling

When uninstalling with the option to delete all data, the plugin removes its tables and settings, including the login log and the change log. Second factor, address list and country block then no longer apply for any user. Only files in quarantine remain under var/staw-security-scan/quarantine and can be deleted by hand.

## Support

Questions, bugs or wishes: reach us directly via Request a feature in the plugin or the contact form.

