Skip to content

[backport stable-8.0] feat(graph): allow disabling the last sign-in timestamp update - #12532

Merged
kobergj merged 3 commits into
owncloud:stable-8.0from
kobergj:backport/OCISDEV-1022-stable-8.0
Jul 13, 2026
Merged

kobergj merged 3 commits into
owncloud:stable-8.0from
kobergj:backport/OCISDEV-1022-stable-8.0

Conversation

@kobergj

@kobergj kobergj commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Backport of #12522 to stable-8.0.

Adds OCIS_LDAP_UPDATE_LAST_SIGNIN_DATE / GRAPH_LDAP_UPDATE_LAST_SIGNIN_DATE (default true) to let operators stop the graph service from writing the oCLastSignInTimestamp LDAP attribute on every sign-in, reducing LDAP write load.

When set to false, the graph service no longer subscribes to UserSignedIn events and does not write the attribute. UserSignedIn is the only event this listener handles, so gating the whole listener has no other side effects.

Notes on the backport

  • Clean cherry-pick (-x); git's 3-way merge applied the service.go gate onto the stable-8.0 variant of StartListenForLogonEvents (which lacks the master-only trace span wiring).
  • introductionVersion adjusted from 8.2.0 (master) to 8.0.6 to reflect the stable-8.0 release line.
  • Build + graph service tests pass locally.

Original PR: #12522

🤖 Generated with Claude Code

…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)
@kw-security

kw-security commented Jul 9, 2026 •

Copy link
Copy Markdown

⚠️ Snyk checks are incomplete.

Status Scan Engine Critical High Medium Low 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.

mklos-kw
mklos-kw previously approved these changes Jul 9, 2026
deyankiteworks
deyankiteworks previously approved these changes Jul 9, 2026
dj4oC
dj4oC previously requested changes Jul 9, 2026

@dj4oC dj4oC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

dj4oC commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
  • Security: no findings
  • Stability: 1 finding — see review
  • Performance: no findings
  • Test coverage: unit test covers both flag states
  • TODOs found: none
  • Dependency touched: no
  • CI status: failing: build-and-test (changelog-lint step)
  • Stale review: no

Generated by Claude Code

@mklos-kw
mklos-kw dismissed stale reviews from deyankiteworks and themself via c1f9e07 July 9, 2026 15:06

dj4oC commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Follow-up on my earlier review (the build-and-test/changelog-lint failure I flagged is now resolved on the current head).

Since that review, two unrelated commits were pushed to this branch by @mklos-kw (not the PR author):

  • c1f9e07 chore: bump go-git (v5.19.0 → v5.19.1)
  • eda4fad chore: bump crypto (golang.org/x/crypto v0.51.0 → v0.52.0)

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:

  • security/snyk: error — "1 test has failed"
  • license/snyk: error — "1 test has failed"

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 golang.org/x/crypto, please have a maintainer check the Snyk dashboard links on the checks before merging — this shouldn't merge with security/license checks in an error state, and the two chore commits probably belong in their own PR rather than riding on this backport.

  • Security: 1 finding — see above (A06:2021 Vulnerable/Outdated Components — CWE-1104, pending Snyk detail)
  • Stability: no new findings (previous blocking issue resolved)
  • Performance: no findings
  • CI status: failing — security/snyk, license/snyk (error state)

Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UpdateUserLastSignInDate config (default true) and gate StartListenForLogonEvents on 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/crypto and github.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.

Comment thread go.mod Resolved
Comment thread go.mod Resolved
@kobergj
kobergj merged commit b0d2d53 into owncloud:stable-8.0 Jul 13, 2026
55 checks passed
@kobergj
kobergj deleted the backport/OCISDEV-1022-stable-8.0 branch July 13, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants