Afunana
Afunana Documentation

AppScan & OWASP

OWASP Top 10 coverage, application security scan readiness, and vulnerability management.

← Back to Docs

OWASP Top 10 (2021) Mapping

The following table maps each OWASP Top 10 2021 category to the controls implemented in Afunana.

OWASP IDCategoryAfunana Controls
A01Broken Access ControlRBAC with 4 roles (admin, user, viewer, qa), collection-based isolation, JWT authentication, 404 returned for unauthorized access (prevents enumeration)
A02Cryptographic FailuresTLS 1.2+ enforced, AES-256 TDE at rest, bcrypt password hashing, SHA-256 hash chain for audit integrity, Docker secrets for credential storage
A03InjectionParameterized SQL via pyodbc (no string concatenation), Pydantic input validation on all API endpoints, React JSX auto-escaping prevents XSS
A04Insecure DesignDefense-in-depth architecture, least-privilege DB user, non-root containers, immutable audit log with DB trigger protection
A05Security MisconfigurationAuto-TLS via Caddy, security headers enforced on all responses, Docker secrets (not env vars), no default credentials (generated at install)
A06Vulnerable Componentspip audit + npm audit on every deploy, minimal UBI 9 base image, automated dependency scanning
A07Auth Failuresbcrypt 12 rounds, account lockout after 5 failures, idle/absolute session timeouts, token revocation on logout/password change, SSO/OIDC support
A08Software/Data IntegritySHA-256 hash chain on audit log, DB trigger prevents UPDATE/DELETE on event log, daily integrity verification checks
A09Security Logging/MonitoringImmutable audit log, SIEM forwarding (CEF/JSON), health endpoint with auto-restart, compliance scheduler for periodic checks
A10SSRFNo user-controlled URL fetching in the application, AS/400 connections are admin-configured only (host/port set via Admin panel)

Authentication & Session Management

Afunana implements a layered authentication model designed to pass AppScan checks for session management, credential handling, and brute-force protection.

Credential Storage

Session Controls

ControlImplementation
Token formatJWT (HS256) with sub, role, jti, iat, exp, session_start claims
Idle timeout15 minutes (configurable via SESSION_IDLE_TIMEOUT_MINUTES)
Absolute timeout8 hours (configurable via SESSION_ABSOLUTE_TIMEOUT_HOURS)
Token revocationLogout revokes single token; password change/admin action revokes all user tokens
Account lockout5 failed attempts triggers 15-minute lockout (database-persisted)

SSO / OIDC

OIDC/OAuth 2.0 integration supports Azure AD, Google Workspace, Okta, and other compliant providers. New users are auto-provisioned on first SSO login (configurable). SSO sessions respect the same idle and absolute timeouts as local authentication.

Input Validation & Injection Prevention

All user input is validated and sanitized before processing, addressing SQL injection, XSS, and other injection vectors flagged by AppScan.

SQL Injection Prevention

XSS Prevention

API Input Validation

Security Headers & Transport Security

Caddy applies the following security headers on all HTTP responses. These are verified on every deploy and satisfy common AppScan header checks.

HeaderValuePurpose
Strict-Transport-Securitymax-age=63072000; includeSubDomains; preloadEnforce HTTPS for 2 years, eligible for HSTS preload list
Content-Security-Policydefault-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.comRestrict resource loading origins
X-Frame-OptionsSAMEORIGINPrevent clickjacking via iframe embedding
X-Content-Type-OptionsnosniffPrevent MIME-type sniffing
Referrer-Policystrict-origin-when-cross-originLimit referrer information leakage
Permissions-Policygeolocation=(), microphone=(), camera=()Disable unnecessary browser APIs

Transport Layer Security

Cryptographic Controls

LayerAlgorithmKey Management
Data in transitTLS 1.2+ (Caddy auto-negotiation)Let’s Encrypt certificates, auto-renewed
Data at restAES-256 via SQL Server TDEDatabase-managed encryption keys
Passwordsbcrypt (12 rounds, per-user salt)Salt generated per password; no global key
Audit integritySHA-256 hash chainEach event hash includes the previous event’s hash
Password reset tokens256-bit random token, SHA-256 hashed for storageSingle-use, 60-minute expiry
Secrets storageDocker secrets (file-based)Secrets mounted as files at /run/secrets/, not env vars

Access Control

Afunana enforces access control at multiple layers to satisfy AppScan checks for authorization bypass, privilege escalation, and data leakage.

Role-Based Access Control

RolePermissions
adminFull access: user management, collections, configuration, builds, audit, deploy
userAccess assigned collections, view documentation, use chat
viewerRead-only access to assigned collections
qaRead-only collection access, build triggers, project management access

Collection-Based Isolation

Infrastructure Access Control

Static Analysis & Dependency Scanning

Automated security scanning runs on every deploy cycle, catching vulnerabilities before they reach production.

Static Analysis (SAST)

ToolScopeTrigger
BanditPython backend codeEvery deploy
ESLint (security rules)React frontend codeBuild-time

Dependency Scanning (SCA)

ToolScopeTrigger
pip auditPython dependencies (requirements.txt)Every deploy
npm auditNode.js dependencies (package-lock.json)Every deploy

Container Security

Remediation Status

Summary of security controls and their implementation status across OWASP categories.

CategoryControlStatus
SQL InjectionParameterized queries (pyodbc)Implemented
XSSReact auto-escaping + CSP headerImplemented
Broken Authenticationbcrypt, lockout, timeouts, revocationImplemented
Broken Access ControlRBAC, collection isolation, 404 maskingImplemented
Security MisconfigurationAuto-TLS, security headers, Docker secretsImplemented
Cryptographic FailuresTLS 1.2+, AES-256 TDE, bcryptImplemented
Vulnerable Componentspip audit + npm audit on every deployImplemented
Insecure DesignDefense-in-depth, least privilege, immutable auditImplemented
Data IntegritySHA-256 hash chain, DB trigger protectionImplemented
Logging & MonitoringImmutable audit log, SIEM forwardingImplemented
SSRFNo user-controlled URL fetchingImplemented
SSO / MFAOIDC integration (MFA via IdP)Implemented

For the full security architecture, compliance mappings, and evidence artifacts, see the Security & Compliance page.