-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add a step to exhaustive tests for observabilitySRE accetpance testing #17623
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
Changes from all commits
bad9efe
fbbcfab
3873b44
0b776dc
1630ca2
a0b1f8e
38f2b8b
018b6a1
d39a080
de9af76
721e13b
a1504c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.crt | ||
*.csr | ||
*.key |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
echo "Generating CA certificate" | ||
openssl req -x509 -newkey rsa:3072 -days 365 -nodes -keyout ca.key -out ca.crt -subj "/CN=Elastic-CA" -sha256 | ||
|
||
echo "Generating Elasticsearch certificate" | ||
openssl req -newkey rsa:3072 -nodes -keyout elasticsearch.key -out elasticsearch.csr -subj "/CN=elasticsearch" -sha256 | ||
openssl x509 -req -in elasticsearch.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out elasticsearch.crt -days 365 -sha256 | ||
|
||
echo "Generating Logstash certificate" | ||
openssl req -newkey rsa:3072 -nodes -keyout logstash.key -out logstash.csr -subj "/CN=logstash" -sha256 | ||
openssl x509 -req -in logstash.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out logstash.crt -days 365 -sha256 | ||
|
||
echo "Generating Filebeat certificate" | ||
openssl req -newkey rsa:3072 -nodes -keyout filebeat.key -out filebeat.csr -subj "/CN=filebeat" -sha256 | ||
openssl x509 -req -in filebeat.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out filebeat.crt -days 365 -sha256 | ||
|
||
chmod 644 *.crt *.key |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
services: | ||
logstash: | ||
image: docker.elastic.co/logstash/logstash-observability-sre:${OBSERVABILITY_SRE_IMAGE_VERSION:-8.19.0-SNAPSHOT} | ||
container_name: fips_test_logstash | ||
ports: | ||
- "5044:5044" | ||
volumes: | ||
- ./logstash/config/${LOGSTASH_CONFIG:-logstash-fips.yml}:/usr/share/logstash/config/logstash.yml | ||
- ./logstash/pipeline/${LOGSTASH_PIPELINE:-logstash-to-elasticsearch.conf}:/usr/share/logstash/pipeline/logstash.conf | ||
- ./certs:/usr/share/logstash/config/certs | ||
networks: | ||
- elastic | ||
depends_on: | ||
- elasticsearch | ||
|
||
elasticsearch: | ||
image: docker.elastic.co/cloud-release/elasticsearch-cloud-ess-fips:${ELASTICSEARCH_IMAGE_VERSION:-8.19.0-SNAPSHOT} | ||
container_name: fips_test_elasticsearch | ||
ports: | ||
- "9200:9200" | ||
volumes: | ||
- ./elasticsearch/config/${ELASTICSEARCH_CONFIG:-elasticsearch-fips.yml}:/usr/share/elasticsearch/config/elasticsearch.yml | ||
donoghuc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- ./certs:/usr/share/elasticsearch/config/certs | ||
environment: | ||
- discovery.type=single-node | ||
- ES_JAVA_OPTS=-Xms1g -Xmx1g | ||
- ELASTIC_PASSWORD=changeme | ||
networks: | ||
- elastic | ||
|
||
filebeat: | ||
# The filebeat shipped with the elasticsearch-fips container is built for FIPS support | ||
# There is no stand alone distribution. This uses the shipped version for testing. | ||
image: docker.elastic.co/cloud-release/elasticsearch-cloud-ess-fips:${FILEBEAT_IMAGE_VERSION:-8.19.0-SNAPSHOT} | ||
container_name: fips_test_filebeat | ||
working_dir: /usr/share/filebeat | ||
entrypoint: ["/bin/bash", "-c"] | ||
# Start Filebeat with /tmp for data (always writable) | ||
command: | ||
- | | ||
exec /opt/filebeat/filebeat -e \ | ||
--strict.perms=false \ | ||
-c /usr/share/filebeat/filebeat.yml \ | ||
--path.data /tmp/filebeat_data | ||
volumes: | ||
- ./filebeat/config/${FILEBEAT_CONFIG:-filebeat-fips.yml}:/usr/share/filebeat/filebeat.yml:ro | ||
- ./filebeat/data:/data/logs:ro | ||
- ./certs:/usr/share/filebeat/certs:ro | ||
networks: | ||
- elastic | ||
depends_on: | ||
- logstash | ||
|
||
networks: | ||
elastic: | ||
driver: bridge |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Elasticsearch settings | ||
discovery.type: single-node | ||
donoghuc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
http.port: 9200 | ||
network.host: 0.0.0.0 | ||
# Security settings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will add this as investigation in https://github.com/elastic/ingest-dev/issues/5320 (added a point in google doc to track this down). |
||
xpack.security.enabled: true | ||
xpack.security.transport.ssl.enabled: true | ||
xpack.security.transport.ssl.verification_mode: certificate | ||
xpack.security.transport.ssl.key: /usr/share/elasticsearch/config/certs/elasticsearch.key | ||
xpack.security.transport.ssl.certificate: /usr/share/elasticsearch/config/certs/elasticsearch.crt | ||
xpack.security.transport.ssl.certificate_authorities: ["/usr/share/elasticsearch/config/certs/ca.crt"] | ||
xpack.security.http.ssl.enabled: true | ||
xpack.security.http.ssl.key: /usr/share/elasticsearch/config/certs/elasticsearch.key | ||
xpack.security.http.ssl.certificate: /usr/share/elasticsearch/config/certs/elasticsearch.crt | ||
xpack.security.http.ssl.certificate_authorities: ["/usr/share/elasticsearch/config/certs/ca.crt"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
filebeat.inputs: | ||
- type: log | ||
enabled: true | ||
paths: | ||
- /data/logs/sample_logs.txt | ||
|
||
output.logstash: | ||
hosts: ["logstash:5044"] | ||
ssl.enabled: true | ||
ssl.certificate: "/usr/share/filebeat/certs/filebeat.crt" | ||
ssl.key: "/usr/share/filebeat/certs/filebeat.key" | ||
ssl.certificate_authorities: ["/usr/share/filebeat/certs/ca.crt"] | ||
ssl.verification_mode: "certificate" | ||
|
||
# Add debugging | ||
logging.level: debug | ||
logging.to_stderr: true | ||
|
||
# Keep registry in the anonymous volume to avoid host pollution | ||
path.data: /tmp/filebeat_data |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TEST-LOG: FIPS filebeat test message |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
api.http.host: "0.0.0.0" | ||
xpack.monitoring.enabled: false | ||
|
||
pipeline.ordered: false | ||
pipeline.workers: 2 | ||
pipeline.buffer.type: heap |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
input { | ||
beats { | ||
port => 5044 | ||
ssl_enabled => true | ||
ssl_certificate => "/usr/share/logstash/config/certs/logstash.crt" | ||
ssl_key => "/usr/share/logstash/config/certs/logstash.key" | ||
ssl_certificate_authorities => ["/usr/share/logstash/config/certs/ca.crt"] | ||
} | ||
} | ||
|
||
filter { | ||
mutate { | ||
add_tag => ["filebeat"] | ||
} | ||
} | ||
|
||
output { | ||
elasticsearch { | ||
hosts => ["https://elasticsearch:9200"] | ||
user => "elastic" | ||
password => "changeme" | ||
ssl_enabled => true | ||
ssl_certificate_authorities => ["/usr/share/logstash/config/certs/ca.crt"] | ||
index => "filebeat-test-%{+YYYY.MM.dd}" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
input { | ||
beats { | ||
port => 5044 | ||
ssl_enabled => true | ||
ssl_certificate => "/usr/share/logstash/config/certs/logstash.crt" | ||
ssl_key => "/usr/share/logstash/config/certs/logstash.key" | ||
ssl_certificate_authorities => ["/usr/share/logstash/config/certs/ca.crt"] | ||
ssl_supported_protocols => ["TLSv1.1"] | ||
} | ||
} | ||
|
||
filter { | ||
mutate { | ||
add_tag => ["filebeat"] | ||
} | ||
} | ||
|
||
output { | ||
elasticsearch { | ||
hosts => ["https://elasticsearch:9200"] | ||
user => "elastic" | ||
password => "changeme" | ||
ssl_enabled => true | ||
ssl_certificate_authorities => ["/usr/share/logstash/config/certs/ca.crt"] | ||
index => "filebeat-weak-ssl-test-%{+YYYY.MM.dd}" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
input { | ||
generator { | ||
lines => ["FIPS weak protocol test message"] | ||
} | ||
} | ||
|
||
filter { | ||
mutate { | ||
add_field => { | ||
"fips_test" => "true" | ||
} | ||
} | ||
} | ||
|
||
output { | ||
elasticsearch { | ||
hosts => ["https://elasticsearch:9200"] | ||
user => "elastic" | ||
password => "changeme" | ||
ssl_enabled => true | ||
ssl_verification_mode => "none" | ||
ssl_supported_protocols => ["TLSv1.1"] | ||
ssl_certificate_authorities => ["/usr/share/logstash/config/certs/ca.crt"] | ||
index => "logstash-weak-ssl-test-%{+YYYY.MM.dd}" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
input { | ||
generator { | ||
lines => ["FIPS compliance test message"] | ||
} | ||
} | ||
|
||
filter { | ||
mutate { | ||
add_field => { | ||
"fips_test" => "true" | ||
} | ||
} | ||
} | ||
|
||
output { | ||
elasticsearch { | ||
hosts => ["https://elasticsearch:9200"] | ||
user => "elastic" | ||
password => "changeme" | ||
ssl_enabled => true | ||
ssl_verification_mode => "full" | ||
ssl_certificate_authorities => ["/usr/share/logstash/config/certs/ca.crt"] | ||
index => "logstash-fips-test-%{+YYYY.MM.dd}" | ||
ssl_supported_protocols => ["TLSv1.2"] | ||
} | ||
|
||
stdout { | ||
codec => rubydebug | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Credit @robbavey for eagle eye 🦅