Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect queries? #5

Open
loganmarchione opened this issue Dec 16, 2020 · 0 comments
Open

Incorrect queries? #5

loganmarchione opened this issue Dec 16, 2020 · 0 comments

Comments

@loganmarchione
Copy link

loganmarchione commented Dec 16, 2020

Are the two queries below correct?

  • Find users that logged in within the last 90 days
  • Find users with passwords last set within the last 90 days <-- I'll be using this as an example

I took your query and added info to get the actual name and pwdlastset timestamp. In the Neo4j browser:
MATCH (u:User) WHERE u.pwdlastset < (datetime().epochseconds - (90 * 86400)) and NOT u.pwdlastset IN [-1.0, 0.0] RETURN u.name, u.pwdlastset

I get this data back:

u.name u.pwdlastset
"USERNAME@DOMAIN" 1540398615.0

Converting that timestamp to a date:
MATCH (u:User) WHERE u.pwdlastset < (datetime().epochseconds - (90 * 86400)) and NOT u.pwdlastset IN [-1.0, 0.0] RETURN u.name,datetime({epochSeconds:toInteger(u.pwdlastset)})

I get this data back (which is more than 90 days):

u.name datetime({epochSeconds:toInteger(u.pwdlastset)})
"USERNAME@DOMAIN" "2018-10-24T16:30:15Z"

I think the text needs to be flipped to read Find users with passwords last set in 90 days or more or the less than symbol (<) needs to be flipped around to a greater than symbol (>)

@loganmarchione loganmarchione changed the title Incorrect queries Incorrect queries? Dec 16, 2020
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

No branches or pull requests

1 participant