Skip to content
This page View Markdown Open in ChatGPT Open in Claude

Security features

Tokens and groups decide who can call which API, table and column. The features below add more layers on top of them.

In short

  • The security report finds where a person could reach rows that are not theirs, and fixes most of it in one click.
  • Allowed origins and two-factor sign-in guard the browser side and the admin panel.
  • Encrypted payloads add a layer when TLS ends at a proxy you do not control. They never replace HTTPS.
Secure by Default: Encrypted APIs, Allowed Origins, Two-Step Sign-In10 chapters and the transcript

APIs Security Report & Actions

  • Security › APIs Security Report & Actions scans the account and shows where a person could read or change rows that are not theirs: collections no pre-hook limits to the caller, groups that reach too far, weak auth providers and public APIs.
  • A leak comes with the request that proves it, and many findings come with an action that fixes them in one click, such as a row scoping pre-hook. Findings you accept are skipped with a reason.
  • The report gets a score out of 100. It goes to the repository as src/api_security_report/ when you commit, where an AI assistant working on the project can read it.
  • Learn more APIs Security Report & Actions.

Encrypted request payloads

  • Send the header x-am-encrypted-payload: true and put the encrypted payload in dataEncFE.
  • dataEncFE is { data, createdAt } encrypted with encryptionAlgorithmFETransfer and secretFETransfer of the secret. Share that key with your frontend or mobile app.
  • What it protects, and what it does not : anyone who opens your app or reads its JavaScript can find that key, so it is no secret from your users. The format is the one of CryptoJS (U2FsdGVkX1…), whose key derivation is based on MD5. Use it as an extra layer when TLS ends at a proxy or a CDN you do not control, never in place of HTTPS, tokens and groups.
  • A payload older than feTransferDataValidityInSeconds is refused, so a captured request can not be replayed later.
  • Turn on acceptOnlyEncryptedData and plain bodies and query strings are refused. It can be set for a database, a table, an API, and for custom and system APIs.
1
2
3
4
5
POST /api/schema/admin/mongodb/shop/orders/save-single-or-multiple
x-am-authorization: <API user token>
x-am-encrypted-payload: true

{ "dataEncFE": "U2FsdGVkX1+q3n..." }
1
2
3
4
5
common: <T.ISecretTypeCommon>{
    encryptionAlgorithmFETransfer: 'AES',
    secretFETransfer: '...',
    feTransferDataValidityInSeconds: 300, // older payloads are refused
},

Encrypted responses

The header x-am-get-encrypted-data gets the answer encrypted in encryptedData, with the same transfer key. It protects as much as encrypted payloads do : see above.

The channel of the local client

  • The local client connects inside the encrypted channel of the admin panel, and proves the sync token without sending it ; the server proves it in its turn. Nothing it says can be read or replayed, and nobody can pass for the server.
  • It writes inside its own folder only, whatever it is sent. An address which gives too many wrong sync tokens is refused for 15 minutes.
  • The bar of the admin panel shows every local client of the account, with its address ; a new sync token disconnects all of them.
  • Learn more Developer tools.

Allowed origins

  • Add the web origins of your apps in the tab Allowed Origins of the Sandbox Settings page.
  • When the list has entries, a browser request from any other origin is refused with 403 before anything runs.
  • An empty list allows every origin.

Two-factor sign-in

  • The root user can ask for a second factor when people sign in to the admin panel: a code from an authenticator app, a code sent by email, or both.
  • Recovery codes are shown once and stored hashed.
  • The root user also sets the code length and expiry, the attempts and the resend delay.
  • Email codes go out through the server of the root user in Outgoing Email (SMTP).
  • The second factor of each person stays on the server : it is never written to Git, and a pull never changes it.

Vulnerabilities

  • Security → Vulnerabilities audits two scopes for known vulnerabilities : a summary by severity (critical, high, moderate…), then each package with its range, how it arrives (the chains from a package asked for by name), the version which clears it and whether that version was checked, and the details of every advisory.
  • Where they come from lists the packages asked for by name which bring the vulnerable ones, each with its version. Click one to see only what comes with it.
  • Sandbox : the packages of your sandboxes, of every language your code is written in. The strip Languages of the sandboxes shows each language which has packages, with its registry and how many of its packages are vulnerable, even when your sandboxes use one language only. A language without any package is not shown. Click a language to see only its packages, click it again to see every package. Every package says its language, and its link opens the registry it comes from.

    Language Registry What is audited Advisories
    TypeScript / JavaScript npm The packages of Sandbox settings, resolved from the registry as an install would resolve them today, with everything they bring npm
    Python PyPI What the image of its sandboxes has installed : the packages of Sandbox settings, what they brought, and the tools of the image OSV
    PHP Packagist The same, from composer.lock of the image OSV
    C# NuGet The same, from what NuGet restored in the image OSV
    Go Go modules The same, from the modules of the build of the image OSV
    Rust crates.io The same, from Cargo.lock of the image (with the crates of the runner of API Maker) OSV (RustSec)
    Java, Kotlin Maven Central The same, from the tree Maven resolved in the image : the packages asked for and what each brought OSV
  • The image says what runs. For Python, PHP, C#, Go, Rust, Java and Kotlin the audit reads the packages in the image of the sandboxes : the version which is installed, not the one written in the settings (time 0.1.43 of Rust installs the newest 0.1.x), and the packages a package brought with it (requests brings idna and urllib3).

  • Before the image is built (the language was never run on this server, or its build failed) only the packages named in the settings are audited, at the version named or the newest one, and the page says so. Composer refuses to install a version with known advisories : such an image is not built, and the audit still shows what is wrong with the package.
  • What to do is said per package : set it to version x for a package you added (in Sandbox settings), rebuild the image for a package another one brought, a newer version of the runtime or an API Maker update for what came with the image. Compare versions shows what each newer version of a package asked for by name would bring ; for a package of another language than JavaScript it compares each version with the packages it brings, worked out from its registry.
  • API Maker : what the server is made of. API Maker v4 is built from crates of Rust : the crates compiled into it are audited against OSV (the RustSec database), and their fixed versions read from crates.io. They change with an update of API Maker : Deploy API Maker.
  • An audit is kept for an hour; an older one (up to 7 days) is shown at once while a new one runs, and Check now asks the registries again. Only package names and versions leave the server.

