Repository navigation
[Server] Audit records for issued storage credentials - #2028
Merged
Merged
Conversation
Collaborator
Author
|
Local AI review run The CI
Fixed in round 1:
Fixed in round 2:
Kept as is: a sink close failure during JVM exit may go unlogged if Log4j shuts down first.
|
shba24
force-pushed
the
uc-audit-records
branch
from
October 21, 2026 04:59
f74a03a to
d2482df
Compare
This was referenced Oct 21, 2026
shba24
force-pushed
the
uc-audit-records
branch
3 times, most recently
from
October 27, 2026 03:26
b9361cb to
f69fa7e
Compare
3 of 4 tasks
shba24
force-pushed
the
uc-audit-records
branch
from
October 27, 2026 04:06
f69fa7e to
b14e588
Compare
shba24
marked this pull request as ready for review
October 27, 2026 04:07
shba24
requested review from
dennyglee,
openinx,
tdas and
yili-db
as code owners
October 27, 2026 04:07
shba24
force-pushed
the
uc-audit-records
branch
6 times, most recently
from
October 27, 2026 07:28
2acf45c to
577a7ce
Compare
Collaborator
Author
|
/review |
1 similar comment
Collaborator
Author
|
/review |
shba24
force-pushed
the
uc-audit-records
branch
3 times, most recently
from
October 28, 2026 00:56
2851527 to
492ab8d
Compare
Collaborator
Author
|
/review |
shba24
force-pushed
the
uc-audit-records
branch
from
October 28, 2026 01:46
492ab8d to
6ad246f
Compare
yili-db
pushed a commit
that referenced
this pull request
Oct 28, 2026
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/2059/files) to review incremental changes. - [**stack/uc-jvm-shutdown**](#2059) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2059/files)] ← _this PR_ - [uc-audit-records](#2028) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2028/files/4db7e939a4129e4ae46752bff44a5e628a20e44e..6ad246f2cb7a16489d89c910e2ec111c32848222)] - [stack/uc-audit-permissions](#2029) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2029/files/6ad246f2cb7a16489d89c910e2ec111c32848222..b4ccca6f0196d58cbf94d102ccfce35ffef018d7)] - [stack/uc-audit-cleanup-join](#2030) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2030/files/b4ccca6f0196d58cbf94d102ccfce35ffef018d7..e6e03d5c059544262cb0f79ff118fae34fc83e49)] --------- **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** On SIGTERM (`docker stop`, or Kubernetes stopping a pod), the server doesn't shut down cleanly. In the Docker image the JVM never even receives the signal: `bin/start-uc-server` runs `java` as a child of the shell, so `docker stop` waits 10s and kills it. This PR: - `exec`s the JVM from `bin/start-uc-server`, so it receives SIGTERM; - on SIGTERM, runs the server's `close()` from Armeria's shutdown hook: it stops the storage cleanup, lets in-flight requests finish for up to `server.shutdown-timeout`, and closes the rest of the server (blocking executor, authorizer, Hikari pool). Log4j stops last; - turns off Log4j's own JVM hook on that `java` command line, so lines logged during the drain are kept; - changes the default H2 URLs (`etc/conf/hibernate.properties` and the Helm chart) from `DB_CLOSE_DELAY=-1` to `DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=0`, so H2's own JVM hook doesn't close the database while requests drain, and the database closes when the server closes its pool. `docs/server/configuration.md` now documents `server.shutdown-timeout`, and `docs/server/deployment.md` the H2 setting. **Compatibility:** after SIGTERM the process can take up to `server.shutdown-timeout` (default 5s) to drain requests, plus up to 5s if a storage cleanup attempt is running, plus about 2s for Armeria's final stop. With the default, give `docker stop` 15s or more, and raise it and `terminationGracePeriodSeconds` when you raise `server.shutdown-timeout`. <details><summary><b>📐 Design notes & details</b></summary> **Before and after, on the Docker image:** | | Before | After | |---|---|---| | PID 1 | `start-uc-server` (bash), with `java` as a child | `java` | | `docker stop` | 10s, then SIGKILL (exit 137) | about 3s, exit 143 | | `server.log` at shutdown | nothing | `Unity Catalog server stopped.`, then Hikari's `Shutdown completed.` | Kafka (`bin/kafka-run-class.sh`), Pulsar (`bin/pulsar`), Elasticsearch (its Docker entrypoint) and Polaris (`run-java.sh`) also `exec` the JVM. **Order on SIGTERM.** Everything runs on Armeria's hook thread, so it finishes before the JVM exits. 1. `closeOnJvmShutdown(unityCatalogServer::close)` runs `close()` as its `whenClosing` step. `close()` stops the cleanup worker, drains requests through `server.stop()`, then drains the blocking executor with the time left and closes the other resources. SIGTERM and `close()` share one shutdown path. 2. Armeria's own `server.close()` then finds the server stopped and returns at once. 3. Log4j stops last, through `whenComplete`, so it stops even if `close()` fails. Armeria logs that failure. **Policy refresh.** With policy refresh on, `close()` interrupts a refresh still running instead of waiting for it: a refresh holds the refresher's lock while it reads the database, and `close()` used to need that lock first, so a refresh stuck in JDBC blocked shutdown. **Leftover requests.** If requests are still running when the drain's time is up, `close()` interrupts them and waits up to 500 ms for them to stop before it closes the resources they use. One that ignores the interrupt keeps running until the process exits. **Failures.** A resource that fails to close is logged and the rest still close. The database pool now closes the same way in `close()`; before, a failure there replaced an earlier failure from `stop()`. If the server fails to start, `main` closes it and then stops Log4j, since the script turns Log4j's own hook off. **Startup window.** The hook is registered after `start()`, so `close()` can't run during a start. A SIGTERM while the server is starting exits without it, as before this PR. **Why Log4j's hook is off.** JVM shutdown hooks run concurrently, and Log4j's own hook stopped logging while Armeria was still draining. The flag is on the `java` line, as Pulsar does it and as Elasticsearch's launcher adds it, so only the server started by the script is affected; the CLI, tests and apps that embed the server keep Log4j's hook. Running the server another way (`java -jar`, `sbt server/run`) still drains on SIGTERM, but may lose the lines logged during the drain, as before. Log4j's config-file switch (`shutdownHook = disable`) doesn't work here. Log4j starts with its default config when `UnityCatalogServer` loads, and registers its hook then. The server applies `etc/conf/server.log4j2.properties` later. **Why H2 keeps the database open.** H2 closes a file database from its own JVM hook as soon as the JVM starts to exit, so a request still draining fails when it touches the database ("Database is already closed"). With `DB_CLOSE_ON_EXIT=FALSE`, it stays open during the drain. `DB_CLOSE_DELAY=0` closes the database when `close()` closes the pool. It must be in the URL, not just `-1` removed: H2 stores the delay in the database file, so a database first opened with `-1`, including the shipped `etc/db/h2db`, keeps it and would never close. **Tests.** No automated test: a JVM hook only runs when the process exits, and the CI jobs that start the server through the script or the image are disabled. A forked-JVM test is tracked in #2064. This was checked by hand: - **locally through `bin/start-uc-server`, 3 runs:** the script's PID is `java`; after SIGTERM the process exits with 143 in about 2.4s and `server.log` has `Unity Catalog server stopped.`, which `close()` logs after the drain, and Hikari's `Shutdown completed.` from its last step. Started with plain `java` (no flag), both lines were missing in 2 of 2 runs; - **H2** (2.2.224): a query from a JVM shutdown hook fails with the old URL and succeeds with `DB_CLOSE_ON_EXIT=FALSE`. A database created with `DB_CLOSE_DELAY=-1` (as the shipped sample was) and reopened without it still reports `-1` and stays open after its last connection closes; reopened with `DB_CLOSE_DELAY=0`, it closes, and a second process can open it. A catalog created before SIGTERM is still there after a restart; - **on an image built from this branch:** the table above; - **start failure:** with port 8080 already taken, the process exits with 1, logs the bind error, and closes the database pool before Log4j stops. `UnityCatalogServerTest` and `UnityCatalogServerShutdownTest` pass. </details> This pull request and its description were written by Isaac. --------- Signed-off-by: Shubham Bansal <[email protected]> Co-authored-by: Isaac <[email protected]>
Adds opt-in audit records. With server.audit.sink set, the server writes one record per issued storage credential: to the caller (CLIENT), for its own use in a request (SERVER), or for the background storage cleanup (CLEANUP, user system:storage-cleanup, with the dropped object's ID). Cache hits count. FileAuditSink writes JSON lines to etc/logs/audit.log; a custom AuditSink can send them elsewhere. Records hold no secrets. Sink failures at runtime are logged and never fail a request; a misconfigured sink fails startup. StorageCredentialVendor becomes an interface (code in StorageCredentialVendorImpl) so the audit decorator wraps it; FileOperationsImpl passes the SERVER or CLEANUP purpose. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Sibling comments in the file are one or two lines; the sink requirements are in docs/server/configuration.md. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
No other feature has its own section there. Keep what an operator needs: the file path, that it is lost on pod restart, and the snippet that turns records on. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
shba24
added a commit
to shba24/unitycatalog
that referenced
this pull request
Nov 3, 2026
…sions Signed-off-by: Shubham Bansal <[email protected]> # Conflicts: # etc/conf/server.properties # helm/README.md # helm/README.md.gotmpl
Collaborator
|
/review |
yili-db
reviewed
Nov 3, 2026
Vending splits the decoded authority at @, so abfss://user%3Apw%40acct... reached the vendor as user info but was written to the audit record as is, secret included. sanitizeLocation now reads the decoded authority too. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Vend the same path twice with the cache on: the second vend is a cache hit, and both are recorded. This fails if the audit layer ends up below the cache. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
With a clock the test advances: the first failure is reported at once, later ones in the same minute are counted, the next record after a minute reports the count, and close reports what is left. unreported is package-private so the test can read the count. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…ported Records dropped after close are only logged, not counted. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
"Configures it the same way" read as if the chart's server.log rolls too; it goes to the console. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
timothyw553
reviewed
Nov 4, 2026
timothyw553
left a comment
Collaborator
There was a problem hiding this comment.
hi @shba24 thanks for this. please have a look at my comments!
Vending a file: location returns only its URL, with no credential and no expiry. The record is still written: it marks the access the server granted, so local storage keeps an audit trail too. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
During a long outage, a failure, not a written record, claims the report slot. The test now covers that path, so the count is checked to reset after it is reported. Changing getAndSet(0) to get() in reportFailure fails the test. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Neither vending nor sanitizeLocation splits on a colon. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
The cache test and the audit cache-hit test built the same properties. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
timothyw553
approved these changes
Nov 4, 2026
timothyw553
left a comment
Collaborator
There was a problem hiding this comment.
Generally looks good. Thanks for the contribution -- two test gaps.
…e-hit test Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…iles A mocked Logger checks that record() logs each record's JSON at INFO, and a check on the parsed shipped Log4j config pins the audit logger to its own AuditFile appender, writing etc/logs/audit.log with the %m%n layout. Logging at debug, adding a timestamp to the layout, or pointing the audit logger at another appender each fails a test. FileAuditSink gets a package-private constructor that takes the Logger. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
… starts it Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Collaborator
Author
|
/review |
…hat was asked for, and the INFO rule Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
… vends Iceberg returned an empty config for file: tables before reaching the vendor, so those loads wrote no audit record, while the same access through the temporary-credentials endpoints or the Delta API did. getFileIOConfig now calls the vendor for local paths too and still returns an empty config. The vendor returns empty credentials for local paths before the external-location lookup, whose result it ignored for them, so no caller pays for that lookup. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Collaborator
Author
|
/review |
yili-db
approved these changes
Nov 5, 2026
yili-db
pushed a commit
that referenced
this pull request
Nov 9, 2026
## 🥞 Stacked PR #2028 is merged, so this PR's Files changed tab shows only its own changes. - [uc-audit-records](#2028) (merged) - [**stack/uc-audit-permissions**](#2029) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2029/files)] ← _this PR_ - [stack/uc-audit-cleanup-join](#2030) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2030/files/9c3a95bbdbbdd9933e3619a6c4710eb9475b22fe..978a53b5390cbe04aaee3e50564f4dbd732b3744)] --------- **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Builds on #2028 (merged). The Java API changes of #2028 (`StorageCredentialVendor` is an interface, and `FileOperations.getCleanupFileIO` takes the dropped object's ID) are described there; this PR adds none. With audit and authorization on, the server also records each permission change: `GRANT` and `REVOKE` (including the implicit `OWNER` on create and the admin grant at first start), `CLEAR_RESOURCE_GRANTS` when an object is dropped, and `CLEAR_PRINCIPAL_GRANTS` when a user is deleted. A grant is recorded when it adds one. A revoke or a clear is recorded once it finishes without throwing, whether or not it removed a grant: with several servers on one database, a server can't always tell whether its own copy of the grants changed. If the database delete fails, the request fails and nothing is recorded. It also pins `dev.failsafe:failsafe` to 3.2.3. `iceberg-aws` brings Failsafe 3.3.2, which removed `ExecutionContext.getLastFailure`; jdbc-adapter 2.13.0 (the latest release) still calls it when a policy write keeps failing, so a failed revoke threw `NoSuchMethodError` instead of the adapter's `Error` wrapping the `SQLException`. `iceberg-aws` only uses Failsafe APIs that 3.2.3 has. A `TODO` links the upstream fix ([apache/casbin-jcasbin-jdbc-adapter#94](apache/casbin-jcasbin-jdbc-adapter#94), merged, not yet released); the pin goes once a release includes it. `JCasbinAuthorizerTest.failedDeleteThrowsTheDatabaseError` failed before the pin and passes with it. <details><summary><b>📐 Design notes & details</b></summary> **Fields.** Each record has: - the acting user; - `principal_id`, whose grants changed; - `resource_id`; - `privilege`, using the API's names, for example `USE CATALOG`. **Where.** - An `AuditingAuthorizer` decorator wraps `JCasbinAuthorizer` before `initializeAdmin`, so the admin grant is recorded. - A grant is recorded when the delegate returns `true`. A revoke or a clear is recorded whenever the call returns, because with several servers on one database the returned flag only says whether this server's in-memory policy changed. - It forwards `refreshAuthorizations` and `close`. - It is package-private and only reachable through `Auditor.wrap(UnityCatalogAuthorizer)`. - With authorization off (`AllowingAuthorizer`), grants are no-ops and nothing is recorded. **User outside a request.** A record made without a request names the service user `system:server`. Today that's only the admin grant at startup. Cleanup credentials keep `system:storage-cleanup`. **Tests.** `SdkTableAccessControlCRUDTest.auditRecordsGrantsRevokeDropAndUserDelete` covers: - grant and repeated grant; - a revoke sent twice, with the resource ID checked, since the second finds nothing to remove and is still recorded; - the admin grant; - OWNER on create; - a table credential with the admin as user; - grants cleared by a drop and by a user delete; - `principal_id` in the record and in the JSON. The decorator check in `AuditorTest` covers the new class. </details> This pull request and its description were written by Isaac. --------- Signed-off-by: Shubham Bansal <[email protected]> Co-authored-by: Isaac <[email protected]>
yili-db
pushed a commit
that referenced
this pull request
Nov 10, 2026
…2030) ## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/2030/files/9c3a95bbdbbdd9933e3619a6c4710eb9475b22fe..978a53b5390cbe04aaee3e50564f4dbd732b3744) to review incremental changes. - [uc-audit-records](#2028) (merged) - [stack/uc-audit-permissions](#2029) (merged) - [**stack/uc-audit-cleanup-join**](#2030) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2030/files/9c3a95bbdbbdd9933e3619a6c4710eb9475b22fe..978a53b5390cbe04aaee3e50564f4dbd732b3744)] ← _this PR_ --------- **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Builds on #2029. Cleanup credentials are recorded as `system:storage-cleanup`, so they don't say who dropped the object. This PR records `QUEUE_CLEANUP` with the dropping user when a drop queues storage cleanup. Its `resource_id` matches the cleanup's credential records. It is written only after the drop commits. **Compatibility:** `Repositories.getStorageCleanupTaskRepository()` now returns the new `CleanupTaskRepository` interface, and its `Claim` and `CleanupFailureReport` records moved there from `StorageCleanupTaskRepository`. Rebuild against this release: the nested class names, the getter's return type and the `StorageCleanupWorker` constructor changed. Use `CleanupTaskRepository.Claim` and `CleanupTaskRepository.CleanupFailureReport`. <details><summary><b>📐 Design notes & details</b></summary> **Where.** `StorageCleanupTaskRepository.create` is the only place cleanup tasks are made: table, volume, model and model-version drops. The class keeps its name and implements the new `CleanupTaskRepository` interface, so an audit decorator can wrap it. `Repositories` and `StorageCleanupWorker` use the interface type. **After commit.** The decorator registers a Hibernate `Synchronization` and records on `STATUS_COMMITTED` only. With UC's resource-local transactions, Hibernate reports a rollback as `STATUS_UNKNOWN`, which is why the check is "committed" rather than "not rolled back". Hibernate rethrows exceptions from `afterCompletion` out of `commit()`, which would turn a committed drop into an error. So the whole callback is guarded, and failures are logged like other audit failures. **Tests.** - `SdkTableAccessControlCRUDTest.auditRecordsGrantsRevokeDropAndUserDelete`: a drop writes `QUEUE_CLEANUP` and then `CLEAR_RESOURCE_GRANTS`, both from the admin. - `AuditorTest.afterCommitRunsOnlyOnCommitAndNeverFailsIt`: on a real session, a rolled-back transaction runs nothing, and an action that throws does not fail the commit. - The table, volume and model cleanup suites build audited repositories and check in `@AfterEach` that each task has exactly one `QUEUE_CLEANUP` record with its ID and location, across rolled-back and cascading drops (for example `taskInsertFailureRollsBackTableDeletion`). - The decorator check in `AuditorTest`. </details> This pull request and its description were written by Isaac. --------- Signed-off-by: Shubham Bansal <[email protected]> Co-authored-by: Isaac <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR
PR Checklist
docsis updatedDescription of changes
Operators can't tell today who received storage credentials. With
server.audit.sinkset, the server writes one audit record per issued storage credential: for the caller (CLIENT), for its own use in a request (SERVER), or for the background cleanup (CLEANUP). Cache hits are included. Records never contain secrets. The built-inFileAuditSinkwrites JSON lines toetc/logs/audit.log; a customAuditSinkclass can send them elsewhere. Unset (the default), nothing changes.{"time":"2026-10-20T10:02:00.000Z","action":"ISSUE_CREDENTIAL","user":"[email protected]","request_id":"…","purpose":"CLIENT","location":"s3://bucket/root/tables/7f3a…","access":"READ","expires_at":"2026-10-20T11:02:00.000Z"}Open for discussion: should audit be on by default? This PR keeps it off.
Compatibility:
StorageCredentialVendoris now an interface;new StorageCredentialVendor(...)becomesnew StorageCredentialVendorImpl(...), andvendCredential(path, privileges)becomesvendCredential(path, privileges, CredentialUse). Code compiled against the old class fails to link (IncompatibleClassChangeError), so embedders must rebuild against this release.FileOperations.getCleanupFileIOalso takes the dropped object's ID now (getCleanupFileIO(rootPath, resourceId, deadline)), so aFileOperationsimplementation orfileOperationsDecoratormust add the parameter and pass it through.📐 Design notes & details
Stack.
Where records are made.
StorageCredentialVendoris split into an interface andStorageCredentialVendorImpl, as withFileOperations/FileOperationsImpl. When the sink is set, an audit decorator wraps the vendor beforeFileOperationsImplgets it. So it sits above the credential cache and sees every credential.Purpose.
vendCredentialtakes aCredentialUse, which has only three values:CredentialUse.CLIENT,CredentialUse.SERVER, andCredentialUse.cleanup(id)for the dropped object's ID. So a purpose and a resource ID cannot disagree, and there is no default.FileOperationsImpl.getFileIOpassesSERVER, andgetCleanupFileIOpassescleanup(id). Every other caller is a client-facing service and passesCLIENT.file:paths have no credential, but a client's request is still recorded, withoutexpires_at, through every API. Iceberg'sgetFileIOConfigused to return before the vendor for them; it now calls the vendor and still returns an empty config. The vendor returns empty credentials for local paths before the external-location lookup, whose result it ignored for them anyway. The server's own local reads, writes and cleanup are not recorded.system:storage-cleanup.resource_idis the dropped object's ID, which the cleanup worker passes to the credential vend.No secrets.
locationkeeps scheme, authority and path, and drops the query, the fragment and user info. ABFS keepscontainer@accountwhen the part before the@looks like a container name (3 to 63 lowercase letters, digits and hyphens), and writes[REDACTED]in its place otherwise.Failures. Anything a sink throws is caught, and the request continues. Failures are logged at ERROR in
server.logat most once a minute, with a count. A location that can't be parsed is logged at WARN, and the record is written without that field. At startup, the server fails if the sink class can't be loaded. It also fails ifFileAuditSink'sauditlogger:That keeps audit lines out of
server.log.Lifecycle.
UnityCatalogServer.close()closes the sink once.close()([Server] Shut down gracefully on SIGTERM #2059), so the sink closes after the drain and before Log4j stops, and drained requests' records are written.Log file.
auditappender inetc/conf/server.log4j2.propertiesmirrorsserver.log's rollover. The Helm template rollsaudit.logthe same way; there,server.loggoes to the console.createOnDemandmeans no file appears while audit is off.server.logis unchanged.server.log's policy: hourly, kept for up to 7 days or 1GB. The docs still say to shipaudit.logcontinuously, since a busy server cannot hold every record on disk for long.Helm. No new values. Turn audit on with
server.config.extraProperties, and ship the file with a sidecar that shares the log directory.Plugin compatibility.
AuditRecordis a final class with a builder, not a Java record, so adding fields doesn't break compiled sinks.timeandactionare always set.AuditSinkmethods aredefaultonly.accessandpurposeare the record's ownAccessandPurposeenums (CredentialUseusesAuditRecord.Purpose), so the public record depends on neither generated API types nor server-internal packages.Tests.
AuditorTest: the cleanup record and its exact JSON, vended through the decorator together with a plain client vend (recorded asCLIENTwithREADaccess), location stripping (including ABFS), sink failures, startup checks, and decorators forwarding default methods.AuditCredentialVendingIntegrationTest: an s3 catalog with authorization off, a request ID on every record, plus server close.FileOperationsTest. The integration test can't seeSERVER/CLEANUP, because its test-onlyLocalMappingFileOperationsserves those calls itself.This pull request and its description were written by Isaac.