feat: full-stack Docker Compose integration tests
- 4-container stack: ClickHouse, platform (Rocky 9), bot-detector, dashboard - Platform builds sentinel on Rocky (CGO+libpcap native), correlator static - mod-reqin-log compiled with apxs on Rocky (matching RPM build target) - ClickHouse init script patches credentials for test env (sed-based) - 8-phase test runner: schema, traffic gen, pipeline, dashboard API, bot-detector, sentinel - All 13 checks pass, 3 non-blocking warnings (empty dicts, log paths) SQL schema fixes discovered during integration: - 02_dictionaries: IPv6CIDR → String (not a valid ClickHouse type) - 03_anubis_tables: dict_anubis_ua missing has_ip/rule_id/category attrs - 03_anubis_tables: dict_anubis_country FLAT() → COMPLEX_KEY_HASHED() (String key) - 09_audit_table: CODEC before DEFAULT → DEFAULT before CODEC Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@ -28,7 +28,7 @@ LIFETIME(MIN 3600 MAX 7200);
|
||||
-- -----------------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS ja4_processing.ref_bot_networks
|
||||
(
|
||||
network IPv6CIDR,
|
||||
network String,
|
||||
bot_name LowCardinality(String),
|
||||
is_legitimate UInt8,
|
||||
last_update DateTime
|
||||
|
||||
@ -44,7 +44,10 @@ CREATE DICTIONARY ja4_processing.dict_anubis_ua
|
||||
(
|
||||
regexp String,
|
||||
bot_name String,
|
||||
action String
|
||||
action String,
|
||||
has_ip String,
|
||||
rule_id String,
|
||||
category String
|
||||
)
|
||||
PRIMARY KEY regexp
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'admin' PASSWORD 'CHANGE_ME' DB 'ja4_processing' TABLE 'anubis_ua_rules'))
|
||||
@ -121,7 +124,7 @@ LIFETIME(MIN 300 MAX 600);
|
||||
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 8. DICTIONARY — Country Flat
|
||||
-- 8. DICTIONARY — Country COMPLEX_KEY_HASHED
|
||||
-- dictGetOrDefault('ja4_processing.dict_anubis_country', 'bot_name', src_country_code, '')
|
||||
-- NOTE: Change 'CHANGE_ME' to the actual ClickHouse admin password before use.
|
||||
-- -----------------------------------------------------------------------------
|
||||
@ -135,5 +138,5 @@ CREATE DICTIONARY ja4_processing.dict_anubis_country
|
||||
)
|
||||
PRIMARY KEY country_code
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'admin' PASSWORD 'CHANGE_ME' DB 'ja4_processing' TABLE 'anubis_country_rules'))
|
||||
LAYOUT(FLAT())
|
||||
LAYOUT(COMPLEX_KEY_HASHED())
|
||||
LIFETIME(MIN 300 MAX 600);
|
||||
|
||||
@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS ja4_processing.audit_logs
|
||||
`entity_type` LowCardinality(String) DEFAULT '',
|
||||
`entity_id` String DEFAULT '',
|
||||
`entity_count` UInt32 DEFAULT 0,
|
||||
`details` String CODEC(ZSTD(3)) DEFAULT '',
|
||||
`details` String DEFAULT '' CODEC(ZSTD(3)),
|
||||
`client_ip` String DEFAULT ''
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
|
||||
Reference in New Issue
Block a user