Administrator guide
Administrators manage Cloud Certainty SQLark from Administration in the portal (PortalUrl):
connections, grants, roles, settings, usage, the audit log, and the licence. Everything is stored
in the stack's DynamoDB table in your account, and every change is written to the audit log.
Administration has the pages Connections, Grants, Roles, Settings, Usage, Audit log and Licence and about.
Roles
| Role | Can |
|---|---|
| User | Use the databases and workgroups their grants allow: browse the catalogue, run queries, download results and run statements that change data, as granted. Own saved queries, dashboards and snapshots |
| Administrator | Every permission on every database and workgroup of every connection (still bounded by each connection's access level and the plan), plus Administration: connections, grants, roles, settings, usage, audit log, licence. Administrators see everyone's query history and results, and can change and delete anyone's saved queries, dashboards and snapshots |
- Everyone who signs in without a role entry is a User, and sees no databases until a grant applies to them.
- Roles and grants match the user's email or groups. The email must be trusted: asserted by
your SAML IdP, verified by your OIDC IdP (
email_verified), or marked verified in the Cognito user pool (Identity providers). - In Administration › Roles, under Grant a role, choose User or Group, enter the email or the group name exactly as your IdP sends it (group names are case-sensitive), choose Administrator or User, and save. A role for a user wins over a role for one of their groups, so you can make a group administrators and keep one member a User. A change applies on the user's next request.
- You can't remove your own Administrator role. Grant it to at least one more person or group.
The bootstrap admin
BootstrapAdminEmail (a stack parameter) is the bootstrap admin. The first person who signs in
with that email is bound to it by their immutable user ID (the Cognito sub) and is always an
Administrator, which prevents lock-out. The Roles page shows the entry as set by the stack. The
binding is recorded in the audit log (bootstrap.bind). Someone else who later signs in with the
same email address but a different user ID is not the bootstrap admin.
Recovering the bootstrap admin
Reset the binding when the bootstrap admin's user ID changes (the user was recreated, the IdP issues
a new subject, or you switched IdentityProvider). Either:
- Use a different person: update the stack and change
BootstrapAdminEmail. The first sign-in with the new email takes over the binding. - Keep the same email: update the stack with
BootstrapAdminEmailset to another address you can sign in with, and sign in with it once. Then set it back and sign in with the original email, which takes the binding over again.
If another Administrator can still sign in, they can simply grant the Administrator role to the person by email under Administration › Roles.
Connections
A connection is one IAM role SQLark assumes in one AWS account, with the Regions it covers (Administration › Connections).
| Connection | Role | Set by |
|---|---|---|
Local (local) | The hub stack's role /sqlark/<NamePrefix>-local-<Region>, in the hub account | The stack: LocalAccessLevel and LocalRegions (empty means the stack's Region). It can't be changed or deleted in the portal |
| Spoke | A role created by the spoke role template (spoke-role.yaml) in another account, /sqlark/<RoleName> (sqlark-spoke by default). It trusts only the hub's API role, and only with your external ID | The spoke stack's AccessLevel, and the Regions you choose here |
Access levels
The access level of a connection's role is the ceiling for everyone, administrators included. Grants can narrow it per user or group but never widen it.
| Access level | SQLark may | Permissions it allows |
|---|---|---|
Query (default) | Browse the Glue Data Catalog, run read-only statements in Athena, and write their results to the workgroups' result locations | browse, query, download |
Full | Query plus statements that change data or the catalogue (CREATE TABLE AS, INSERT, ALTER, DROP, MSCK and the like) | plus ddl (Team and above) |
Whatever the level, the role reads table data only from the buckets in the stack's
DataBucketNames parameter (every bucket by default) and uses only the KMS keys in
DataKmsKeyArns besides the AWS managed keys. With Query it writes only query results, to the
SQLark results buckets and the buckets in ResultBucketNames; with Full it may also write to the
data buckets, for CREATE TABLE AS and INSERT
(parameter reference). If your tables are governed by AWS Lake
Formation, grant the connection's role data permissions there; Lake Formation then applies to every
SQLark query in that account.
Use Query unless teams really need to create or change tables through SQLark.
Add a connection
- Deploy the spoke role in the account
(installation guide). How to connect
another AWS account at the bottom of the page shows the steps, the template URL and an AWS CLI
command. Set
TrustedPrincipalto the hub stack'sSpokeTrustedPrincipaloutput and choose anExternalIdsecret of 16 or more characters. - Choose Add connection and enter:
- Id: a short name used in links, for example
production. It can't be changed later. - Name and AWS account id.
- Access level: the same as the spoke stack's
AccessLevel. - Role ARN: the spoke stack's
RoleArnoutput,arn:aws:iam::<account>:role/sqlark/<RoleName>. It must be in that account and under the/sqlark/path. - External ID: the same secret you gave the spoke stack. It is stored and never shown again; when you edit the connection, leave it empty to keep it.
- Regions to show.
- Id: a short name used in links, for example
- Save connection, then choose Test. The test assumes the role and, for each Region, reports the workgroups and databases it found, or the AWS error.
For more Regions of the same account, deploy the spoke template again in each Region with
CreateRole set to Disabled and the same WorkgroupName: it adds a SQLark workgroup and results
bucket there, and the existing role may use them. Then add the Region to the connection.
Each distinct AWS account counts against your plan's account limit, the hub account included (3 on Starter, 10 on Team, 50 on Business, unlimited on Enterprise). When the limit is reached, Add connection is disabled. Deleting a connection makes SQLark stop using the role, and grants on it stop applying; the role stays in the account until you delete its stack.
Workgroups
Every query runs in an Athena workgroup, which decides where results are written, the engine version and the most a query may scan.
The SQLark workgroup
With CreateWorkgroup set to Enabled (the default), the hub stack creates a workgroup in its
Region named after NamePrefix (sqlark by default), and the spoke stack one named WorkgroupName
(sqlark by default) in each Region you deploy it to. Each has:
- its own encrypted results bucket,
<name>-results-<account>-<Region>, which keeps result files forResultsRetentionDays(30 by default; SQLark's own history is kept longer); - enforced settings, so no client can change its result location, encryption or limits;
- a per-query scan limit,
BytesScannedCutoffPerQuery(1 TB by default, about $5): Athena cancels a query once it has scanned that much; - CloudWatch metrics.
People see it only once a grant names it, for example with the workgroup pattern sqlark.
Existing workgroups
SQLark can use your existing workgroups too:
- If the workgroup writes results to an S3 bucket, list that bucket in the stack's (or spoke
stack's)
ResultBucketNamesparameter, so the role may write there. Without it, queries in that workgroup fail with an access error. - A workgroup whose results are managed by Athena needs no bucket. Results can't be downloaded as a file there (people export them from the grid instead), are kept for 24 hours, and can't be reused by Athena.
- A workgroup with neither a result location nor managed results is refused ("This workgroup has no query result location. Ask an administrator to set one.").
- Disabled workgroups aren't shown.
We recommend workgroups that enforce their settings and set a per-query scan limit. SQLark never overrides a workgroup's result location.
Grants
A grant gives a user or a group permissions on the databases matching some patterns, in the workgroups matching other patterns, on a connection (or all) in some Regions (or all) (Administration › Grants). A new grant, or a change, applies on the user's next request.
| Field | Values |
|---|---|
| Subject | A user (their sign-in email) or a group (the name as your IdP sends it in the groups claim) |
| Connection | One connection, or All connections (including ones you add later) |
| Regions | Some Regions, or All Regions |
| Workgroup patterns | One per line, up to 50, case-sensitive, for example analysts or team-*. Letters, digits, ., _ and - besides the wildcards |
| Database patterns | One per line, up to 50, compared in lower case (the Glue Data Catalog stores names in lower case), for example sales_*. Letters, digits, _ and - besides the wildcards |
| Permissions | Any of the table below |
| Description | Optional, for your records |
In both kinds of pattern, * matches any run of characters and ? exactly one.
| Permission | Allows | Implies | Needs |
|---|---|---|---|
browse | See the database, its tables, columns, partitions and properties in the catalogue | ||
query | Run read-only statements in the workgroup with this database, and read the results on screen | browse | |
download | Download the full result file of one's own queries, export results from the grid, and create snapshots (Team and above) | query | |
ddl | Run statements that change data or the catalogue: CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, MERGE, MSCK, UNLOAD, OPTIMIZE, VACUUM, CREATE TABLE AS, PREPARE | query | the Full access level, Team and above |
How grants combine
- A user's permissions are the union of every grant that matches them, through their email or any of their groups, capped by the connection's access level and the plan.
- Browsing ignores workgroups: a user sees every database matched by any of their grants in that connection and Region.
- Querying is decided per workgroup. In a given workgroup, a user can query the databases of the
grants whose workgroup patterns match that workgroup, and no others. A grant on workgroup
Awith databaseXplus a grant on workgroupBwith databaseYlets the user queryXinAandYinB, but neverXinB, and a query inAcan't read tables ofY. - Within one workgroup, a query can join tables from every database the user may query there.
- A user with no matching grant gets "not found" for a database or workgroup: SQLark doesn't reveal that it exists. A database they can see but not use in that way answers "forbidden".
- Administrators have every permission everywhere, still bounded by each connection's access level and the plan.
How grants are enforced
Grants are enforced twice. SQLark checks them on every request, and every AWS call runs with
temporary credentials (15 minutes) that a per-request session policy limits to the user's grants:
the Athena workgroup, the Glue databases and tables the user may query in that workgroup, the
workgroup's result location, and, only with ddl, the Glue actions that change those databases.
Even if SQLark's own check had a bug, AWS would refuse anything outside the grants. Athena checks the
same credentials when it reads the Glue Data Catalog, your S3 data and KMS keys.
If someone's grants would make a session policy larger than AWS allows, SQLark refuses the request
("too many grants") rather than widening it. Combine grants: use groups, and patterns such as
sales_* instead of many single names.
Examples
| Goal | Grant |
|---|---|
Analysts can query sales_* in workgroup analysts | group analysts, connection production, all Regions, workgroups analysts, databases sales_*, query download |
Finance can browse every database but query only finance in workgroup finance | Two grants for group finance on production: workgroups finance, databases *, browse (workgroups don't matter for browsing); and workgroups finance, databases finance, query download |
Data engineers can run DDL on staging_* in workgroup etl on a Full connection | group data-engineers, connection data-lake (access level Full), all Regions, workgroups etl, databases staging_*, ddl download. Add raw to the databases (or another grant with query on raw in etl) so their CREATE TABLE AS SELECT ... FROM raw.events can read the source. Run the statement with a staging_* database chosen in the datasource |
Everyone can browse public_* | a group every user belongs to (for example all-staff), all connections, all Regions, workgroups *, databases public_*, browse |
| An on-call engineer can query everything in the SQLark workgroup | user [email protected], all connections, all Regions, workgroups sqlark, databases *, query download |
Settings
Administration › Settings:
| Setting | Default | Meaning |
|---|---|---|
| Allowed IP ranges (CIDR) | empty (any network) | Business and above. One IPv4 or IPv6 range per line. People outside these ranges can sign in but can't use SQLark (snapshots included). A list that doesn't contain your own address is refused, so you can't lock yourself out |
| Price per TB scanned (US dollars) | 5 | 0.1 to 100. Used for every cost estimate. Set your Region's Athena price, or your negotiated price |
| Default reuse age (minutes) | 60 | 0 to 10,080 (7 days). How long a user's own earlier result of the same SQL is shown again instead of running the query, for dashboard panels and the editor's Reuse results option. Also how old an Athena result may be to be reused. 0 turns reuse off |
| Daily scan budget per user (GB) | 0 (no budget) | Business and above. Once a person's queries have scanned this much in a UTC day, new queries are refused ("You have used today's scan budget of N GB") until the next day. A query's data counts when it finishes, so the last query of the day can go over |
| Longest snapshot lifetime (days) | 30 | 1 to 3,650. The most days a snapshot may last before it expires |
Usage
Administration › Usage shows what your teams ran through SQLark over the last 30 days:
- Per day: queries, failed, cancelled, reused, data scanned, engine time and the estimated cost, with the total estimated cost of the period.
- Per user and per workgroup (Business and above): the 50 users and the 50 workgroups that scanned the most data over the period, with their queries, data scanned and estimated cost.
Each query is counted once, when it reaches its final state (succeeded, failed or cancelled), however many people or panels were watching it. A query Athena answered from a reused result counts as reused and scanned nothing; a result SQLark showed again from someone's own earlier run starts no query and isn't counted again. Estimated costs use the Price per TB scanned setting and Athena's 10 MB minimum; your AWS bill is the record. Usage is kept for 400 days.
Audit log
Administration › Audit log lists events by UTC day, newest first, with the time, the actor, the action, the target and the source IP. Open an event for its details. Filter this page searches the events shown.
| Action | When |
|---|---|
bootstrap.bind | The bootstrap admin was bound to a user |
role.put, role.delete | A role was granted or removed |
connection.put, connection.delete | A connection was added, changed or deleted |
grant.put, grant.delete | A grant was added, changed or deleted |
settings.put | Settings were changed |
licence.refresh | An administrator checked the licence |
update.available | A new release was found |
execution.write | A statement that changes data or the catalogue ran (the workgroup, database, query id and the first 1,000 characters of the SQL) |
result.download | Someone downloaded a result file |
query.put, query.delete | A saved query was created, changed or deleted |
dashboard.put, dashboard.delete | A dashboard was created, changed or deleted |
snapshot.create, snapshot.delete | A snapshot was created or deleted |
access.denied | A request was refused for a missing permission or an address outside the IP allowlist |
Events are kept for your plan's audit days: 30 on Starter, 90 on Team, 365 on Business and 3,650 on
Enterprise. Each event is also written to the API's CloudWatch log group,
/aws/lambda/<NamePrefix>-api, kept for the stack's LogRetentionDays, so you can forward it to your
SIEM.
Every query, read-only ones included, is in the query history, which administrators can see for everyone, day by day, under History › Everyone.
For a full trail, CloudTrail in each account records every Athena, Glue and S3 call SQLark makes with
sourceIdentity set to the user's email and the role session name sq-<email> (S3 object-level
calls need CloudTrail data events).
Licence and about
Administration › Licence and about shows your licence, your plan and the installed version.
Licence
SQLark reads your AWS Marketplace licence from AWS License Manager in the hub account. The page shows the status, the plan, the entitlements, when the licence is valid until and when it was last checked. Check licence now reads it again (SQLark otherwise rechecks every 10 minutes).
| Status | Meaning |
|---|---|
| Active | The licence is valid |
| Grace period | License Manager is unreachable, or an active licence disappeared (for example while you move between plans). The last active plan keeps working for 72 hours |
| Expired | The grace period ended without an active licence |
| No licence | The account has no SQLark licence |
Without a valid licence every page except this one says a licence is required. Nothing is deleted; subscribing again unlocks SQLark.
Plan
What your plan includes lists the limits and features of your plan:
| Starter | Team | Business | Enterprise | |
|---|---|---|---|---|
| AWS accounts | 3 | 10 | 50 | unlimited |
| Saved queries per user | 50 | 500 | 2,000 | unlimited |
| Dashboards per user | 5 | 50 | 500 | unlimited |
| Versions kept per query or dashboard | 5 | 25 | 50 | 100 |
| Query history kept | 30 days | 90 days | 365 days | 730 days |
| Audit log kept | 30 days | 90 days | 365 days | 3,650 days |
| Fastest dashboard refresh | 5 minutes | 1 minute | 30 seconds | 10 seconds |
| Rows per snapshot | no snapshots | 10,000 | 50,000 | 100,000 |
| Workspace, editor with autocomplete, schema browser, query history, private saved queries and dashboards with versions, every visualisation, variables and macros, daily usage, grants, audit log, IAM Identity Center and Cognito sign-in | yes | yes | yes | yes |
Shared queries and dashboards, snapshots, statements that change data or the catalogue (ddl), SAML and OIDC sign-in | yes | yes | yes | |
| IP allowlist, daily scan budgets, usage by user and workgroup | yes | yes |
Features your plan doesn't include show a plan badge, and SQLark refuses them. To change plan, see Changing plan.
Version and updates
The version card shows the installed version and, when update checks are on (UpdateChecks), the
latest release, its summary and release notes, whether it is a security release, the oldest supported
version, and How to upgrade with the template URL and an AWS CLI command. A banner on the
Administration pages announces a newer release once. See Upgrading.
Something unclear or missing? Email [email protected].