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

Feature request for audit logs to include failed login attempts #99

Open
jens-egerod-ruter opened this issue Dec 5, 2023 · 2 comments

Comments

@jens-egerod-ruter
Copy link

Hi, we would like to monitor failed login attempts to our account.
We are using https://dbtc.dpguthrie.com/0.2/guide/cloud/#list_audit_logs to access the audit logs.

it includes these event types:
credentials.added
credentials.changed
environment.changed
job_definition.added
job_definition.changed
job_definition.removed
login.sso.succeeded
project.changed

please add events for:
login.sso.failed
login.XYZ.failed

and any/all other relevant events

@dpguthrie
Copy link
Owner

The events themselves are not something that this package controls - that's internal to dbt Cloud. That being said, we do have some authentication events that are being logged. Are you able to see these?

@jens-egerod-ruter
Copy link
Author

Hi yes the authentication events is what we would like to get access too :)
How to get access to those events?
v1.events.auth_provider.Changed
v1.events.auth.CredentialsLoginFailed
v1.events.auth.CredentialsLoginSucceeded
v1.events.auth.SsoLoginFailed
v1.events.auth.SsoLoginSucceeded

The code below is what I use and only receive logs for these events:
credentials.added
credentials.changed
environment.changed
job_definition.added
job_definition.changed
job_definition.removed
login.sso.succeeded
project.changed

from datetime import date, timedelta
from dbtc import dbtCloudClient


#Date to begin retrieving audit logs Format is yyyy-mm-dd
logged_at_start= str(date.today()- timedelta(days = 20))
#Date to stop retrieving audit logs. Format is yyyy-mm-dd
logged_at_end= str(date.today()- timedelta(days = 1))

#account id to dbt cloud
account_id=1234

audit_logs = client.cloud.list_audit_logs(account_id=account_id,
                                              logged_at_start=logged_at_start,
                                              logged_at_end=logged_at_end )

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

2 participants