Commit Graph

9 Commits

Author SHA1 Message Date
imre.agent
ca4d61d6c0 fix(baseline): catch .htaccess php-enable persistence in safety-net
The malware safety-net missed .htaccess/.htaccess.json droppers that
enable PHP on non-.php extensions (AddType/AddHandler
application/x-httpd-php .json, php_flag engine on): they carry no
<?php tag and are not *.php.json, so filters (a)/(b)/(c) all skipped
them. One such file (deployed/helix3/.../shaper_helix3/.htaccess.json)
had entered the source repo and was built into the baseline (B:match),
blinding the detector against itself.

Add safety-net section (d) mirroring the malware_htaccess_php_enable
YARA rule (illusion/hids#183), remove the file from the source tree,
and add its path to malware-iocs.paths.

Ref: cadline/infra#180
2026-07-22 07:52:52 +02:00
5603690a72 security: purge planted malware from baseline + content-based IOC filter
The "clean" baseline unintentionally shipped ~34 planted webshells/backdoors
plus sbtrack (a third-party SEO-cloaking proxy) and inert scanner probes,
carried in from the vetted-live Helix3 template. They survived because the IOC
safety net keyed on extension ('*.php.json') while the attacker disguised one
webshell under ~20 fake extensions (.inc.json/.phar.json/.php[3-5].json/
.php.json.json) plus plain-.json defacements.

- History rewritten (git filter-repo) to remove all 48 files from every commit.
- build-baseline.sh step 6 is now CONTENT-based: any templates/**/*.json with a
  PHP open tag is dropped (legit Helix3 presets are pure JSON).
- malware-iocs.paths extended with plain-.json defacements, probe artifacts and
  non-.json droppers a content grep cannot key on.

Found by the imrcli HIDS YARA union layer during baseline integration (the
baseline-diff alone would have marked them baseline-match).

Assisted-by: claude-code@claude-opus-4-8
2026-07-16 15:21:49 +02:00
8282cd9d9c chore(build): drop unused JMAP variable
jmap.py is an authoring-only tool and is not invoked at build time; remove the
dead variable so the script matches the README.

Signed-off-by: LÁZÁR Imre <imre@illusion.hu>
Assisted-by: claude-code@claude-opus-4-8
2026-07-16 13:58:28 +02:00
74b12145f2 fix(build): anchor data-dir excludes to root
--exclude='cache/' matched any nested dir named cache (e.g. core
com_cache/views/cache/); anchor cache/tmp/logs/images excludes to the docroot
root so only runtime-data top-level dirs are dropped. Non-malware code residual
now 0 (remaining residual is excluded malware + scan artifacts).

Signed-off-by: LÁZÁR Imre <imre@illusion.hu>
Assisted-by: claude-code@claude-opus-4-8
2026-07-16 13:50:51 +02:00
62bb645679 build(baseline): use submodule content as-is (authoritative), no LF normalize
Live has mixed CRLF/LF and content drift vs the submodule HEADs, so normalizing
would break the currently-matching files. The baseline reflects the authoritative
developer repos; line-ending handling is a verifier concern.

Signed-off-by: LÁZÁR Imre <imre@illusion.hu>
Assisted-by: claude-code@claude-opus-4-8
2026-07-16 13:49:14 +02:00
efefce3fd8 feat(cadline): convert common_cadline_libraries + maintenance to submodules
The developer-controlled Cadline repos (cadcommonlib, maintenance) become git
submodules so updates flow through: git submodule update --remote -> build ->
commit new pointers. Pinned to their authoritative HEADs. build-baseline.sh
inits the submodules and normalizes their CRLF to LF (the deploy transform) so
the assembled baseline byte-matches the deployed form. constants.php (live-only
config, not in the repo; carries a DB credential tracked in the credential
inventory) is kept as an overlay (overrides/) per instruction — removal happens
at source later.

Signed-off-by: LÁZÁR Imre <imre@illusion.hu>
Assisted-by: claude-code@claude-opus-4-8
2026-07-16 13:47:32 +02:00
e17c6268c5 docs: remove operator-internal (git.illusion.hu) references
This repo lives on the customer Gitea (git.cadline.hu); drop references to the
operator's internal Gitea repos (audit/incident tracker, HIDS verifier) and
describe those generically instead.

Signed-off-by: LÁZÁR Imre <imre@illusion.hu>
Assisted-by: claude-code@claude-opus-4-8
2026-07-16 12:14:05 +02:00
4fa771286f build(baseline): finalize generator (packages as deployed, overrides as files)
build-baseline.sh: packages/*/ placed as deployed-layout (reconciled to live
bytes at commit-authoring; jmap authors the pristine commit), overrides/ overlaid
as live files. Final out/ = 23578 clean code files; verified against live:
non-malware code residual = 0 (all residual is excluded malware + scan artifacts).

Signed-off-by: LÁZÁR Imre <imre@illusion.hu>
Assisted-by: claude-code@claude-opus-4-8
2026-07-16 11:41:04 +02:00
bd48d89480 build(baseline): constituents+generator skeleton
Re-architect the baseline as constituents + a generator script (build-baseline.sh)
instead of a checked-out deployed tree: a deployed Joomla docroot differs from the
repo/source layout, so the script manifest-maps packaged extensions (lib/jmap.py),
places no-source and Cadline files, applies core overrides, excludes malware/data,
and emits out/ = the code baseline the operator HIDS verifier consumes.

Adds RUNBOOK.md (recipe+inventory), PROVENANCE.md (upstream map), malware-iocs.

Signed-off-by: LÁZÁR Imre <imre@illusion.hu>
Assisted-by: claude-code@claude-opus-4-8
2026-07-16 09:40:46 +02:00