Repository navigation
[backport stable-8.0] feat(graph): allow disabling the last sign-in timestamp update - #12532
Conversation
…oud#12522) * feat(graph): [OCISDEV-1022] allow disabling last sign-in timestamp update Add a new setting OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE / GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE (default true) to disable maintaining the 'oCLastSignInTimestamp' LDAP attribute on user sign-in. When set to false the graph service no longer listens for UserSignedIn events and does not write the attribute, without having to disable all LDAP writes or the events consumer. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * docs(changelog): [OCISDEV-1022] fix PR link to 12522 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(graph): [OCISDEV-1022] cover last sign-in toggle; address review - Add unit test covering both branches of StartListenForLogonEvents (subscribes when UpdateUserLastSignInDate is enabled, not when disabled). - Set introductionVersion to 8.2.0. - Reword the config description: the two settings are independent, the timestamp is only persisted when OCIS_LDAP_SERVER_WRITE_ENABLED is enabled rather than the toggle requiring it. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Co-authored-by: Martin <[email protected]> (cherry picked from commit 49c897e)
|
| Status | Scan Engine | Total (0) | ||||
|---|---|---|---|---|---|---|
| Open Source Security | 0 | 0 | 0 | 0 | See details | |
| Licenses | 0 | 0 | 0 | 0 | See details | |
| ✅ | Code Security | 0 | 0 | 0 | 0 | 0 issues |
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.
dj4oC
left a comment
There was a problem hiding this comment.
Backports the "allow disabling the last sign-in LDAP timestamp write" flag (#12522) to stable-8.0.
Findings
Security: No findings — this only gates an existing LDAP write behind a new opt-out flag (default true, backward compatible); no new attack surface.
Stability (blocking): The build-and-test check fails on this PR's head commit (ec857cc) at the changelog-lint step (Process completed with exit code 1). The job log doesn't surface the underlying lint message, but notably the byte-for-byte identical change backported to stable-8.1 in #12531 passes changelog-lint cleanly on its head commit — so this looks specific to something in the stable-8.0 branch state rather than this PR's diff. Worth a maintainer check (e.g. a stale/duplicate changelog filename already present on stable-8.0, or a changelog-lint tooling difference between the two stable branches) before merging.
Performance: No findings.
Test coverage: Good — logon_events_test.go asserts the consumer is/isn't subscribed for both flag states.
TODOs found: none. Dependency touched: no.
Deployment topology check
Compatible — per-service Go config flag, no topology-specific assumptions.
Verdict
Changes requested — not on code content (which is clean and already has two human approvals), but this shouldn't merge with a failing required check. Please don't merge until build-and-test is green.
🤖 Automated review by Claude Code (security · stability · performance · coverage)
Generated by Claude Code
Generated by Claude Code |
|
Follow-up on my earlier review (the Since that review, two unrelated commits were pushed to this branch by @mklos-kw (not the PR author):
These are out of scope for a backport PR whose stated purpose is the LDAP last-sign-in timestamp flag, and they've triggered new failures:
Both are commit-status "error" (scan failure) rather than a clean pass/fail, so it's not yet clear whether this is a newly-flagged CVE/license issue in the bumped versions or a Snyk scan hiccup. Given this touches
Generated by Claude Code |
There was a problem hiding this comment.
Pull request overview
Backports the graph-service capability to disable LDAP oCLastSignInTimestamp updates by conditionally skipping the UserSignedIn event subscription when the new OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE / GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE setting is false. In addition to the graph change, the PR also updates vendored dependencies (notably golang.org/x/crypto and github.com/go-git/go-git/v5), which broadens the scope and review surface on the stable branch.
Changes:
- Add
UpdateUserLastSignInDateconfig (defaulttrue) and gateStartListenForLogonEventson it. - Add service-level tests to assert event subscription is skipped/enabled based on the setting; add changelog entry.
- Bump and re-vendor
golang.org/x/cryptoandgithub.com/go-git/go-git/v5(large vendor diff).
Reviewed changes
Copilot reviewed 6 out of 47 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vendor/modules.txt | Vendor manifest updates for bumped modules. |
| vendor/golang.org/x/crypto/ssh/server.go | Vendored x/crypto update (SSH permissions/verification behavior). |
| vendor/golang.org/x/crypto/ssh/mux.go | Vendored x/crypto update (global request response gating). |
| vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts.go | Vendored x/crypto update (revocation checks). |
| vendor/golang.org/x/crypto/ssh/keys.go | Vendored x/crypto update (key validation / DoS hardening, SK UP handling). |
| vendor/golang.org/x/crypto/ssh/cipher.go | Vendored x/crypto update (padding bounds fix). |
| vendor/golang.org/x/crypto/ssh/channel.go | Vendored x/crypto update (payload sizing + request/response gating). |
| vendor/golang.org/x/crypto/ssh/certs.go | Vendored x/crypto update (cert authority nil checks, SK UP behavior). |
| vendor/golang.org/x/crypto/ssh/agent/server.go | Vendored x/crypto update (ed25519 key size validation). |
| vendor/golang.org/x/crypto/ssh/agent/keyring.go | Vendored x/crypto update (constraint support validation). |
| vendor/golang.org/x/crypto/ssh/agent/client.go | Vendored x/crypto update (constraint extensions encoding). |
| vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go | Vendored x/crypto update (AVX2 gating behavior). |
| vendor/golang.org/x/crypto/blake2b/go125.go | Vendored x/crypto update (removes go1.25 build-tag file). |
| vendor/github.com/go-git/go-git/v5/worktree.go | Vendored go-git update (worktree reset path validation refactor). |
| vendor/github.com/go-git/go-git/v5/worktree_status.go | Vendored go-git update (tree-path validation before index add). |
| vendor/github.com/go-git/go-git/v5/worktree_fs.go | Vendored go-git update (new worktree filesystem wrapper with path validation). |
| vendor/github.com/go-git/go-git/v5/utils/binary/read.go | Vendored go-git update (varint overflow checks). |
| vendor/github.com/go-git/go-git/v5/submodule.go | Vendored go-git update (submodule path validation + relative URL resolution). |
| vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go | Vendored go-git update (submodule name escape prevention). |
| vendor/github.com/go-git/go-git/v5/repository.go | Vendored go-git update (protectNTFS/protectHFS defaults + worktree FS wrapper). |
| vendor/github.com/go-git/go-git/v5/plumbing/transport/ssh/common.go | Vendored go-git update (shell quoting hardening). |
| vendor/github.com/go-git/go-git/v5/plumbing/object/tree.go | Vendored go-git update (tree-path validation at boundaries). |
| vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/scanner.go | Vendored go-git update (pack parsing hardening + bounded inflate). |
| vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/patch_delta.go | Vendored go-git update (delta decoding hardening + overflow checks). |
| vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/parser.go | Vendored go-git update (prealloc caps + delta chain depth limit). |
| vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/packfile.go | Vendored go-git update (delta size decode error handling). |
| vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/fsobject.go | Vendored go-git update (bounded reader for lazy streams). |
| vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/diff_delta.go | Vendored go-git update (constants cleanup). |
| vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/reader.go | Vendored go-git update (header-not-read guard). |
| vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/idxfile.go | Vendored go-git update (idx offset bounds checking). |
| vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/decoder.go | Vendored go-git update (idx size validation using Stat). |
| vendor/github.com/go-git/go-git/v5/internal/url/url.go | Vendored go-git update (SCP-like URL disambiguation). |
| vendor/github.com/go-git/go-git/v5/internal/pathutil/tree.go | Vendored go-git update (new tree-path validator). |
| vendor/github.com/go-git/go-git/v5/internal/pathutil/ntfs.go | Vendored go-git update (NTFS dotfile/device-name detection). |
| vendor/github.com/go-git/go-git/v5/internal/pathutil/hfs.go | Vendored go-git update (HFS+ dotfile disguise detection). |
| vendor/github.com/go-git/go-git/v5/internal/pathutil/dotgit.go | Vendored go-git update (dotgit name helper). |
| vendor/github.com/go-git/go-git/v5/config/optbool.go | Vendored go-git update (tri-state bool for config parsing). |
| vendor/github.com/go-git/go-git/v5/config/modules.go | Vendored go-git update (submodule-name validation hardening). |
| vendor/github.com/go-git/go-git/v5/config/config.go | Vendored go-git update (core.protectNTFS/HFS config plumbing). |
| services/graph/pkg/service/v0/service.go | Gate logon event subscription on UpdateUserLastSignInDate. |
| services/graph/pkg/service/v0/logon_events_test.go | New tests for subscription gating behavior. |
| services/graph/pkg/config/defaults/defaultconfig.go | Default UpdateUserLastSignInDate: true. |
| services/graph/pkg/config/config.go | Add env/yaml setting UpdateUserLastSignInDate (introduced in 8.0.6). |
| go.sum | Checksums updated for bumped modules. |
| go.mod | Bump golang.org/x/crypto and indirect go-git. |
| changelog/unreleased/graph-disable-last-signin-timestamp.md | Changelog entry for the new operator toggle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Backport of #12522 to
stable-8.0.Adds
OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE/GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE(defaulttrue) to let operators stop the graph service from writing theoCLastSignInTimestampLDAP attribute on every sign-in, reducing LDAP write load.When set to
false, the graph service no longer subscribes toUserSignedInevents and does not write the attribute.UserSignedInis the only event this listener handles, so gating the whole listener has no other side effects.Notes on the backport
-x); git's 3-way merge applied theservice.gogate onto the stable-8.0 variant ofStartListenForLogonEvents(which lacks the master-only trace span wiring).introductionVersionadjusted from8.2.0(master) to8.0.6to reflect the stable-8.0 release line.Original PR: #12522
🤖 Generated with Claude Code