Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
zappzarapp-php-security — PHP 8.4+ security library (mirror) | Kitploit
工具/GitLabGitLab/marcstraube/zappzarapp-php-security
Authentication & AuthorizationEncryption/Decryption ToolsVulnerability AnalysisCode AnalysisConfiguration AuditingWeb SecurityDevSecOpsAPI SecurityLog Analysis
GitLabmarcstraube/zappzarapp-php-security

zappzarapp-php-security

PHP 8.4+ security library (mirror)

4天前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
查看仓库
内容在请求的语言中不可用。显示英文版本。

⚡ zappzarapp/security

Latest Version PHP Version License CI Socket Badge

Comprehensive PHP security library providing CSP, Security Headers, CSRF protection, Secure Cookies, Password Validation, Input Sanitization, Rate Limiting, SRI, Secrets Loading, Encryption, Session Security, TOTP two-factor authentication, Signed URLs, and Security Event Logging.

Highlights

  • All-in-one — 17 security modules in a single, composable package
  • Secure by default — strict CSP, no unsafe-*, HTTPS-first
  • Framework-agnostic — works with any PHP 8.4+ application
  • Immutable & type-safe — readonly classes, enums, with*() API
  • Quality-backed — PHPStan Level 8, Psalm Level 1, 100% Mutation Score, Deptrac architecture enforcement
  • PSR-compatible — PSR-3 (Logging), PSR-15 (Middleware), PSR-18 (HTTP Client)

Modules

Requirements

  • PHP ^8.4
  • ext-dom
  • ext-libxml
  • ext-sodium

Installation

root@kitploit:~
composer require zappzarapp/security

Quick Start

Security Headers

root@kitploit:~
use Zappzarapp\Security\Headers\Builder\SecurityHeadersBuilder;

$headers = SecurityHeadersBuilder::recommended()->build();
foreach ($headers as $name => $value) {
    header("{$name}: {$value}");
}

CSP with Nonces

root@kitploit:~
use Zappzarapp\Security\Csp\HeaderBuilder;
use Zappzarapp\Security\Csp\Directive\CspDirectives;
use Zappzarapp\Security\Csp\Nonce\NonceGenerator;

$generator = new NonceGenerator();
$csp = HeaderBuilder::build(CspDirectives::strict(), $generator);
header("Content-Security-Policy: {$csp}");

$nonce = $generator->get();
echo "<script nonce=\"{$nonce}\">console.log('Safe!');</script>";

CSRF Protection

root@kitploit:~
use Zappzarapp\Security\Csrf\CsrfProtection;
use Zappzarapp\Security\Csrf\Storage\SessionCsrfStorage;

$csrf = new CsrfProtection(new SessionCsrfStorage());

// Generate token for form
$token = $csrf->generateToken();
echo '<input type="hidden" name="_token" value="' . $token->value() . '">';

// Validate on submission
if (!$csrf->validateToken($_POST['_token'])) {
    throw new Exception('CSRF validation failed');
}

Input Sanitization

root@kitploit:~
use Zappzarapp\Security\Sanitization\Html\HtmlSanitizer;
use Zappzarapp\Security\Sanitization\Path\PathValidationConfig;
use Zappzarapp\Security\Sanitization\Path\PathValidator;

// Sanitize HTML (removes dangerous tags/attributes)
$sanitizer = new HtmlSanitizer();
$safe = $sanitizer->sanitize($userInput);

// Validate file paths (prevent directory traversal)
$validator = new PathValidator(new PathValidationConfig(basePath: '/var/www/uploads'));
if (!$validator->isSafe($userPath)) {
    throw new Exception('Invalid path');
}

See the documentation for detailed examples of all modules.

Documentation

Each module has detailed API documentation with class references, configuration options, and code examples:

Versioning

This library follows Semantic Versioning 2.0.0.

All classes, interfaces, and methods in the Zappzarapp\Security namespace are considered public API unless marked with @internal. Breaking changes only happen in major versions, with deprecation warnings at least one minor version before removal.

Releases are automated via release-please and GPG-signed. See CHANGELOG.md for release history.

Security

See SECURITY.md for vulnerability reporting and security considerations.

Contributing

See CONTRIBUTING.md for development setup and contribution guidelines.

License

MIT License - see LICENSE file for details.

下载工具
ModuleDescriptionKey Classes
CSPContent Security Policy header building and violation reportingCspDirectives, HeaderBuilder, NonceGenerator, CspReportParser
HeadersSecurity headers (HSTS, Permissions-Policy, etc.)SecurityHeaders, SecurityHeadersBuilder
CSRFCross-Site Request Forgery protectionCsrfProtection, CsrfConfig
CookieSecure cookie handlingSecureCookie, CookieBuilder, CookieOptions
EncryptionXChaCha20-Poly1305 authenticated encryptionSymmetricEncryptor, EnvelopeEncryptor, EncryptionKey, KeyRingEncryptor
PasswordPassword validation and hashingPasswordPolicy, PwnedPasswordChecker, PepperedPasswordHasher
SanitizationInput sanitization (HTML, SQL, URI, Path) and file upload validationHtmlSanitizer, UriSanitizer, PathValidator, UploadValidator
RateLimitingRate limiting with multiple algorithmsDefaultRateLimiter, RateLimitConfig
SRISubresource Integrity hash generationSriHashGenerator, IntegrityAttribute
SecretsDocker/file-based secret loadingSecretLoader, SecretValue, FileSecretSource
SessionSession hardening and fixation protectionSessionGuard, SessionConfig, SessionConfigurator
SignedUrlHMAC-signed URLs with mandatory expiryUrlSigner, SigningKey
TOTPTime-based one-time passwords (RFC 6238)TotpAuthenticator, TotpSecret, ProvisioningUri, RecoveryCodeGenerator
AnalyzerSecurity header analysis and auditingSecurityHeaderAnalyzer, AnalysisResult
ScannerCLI security header scannerScanCommand, StreamHeaderFetcher
MiddlewarePSR-15 middleware for drop-in framework integrationSecurityHeadersMiddleware, CspMiddleware, CspReportHandler, CsrfMiddleware, DoubleSubmitCsrfMiddleware, RateLimitMiddleware, CorsMiddleware
LoggingSecurity event loggingSecurityAuditLogger, SecurityEvent
ModuleDescription
CSPContent Security Policy with nonces and violation reporting
HeadersHSTS, COOP, COEP, CORP, Permissions
CSRFToken patterns and validation
CookieSecure cookie handling
EncryptionAuthenticated encryption, envelopes
PasswordHashing, policies, breach detection
SanitizationHTML, URI, path sanitization and file upload validation
Rate LimitingToken bucket, sliding window
SRISubresource integrity hashes
SecretsDocker/file-based secret loading
SessionSession hardening, fingerprinting
Signed URLsHMAC-signed URLs with expiry
TOTPOne-time passwords, recovery codes
AnalyzerSecurity header auditing
ScannerCLI header scanner for CI
MiddlewarePSR-15 middleware
LoggingSecurity event logging
GlossarySecurity terminology reference