Security Hub

detection-finding

Auto-generated mapping for AWS Security Hub Detection Finding

Vendor: AWS
Type: Detection Finding
OCSF Version: 1.1.0
Created by: Rajas Panat

Templates provide pre-built configurations for transforming common log formats into OCSF. They save you time by handling the complex mapping logic for popular security tools and services. Learn more about using templates →

Mapping Configuration

The mapping configuration transforms parsed log fields into OCSF format. This step is required to convert your specific log structure into OCSF's standardized schema. To define these field mappings, the configuration below uses the Fleak Eval Expression Language (FEEL). This language lets you specify how to transform data from AWS Detection Finding logs into OCSF fields - converting timestamps to standard formats, restructuring nested data, and applying conditional logic to determine field values.

dict(
  time=ts_str_to_epoch($.LastObservedAt, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),
  cloud=dict(
    region=$.Region,
    account=dict(
      uid=$.AwsAccountId
    ),
    provider='AWS'
  ),
  status=$.Workflow.Status,
  message=$.Description,
  time_dt=$.LastObservedAt,
  metadata=dict(
    product=dict(
      uid=$.ProductArn,
      name=$.ProductName,
      feature=dict(
        uid=$.GeneratorId,
        name=$.ProductFields['aws/guardduty/service/featureName']
      ),
      vendor_name=$.CompanyName
    ),
    version='1.1.0',
    profiles=array('cloud', 'datetime', 'linux'),
    extensions=array(
      dict(
        uid=1,
        name='linux',
        version='1.1.0'
      )
    ),
    log_version=$.SchemaVersion,
    processed_time_dt=$.ProcessedAt
  ),
  severity=$.Severity.Label,
  type_uid=case(
    $.CreatedAt == $.UpdatedAt => 200401,
    _ => 200402
  ),
  class_uid=2004,
  evidences=array(
    dict(
      api=dict(
        service=dict(
          name=$.ProductFields['aws/guardduty/service/action/awsApiCallAction/serviceName']
        ),
        operation=$.ProductFields['aws/guardduty/service/action/awsApiCallAction/api']
      ),
      src_endpoint=dict(
        ip=$.ProductFields['aws/guardduty/service/action/awsApiCallAction/remoteIpDetails/ipAddressV4'],
        location=dict(
          city=$.ProductFields['aws/guardduty/service/action/awsApiCallAction/remoteIpDetails/city/cityName'],
          country=$.ProductFields['aws/guardduty/service/action/awsApiCallAction/remoteIpDetails/country/countryName'],
          coordinates=array(
            $.ProductFields['aws/guardduty/service/action/awsApiCallAction/remoteIpDetails/geoLocation/lon'],
            $.ProductFields['aws/guardduty/service/action/awsApiCallAction/remoteIpDetails/geoLocation/lat']
          )
        )
      )
    )
  ),
  resources=arr_foreach($.Resources, resource, dict(
      uid=resource.Id,
      data=resource.Details,
      type=resource.Type,
      owner=dict(
        account=dict(
          uid=$.ProductFields.ResourceOwnerAccount
        )
      ),
      labels=resource.Tags,
      region=resource.Region,
      criticality=$.Criticality,
      cloud_partition=resource.Partition
    )
  ),
  type_name=case(
    $.CreatedAt == $.UpdatedAt => 'Detection Finding: Create',
    _ => 'Detection Finding: Update'
  ),
  class_name='Detection Finding',
  activity_id=case(
    $.CreatedAt == $.UpdatedAt => 1,
    _ => 2
  ),
  severity_id=case(
    upper($.Severity.Label) == 'LOW' => 1,
    upper($.Severity.Label) == 'MEDIUM' => 2,
    upper($.Severity.Label) == 'HIGH' => 3,
    upper($.Severity.Label) == 'CRITICAL' => 4,
    _ => 0
  ),
  category_uid=2,
  finding_info=dict(
    uid=$.Id,
    desc=$.Description,
    title=$.Title,
    types=$.Types,
    src_url=$.SourceUrl,
    created_time_dt=$.CreatedAt,
    modified_time_dt=$.UpdatedAt,
    last_seen_time_dt=$.LastObservedAt,
    first_seen_time_dt=$.FirstObservedAt
  ),
  activity_name=case(
    $.CreatedAt == $.UpdatedAt => 'Create',
    _ => 'Update'
  ),
  category_name='Findings',
  confidence_score=$.Confidence
)

Template ID: 6f135060-64ba-4519-9d04-62a2064c941a

Text Mapping: No

Ready to use this template?