PantherFlow 문
PantherFlow 쿼리 문에는 두 가지 유형이 있습니다
마지막 업데이트
도움이 되었나요?
도움이 되었나요?
let elbOK = panther_logs.public.aws_alb
| where elbStatusCode == 200;
elbOKlet elbOK = panther_logs.public.aws_alb
| where elbStatusCode == 200;
elbOK
| where p_event_time > time.ago(1h)let ec2Events = panther_logs.public.aws_cloudtrail
| where p_event_time > time.ago(1h)
| where eventSource == "ec2.amazonaws.com";
let s3Events = panther_logs.public.aws_cloudtrail
| where p_event_time > time.ago(1h)
| where eventSource == "s3.amazonaws.com";
union ec2Events, s3Events
| summarize count=agg.count() by eventName, eventSource
| sort count desclet threshold = 100;
panther_logs.public.aws_cloudtrail
| where p_event_time > time.ago(1d)
| summarize count=agg.count() by eventName
| where count > thresholdlet domain = "example.com";
let searchSuffix = strings.cat("@", domain);
panther_logs.public.aws_cloudtrail
| where strings.ends_with(userIdentity.principalId, searchSuffix)
| summarize count=agg.count() by eventNamelet hourInSeconds = 60 * 60;
let dayInSeconds = hourInSeconds * 24;
let weekInSeconds = dayInSeconds * 7;
panther_logs.public.aws_cloudtrail
| extend ageInSeconds = time.diff("s", p_event_time, time.now())
| extend ageCategory = case(
ageInSeconds < hourInSeconds, "1시간 미만",
ageInSeconds < dayInSeconds, "1일 미만",
ageInSeconds < weekInSeconds, "1주 미만",
"1주 이상"
)
| summarize count=agg.count() by ageCategory// Scalar variables
let minSeverity = 3;
let timeRange = 7d;
let criticalServices = ["ec2.amazonaws.com", "iam.amazonaws.com", "s3.amazonaws.com"];
// Table variable
let baseQuery = panther_logs.public.aws_cloudtrail
| where p_event_time > time.ago(timeRange)
| where eventSource in criticalServices;
// Table variable
let failedActions = baseQuery
| where errorCode != ""
| extend severity = case(
errorCode == "AccessDenied", 4,
errorCode == "UnauthorizedOperation", 3,
strings.starts_with(errorCode, "Client"), 2,
1
);
// Tabular expression statement
failedActions
| where severity >= minSeverity
| summarize count=agg.count() by eventSource, errorCode, severity
| sort severity desc, count desc