mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #10704 from Security-Onion-Solutions/patch/x509_v2
Patch/x509 v2
This commit is contained in:
@@ -20,7 +20,6 @@ pki_private_key:
|
|||||||
- name: /etc/pki/ca.key
|
- name: /etc/pki/ca.key
|
||||||
- keysize: 4096
|
- keysize: 4096
|
||||||
- passphrase:
|
- passphrase:
|
||||||
- cipher: aes_256_cbc
|
|
||||||
- backup: True
|
- backup: True
|
||||||
{% if salt['file.file_exists']('/etc/pki/ca.key') -%}
|
{% if salt['file.file_exists']('/etc/pki/ca.key') -%}
|
||||||
- prereq:
|
- prereq:
|
||||||
|
|||||||
@@ -76,12 +76,6 @@ influxdb_crt:
|
|||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
{% if grains.role not in ['so-heavynode'] %}
|
|
||||||
- unless:
|
|
||||||
# https://github.com/saltstack/salt/issues/52167
|
|
||||||
# Will trigger 5 days (432000 sec) from cert expiration
|
|
||||||
- 'enddate=$(date -d "$(openssl x509 -in /etc/pki/influxdb.crt -enddate -noout | cut -d= -f2)" +%s) ; now=$(date +%s) ; expire_date=$(( now + 432000)); [ $enddate -gt $expire_date ]'
|
|
||||||
{% endif %}
|
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
@@ -121,12 +115,6 @@ redis_crt:
|
|||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
{% if grains.role not in ['so-heavynode'] %}
|
|
||||||
- unless:
|
|
||||||
# https://github.com/saltstack/salt/issues/52167
|
|
||||||
# Will trigger 5 days (432000 sec) from cert expiration
|
|
||||||
- 'enddate=$(date -d "$(openssl x509 -in /etc/pki/redis.crt -enddate -noout | cut -d= -f2)" +%s) ; now=$(date +%s) ; expire_date=$(( now + 432000)); [ $enddate -gt $expire_date ]'
|
|
||||||
{% endif %}
|
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
@@ -169,12 +157,6 @@ etc_elasticfleet_crt:
|
|||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
{% if grains.role not in ['so-heavynode'] %}
|
|
||||||
- unless:
|
|
||||||
# https://github.com/saltstack/salt/issues/52167
|
|
||||||
# Will trigger 5 days (432000 sec) from cert expiration
|
|
||||||
- 'enddate=$(date -d "$(openssl x509 -in /etc/pki/elasticfleet.crt -enddate -noout | cut -d= -f2)" +%s) ; now=$(date +%s) ; expire_date=$(( now + 432000)); [ $enddate -gt $expire_date ]'
|
|
||||||
{% endif %}
|
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
@@ -227,7 +209,7 @@ efcrtlink:
|
|||||||
etc_elasticfleetlogstash_key:
|
etc_elasticfleetlogstash_key:
|
||||||
x509.private_key_managed:
|
x509.private_key_managed:
|
||||||
- name: /etc/pki/elasticfleet-logstash.key
|
- name: /etc/pki/elasticfleet-logstash.key
|
||||||
- bits: 4096
|
- keysize: 4096
|
||||||
- backup: True
|
- backup: True
|
||||||
- new: True
|
- new: True
|
||||||
{% if salt['file.file_exists']('/etc/pki/elasticfleet-logstash.key') -%}
|
{% if salt['file.file_exists']('/etc/pki/elasticfleet-logstash.key') -%}
|
||||||
@@ -250,12 +232,6 @@ etc_elasticfleetlogstash_crt:
|
|||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
{% if grains.role not in ['so-heavynode'] %}
|
|
||||||
- unless:
|
|
||||||
# https://github.com/saltstack/salt/issues/52167
|
|
||||||
# Will trigger 5 days (432000 sec) from cert expiration
|
|
||||||
- 'enddate=$(date -d "$(openssl x509 -in /etc/pki/elasticfleet-logstash.crt -enddate -noout | cut -d= -f2)" +%s) ; now=$(date +%s) ; expire_date=$(( now + 432000)); [ $enddate -gt $expire_date ]'
|
|
||||||
{% endif %}
|
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
@@ -359,12 +335,6 @@ etc_filebeat_crt:
|
|||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
{% if grains.role not in ['so-heavynode'] %}
|
|
||||||
- unless:
|
|
||||||
# https://github.com/saltstack/salt/issues/52167
|
|
||||||
# Will trigger 5 days (432000 sec) from cert expiration
|
|
||||||
- 'enddate=$(date -d "$(openssl x509 -in /etc/pki/filebeat.crt -enddate -noout | cut -d= -f2)" +%s) ; now=$(date +%s) ; expire_date=$(( now + 432000)); [ $enddate -gt $expire_date ]'
|
|
||||||
{% endif %}
|
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
@@ -436,10 +406,6 @@ registry_crt:
|
|||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
- unless:
|
|
||||||
# https://github.com/saltstack/salt/issues/52167
|
|
||||||
# Will trigger 5 days (432000 sec) from cert expiration
|
|
||||||
- 'enddate=$(date -d "$(openssl x509 -in /etc/pki/registry.crt -enddate -noout | cut -d= -f2)" +%s) ; now=$(date +%s) ; expire_date=$(( now + 432000)); [ $enddate -gt $expire_date ]'
|
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
@@ -478,12 +444,6 @@ regkeyperms:
|
|||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
{% if grains.role not in ['so-heavynode'] %}
|
|
||||||
- unless:
|
|
||||||
# https://github.com/saltstack/salt/issues/52167
|
|
||||||
# Will trigger 5 days (432000 sec) from cert expiration
|
|
||||||
- 'enddate=$(date -d "$(openssl x509 -in /etc/pki/elasticsearch.crt -enddate -noout | cut -d= -f2)" +%s) ; now=$(date +%s) ; expire_date=$(( now + 432000)); [ $enddate -gt $expire_date ]'
|
|
||||||
{% endif %}
|
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
@@ -545,12 +505,6 @@ conf_filebeat_crt:
|
|||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
{% if grains.role not in ['so-heavynode'] %}
|
|
||||||
- unless:
|
|
||||||
# https://github.com/saltstack/salt/issues/52167
|
|
||||||
# Will trigger 5 days (432000 sec) from cert expiration
|
|
||||||
- 'enddate=$(date -d "$(openssl x509 -in /opt/so/conf/filebeat/etc/pki/filebeat.crt -enddate -noout | cut -d= -f2)" +%s) ; now=$(date +%s) ; expire_date=$(( now + 432000)); [ $enddate -gt $expire_date ]'
|
|
||||||
{% endif %}
|
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
@@ -605,10 +559,6 @@ chownfilebeatp8:
|
|||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
- unless:
|
|
||||||
# https://github.com/saltstack/salt/issues/52167
|
|
||||||
# Will trigger 5 days (432000 sec) from cert expiration
|
|
||||||
- 'enddate=$(date -d "$(openssl x509 -in /etc/pki/elasticsearch.crt -enddate -noout | cut -d= -f2)" +%s) ; now=$(date +%s) ; expire_date=$(( now + 432000)); [ $enddate -gt $expire_date ]'
|
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
|
|||||||
1814
setup/files/patch/states/x509_v2.py
Normal file
1814
setup/files/patch/states/x509_v2.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2046,6 +2046,12 @@ saltify() {
|
|||||||
logCmd "salt-pip install docker --no-index --only-binary=:all: --find-links files/salt_module_deps/docker/"
|
logCmd "salt-pip install docker --no-index --only-binary=:all: --find-links files/salt_module_deps/docker/"
|
||||||
logCmd "salt-pip install pymysql --no-index --only-binary=:all: --find-links files/salt_module_deps/pymysql/"
|
logCmd "salt-pip install pymysql --no-index --only-binary=:all: --find-links files/salt_module_deps/pymysql/"
|
||||||
|
|
||||||
|
# this can be removed when https://github.com/saltstack/salt/issues/64195 is resolved
|
||||||
|
if [ $SALTVERSION == "3006.1" ]; then
|
||||||
|
info "Salt version 3006.1 found. Patching /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/x509_v2.py"
|
||||||
|
\cp -v ./files/patch/states/x509_v2.py /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/x509_v2.py
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user