Skip to content
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

[Filebeat] NetFlow: Add Cisco ASA fields #11201

Merged
merged 5 commits into from
Apr 1, 2019

Conversation

adriansr
Copy link
Contributor

@adriansr adriansr commented Mar 11, 2019

Cisco ASA uses some custom fields for NetFlow V9.

From Cisco ASA NetFlow Implementation Guide:

ID Original name Filebeat name
33000 NF_F_INGRESS_ACL_ID ingress_acl_id
33001 NF_F_EGRESS_ACL_ID egress_acl_id
33002 NF_F_FW_EXT_EVENT fw_ext_event
40000 NF_F_USERNAME username

Some devices also use the following fields,
from Information Elements for Stealthwatch v7.0:

ID Original name Filebeat name
40001 ASAXlateSourceAddressIPV4 xlate_source_address_ipv4
40002 ASAXlateDestinationAddressIPV4 xlate_destination_address_ipv4
40003 ASAXlateSourcePort xlate_source_port
40004 ASAXlateDestinationPort xlate_destination_port
40005 ASAFirewallEvent firewall_event

The ACL_ID are stored in binary format, 12-byte length, encoding the following information:

  • First four bytes are the ACL name ID.
  • Next four bytes are the ACL entry ID / Object-Group ID.
  • Final four bytes are the Extended ACL Entry ID.

Following with Logstash tradition, these fields are converted to string featuring the 3 IDs in encoded in hex and separated by a hyphen.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/secops

return aclIDLength
}

func (u ACLIDDecoder) Decode(data []byte) (interface{}, error) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method ACLIDDecoder.Decode should have comment or be unexported

return aclIDLength
}

func (u ACLIDDecoder) MaxLength() uint16 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method ACLIDDecoder.MaxLength should have comment or be unexported


const aclIDLength = 12

func (u ACLIDDecoder) MinLength() uint16 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method ACLIDDecoder.MinLength should have comment or be unexported

@@ -322,6 +323,34 @@ func (u UnsupportedDecoder) Decode(data []byte) (interface{}, error) {

var _ Decoder = (*UnsupportedDecoder)(nil)

type ACLIDDecoder struct{}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported type ACLIDDecoder should have comment or be unexported

@adriansr adriansr marked this pull request as ready for review March 14, 2019 08:49
@adriansr adriansr changed the title [DRAFT] [Filebeat] NetFlow: Add Cisco ASA fields [Filebeat] NetFlow: Add Cisco ASA fields Mar 14, 2019
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can you add a changelog entry.

@adriansr adriansr force-pushed the feature-netflow-cisco-asa branch from ff7d309 to 3aee8e9 Compare March 28, 2019 13:54
Cisco ASA NetFlow implementation requires a new field datatype, ACL ID,
with 12-byte length, that encodes the following information:

- First four bytes are the ACL name ID.
- Next four bytes are the ACL entry ID / Object-Group ID.
- Final four bytes are the Extended ACL Entry ID.

Following with Logstash tradition, these fields are converted to string
featuring the 3 ID's in encoded in hex and separated by a hypen.
Cisco ASA uses some custom fields for NetFlow V9.

From "Cisco ASA NetFlow Implementation Guide":

- 33000 NF_F_INGRESS_ACL_ID, renamed to ingress_acl_id
- 33001 NF_F_EGRESS_ACL_ID, renamed to egress_acl_id
- 33002 NF_F_FW_EXT_EVENT, renamed to fw_ext_event
- 40000 NF_F_USERNAME, renamed to username

Some devices also use the following fields,
from "Information Elements for Stealthwatch v7.0":

- 40001 ASAXlateSourceAddressIPV4, renamed to xlate_source_address_ipv4
- 40002 ASAXlateDestinationAddressIPV4, renamed to xlate_destination_address_ipv4
- 40003 ASAXlateSourcePort, renamed to xlate_source_port
- 40004 ASAXlateDestinationPort, renamed to xlate_destination_port
- 40005 ASAFirewallEvent, renamed to firewall_event
@adriansr adriansr force-pushed the feature-netflow-cisco-asa branch from 3aee8e9 to ebea41b Compare March 29, 2019 09:56
@adriansr adriansr merged commit 5c04770 into elastic:master Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants