Download the PHP package nawasara/secscan without Composer

On this page you can find all versions of the php package nawasara/secscan. 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 secscan

nawasara/secscan

Security threat detection and response for the Nawasara superapp. Two independent sources of signal feed one dashboard:

  1. Database scanner. Reads the MySQL databases already monitored by nawasara/database-monitor (read-only) for indicators of compromise on hosted sites (WordPress in particular).
  2. Host agents (nawasara-agent). A Go binary installed on each server that tails logs, watches SSH, and scans the filesystem for webshells and backdoors, reporting incidents and findings back to the dashboard.

Everything is detect plus alert: the database scanner never writes to OPD databases. Findings get a confidence score (0-100) and severity, a triage workflow (open / acknowledged / false-positive / resolved), a dashboard, and alerts via nawasara/alerting.


Dashboard pages

Page Route Contents
Dashboard /nawasara-secscan/dashboard Summary: agents online, critical incidents, urgent findings
Temuan Website /nawasara-secscan/findings Findings from the database scanner (gambling spam/malware/defacement) plus triage
Incidents /nawasara-secscan/incidents Incidents from the agent (SSH brute-force, exploit chain, scanner bot)
Agents /nawasara-secscan/agents List of installed agents plus detail (scan findings, command queue)
IP Timeline /nawasara-secscan/ip/{ip} Every incident from one source IP
Versi PHP /nawasara-secscan/php-runtimes Versi PHP seluruh situs dan server: dari luar, dari server WHM, dan dari agen

Permissions: secscan.view, secscan.finding.triage, secscan.agent.view, secscan.agent.scan, secscan.agent.command.

IP blocks never expire, so the page is the cleanup path

Decided on 8 October 2026: blocks stay until someone lifts them (566 active at the time, 455 older than 30 days). Blokir IP therefore filters by reason, source and age, and "Cabut N blokir" lifts the whole filtered result. It only appears once the list is narrowed, is sudo-gated, and runs as queued jobs of 100 (one Cloudflare call each; a worker kills a job at the smaller of its own and the worker's timeout).

Every manual block and every unblock goes through Services\IpBlockManager, for the panel and the API alike. An unblock that Cloudflare refuses changes nothing. The panel used to mark such a block "removed" anyway, so it showed an IP as unblocked while Cloudflare kept dropping it.

Retiring an agent

"Cabut agen" (permission secscan.agent.delete, sudo) soft-deletes the agent, replaces its key hash, cancels its pending and approved commands, and resolves its offline alert. The commands matter: a dead agent never pulls them, and 170 had piled up as approved, which the panel read as "blocked on the host". Incidents keep naming a revoked agent (withTrashed).

Online/offline is one rule everywhere (Agent::online() / offline(), last heartbeat within 180 s), and "hari ini" counts from midnight WIB (SecurityIncident::today()); the app timezone is UTC.

Finding status follows the scanner

Every status change, by staff or by a scanner, goes through Services\FindingTriage, so each one leaves a history row.

Deteksi konten situs: tiga lapis, dan apa yang tidak dilihat masing-masing

Halaman judol "SLOT777 LOGIN" di umum.ponorogo.go.id (16 Oktober 2026) sampai ke hasil Google tanpa satu pun peringatan. Penelusurannya menemukan bahwa ketiga lapis buta terhadapnya, masing-masing karena alasan berbeda:

Lapis Yang dibaca Buta terhadap
Scan database (tiap jam) Kolom konten DB di server DB yang dipantau Berkas statis, route, DB di server lain
Probe HTTP (tiap 6 jam) / + path WP + beberapa URL sitemap URL dalam yang tidak tertaut dan tidak ada di sitemap
Agen, pemindai berkas (tiap 6 jam) Berkas di web_dirs server ber-agen Server tanpa agen — umum ada di Himalaya (.29), agennya hanya di alpine (.30)

Jadi menaikkan frekuensi cron tidak menolong; yang menentukan adalah apa yang dibaca. Keputusan yang sebaiknya tidak dibatalkan:

"Lihat kode" pada temuan berkas agen

Agen ≥ v0.13.0 mengirim ±15 baris di sekitar temuan (maks 300 byte per baris, 4 KB total) beserta nomor barisnya; dasbor menampilkannya di menu ⋯ → Lihat kode. Sebagian besar temuan (plugin yang menulis index.php-nya sendiri, JS termampatkan) dapat diputuskan false positive dalam hitungan detik tanpa SSH.

Dua keputusan yang jangan dibatalkan:

Temuan dari agen lama hanya punya potongan 120 karakter; modal menampilkannya dengan catatan untuk memperbarui agen.

Yang masih belum tertangkap: cloaking berbasis IP Googlebot asli (reverse DNS) dan konten yang disisipkan JavaScript sesudah halaman dimuat — yang kedua butuh browser headless (lihat Roadmap F4).

Versi PHP: tiga arah, karena tidak ada satu pun yang melihat semuanya

Lahir dari PHP2Shell (CVE-2026-109618/109619, Oktober 2026). Survei manual pertama menemukan e-bmd dan simap di PHP 5.6, smep di 7.4, enam situs Himalaya di 8.1 (tak akan pernah ditambal), dan penataanruang di 8.2.30 (tambalan ada, belum dipasang). Halaman ini mengulang survei itu tiap pagi pukul 05.15 WIB (ScanPhpRuntimesJob).

Arah Melihat Buta terhadap
Dari luar Semua hostname A/AAAA/CNAME di DNS Cloudflare Versi, kecuali situs memasang X-Powered-By
Server WHM Handler dan versi lengkap PHP tiap vhost cPanel Server yang token API-nya tanpa ACL all dan tanpa kunci SSH
Agen (v0.15.0+) Host, ea-php, alt-php, container Docker Host tanpa agen

Keputusan yang tampak keliru tetapi disengaja:

Saat ada CVE PHP baru, perbarui SECSCAN_PHP_PATCHED (versi aman pertama per cabang, dipisah koma) dan SECSCAN_PHP_ADVISORY, lalu tekan Pindai Sekarang. Status dihitung ulang dari versinya, tanpa migrasi.


Setup (database scanner)

  1. nawasara/database-monitor must be configured (Vault group database-monitor); secscan reuses its read-only connection.
  2. Seed permissions:

  3. The scan runs automatically (scheduler). Trigger it manually from the "Pindai sekarang" button on the dashboard, or:

API

Requires nawasara/api. If that package is not installed, the routes are not mounted and nothing changes.

Authentication: Authorization: Bearer nws_… or X-API-Key: nws_…. Every path is prefixed with /api/v1/secscan.

Do not confuse this with /api/agent/*, which is the path agents use to report to the server; it authenticates with X-Agent-Key and has nothing to do with the tokens or scopes below.

Scope

Scope Access
secscan.incident.read Incidents from the agent
secscan.finding.read Website findings
secscan.agent.read Agent status
secscan.stats.read Aggregate statistics
secscan.ipblock.read List of blocked IPs
secscan.ipblock.write Block a new IP
secscan.ipblock.delete Unblock

Split per domain so a token can be given narrow access: a consumer that only needs statistics does not also need to read every incident and its attacker IP. Configure this in Pengaturan → API Token.

Endpoints

Method Path Query params
GET /incidents severity, type, ip, blocked, since, per_page
GET /incidents/{incidentId}
GET /findings status (default active; all for everything), threat, severity, q, per_page
GET /findings/{id}
GET /agents status, per_page
GET /agents/{agentId}
GET /stats days (1-90, default 1) or from+to (ISO8601)
GET/POST/DELETE /ip-blocks see the IP block section

Multi-value parameters accept commas: ?severity=high,critical.

These numbers come from the same IncidentStatsCollector as the daily email digest, so the two cannot silently diverge.

What is never returned

Each Resource is an allow-list, not a filtered dump. Deliberately withheld:

Widening this list is a deliberate decision, not a convenience: change the Resource, and write down why in the same commit.

Restrict tokens by IP

top_hosts is a list of our own sites that are attacked most often. Useful for prioritizing defense, but if the token leaks it is a ready-made target list. The same goes for source_ip on incidents.

Put an IP allow-list on every token that carries a secscan scope, through the API Token page.


nawasara-agent install guide

The security agent installed on every target server. It monitors logs (nginx, SSH, Laravel), detects attacks (brute-force, exploit, scanner bot), and scans for malicious files (webshell/backdoor), then reports to the dashboard.

Needs: root/sudo access, Linux (amd64/arm64), about 3 minutes.

Quick way: one line (recommended)

Enrollment token required (since the 15 October 2026 security audit, T1). /api/agent/register used to be open to anyone, and a self-registered agent could make the Decision Engine block any IP on Cloudflare. Now an admin with secscan.agent.enroll creates a one-time token on the Agents page (Buat Token, needs sudo; valid 1 hour to 7 days). The new agent then sits in Menunggu persetujuan until an admin approves it from the row menu: its incidents are stored but never trigger a block, and it receives no commands.

Run this on the target server, with the token from the Agents page:

The script automatically:

  1. Downloads the binary for the architecture (amd64/arm64)
  2. Registers with the dashboard using the enrollment token, receiving agent_id plus api_key
  3. Writes the config (/etc/nawasara-agent/config.yaml, chmod 600)
  4. Installs the systemd service (nawasara-agent run --config …)
  5. Starts the service

No manual step is needed. Successful output:

Installed before? If /etc/nawasara-agent/config.yaml already exists, the script skips registration (the old credentials are kept). To register again from scratch, remove the config first:

Verification

Then open Dashboard → Security Scan → Agents. The server appears online within about 30 seconds (the heartbeat interval).

Configuration

The config is written automatically to /etc/nawasara-agent/config.yaml. Touch it only to adjust log paths or turn on the file scanner.

Field Meaning
dashboard_url The Nawasara dashboard address (filled in automatically)
agent_id The agent's unique ID (received automatically at registration)
api_key Auth key (nwa_…, received automatically, stored chmod 600)
heartbeat_interval Heartbeat interval (default 30s)
plugins.enabled Active collectors: nginx, ssh, laravel
plugins.laravel.log_paths List of Laravel log paths to watch
scanner.enabled Webshell/backdoor file scanner (default false)
scanner.scan_interval Scan interval (default 6h)
scanner.web_dirs Web directories scanned when the scanner is active
scanner.watch_paths Paths watched for integrity changes (e.g. .env, /etc/nginx)
scanner.integrity_ignore Extra path substrings skipped by the integrity check (agent ≥ v0.12; caches/logs are built in)

Config structure (example):

Turning on the file scanner (Phase 3): edit the config, set scanner.enabled: true, adjust web_dirs and watch_paths, then restart:

Manual way (if server policy forbids curl | bash)

1. Download the binary (change amd64 to arm64 for ARM servers):

2. Register the agent (note the agent_id and api_key; the api_key only appears once):

3. Write the config /etc/nawasara-agent/config.yaml. Paste the agent_id/api_key from step 2, following the structure above.

4. Create the systemd service /etc/systemd/system/nawasara-agent.service. The ExecStart line must use the run subcommand:

5. Enable and start:

Troubleshooting

Script stops at "Registration failed" with 401. The enrollment token is missing, expired, revoked, or already used (each token registers exactly one agent). Create a new one on the Agents page.

Script stops at "Registration failed" otherwise. The registration endpoint is unreachable (a firewall or Cloudflare bot challenge is blocking curl from the VM). Test manually:

Without a token it should be 401 (reachable). Do not test with a real token: it would be consumed. If it is 403 or times out, ask an admin to open the /agent/* path from this server's IP in the Cloudflare WAF.

Log keeps saying "HTTP 403, buffering". Reports are being rejected, and the old buffer holds the failed payloads. Clear the buffer, then restart:

If it is still 403, the source is not the agent; contact the dashboard admin to check the /api/agent/* gating.

status=203/EXEC at start. The ExecStart is missing the run subcommand. Make sure the line reads … nawasara-agent run --config …, then:

Binary is only a few bytes / "Not Found". The download returned an error page. Check the size (it should be tens of MB):

If it is small, the release repo is not public yet or the release tag is wrong. Download again after an admin confirms the release is available.

Final checklist


Agent binary release

The binary is built via GitHub Actions (release.yml) when a tag is pushed to the nawasara/agent repo (linux/amd64 plus linux/arm64). The dashboard serves:

The release repo must be public or the asset download 404s.

Roadmap


All versions of secscan with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-pdo Version *
illuminate/support Version ^10.0|^12.0
spatie/laravel-permission Version ^6.0
nawasara/ui Version *
nawasara/sync Version *
nawasara/vault Version *
nawasara/alerting Version *
nawasara/notification Version *
nawasara/cloudflare Version *
nawasara/database-monitor Version *
nawasara/registry Version *
nawasara/auth-primitives Version *
livewire/livewire Version ^3.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 nawasara/secscan contains the following files

Loading the files please wait ...