PhpSecureGuard is a lightweight, framework-agnostic PHP library designed to enhance the security of your web applications. With easy-to-use tools for input sanitization, security headers, CSRF protection, encryption, and more, PhpSecureGuard helps developers secure their projects with minimal effort.
- Input Validation and Sanitization: Prevent SQL injection and XSS attacks with robust input handling tools.
- Security Headers Management: Easily configure HTTP security headers like CSP, HSTS, and X-Frame-Options.
- Advanced CSRF Protection: Secure your forms with token-based CSRF prevention workflows.
- Encryption and Decryption Utilities: Protect sensitive data with user-friendly encryption tools.
- Rate Limiting: Throttle requests to prevent brute-force attacks.
- Real-Time Logging and Alerts: Monitor suspicious activities and send alerts for potential breaches.
- Security Auditing Tool: Identify vulnerabilities and misconfigurations in your application.
Install the library via Composer: $ composer require your-namespace/php-secure-guard
Basic Usage Include the autoloader and initialize PhpSecureGuard:
require 'vendor/autoload.php';
use PhpSecureGuard\SecurityHeaders;
// Example: Add Content Security Policy (CSP) header
$securityHeaders = new SecurityHeaders();
$securityHeaders->addCSP("default-src 'self'");- Install the library via Composer.
- Use the provided middleware to configure security settings.
- Install the library via Composer.
- Add filters in your
Config/Filters.php.
Visit the official documentation (link to be added) for detailed usage instructions and examples.
We welcome contributions! Please check out the contribution guidelines (link to be added).
PhpSecureGuard is licensed under the MIT License.