Fix a package from the page

An admin fixes a vulnerable package of the sandboxes without leaving the page. The new version is saved in Sandbox Settings, exactly as if it was changed there (git, history and the build of the image included). Then the packages are checked again, and a bar on top shows each step : Save in Sandbox settings, Check the packages again, Result.

Button Where What it does
Update to x A package you added, with a fix Moves it to the first version with no known advisory.
Another version Any package of the sandboxes Lists the versions of its registry. The nearest ones are checked at once, with the packages each one brings, so each says no known advisory · brings 12 packages, none vulnerable or 2 advisories, the worst high. Pick one and press Use this version. For a package you did not add, the button is Pin another version : it adds the package at that version.
Pin x y A package you did not add, when nothing holds its fix back Adds it to Sandbox settings at the fixed version, so the sandboxes install that version.
Use What a newer version brings, for each version compared Moves the package asked for by name (the one which brings the vulnerable one) to that version.

Other languages than JavaScript

For Python, PHP, C#, Go, Rust, Java and Kotlin, the image of the sandboxes is built again with the new version in the background. Until it is built, the check looks at the packages the settings name only. Press Check now once it is built to see what the new version brings with it.

A developer sees the same advice, without the buttons : the admin of the account changes the packages.

Change the version of any package

The tab Packages lists every package your Sandbox Settings name, of every language, vulnerable or not. Each row says what the last check found : No known problem, 2 advisories or brings 3 vulnerable packages. See opens them in the tab Sandbox.

  1. Open the list of versions of a package. The version in use, the nearest newer ones and the newest are checked at once, with the packages each one brings. A green mark is a version with no known problem.
  2. Pick a version and press Use. It is saved in Sandbox settings, then the packages are checked again, with the same bar as a fix.

A developer sees the list and the checks, without Use.

Check packages

The tab Check packages tells you whether versions of packages have known problems, before you use them. It works for every package manager : npm, PyPI, Packagist (Composer), NuGet, Go modules, crates.io and Maven Central.

  1. Pick a package manager, search or type a package, and press Add. Its newest version is picked ; pick more versions in its list, or +3 newest.
  2. Or press My sandbox packages : the packages your Sandbox settings name, at their versions. Add newer versions to compare them.
  3. Or press Paste a list : one package a line, or a whole package.json or composer.json.
  4. Press Check. The bar shows how many packages are checked, and each row fills as its answer comes.
Paste a list
[email protected], 4.17.21
pypi:requests==2.25.0
composer guzzlehttp/guzzle:7.0.1
nuget Newtonsoft.Json 12.0.1
go golang.org/x/text v0.3.0
cargo serde = "1.0.100"
maven com.google.guava:guava:31.1-jre

Each version says how many advisories it has, how bad the worst one is, and how many vulnerable packages it brings with it. Open a row to read them : its own advisories with their CVSS score, the versions they affect and a link to each, then It brings n packages with every vulnerable one, the way it comes (via express › body-parser), the versions which fix it and links to its advisories.

A version with a problem shows nearest safe x : the next release with no known advisory, which brings nothing vulnerable either. When a nearer release only fixes its own advisories, the row says so too. Use x and Use in sandbox save that version in Sandbox settings, then check the sandboxes again.

  • The versions are looked up in OSV, the open database of advisories of every registry, all at once.
  • Every package a version brings is checked too, at the version an install would pick today. What a version brings comes from deps.dev for npm, PyPI and Maven Central, and from the registry itself for crates.io, Go modules, NuGet and Packagist. It is kept 6 hours : a check of a few packages takes a few seconds the first time, about a second after.
  • The list stays in your browser until you press Clear. Nothing is installed, and nothing is saved on the server.

Get it by mail

The AI Report button opens AI Reporting with a Vulnerability Report : every morning it checks the packages, and mails you only when something changed. An AI model explains what to update first, and to which version.

Encrypted and hashed fields

  • Schema conversions can store a field encrypted or as an HMAC SHA-256 hash, with the keys of your secret.

Good to know

  • API Maker itself speaks plain HTTP on its port. Serve it over HTTPS : Launchpad puts a reverse proxy with certificates in front of it, or turns on the built-in web server.
  • Encrypted payloads do not replace HTTPS. They add a layer on top of it, useful when TLS ends before API Maker.