Skip to content

Commit de936f1

Browse files
tas50claude
andcommitted
⭐ Expand Security Hub with standards controls, findings, automation rules, and insights
Add typed resources for comprehensive Security Hub querying: - standardSubscription: enabled standards with status - standardControl: individual controls with pass/fail status, severity, remediation URLs - finding: ASFF findings with severity, compliance status, workflow state, affected resources - automationRule: rule metadata with status and execution order - insight + insightResult: saved filters with computed result aggregations This enables queries like: aws.securityhub.hubs { standardSubscriptions { controls.where(controlStatus == "ENABLED") { controlId severity title } } } Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bf0486f commit de936f1

File tree

5 files changed

+1708
-5
lines changed

5 files changed

+1708
-5
lines changed

providers/aws/resources/aws.lr

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,6 +3035,148 @@ private aws.securityhub.hub @defaults("arn region") {
30353035
region string
30363036
// List of enabled security standards (CIS, PCI-DSS, AWS Foundational, etc.)
30373037
enabledStandards() []dict
3038+
// Typed standard subscriptions with control details
3039+
standardSubscriptions() []aws.securityhub.standardSubscription
3040+
// Active findings (non-archived) in this hub
3041+
findings() []aws.securityhub.finding
3042+
// Automation rules configured in this hub
3043+
automationRules() []aws.securityhub.automationRule
3044+
// Custom and default insights
3045+
insights() []aws.securityhub.insight
3046+
}
3047+
3048+
// AWS Security Hub enabled standard subscription
3049+
private aws.securityhub.standardSubscription @defaults("name status") {
3050+
// ARN of the standard subscription
3051+
arn string
3052+
// ARN of the standard definition
3053+
standardArn string
3054+
// Name of the standard (e.g., CIS AWS Foundations Benchmark)
3055+
name string
3056+
// Region for this subscription
3057+
region string
3058+
// Subscription status: READY, INCOMPLETE, FAILED, DELETING, PENDING
3059+
status string
3060+
// Controls within this standard
3061+
controls() []aws.securityhub.standardControl
3062+
}
3063+
3064+
// AWS Security Hub standard control
3065+
private aws.securityhub.standardControl @defaults("controlId title controlStatus") {
3066+
// Control ARN
3067+
arn string
3068+
// Control identifier (e.g., CIS.1.1)
3069+
controlId string
3070+
// Control title
3071+
title string
3072+
// Description of what the control checks for
3073+
description string
3074+
// Control status: ENABLED, DISABLED
3075+
controlStatus string
3076+
// Severity: CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL
3077+
severity string
3078+
// Reason the control was disabled
3079+
disabledReason string
3080+
// Related compliance requirements
3081+
relatedRequirements []string
3082+
// URL to remediation documentation
3083+
remediationUrl string
3084+
}
3085+
3086+
// AWS Security Hub finding (ASFF format)
3087+
private aws.securityhub.finding @defaults("title severity workflowStatus") {
3088+
// Finding identifier
3089+
id string
3090+
// Finding ARN
3091+
arn string
3092+
// Finding title
3093+
title string
3094+
// Finding description
3095+
description string
3096+
// Normalized severity label: CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL
3097+
severity string
3098+
// Normalized severity score (0-100)
3099+
severityScore float
3100+
// Record state: ACTIVE, ARCHIVED
3101+
recordState string
3102+
// Compliance status: PASSED, FAILED, WARNING, NOT_AVAILABLE
3103+
complianceStatus string
3104+
// Workflow status: NEW, NOTIFIED, RESOLVED, SUPPRESSED
3105+
workflowStatus string
3106+
// Finding type categories
3107+
types []string
3108+
// ARN of the product that generated the finding
3109+
productArn string
3110+
// Name of the product that generated the finding
3111+
productName string
3112+
// Identifier for the rule or check that generated the finding
3113+
generatorId string
3114+
// Type of the affected resource (e.g., AwsEc2Instance)
3115+
resourceType string
3116+
// ID of the affected resource
3117+
resourceId string
3118+
// Region of the affected resource
3119+
resourceRegion string
3120+
// When the finding was created
3121+
createdAt time
3122+
// When the finding was last updated
3123+
updatedAt time
3124+
// When the potential issue was first observed
3125+
firstObservedAt time
3126+
// When the potential issue was last observed
3127+
lastObservedAt time
3128+
// URL to remediation documentation
3129+
remediationUrl string
3130+
// Text description of the remediation
3131+
remediationText string
3132+
// AWS account ID where the finding was generated
3133+
accountId string
3134+
// Region where the finding was generated
3135+
region string
3136+
}
3137+
3138+
// AWS Security Hub automation rule
3139+
private aws.securityhub.automationRule @defaults("ruleName ruleStatus") {
3140+
// Rule ARN
3141+
arn string
3142+
// Rule name
3143+
ruleName string
3144+
// Rule execution order (1-1000, lower executes first)
3145+
ruleOrder int
3146+
// Rule status: ENABLED, DISABLED
3147+
ruleStatus string
3148+
// Rule description
3149+
description string
3150+
// Whether this rule stops further rule evaluation
3151+
isTerminal bool
3152+
// When the rule was created
3153+
createdAt time
3154+
// When the rule was last updated
3155+
updatedAt time
3156+
// Who created the rule
3157+
createdBy string
3158+
}
3159+
3160+
// AWS Security Hub insight (saved filter/aggregation)
3161+
private aws.securityhub.insight @defaults("name") {
3162+
// Insight ARN
3163+
arn string
3164+
// Insight name
3165+
name string
3166+
// Attribute that findings are grouped by
3167+
groupByAttribute string
3168+
// Filter criteria as dict
3169+
filters dict
3170+
// Computed insight results
3171+
results() []aws.securityhub.insightResult
3172+
}
3173+
3174+
// AWS Security Hub insight result entry
3175+
private aws.securityhub.insightResult @defaults("groupByAttributeValue count") {
3176+
// The value of the grouping attribute
3177+
groupByAttributeValue string
3178+
// Number of findings matching this value
3179+
count int
30383180
}
30393181

30403182
// AWS Shield Advanced

0 commit comments

Comments
 (0)