Skip to content

Commit

Permalink
Add admin check for the stream/read-logs functions (#2919) (#2948)
Browse files Browse the repository at this point in the history
  • Loading branch information
neo4j-oss-build authored May 30, 2022
1 parent bcbc626 commit 8a9d0ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/apoc/log/Neo4jLogStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public int compareTo(FileEntry o) {
}
}

@Admin
@Procedure(mode=Mode.DBMS)
@Description( "apoc.log.stream('neo4j.log', { last: n }) - retrieve log file contents, optionally return only the last n lines" )
public Stream<FileEntry> stream(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
NOTE: To use the `apoc.log.stream` procedure the user must have the `admin` role, otherwise the procedure throws with an error `permission has not been granted for user 'xxx'`,
to make sure that only the Administrator can access the logs, which could provide sensitive data.

The following returns the last 10 lines in `neo4j.log`:

[source,cypher]
Expand Down

0 comments on commit 8a9d0ca

Please sign in to comment.