Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit c70b182

Browse files
author
Chris Wiechmann
committed
#26 Indexing Domain-Audit logs
1 parent cbcd0a4 commit c70b182

11 files changed

+104
-7
lines changed

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ services:
2121
volumes:
2222
- type: volume
2323
source: filebeatdata
24-
target: /usr/share/filebeat/data # Required to make sure that Filebeat remembers the last position, even if the container has been removed
25-
- /etc/localtime:/etc/localtime:ro # Required to sync timezone of API-Gateway into the Docker-Container
24+
target: /usr/share/filebeat/data # Required to make sure that Filebeat remembers the last position, even if the container is recreated
25+
- /etc/localtime:/etc/localtime:ro # Required to sync timezone of API-Gateway into the Filebeat Docker-Container
2626
- ${PWD}/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml
2727
- ${APIGATEWAY_OPENTRAFFIC_FOLDER}:/var/log/opentraffic
2828
- ${APIGATEWAY_TRACES_FOLDER}:/var/log/trace
2929
- ${APIGATEWAY_EVENTS_FOLDER}:/var/log/events
30+
- ${APIGATEWAY_AUDITLOGS_FOLDER}:/var/log/audit
3031
- /var/lib/docker/containers:/var/lib/docker/containers:ro
3132
- /var/run/docker.sock:/var/run/docker.sock
3233
- ${PWD}/certificates:/usr/share/filebeat/config/certificates
@@ -121,4 +122,3 @@ volumes:
121122

122123
networks:
123124
elastic:
124-
ingress:

elasticsearch/config/elasticsearch.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ http.cors.allow-credentials: true
99
http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
1010
http.cors.allow-headers: X-Requested-With, X-Auth-Token, Content-Type, Content-Length, Authorization. Access-Control-Allow-Headers, Accept
1111

12-
#node.name: elasticsearch1
13-
#discovery.type: single-node
1412
bootstrap.memory_lock: true
1513

1614
# Enable security in general

env-sample

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ COMPOSE_PROJECT_NAME=axway-apim-elastic
3535
APIGATEWAY_OPENTRAFFIC_FOLDER=/home/localuser/Axway-x.y.z/apigateway/logs/opentraffic
3636
APIGATEWAY_TRACES_FOLDER=/home/localuser/Axway-x.y.z/apigateway/groups/group-2/instance-1/trace
3737
APIGATEWAY_EVENTS_FOLDER=/home/localuser/Axway-x.y.z/apigateway/events
38+
APIGATEWAY_AUDITLOGS_FOLDER=/home/localuser/Axway-x.y.z/apigateway/logs
3839

3940
# ----------------------------------------------------------------------------------------------
4041
# Is used by almost all services to communicate with Elasticsearch. Either to send events,
@@ -44,7 +45,7 @@ APIGATEWAY_EVENTS_FOLDER=/home/localuser/Axway-x.y.z/apigateway/events
4445
# When running the ElasticSearch on a difference host (e.g. existing Elastic-Search cluster)
4546
# this environment variable is used to locate the ElasticSearch cluster.
4647
# You may provide a single host or an array of hosts.
47-
# Example: ELASTICSEARCH_HOSTS=["https://elasticsearch1:9200","https://elasticsearch1:9201"]
48+
# Example: ELASTICSEARCH_HOSTS=https://elasticsearch1:9200,https://elasticsearch2:9201
4849
# Used-By: Filebeat, API-Builder, Logstash
4950
ELASTICSEARCH_HOSTS=https://elasticsearch1:9200
5051

@@ -121,7 +122,7 @@ ELASTICSEARCH_HOST3=elasticsearch3
121122
# Ports are different just to be able to start multiple Elasticsearch containers on one host.
122123
ELASTICSEARCH_HOST1_TRANSPORT=9300
123124
ELASTICSEARCH_HOST2_TRANSPORT=9301
124-
ELASTICSEARCH_HOST3_TRANSPORT=9301
125+
ELASTICSEARCH_HOST3_TRANSPORT=9302
125126

126127
################################################################################################
127128
# Optional / Advanced parameters

logstash/config/pipelines.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@
2323
- pipeline.id: Events
2424
path.config: "pipelines/EventsPipeline.conf"
2525
pipeline.workers: 1
26+
pipeline.ordered: false
27+
28+
- pipeline.id: DomainAudit
29+
path.config: "pipelines/DomainAuditPipeline.conf"
30+
pipeline.workers: 1
2631
pipeline.ordered: false
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"version": "1.0.0",
3+
"index_patterns": [
4+
"apigw-domainaudit"
5+
],
6+
"settings": {
7+
"number_of_shards": 1,
8+
"number_of_replicas": 1,
9+
"index": {
10+
"codec": "best_compression"
11+
}
12+
},
13+
"mappings": {
14+
"dynamic": false,
15+
"properties": {
16+
"@timestamp": {
17+
"type" : "date"
18+
},
19+
"message": {
20+
"type": "text"
21+
},
22+
"additionalInfo": {
23+
"type": "text"
24+
},
25+
"eventId": {
26+
"type": "integer"
27+
},
28+
"user": {
29+
"type": "keyword"
30+
},
31+
"outcome": {
32+
"type": "keyword"
33+
},
34+
"metaData.serviceID": {
35+
"type": "keyword"
36+
},
37+
"metaData.clientAddr": {
38+
"type": "keyword"
39+
},
40+
"metaData.Referer": {
41+
"type": "keyword"
42+
},
43+
"metaData.Host": {
44+
"type": "keyword"
45+
},
46+
"metaData.requestURI": {
47+
"type": "text"
48+
}
49+
}
50+
}
51+
}

logstash/index_templates/monitoring_event_index_template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": 1,
23
"index_patterns": [
34
"apigw-monitoring-*"
45
],

logstash/index_templates/trace_messages_index_template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": 1,
23
"index_patterns": [
34
"apigw-trace-*",
45
"apigw-traffic-trace-*"

logstash/index_templates/traffic_details_index_template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": 1,
23
"index_patterns": [
34
"apigw-traffic-details-*"
45
],

logstash/index_templates/traffic_summary_index_template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": 1,
23
"index_patterns": [
34
"apigw-traffic-summary-*"
45
],

logstash/pipelines/BeatsInputPipeline.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ output {
2525
send_to => "Events"
2626
id => "Events"
2727
}
28+
} else if [logtype] == "domainaudit" {
29+
pipeline {
30+
send_to => "DomainAudit"
31+
id => "DomainAudit"
32+
}
2833
} else {
2934
elasticsearch {
3035
hosts => "${ELASTICSEARCH_HOSTS}"

0 commit comments

Comments
 (0)