external_cloud_audit: resource#32833
Conversation
660727f to
c04c4d4
Compare
espadolini
left a comment
There was a problem hiding this comment.
What's the plan to enforce that cluster_external_audit must always refer to an existing external_audit?
c04c4d4 to
8be00ed
Compare
I was planning to have following logic in grpc service: |
That's vulnerable to race conditions, you can delete the external_audit between Until we figure out transactional writes, your best bet is to put a backend lock around DeleteExternalAudit and SetClusterExternalAudit (not sure if you need the lock for DeleteClusterExternalAudit). |
6c9a543 to
07bb561
Compare
|
What's the need for the multiple configuration objects, btw? Just the UX flow we decided on? We could keep the ExternalCloudAudit objects for ui, checks and testing but then simply copy the entire configuration onto the singleton ClusterExternalCloudAudit item whenever we need to enable it. |
Just to understand you correctly, instead of passing name to |
7529ced to
134ca5e
Compare
There was a problem hiding this comment.
i have added new command, because we will extend it also with testConnection
a6374f4 to
d8a656d
Compare
|
@espadolini based on your comment with cloning new proto was spec was designed: #33022 cc @bl-nero |
3353e11 to
549ff3f
Compare
bl-nero
left a comment
There was a problem hiding this comment.
I'm publishing a part of my comments, because I need to take a break, and then I'll move on to the rest.
cbb3938 to
d09cc0c
Compare
d09cc0c to
92241f8
Compare
a606832 to
b5cd054
Compare
|
@tobiaszheller See the table below for backport results.
|
* [v14] external cloud audit proto Backport #33022 to branch/v14 * [v14] external_cloud_audit: add resource layer Backport #32833 to branch/v14 * [v14] feat: IAM permissions for BYOBucket Backport #33416 to branch/v14 This commit adds a one-off teleport command that configures the necessary IAM permissions for the upcoming External Cloud Audit (BYOBucket) feature. An example command invocation looks like: ``` $ teleport integration configure externalcloudaudit-iam \ --aws-region us-west-2 --role nic-byob-test --policy nic-byob \ --session-recordings s3://nic-byob/sess-rec-v2 \ --audit-events s3://nic-byob/events --athena-results s3://nic-byob/results \ --athena-workgroup primary --glue-database nic_byob --glue-table nic_byob_table ``` In normal usage this command will be generated for the user so that they can just copy a command from the Web UI and run it in AWS CloudShell. The permissions generated here are based on https://github.com/gravitational/cloud/blob/rfd/77-bring-your-own-bucket/rfd/0077-Bring-your-own-bucket.md, but only include the permissions necessary for using the feature at runtime and not any permissions necessary to bootstrap/create the resources. * [v14] feat: generate randomized ExternalCloudAudit config Backport #33555 to branch/v14 * [v14] BYOB: Bootstrap Athena Infrastructure Backport #33272 to branch/v14 * [v14] feat: cached auto-refreshing AWS credentials for BYOBucket Backport #34380 to branch/v14 This commit implements a "Configurator" for the BYOBucket feature that provides AWS credentials that can be used by the v1 or v2 AWS SDKs for Go. These credentials are generated via an AWS OIDC integration: auth signs a JWT and we swap that with AWS STS for AWS credentials. It also reports whether or not the BYOB feature `IsUsed()` currently, and provides access to the current cluster ExternalCloudAudit spec. This looks a bit weird because of a chicken-egg problem where the audit log must be set up before the auth server can be created, but the auth server must be created to provide the OIDC signing facilities. This will be more clear in following PRs. * [v14] fix: correct IAM policies for BYOB Backport #34484 to branch/v14 This commit fixes the IAM policies generated by the oneoff externalcloudaudit bootstrap command based on manual testing, and brings them more in line with the original RFD https://github.com/gravitational/cloud/blob/master/rfd/0077-Bring-your-own-bucket.md * [v14] feat: enable External Cloud Audit backend Backport #34606 to branch/v14 This commit enables the External Cloud Audit (BYOBucket) feature with a fully functional backend by setting up the Athena and S3 audit components with the right AWS configurations and resource locations. * [v14] Add ExternalCloudAudit permissions to user context ACL Backport #34289 to branch/v14 --------- Co-authored-by: Tobiasz Heller <14020794+tobiaszheller@users.noreply.github.com> Co-authored-by: Logan Davis <38335829+logand22@users.noreply.github.com> Co-authored-by: matheus <matheus.battirola@goteleport.com>
This part adds
external_cloud_auditas resource.You can have only two resources as external cloud audit:
draftandcluster. Draft is now mutable, and there is CRUD around it. You will be also to use it for test connection.To use external audit in cluster, now you need to call
PromoteToClusterExternalCloudAudit, which clones existing draft as cluster resource.They are both of the same kind, only difference is name, which is hardcoded.
Depends on: #33022
Part of: https://github.com/gravitational/cloud/issues/4661
RFD: https://github.com/gravitational/cloud/blob/rfd/77-bring-your-own-bucket/rfd/0077-Bring-your-own-bucket.md