Download the PHP package protect/sql-query-protection without Composer

On this page you can find all versions of the php package protect/sql-query-protection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sql-query-protection

��---

# SQL and LDAP Query Protection Middleware for Laravel

This package provides middleware for Laravel applications to prevent SQL injection and LDAP injection attacks. It ensures secure communication by blocking malicious queries, protecting both your database and directory services.

---

## Features

- SQL Injection Protection:

Validates and sanitizes SQL queries to prevent unauthorized access.

- LDAP Injection Protection:

Prevents malicious LDAP queries by sanitizing input before querying directory services.

- Custom Logging:

Logs suspicious queries for monitoring and further analysis.

- Easy to Configure:

Configurable middleware with options for logging and handling injection attempts.

---

## Installation

You can install the package via Composer.

### 1. Require the Package

`bash

composer require protect/sql-query-protection

`

Alternatively, you can install the latest development version:

`bash

composer require protect/sql-query-protection:@dev

`

### 2. Publish the Configuration File

`bash

php artisan vendor:publish --provider="SqlQueryProtection\SqlQueryProtectionServiceProvider"

`

### 3. Clear Config Cache

After publishing the configuration, clear the config cache:

`bash

php artisan config:clear

`

---

Route Middleware Registration

If you prefer to apply the middleware to specific routes, add the following line to the $routeMiddleware array:

`bash

protected $routeMiddleware = [

// Other route middleware...

'sql.protection' => \SqlQueryProtection\Middleware\SqlQueryProtection::class,

];

`

You can then use the middleware in your routes like this:

`bash

Route::middleware(['sql.protection'])->group(function () {

Route::get('/your-route', 'YourController@yourMethod');

});

`

---

---

## Usage: SQL Protection Command

This package provides an Artisan command to scan your routes for SQL injection vulnerabilities.

### Command Syntax

`bash

php artisan sqlprotection:scan

`

### Sample Output:

`plaintext

Running SQL Protection Scan...

Checking route: api/users

Checking route: api/orders

No SQL injection vulnerabilities detected.

`

If vulnerabilities are detected, they will be listed as follows:

`plaintext

Potential SQL injection vulnerabilities found in the following routes:

- api/orders

`

---

## Configuration Options

The configuration file is located at config/sqlqueryprotection.php. You can adjust the following settings:

`php

return [

'sqlprotectionenabled' => true,

'xssprotectionenabled' => true,

];

`

- sql_protection_enabled: Enables/Disables SQL injection protection.

- xss_protection_enabled: Enables/Disables XSS protection.

---

## Troubleshooting

If the sqlprotection:scan command is not recognized or the package does not function as expected, follow these steps:

1. Ensure the Service Provider is Registered:

Confirm the service provider is registered in config/app.php:

`php

'providers' => [

SqlQueryProtection\SqlQueryProtectionServiceProvider::class,

],

`

2. Run composer dump-autoload:

`bash

composer dump-autoload

`

3. Clear Application Cache:

`bash

php artisan cache:clear

php artisan config:clear

`

---

This README provides all the necessary steps to install, configure, and use the package effectively, including details about the Artisan command and configuration options.


All versions of sql-query-protection with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package protect/sql-query-protection contains the following files

Loading the files please wait ....