Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Security Laravel Package

artisanpack-ui/security

Core Laravel security toolkit for ArtisanPack UI: sanitization, escaping (Laminas Escaper), KSES filtering, validation rules, security/CSP middleware, CSP builder with nonce & reporting, rate limiting, audit/scan commands, and testing helpers.

View on GitHub
Deep Wiki
Context7

Configuration Management

The ArtisanPack UI Security package provides a comprehensive security configuration file that allows you to manage various security settings for your application. This document explains how to publish and manage this configuration, and how to use the provided tools to validate your setup.

Publishing the Configuration

To publish the security configuration file, run the following Artisan command:

php artisan vendor:publish --tag=artisanpack-package-config

This will publish the security.php configuration file to your application's config/artisanpack directory. You can then customize the settings in this file to suit your needs.

Configuration Validation

The package includes a service to validate your security configuration against best practices. This is especially important in production environments.

Environment Validation Service

The ArtisanPackUI\Security\Services\EnvironmentValidationService is responsible for checking your configuration. In a production environment, it performs the following checks:

  • Debug Mode: Ensures app.debug is false.
  • Session Encryption: Ensures artisanpack.security.encrypt is true.
  • Two-Factor Authentication: Warns if artisanpack.security.enabled is false.
  • Content Security Policy (CSP): Warns if the CSP contains 'unsafe-inline' or 'unsafe-eval'.

Production Environment Checks

These validation checks are run automatically when your application is in a production environment. Any errors or warnings are logged to the application's log file. Errors are logged as critical, and warnings as warning.

Artisan Command

You can manually check your security configuration at any time using the security:check-config Artisan command:

php artisan security:check-config

This command will run the validation checks for your current environment and display the results in the console. If any errors are found, the command will exit with a non-zero status code, which can be useful for CI/CD pipelines.

Configuration Caching

The security configuration fully supports Laravel's configuration caching. When you run php artisan config:cache, your config/artisanpack/security.php file will be cached along with the rest of your application's configuration. The package will correctly use the cached values.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor