Repository navigation
Mimicway 0.2.0
·
287 commits
to develop
since this release
Added
- Releases: pushing a
vX.Y.Ztag builds static Linux binaries (x86_64, arm64), macOS and Windows binaries with the UI inside, a multi-architecture image onghcr.io/eoth/mimicway, CycloneDX SBOMs and checksums; each archive and SBOM is published with its keyless signature (.sigstore.json) and the build provenance of all of them (.intoto.jsonl, also in GitHub's attestation store), and the image is signed and attested the same way. SECURITY.md shows how to verify them; both Dockerfiles pin their base images by digest. - Release builds are reproducible: the Dockerfile builds the Linux binaries (Rust and Node.js pinned by digest, the same paths on every machine),
scripts/release-archive.shpacks every archive with fixed times, order, owners and permissions, and the release workflow publishes nothing unless a second machine rebuilds the same Linux binaries and archives. The CI compares two builds whenever the way they are made changes, and every week; SECURITY.md says how to rebuild a release and compare it. The macOS and Windows binaries are built with the Rust version of the Dockerfile. - CI lints every workflow with actionlint and shellcheck, including the release one that only runs on tags, and the OpenSSF Scorecard of the repository is published weekly; the README shows its badge and the CI status.
- The UI is embedded in the binary when it is built first (as the Dockerfile and the release builds do): one file is a complete Mimicway, with no
frontend/distto ship next to it.STATIC_DIRstill serves a directory instead, and a binary built without the UI reads./frontend/distas before. Fingerprinted assets are served with a one-year immutable cache,index.htmlis revalidated on each visit. The embedding is a 50-linebuild.rs, with no new dependency. - A security policy (
SECURITY.md: private reporting channel, scope, response times), a security model (docs/en/security.md: exposed surfaces, every outbound flow, trust boundaries, hardening checklist) and a reviewer guide (REVIEWING.md: reading order, authorization matrix, commands that check each claim). - An explicit
LICENSEfile (MIT, already announced by the README). - A roadmap (
ROADMAP.md). - A contribution guide (
CONTRIBUTING.md), a code of conduct (Contributor Covenant 2.1), issue forms for bugs and features, and a pull request checklist. - Packaging metadata (license, repository, description) in
Cargo.tomlandfrontend/package.json, for complete SBOMs. - The interface is available in English and French: it follows the browser's language (English when no catalogue exists for it), and a language selector in the header remembers the choice. Each sentence is written once, in English, where it is used, and a language adds one catalogue (
frontend/src/locales/<language>.json), loaded only by its users; a test fails on any message missing from a catalogue, any catalogue entry no longer used, any lost placeholder, and any visible word of the interface that escapes translation (rendered in a pseudo-locale). - The messages of the server that people read (API validation errors, rule tester hints, script errors, availability-test errors) follow the
Accept-Languageof the request, which the UI sets to its own language; English by default. Same rule and same test as the UI, withsrc/locales/fr.json. - The user guide and the README exist in English and French, page for page:
docs/en/anddocs/fr/(same file names),README.mdandREADME.fr.md, each page linking to its other language. Every screenshot exists in both languages, taken in the same state by the end-to-end suite, which switches the interface's language between the two captures. CI fails when a page, a screenshot, a heading, an image or a language link exists in one language only. The guide's former French addresses (docs/regles-de-matching.md…) are listed in MIGRATING.md. - The guide shows, in both languages, states of the interface that no test reached before, each now covered by an end-to-end test that checks what the image shows: AND and OR conditions combined on one rule, rules reordered by drag and drop (with the order checked through the API and a real call), the breadcrumb of the detailed JSON builder, fake data chosen for pasted fields, the chaos settings, the members of a group, the import dialog (with a merge checked through the API) and the reset confirmation (with a real reset).
- CI runs the end-to-end Kafka specs against the binary built with
messaging-kafka; they skipped themselves everywhere else, so they had not run since the interface switched to English.
Changed
- The CI runs, for each change, only the jobs that check the files it touches (
scripts/ci-plan.mjsdecides, andCI passedis the one check to require): a push of documentation alone takes half a job-minute of machine time, where every push took ten to seventeen. The Rust builds, Playwright's browser and the image layers are cached, the actions run on Node.js 24, the runners are pinned to Ubuntu 24.04, and Dependabot proposes its updates monthly, grouped, without rebasing them on every push. - Building from source needs Node.js 22.12 or later (the UI's test tools no longer run on Node.js 20, which reached its end of life); CI, releases and the container image build the UI with Node.js 24 LTS.
- The interface is built for the browsers released since March 2023: Chrome and Edge 111, Firefox 114, Safari 16.4 or later (Firefox ESR 115 included). Its build moved to Vite 8, whose output is 12% smaller once compressed (88.6 kB of JavaScript gzipped, now 78.1 kB).
- The interface has a design system of its own, Phasme (frontend/design-system.md, previewed with
npm run design:preview): lichen neutrals and a moss accent in the light and dark themes, the system's own fonts with one monospace face for code, one focus ring everywhere. A mocked service or rule is drawn with a dashed stem and badge, a proxied one with a solid stem and badge, so the mode reads without color. Every color comes from one tokens file, and a test fails on a literal color in a component, on a variable read and never defined, and on any pair of text and background under WCAG AA in either theme. - The UI declares Svelte as a runtime dependency, which it is: the compiler puts Svelte's runtime in the shipped bundle. The audit of production packages in CI and the UI's SBOM now cover it and the packages it brings.
- lightMock is now Mimicway (binary
mimicway, imageghcr.io/eoth/mimicway, repositorygithub.com/Eoth/mimicway). The API, service URLs, environment variables, configuration format and data directory are unchanged. The language, theme and session saved by the browser move to the new keys on the first visit, andRUST_LOGfilters naminglight_mockkeep working, with a warning. Breaking: the default Kafka consumer group ismimicway(setKAFKA_CONSUMER_GROUP=lightmockto keep the old one), and the Kubernetes resources and volume are renamed; MIGRATING.md shows how to keep the existing volume. - The end-to-end suite reads the interface in English, its source language, and produces the guide's screenshots in English under English file names; new tests cover the request log view, the SOAP service form, the login screen and the signed-in header. CI fails on any Markdown link, image or anchor that does not resolve.
- Every screenshot of the guide names its subject: the end-to-end suite scrolls it into view and fails, in CI too, when it does not show entirely in the image in either language, or when a text area of it hides part of its text. Five images that cut their subject are reframed: the Rhai autocompletion list, the conflict warning with its two buttons, and the three script examples, which now show the script next to the template that uses it.
- The README, the user guide, the Kubernetes and UI READMEs and the build scripts are written in English first; the user guide moved to
docs/en/(English) anddocs/fr/(French). - The Kubernetes manifests are a base plus two overlays,
k8s/ingress(a standardIngress, the new default) andk8s/gloo-edge, in amimicwaynamespace; set the image withkustomize edit set image. Breaking forkubectl apply -k k8s/: apply an overlay instead. - The responses that Mimicway itself sends to the applications under test (no matching rule, purely mocked service, refused path) are in English.
Security
- Before each copy or deletion in
backups/andbackups/protected/, the configuration store resolves the two directories and the configuration file on disk and refuses any that leaves the data directory it opened: a symbolic link planted there (on a shared volume, another process can write to the data directory) would have sent the copies, and the deletions of the rotation and of the thirty-day purge, wherever it pointed. - The container image holds the binary and its data directory only (
FROM scratch), built and released alike. The Alpine base shipped OpenSSL, which Mimicway never used (it is linked statically and its TLS goes through rustls with its own root certificates), and which lagged behind Alpine's fixes: the image scan failed on two of them (CVE-2026-75804, CVE-2026-84782). With no operating system left, there is no shell in the container either:docker exec … shno longer works. - Raw TCP mocks listen on
BIND_ADDRESS, like the HTTP server; they listened on every interface, so a TCP mock created on a workstation was reachable from the local network while the rest of Mimicway was not.GET /api/tcp/statusnow reports the address of each listener. - Every GitHub Action of the CI is pinned to a commit SHA, so a moved tag cannot change what runs; the container scan referenced a Trivy action tag that no longer exists, which would have failed the job.
- The build scripts no longer run an installer fetched on the spot. The Linux and macOS one piped rustup's and NodeSource's install scripts to a shell, unpinned: it now checks that Rust 1.85 and Node.js 22.12 or later are there, says where to install what is missing, and stops (it accepted older versions, for the build to fail further on). The Windows one installs rustup with winget, which checks the installer against the SHA-256 of its manifest, as it already did for Node.js.
- The Windows build script no longer turns off certificate revocation checks for crate downloads; when a proxy blocks revocation lists, it says how to do it knowingly. Both build scripts install the UI's exact locked dependencies without running their install scripts.
- With authentication enabled, the Kafka message log and
POST /api/messaging/simulateare reserved to super-admins: Kafka is configured for the whole instance, its log spans every group's services, and a simulation publishes on the real reply topic. - The parsers and matchers of untrusted input are fuzzed: request conditions (query, headers, JSON Pointer, XPath, form fields), rule sub-paths, XML paths, response templates, the hexadecimal of raw TCP mocks and configuration imports, which must read back unchanged from the stored YAML. ClusterFuzzLite runs the targets five minutes on every pull request that changes the server and an hour every week; the UI's template, hexadecimal and path parameter helpers have property tests (fast-check).
- CodeQL analyses the Rust server, the UI's JavaScript and the CI workflows on every change that touches them, the workflows on every pull request, and all three weekly, with the default queries; its alerts are listed in the repository's Security tab.
- CI checks every lock file against OSV (osv-scanner), which also holds the GitHub advisories and is what the OpenSSF Scorecard reads: cargo deny reads RustSec only, which lacked the jsonwebtoken advisory above. Exceptions are kept with their reason in
osv-scanner.toml, as indeny.toml. - Access tokens are validated with jsonwebtoken 11, on AWS-LC instead of ring: before 10.3, a
nbforexpclaim of the wrong type was skipped by the time checks when not required (GHSA-h395-gr6q-cpjc). Mimicway was not exposed (the signature is checked first,expis required andnbfis not checked), but the 9.x line gets no fix. Windows builds use the prebuilt assembly that aws-lc-sys ships, so they need no NASM install (.cargo/config.toml). - Dependencies upgraded past known vulnerabilities: quick-xml 0.42 (RUSTSEC-2026-0194 and -0195: quadratic time and unbounded allocation on crafted XML, which Mimicway parses from incoming requests), rustls 0.23.45 (RUSTSEC-2026-0285), and the yanked chacha20 0.10.0; in the UI's build tools, source-map-js 1.2.2 (GHSA-68fv-2mgg-jv7q: a crafted indexed source map could block the tool reading it; only the build reads source maps, the project's own). XML text now resolves character references (
é) as well as the predefined entities. - The UI and the management API are served with a content security policy (no inline script, no framing, API calls to the UI's own origin or
API_BASE_URLonly),X-Content-Type-Options: nosniff,X-Frame-Options: DENYandReferrer-Policy: no-referrer. Responses of mocked and proxied services are left untouched. - With authentication enabled, the management API enforces group boundaries everywhere: moving a service needs the right to create it in its destination (a member could push services into any group, or out of all groups);
GET /api/configandGET /api/logsonly return what the user can access (they exposed every team's services, targets and captured traffic); a group update is validated like a creation (name, 5-character code, uniqueness) and a renamed group keeps its services. Checks and changes now happen atomically, so concurrent requests cannot create duplicates. - Requests whose path holds a
.or..segment (literal or%2e-encoded) are refused with 400: URL parsing resolved them, so/service/../adminreached paths of the real backend outside the base path configured for the service. The proxy now gives up on a backend after 10 s without a connection or 120 s without data (PROXY_READ_TIMEOUT_SECS) and answers 504; a backend that accepted the connection and never answered held the request forever. - Credential headers (
Authorization,Proxy-Authorization,Cookie,Set-Cookie,X-Api-Key,X-Auth-Token,X-Amz-Security-Token, plus any name listed inREDACT_HEADERS) are replaced by[redacted]in the request log, the traffic observation and the rule tester captures, and are never copied into a suggested rule.GET /api/logsreturned the bearer tokens and session cookies of the applications under test, and a suggestion saved the real backend'sSet-Cookieinto the configuration. Proxy target URLs lose theiruser:password@part in logs. - Access tokens are validated locally only, against the realm's published keys: any asymmetric algorithm Keycloak signs with (RSA, RSA-PSS, ECDSA, EdDSA), issuer, expiry, and the client the token was issued to (
azporaud). The fallback to Keycloak'suserinfoendpoint is removed: it accepted tokens issued to any client of the realm, so another application's token opened Mimicway, and every invalid token cost a call to Keycloak. A rotated key is picked up at once; unknown key ids trigger at most one key-set fetch per 30 s. Calls to Keycloak time out (5 s to connect, 10 s overall); an unreachable Keycloak answers 503 and error responses no longer carry internal details. Breaking when Keycloak issues tokens under another URL thanKEYCLOAK_URL(public hostname vs in-cluster service): setKEYCLOAK_ISSUER. The login now reports the user name found in the token. - Rule scripts (Rhai) can no longer
importscript files from the server's disk (Rhai's default module resolver was active),evalis disabled,print/debuggo to the debug log instead of stdout, and the call depth is bounded.random_int,seeded_int,date_past/date_futureandparse_dateno longer panic on extreme arguments;seeded_intreturns the same values as before for the same seed. - The binary listens on
127.0.0.1by default instead of every interface (BIND_ADDRESS, set to0.0.0.0in the Docker image and the Kubernetes manifests). Without authentication, a binary started on a workstation exposed its configuration API and its proxy rules to the whole local network. When listening on loopback only, the management API also refuses requests addressed to another host name (DNS rebinding). Breaking for native installs reached from other machines: setBIND_ADDRESS=0.0.0.0. - The management API no longer answers cross-origin requests from any website (
Access-Control-Allow-Origin: *), and refuses state-changing requests that the browser marks as cross-site: any page open in a developer's browser could read and rewrite a local Mimicway's configuration. Allowed origins are listed inCORS_ALLOWED_ORIGINS(needed only when the UI is served from another origin than the API, seeAPI_BASE_URL). Mocked and proxied services still accept every origin. Breaking for split deployments that relied on the open CORS policy: setCORS_ALLOWED_ORIGINSon the API. - With
AUTH_ENABLED=true, only the management API (/api/...) requires a token, as documented. The mocked and proxied service routes required one too, which broke every mock for the applications under test and forwarded the Mimicway token to the real backends on proxied rules.
Fixed
- The response builders keep special characters: an example pasted in the JSON builder with a quote, a backslash or a line break in a key or a string gave an invalid template, and
nullbecame an empty string; an XML example with&,<or a quote in its text or attributes gave invalid XML, and opening an XML template that held&in the structured view turned it into a bare&. A JSON key with an escaped quote also read back cut short. - The list of backups is newest first even when several were taken in the same millisecond, as successive changes from a script can do: their order came from the file system (on Windows, oldest first).
- With the dark theme chosen, or preferred by the system, the page no longer shows light while it loads: the theme applies before the configuration and the language are fetched.
- On a phone (360 px wide), the service page, the rule form and the request log no longer scroll sideways: long URLs break, a form section shrinks with the screen, and the log table scrolls inside its own box.
- The knob of a switched-off toggle stands out from its track in both themes (it was at 1.6:1 or less); the group creation form keeps a single primary button; in the Kafka log only the replies Mimicway publishes wear the mock badge, a received message an information badge.
- In the dark theme, the rule tester kept light-theme colors: its result banners, its warning about a truncated body, and its panel of script results, whose light text on a near-white background could not be read (1.18:1). The borders of fields and small buttons were drawn in the color of hairlines, at 1.59:1 in the light theme and 1.44:1 in the dark one, under the 3:1 WCAG asks of a control's boundary; they are at 3.6:1 in both.
- The rule form saves the response it shows, whatever is on screen: folding "Mocked response" before saving wrote an empty body instead of the pasted JSON or XML, and so did saving a rule switched to proxy after its response was edited. "Edit in detail" and the way back keep the root tag and root attributes of pasted XML (they became
<response>), folding the section keeps a JSON array pasted by example (it became an object), and the detailed view keeps that array too. A rule saved with such an array reopens by example instead of in "Advanced template". - With authentication on, the "Backups" button shows to super-admins only, as the guide says: other users saw it and got an error from the server, which reserves listing and restoring backups to super-admins.
- Saving a service from its form keeps its WSDL mode: a
mockorproxymode, set through the API or the configuration file, went back toautoeach time. - The action of a rule (Mock or Proxy) can be chosen with the keyboard: Tab reaches it, the arrow keys change it, and the focused card is outlined. Its radio buttons were removed from the page (
display: none), so only a mouse could change the action. - Switching a JSON or XML response built by example to "Advanced template" turns it into its template, as the detailed view already did; it warned that data might be lost and then dropped the response, which also broke the way the guide suggests from XML to JSON (through "Advanced template").
- The rule form reads the traffic of its own service only: with two services of the same name in different groups, the rule tester offered the requests of both, and the query parameters suggested for conditions came from both.
- In the detailed JSON and XML builders, a folded field stays folded when it is moved or a field before it is deleted; the fold stayed at the position and landed on the field that came there.
- The rule tester writes a failed script as "Custom script: …" in English; the French spacing (" : ") showed in every language.
- Pasting invalid JSON by example reports "Invalid JSON: …" in English; the message was written in French in every language.
- The raw TCP mock form opens a response or a prefix that is not valid hexadecimal (possible in a hand-written
tcp-config.yaml) in hexadecimal mode; a value such as1zread as the text of byte01, which saving the rule then wrote back as01. - The page of a service shows the URL to call it, with its group's code, as the guide said it did; only the service card and the service form showed it, so after creating a service one had to go back to the list to find it.
- The breadcrumb of the detailed JSON builder named its first level "racine" in every language; it reads "root" in English. The translation test now also renders the breadcrumbs of the JSON and XML builders.
- The Kubernetes Deployment sets
fsGroup: 1000: on storage classes that create volumes owned by root, the non-root process could not write its configuration and the pod failed to start. index.htmlpointed to a/favicon.svgthat was never shipped, so every page load ended with a 404: the UI now has its icon, and a unit test fails when the page refers to a public file that does not exist.- Building the Kafka feature on Linux needs the libcurl headers, which librdkafka links; the CI job installs them and the README and contribution guide list them.
- In the request log, long paths and target URLs widened the table past its container and hid the status column: the cells never truncated, since a table cell ignores
max-widthin automatic table layout. - The Gloo Edge example served Mimicway under
/mimicway, where its UI could not load its assets nor reach the API (they are requested from the root); it now routes the whole host. The Deployment used a rolling update, which ran the new pod next to the old one on the same volume, both writing the configuration: it now recreates the pod. The memory limit (64 MiB) left no room for the 10 MiB request bodies Mimicway buffers; it is 256 MiB. The volume no longer names a storage class that most clusters lack. - A start that cannot succeed (authentication enabled without its Keycloak settings, unreadable configuration, port already in use, invalid
BIND_ADDRESS) stops with one clear message and exit code 2 instead of a panic and its stack trace. - Regular expressions of rule conditions and raw TCP matchers are compiled once and cached instead of on every evaluated request, with a 1 MiB limit on their compiled size; a rule whose expression does not compile is refused when saved instead of silently never matching.
- A service could be renamed onto another service of the same group, or created in a group that does not exist; an ungrouped service named like a group code (or the reverse) made
/{code}/...route to two places. All are refused. Creating a service returns the one of the requested group when another group has a namesake. The ping cache no longer mixes up namesake services of different groups. Request log entries carry the service'sgroup_name. PUT /api/config(and the UI import) refuses a service that refers to a group the configuration does not define; such a service silently lost its group URL prefix and permissions.- Traffic observation and rule suggestions now work for services that belong to a group; they never started for them (the group was looked up by code instead of name).
- Non-ASCII path parameters are decoded as UTF-8:
/users/%C3%A9t%C3%A9givesété(it gaveété), in any script; patterns written with non-ASCII characters match their percent-encoded requests.%followed by anything but two hex digits is kept as is. - SIGTERM (Kubernetes, Docker, systemd) now triggers the graceful shutdown that drains pending configuration writes; only Ctrl+C did, so a pod stop could lose the last changes.