Skip to main content

Sulu Security.txt Bundle 0.1.0 released!

· 2 min read
Stephan Hochdörfer
Head of IT Business Operations

A few days ago, we released our first open-source bundle for the Sulu CMS - a content management solution built on top of the Symfony framework.

The bundle allows you to manage security.txt files via Sulu Admin. But what is a security.txt file? Security.txt files are a proposed standard (see RFC 9116) which allows websites to define security policies.

Instead of manually adding and managing the files, with our bundle you can use Sulu Admin to do so.

Installing the bundle is done as follows:

  1. Download the bundle via Composer:
composer require bitexpert/sulu-securitytxt-bundle
  1. Register the bundle in the file config/bundles.php
BitExpert\Sulu\SecuritytxtBundle\BitExpertSuluSecuritytxtBundle::class => ['all' => true],
  1. Create file config/packages/securitytxt.yaml to expose the securitytxt resources:
list: app.get_securitytxt_list
detail: app.get_securitytxt

  1. Configure the routing as follows:

Create file config/routes/securitytxt_admin.yaml:

resource: "@BitExpertSuluSecuritytxtBundle/Resources/config/routing_api.yaml"
type: rest
prefix: /admin/api

Create file config/routes/securitytxt_website.yaml:

resource: "@BitExpertSuluSecuritytxtBundle/Resources/config/routing_website.yaml"
  1. Run Doctrine Schema Update
./bin/adminconsole doctrine:schema:update -f

Now, when you open Sulu Admin and navigate to the Webspaces menu, you should see an additional tab "Security.txt" which allows you to manage the Security.txt files for each of your webspaces. Be aware that you can only save one security.txt file for one specific webspace!

If you like the module, let us know!