-
Notifications
You must be signed in to change notification settings - Fork 1
Add table alb_connection_log
#106
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
Open
Priyanka-Chatterjee-2000
wants to merge
7
commits into
main
Choose a base branch
from
add_alb_connection_log
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
59dff26
Add table alb connection log
Priyanka-Chatterjee-2000 16745c2
Add docs
Priyanka-Chatterjee-2000 0d71a18
Update fields and queries
Priyanka-Chatterjee-2000 4b7ba80
Update docs and grok pattern
Priyanka-Chatterjee-2000 434cc37
Update tp_index and grok pattern
Priyanka-Chatterjee-2000 79ac830
Merge branch 'main' of github.com:turbot/tailpipe-plugin-aws into add…
misraved d2c403c
Merge branch 'main' of github.com:turbot/tailpipe-plugin-aws into add…
cbruno10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
--- | ||
title: "Tailpipe Table: aws_alb_connection_log - Query AWS ALB Connection Logs" | ||
description: "AWS ALB Connection logs capture detailed information about connection attempts to an Application Load Balancer, including TLS handshake details, client certificate data, and connection traceability identifiers." | ||
--- | ||
|
||
# Table: aws_alb_connection_log - Query AWS ALB connection logs | ||
|
||
The `aws_alb_connection_log` table allows you to query AWS Application Load Balancer (ALB) connection logs. This table provides detailed information about connection attempts to your load balancers, including TLS handshake details, client certificate data, and connection traceability identifiers. | ||
|
||
## Configure | ||
|
||
Create a [partition](https://tailpipe.io/docs/manage/partition) for `aws_alb_connection_log` ([examples](https://hub.tailpipe.io/plugins/turbot/aws/tables/aws_alb_connection_log#example-configurations)): | ||
|
||
```sh | ||
vi ~/.tailpipe/config/aws.tpc | ||
``` | ||
|
||
```hcl | ||
connection "aws" "logging_account" { | ||
profile = "my-logging-account" | ||
} | ||
|
||
partition "aws_alb_connection_log" "my_alb_conn_logs" { | ||
source "aws_s3_bucket" { | ||
connection = connection.aws.logging_account | ||
bucket = "aws-alb-logs-bucket" | ||
} | ||
} | ||
``` | ||
|
||
## Collect | ||
|
||
[Collect](https://tailpipe.io/docs/manage/collection) logs for all `aws_alb_connection_log` partitions: | ||
|
||
```sh | ||
tailpipe collect aws_alb_connection_log | ||
``` | ||
|
||
Or for a single partition: | ||
|
||
```sh | ||
tailpipe collect aws_alb_connection_log.my_alb_conn_logs | ||
``` | ||
|
||
## Query | ||
|
||
**[Explore 10+ example queries for this table →](https://hub.tailpipe.io/plugins/turbot/aws/queries/aws_alb_connection_log)** | ||
|
||
### Failed TLS handshakes | ||
|
||
Find failed TLS handshakes to troubleshoot connection issues. | ||
|
||
```sql | ||
select | ||
timestamp, | ||
tp_index as conn_trace_id, | ||
client_ip, | ||
client_port, | ||
tls_protocol, | ||
tls_cipher, | ||
tls_verify_status | ||
from | ||
aws_alb_connection_log | ||
where | ||
tls_verify_status like 'Failed:%' | ||
order by | ||
timestamp desc; | ||
``` | ||
|
||
### Slow TLS handshakes | ||
|
||
Identify connections with unusually high TLS handshake latency that might indicate performance issues. | ||
|
||
```sql | ||
select | ||
timestamp, | ||
tp_index as conn_trace_id, | ||
client_ip, | ||
client_port, | ||
tls_protocol, | ||
tls_cipher, | ||
tls_handshake_latency | ||
from | ||
aws_alb_connection_log | ||
where | ||
tls_handshake_latency > 1 -- Handshakes taking longer than 1 second | ||
order by | ||
tls_handshake_latency desc | ||
limit 10; | ||
``` | ||
|
||
### Deprecated TLS protocols | ||
|
||
Identify connections using deprecated or insecure TLS protocols. | ||
|
||
```sql | ||
select | ||
tls_protocol, | ||
tls_cipher, | ||
count(*) as connection_count | ||
from | ||
aws_alb_connection_log | ||
where | ||
tls_protocol in ('TLSv1.1', 'TLSv1', 'SSLv3', 'SSLv2') -- Insecure protocols | ||
group by | ||
tls_protocol, | ||
tls_cipher | ||
order by | ||
connection_count desc; | ||
``` | ||
|
||
## Example Configurations | ||
|
||
### Collect logs from an S3 bucket | ||
|
||
Collect ALB connection logs stored in an S3 bucket using the default log file format. | ||
|
||
```hcl | ||
connection "aws" "logging_account" { | ||
profile = "my-logging-account" | ||
} | ||
|
||
partition "aws_alb_connection_log" "my_alb_conn_logs" { | ||
source "aws_s3_bucket" { | ||
connection = connection.aws.logging_account | ||
bucket = "aws-alb-logs-bucket" | ||
} | ||
} | ||
``` | ||
|
||
### Collect logs from an S3 bucket with a prefix | ||
|
||
Collect ALB connection logs stored in an S3 bucket using a prefix. | ||
|
||
```hcl | ||
partition "aws_alb_connection_log" "my_alb_conn_logs_prefix" { | ||
source "aws_s3_bucket" { | ||
connection = connection.aws.logging_account | ||
bucket = "aws-alb-logs-bucket" | ||
prefix = "my/prefix/" | ||
} | ||
} | ||
``` | ||
|
||
### Collect logs from local files | ||
|
||
You can also collect ALB connection logs from local files. | ||
|
||
```hcl | ||
partition "aws_alb_connection_log" "local_logs" { | ||
source "file" { | ||
paths = ["/Users/myuser/elb_logs"] | ||
file_layout = "%{DATA}.log.gz" | ||
} | ||
} | ||
``` | ||
|
||
### Collect logs for all accounts in an organization | ||
|
||
For a specific organization, collect logs for all accounts and regions. | ||
|
||
```hcl | ||
partition "aws_alb_connection_log" "my_logs_org" { | ||
source "aws_s3_bucket" { | ||
connection = connection.aws.logging_account | ||
bucket = "aws-alb-logs-bucket" | ||
file_layout = "AWSLogs/o-aa111bb222/%{NUMBER:account_id}/elasticloadbalancing/%{DATA:region}/%{YEAR:year}/%{MONTHNUM:month}/%{MONTHDAY:day}/conn_log.%{DATA}.log.gz" | ||
} | ||
} | ||
``` | ||
|
||
### Collect logs for a single account | ||
|
||
For a specific account, collect logs for all regions. | ||
|
||
```hcl | ||
partition "aws_alb_connection_log" "my_logs_account" { | ||
source "aws_s3_bucket" { | ||
connection = connection.aws.logging_account | ||
bucket = "aws-alb-logs-bucket" | ||
file_layout = "AWSLogs/(%{DATA:org_id}/)?123456789012/elasticloadbalancing/%{DATA:region}/%{YEAR:year}/%{MONTHNUM:month}/%{MONTHDAY:day}/conn_log.%{DATA}.log.gz" | ||
} | ||
} | ||
``` | ||
|
||
### Collect logs for a single region | ||
|
||
For all accounts, collect logs from us-east-1. | ||
|
||
```hcl | ||
partition "aws_alb_connection_log" "my_logs_region" { | ||
source "aws_s3_bucket" { | ||
connection = connection.aws.logging_account | ||
bucket = "aws-alb-logs-bucket" | ||
file_layout = "AWSLogs/(%{DATA:org_id}/)?%{NUMBER:account_id}/elasticloadbalancing/us-east-1/%{YEAR:year}/%{MONTHNUM:month}/%{MONTHDAY:day}/conn_log.%{DATA}.log.gz" | ||
} | ||
} | ||
``` | ||
|
||
### Collect logs for multiple regions | ||
|
||
For all accounts, collect logs from us-east-1 and us-east-2. | ||
|
||
```hcl | ||
partition "aws_alb_connection_log" "my_logs_regions" { | ||
source "aws_s3_bucket" { | ||
connection = connection.aws.logging_account | ||
bucket = "aws-alb-logs-bucket" | ||
file_layout = "AWSLogs/(%{DATA:org_id}/)?%{NUMBER:account_id}/elasticloadbalancing/(us-east-1|us-east-2)/%{YEAR:year}/%{MONTHNUM:month}/%{MONTHDAY:day}/conn_log.%{DATA}.log.gz" | ||
} | ||
} | ||
``` | ||
|
||
## Source Defaults | ||
|
||
### aws_s3_bucket | ||
|
||
This table sets the following defaults for the [aws_s3_bucket source](https://hub.tailpipe.io/plugins/turbot/aws/sources/aws_s3_bucket#arguments): | ||
|
||
| Argument | Default | | ||
|--------------|---------| | ||
| file_layout | `AWSLogs/(%{DATA:org_id}/)?%{NUMBER:account_id}/elasticloadbalancing/%{DATA:region}/%{YEAR:year}/%{MONTHNUM:month}/%{MONTHDAY:day}/conn_log.%{DATA}.log.gz` | |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The folder name 'aws_alb_conection_log' appears to be misspelled; consider renaming it to 'aws_alb_connection_log' to maintain consistency with the table name.
Copilot uses AI. Check for mistakes.