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

Support Audit Logging export in teleport #3250

Closed
QuentinBisson opened this issue Feb 19, 2024 · 10 comments
Closed

Support Audit Logging export in teleport #3250

QuentinBisson opened this issue Feb 19, 2024 · 10 comments

Comments

@QuentinBisson
Copy link

Is your feature request related to a problem? Please describe.

Teleport provide audit logs when we access clusters and nodes using teleport but those logs are stored in dynamodb. @ssyno talked to me about this plugin that could be useful https://goteleport.com/docs/reference/helm-reference/teleport-plugin-event-handler/

Describe the solution you'd like

I would like to have a solution to be able to get the teleport audit logs sent to customer endpoints.

To that end, we could use this https://goteleport.com/docs/reference/helm-reference/teleport-plugin-event-handler/ with a custom fluentd/fluent bit instance or maybe another teleport plugin to be able to send the logs to customer endpoints if they require it

Describe alternatives you've considered

Additional context

This is needed by a few customers

cc @gawertm as PO of bigmac. Should we schedule a session to talk about this ?

@github-project-automation github-project-automation bot moved this to Inbox 📥 in Roadmap Feb 19, 2024
@ssyno ssyno self-assigned this Feb 19, 2024
@ssyno ssyno moved this from Inbox 📥 to In Progress ⛏️ in Roadmap Feb 19, 2024
@ssyno
Copy link

ssyno commented Feb 20, 2024

As of teleport documentation around teleport-plugin-event-handler.

  1. Generate a plugin configuration teleport-event-handler-client-tls
TELEPORT_CLUSTER_ADDRESS=teleport.giantswarm.io:443
docker run -v `pwd`:/opt/teleport-plugin -w /opt/teleport-plugin public.ecr.aws/gravitational/teleport-plugin-event-handler:15.0.2 configure . ${TELEPORT_CLUSTER_ADDRESS?}
kubectl create secret generic teleport-event-handler-client-tls --from-file=ca.crt=ca.crt,client.crt=client.crt,client.key=client.key
  1. It is possible to create separate user and role for each cluster in the following pattern:
kind: role
metadata:
  name: teleport-event-handler-gaggle
spec:
  allow:
    rules:
      - resources: ['event', 'session']
        verbs: ['list','read']
        where: 'contains(session.cluster_name, "gaggle")'
version: v5
---
kind: user
metadata:
  name: teleport-event-handler-gaggle
spec:
  roles: ['teleport-event-handler-gaggle']
version: v2

Apply with tctl command (can be included to our Gitops approach).

tctl create -f teleport-event-handler-gaggle-role.yaml
  1. Create teleport-event-handler credentials for each user/role:
kind: role
version: v5
metadata:
  name: teleport-event-handler-gaggle-impersonator
spec:
  options:
    max_session_ttl: 10h
  allow:
    impersonate:
      users: ["teleport-event-handler-gaggle"]
      roles: ["teleport-event-handler-gaggle"]

Apply with tctl command (can be included to our Gitops approach).

tctl create teleport-event-handler-gaggle-impersonator.yaml
  1. Both tbot-credentials and long lived-credentials are supported to be discussed
  2. fluentd.conf has been generated on step no.1,fluentd deployment?
  3. Implementation of the handler and all mentioned above to teleport helm chart like:
eventHandler:
  storagePath: "./storage"
  timeout: "10s"
  batch: 20
  namespace: "teleport"

teleport:
  address: "teleport.giantswarm.io:443"
  identitySecretName: teleport-event-handler-gaggle-identity
  identitySecretPath: identity

fluentd:
  url: "https://fluentd.fluentd.svc.cluster.local/events.log"
  sessionUrl: "https://fluentd.fluentd.svc.cluster.local/session.log"
  certificate:
    secretName: "teleport-event-handler-client-tls"
    caPath: "ca.crt"
    certPath: "client.crt"
    keyPath: "client.key"

persistentVolumeClaim:
  enabled: true

@gawertm
Copy link

gawertm commented Feb 29, 2024

@QuentinBisson do you know how to proceed here?

@QuentinBisson
Copy link
Author

Hey @gawertm and @ssyno sorry about the delay :(

Thank you very much for the investigation.

So from what I understand, we could deploy a fluentd now and eventually configure it later to send logs to some custom locations right?

We probably would need to be able to send logs to private MCs as well the customer SIEM tools will probably be private. Do you think that would be possible ? If yes then it would be amazing if you could deploy this on our teleport cluster and then we can configure it per installation.

I think we probably would need those logs in loki as well as in a customer fluent logshipper for some customers

@ssyno
Copy link

ssyno commented Mar 5, 2024

Hey @QuentinBisson, sorry about the delay,

Deploying Fluentd/Fluent Bit with the teleport-plugin-event-handler configuration for secure log collection as an initial will allow us to collect audit logs securely and forward them to various endpoints, including Loki for internal use and customer-specific SIEM tools.
Then we can set up the necessary roles and permissions for secure access to the logs and configure log forwarding to meet both internal and customer-specific requirements, ensuring privacy and security.

@QuentinBisson
Copy link
Author

Awesome then for next steps, I would probably start by sending them to each loki and then we can split it for specific customers SIEM. What do you think?
Should we schedule a call to start this?

@ssyno
Copy link

ssyno commented Mar 6, 2024

Sure, we can have a call whenever you like.

@ssyno ssyno moved this from In Progress ⛏️ to Up Next ➡️ in Roadmap Mar 12, 2024
@QuentinBisson
Copy link
Author

Here is the outcome of the call of the day:
image

Preferred solution is the orange one. Atlas will take care of the fluent bit receiver (issue will come) and Big Mac will take care of the event handlers to be deployed per instalation.

@ssyno ssyno moved this from Up Next ➡️ to In Progress ⛏️ in Roadmap Mar 19, 2024
@vvondruska vvondruska moved this from In Progress ⛏️ to Blocked / Waiting ⛔️ in Roadmap Mar 21, 2024
@QuentinBisson
Copy link
Author

QuentinBisson commented Mar 21, 2024

Here is the receiver issue on our end #3343 :)

@gawertm
Copy link

gawertm commented Apr 30, 2024

@QuentinBisson @Rotfuks as you have a separate ticket in your board already, do we need this ticket here still?

@Rotfuks
Copy link
Contributor

Rotfuks commented May 8, 2024

No, not really :) Guess you can close it then as a duplicate

@gawertm gawertm closed this as completed May 14, 2024
@github-project-automation github-project-automation bot moved this from Blocked / Waiting ⛔️ to Done ✅ in Roadmap May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants