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

2.4.50 #12353

Merged
merged 158 commits into from
Feb 20, 2024
Merged

2.4.50 #12353

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
a73d783
Add initial stig state
reyesj2 Jan 16, 2024
4bffd8e
Merge remote-tracking branch 'remotes/origin/2.4/dev' into reyesj2-pa…
reyesj2 Jan 16, 2024
6cf0b36
Modify yum.conf.jinja to include localpkg_gpgcheck rather than modify…
reyesj2 Jan 16, 2024
8a92b02
Add interface name
weslambert Jan 16, 2024
ea64ce9
Add Suricata IKE pipeline
weslambert Jan 16, 2024
f6590ac
Remove Suricata IKEv2 pipeline
weslambert Jan 16, 2024
e70ce50
Change description
weslambert Jan 17, 2024
958c827
Update VERSION
TOoSmOotH Jan 17, 2024
880f2a3
Merge pull request #12197 from Security-Onion-Solutions/TOoSmOotH-pat…
TOoSmOotH Jan 17, 2024
4e69246
Add additional status checks to so-common-status-check for telegraf
reyesj2 Jan 17, 2024
739feb2
Add telegraf script to import featuresdetected
reyesj2 Jan 17, 2024
df92189
Remove post scan from remediate log.
reyesj2 Jan 17, 2024
3173f9a
Merge remote-tracking branch 'remotes/origin/2.4/dev' into reyesj2-pa…
reyesj2 Jan 17, 2024
33d7409
Merge pull request #12201 from Security-Onion-Solutions/fix/suricata_ike
weslambert Jan 17, 2024
6a8bf0b
Merge pull request #12202 from Security-Onion-Solutions/reyesj2-patch-sl
reyesj2 Jan 18, 2024
67445de
Remove need for stig script
reyesj2 Jan 18, 2024
65d46ea
Merge remote-tracking branch 'remotes/origin/2.4/dev' into reyesj2-pa…
reyesj2 Jan 18, 2024
4a89861
Merge pull request #12206 from Security-Onion-Solutions/reyesj2-patch-sl
reyesj2 Jan 18, 2024
caf4036
Update features check
reyesj2 Jan 18, 2024
0760207
Update telegraf script
reyesj2 Jan 18, 2024
97e2721
Merge pull request #12208 from Security-Onion-Solutions/reyesj2-patch-sl
reyesj2 Jan 18, 2024
ca4f2f1
Add creation of additional pillars to soup for stig state
reyesj2 Jan 19, 2024
0786806
Merge pull request #12213 from Security-Onion-Solutions/reyesj2-patch-sl
reyesj2 Jan 19, 2024
2b6927d
Add stig pillar dir during soup
reyesj2 Jan 19, 2024
40d0411
Merge pull request #12214 from Security-Onion-Solutions/reyesj2-patch-sl
reyesj2 Jan 19, 2024
08486e2
Update suricata.common
TOoSmOotH Jan 19, 2024
efe8cfd
Update suricata.common
TOoSmOotH Jan 19, 2024
6db3288
Merge pull request #12216 from Security-Onion-Solutions/TOoSmOotH-pat…
TOoSmOotH Jan 19, 2024
8f8c250
Disable stigs setting/verifing umask is set to 077. Known issue with …
reyesj2 Jan 19, 2024
c2b4498
Merge pull request #12220 from Security-Onion-Solutions/reyesj2-patch-sl
reyesj2 Jan 19, 2024
d0457cb
Add additional integrations to defaults
weslambert Jan 19, 2024
05aa8b0
Add additional integration to templates
weslambert Jan 19, 2024
7118cc8
Add additional integration SOC configuration
weslambert Jan 19, 2024
de6151f
Merge pull request #12221 from Security-Onion-Solutions/feature/addit…
weslambert Jan 19, 2024
80a3942
Rename RITA pipelines
weslambert Jan 22, 2024
b08db3e
Add RITA policy
weslambert Jan 22, 2024
5542db0
Leave package version null
weslambert Jan 22, 2024
350b0df
Handle non-zero
reyesj2 Jan 23, 2024
d25a2d4
Merge pull request #12230 from Security-Onion-Solutions/reyesj2-patch-sl
reyesj2 Jan 23, 2024
3bcb0bc
Update defaults
weslambert Jan 23, 2024
34bb37e
Merge pull request #12227 from Security-Onion-Solutions/feature/rita_…
weslambert Jan 23, 2024
72319e3
Avoid leak test triggering
weslambert Jan 23, 2024
63ba973
Exclude Strelka defaults
weslambert Jan 23, 2024
0ccdfcb
Exclude only offset_meta_key
weslambert Jan 23, 2024
0cb36bb
Exclude StrelkaHexDump and PLACEHOLDER values
weslambert Jan 23, 2024
b1052dd
Merge pull request #12241 from Security-Onion-Solutions/fix/leak_test
weslambert Jan 23, 2024
1698d95
Use PLACEHOLDER for key values
weslambert Jan 23, 2024
8348506
Merge pull request #12240 from Security-Onion-Solutions/upgrade/strel…
weslambert Jan 23, 2024
4d7af21
Fix quote
weslambert Jan 23, 2024
cbdaf2e
Merge pull request #12242 from Security-Onion-Solutions/upgrade/strel…
weslambert Jan 23, 2024
d23d367
Make scan.pe.flags a string
weslambert Jan 24, 2024
8426aad
Text mapping for scan.pe.flags
weslambert Jan 24, 2024
9f17bd2
lks/fps
jertel Jan 24, 2024
e53030f
Merge pull request #12248 from Security-Onion-Solutions/jertel/pfeat
jertel Jan 24, 2024
d2d70d1
Merge pull request #12250 from Security-Onion-Solutions/fix/scan_pe_f…
weslambert Jan 24, 2024
5f1c76f
endpoint.diagnostic.collection
weslambert Jan 25, 2024
cd54d4b
Fix indent
weslambert Jan 25, 2024
12ab633
Add diagnostic
weslambert Jan 25, 2024
cd6e387
remove --local from soup common.soup_scripts update.
reyesj2 Jan 25, 2024
2e026b6
Update soup to retry modified salt command on failure to update soup …
reyesj2 Jan 26, 2024
91c7b81
soup logic
reyesj2 Jan 26, 2024
c4301d7
Soup script update locations
reyesj2 Jan 26, 2024
dc5ea89
Merge pull request #12260 from Security-Onion-Solutions/fix/endpoint_…
weslambert Jan 26, 2024
cfc33b1
Sync Elastic Agent Artifacts
defensivedepth Jan 28, 2024
1847e5c
Enable nginx on Fleet Node
defensivedepth Jan 28, 2024
afa98fa
update artifacts URL automatically
defensivedepth Jan 28, 2024
7c08b34
Add comment for soup update w/ STIGs enabled
reyesj2 Jan 29, 2024
cb5e111
Merge pull request #12267 from Security-Onion-Solutions/reyesj2-patch-6
reyesj2 Jan 29, 2024
0d08bb0
Finalize script
defensivedepth Jan 29, 2024
b5ffa18
Remove remediate from initial oscap scan
reyesj2 Jan 30, 2024
4dd0b4a
Merge pull request #12283 from Security-Onion-Solutions/reyesj2-patch-6
reyesj2 Jan 30, 2024
1192dbd
also remove intca symlink
petiepooo Jan 31, 2024
cd4bd64
Custom pipelines
weslambert Jan 31, 2024
bc75be9
Custom pipelines in UI
weslambert Jan 31, 2024
1853dc3
Custom pipeline configuration
weslambert Jan 31, 2024
4672a5b
Custom pipeline configuration in UI
weslambert Jan 31, 2024
0fe96bf
switch to symlink
defensivedepth Jan 31, 2024
341ff5b
Update so-functions
TOoSmOotH Jan 31, 2024
a094d10
Merge pull request #12293 from Security-Onion-Solutions/TOoSmOotH-pat…
TOoSmOotH Jan 31, 2024
2f03248
use different nginx defaults for so-fleet node hosting artifacts
m0duspwnens Jan 31, 2024
ae32ac4
add fleet node nginx to docker annotations
m0duspwnens Jan 31, 2024
bc502cc
Custom Elasticserach pipeline annotations
weslambert Jan 31, 2024
136097f
Custom Logstash pipeline annotations
weslambert Jan 31, 2024
182667b
Change numbers for Elasticsearch
weslambert Feb 1, 2024
1818e13
Change numbers for Logstash
weslambert Feb 1, 2024
91c1e59
Merge pull request #12297 from Security-Onion-Solutions/feature/pipel…
weslambert Feb 1, 2024
e090518
Refactor script
defensivedepth Feb 1, 2024
3d478b9
Merge pull request #12294 from Security-Onion-Solutions/jppffa
defensivedepth Feb 1, 2024
0d5db58
upgrade salt3006.6
m0duspwnens Feb 1, 2024
61ee41e
Merge remote-tracking branch 'origin/2.4/dev' into salt3006.6
m0duspwnens Feb 1, 2024
7a29b3a
call salt before stopping salt services
petiepooo Feb 2, 2024
cf83d1c
feat: use mountpoint for Elastic log limit
petiepooo Feb 2, 2024
2643ae0
add append to list
m0duspwnens Feb 5, 2024
9d62ade
update so-yaml tests
m0duspwnens Feb 6, 2024
7106095
FEATURE: Improve Correlate and Hunt actions on SOC Actions menu #12315
dougburks Feb 6, 2024
d800d59
Merge pull request #12316 from Security-Onion-Solutions/feature/impro…
dougburks Feb 6, 2024
b3f6153
update so-yaml tests
m0duspwnens Feb 6, 2024
24fd3ef
uopdate error message
m0duspwnens Feb 6, 2024
f97d0f2
add /opt/so/rules/ to files_roots
m0duspwnens Feb 7, 2024
e42e07b
update salt mine after salt-master restarts
m0duspwnens Feb 7, 2024
478fb62
Merge remote-tracking branch 'origin/2.4/dev' into salt3006.6
m0duspwnens Feb 7, 2024
6534f39
update backup filename
m0duspwnens Feb 7, 2024
d3d2305
FEATURE: Add new dashboards for community_id and firewall auth #12323
dougburks Feb 7, 2024
8c5dafa
Merge pull request #12324 from Security-Onion-Solutions/feature/dashb…
dougburks Feb 7, 2024
f02f61c
Merge pull request #12325 from Security-Onion-Solutions/salt3006.6
m0duspwnens Feb 7, 2024
503a09f
Merge remote-tracking branch 'origin/2.4/dev' into feature/fleet-arti…
defensivedepth Feb 8, 2024
8d0e878
Use salt file roots
defensivedepth Feb 8, 2024
683abf0
Rework naming
defensivedepth Feb 8, 2024
3c9d6da
add putty to sod packages.sls
reyesj2 Feb 9, 2024
654602b
Fixup shell
defensivedepth Feb 9, 2024
0c423c9
Merge pull request #12333 from Security-Onion-Solutions/fix/shell
defensivedepth Feb 9, 2024
5903ae5
move suricata rules to /opt/so/rules/nids/suri
m0duspwnens Feb 9, 2024
2143881
specify *.rules
m0duspwnens Feb 9, 2024
213ac82
create dir and chown
m0duspwnens Feb 9, 2024
304ae49
fix source
m0duspwnens Feb 9, 2024
94b6e78
Merge pull request #12337 from Security-Onion-Solutions/salt3006.6v2
m0duspwnens Feb 9, 2024
feabb7c
Merge remote-tracking branch 'origin/2.4/dev' into feature/fleet-arti…
defensivedepth Feb 10, 2024
66ac36a
Update soup
defensivedepth Feb 10, 2024
2b2aa30
Merge pull request #12332 from Security-Onion-Solutions/reyesj2/sod-p…
reyesj2 Feb 11, 2024
eafb5cf
Change to file_root
defensivedepth Feb 11, 2024
cc0f25a
Wait for ES to be ready
defensivedepth Feb 11, 2024
b1de6ab
Merge pull request #12343 from Security-Onion-Solutions/fix/anothercheck
defensivedepth Feb 12, 2024
c04f5a3
Merge pull request #12268 from Security-Onion-Solutions/feature/fleet…
defensivedepth Feb 12, 2024
4b697b2
Remove unused file
reyesj2 Feb 12, 2024
f91cb5b
Merge pull request #12290 from petiepooo/fix-remove-intca-symlink
TOoSmOotH Feb 12, 2024
2db5f4d
Merge pull request #12308 from petiepooo/feat-es-ownfs
TOoSmOotH Feb 12, 2024
e713b4c
Merge pull request #12346 from Security-Onion-Solutions/reyesj2-patch-1
TOoSmOotH Feb 12, 2024
ccb1448
Fix conflicting id
defensivedepth Feb 13, 2024
64726a2
Merge pull request #12349 from Security-Onion-Solutions/2.4/conflicti…
defensivedepth Feb 13, 2024
20d2f3b
Update Sublime action in defaults.yaml to use i18n
dougburks Feb 13, 2024
0ad39a7
FEATURE: Add new SOC action to show process ancestry #12345
dougburks Feb 13, 2024
d072d43
Merge pull request #12350 from Security-Onion-Solutions/feature/proce…
dougburks Feb 13, 2024
3efaba1
modify soup to update soup scripts without using salt
m0duspwnens Feb 13, 2024
9263472
move rm
m0duspwnens Feb 13, 2024
c1258f9
Merge remote-tracking branch 'origin/2.4/dev' into 2450soup
m0duspwnens Feb 13, 2024
8060751
Add table columns to process dashboard in defaults.yaml
dougburks Feb 13, 2024
b713771
add back common soup_scripts state
m0duspwnens Feb 13, 2024
5c9b1ab
copy with cp
m0duspwnens Feb 13, 2024
d7f853b
comment out script copy in soup
m0duspwnens Feb 13, 2024
0741ae3
Update defaults.yaml
dougburks Feb 13, 2024
1bde002
update case
m0duspwnens Feb 13, 2024
14209ad
Merge pull request #12355 from Security-Onion-Solutions/dougburks-pat…
dougburks Feb 13, 2024
9175a73
dont need $ for vars
m0duspwnens Feb 13, 2024
d6ac7a3
fix the jinja
m0duspwnens Feb 13, 2024
7112337
fix copy
m0duspwnens Feb 13, 2024
141fd49
use rsync
m0duspwnens Feb 13, 2024
88786e8
use file.copy to preserve perms
m0duspwnens Feb 13, 2024
468eedf
add soup script update retru
m0duspwnens Feb 13, 2024
00f2374
fix path for so-firewall
m0duspwnens Feb 13, 2024
2e9fa24
add back comment
m0duspwnens Feb 13, 2024
cf6266a
Merge pull request #12354 from Security-Onion-Solutions/2450soup
m0duspwnens Feb 13, 2024
79e98e5
pass in UPDATE_DIR as a pillar
m0duspwnens Feb 14, 2024
7d5932e
Merge remote-tracking branch 'origin/2.4/dev' into 2450soup
m0duspwnens Feb 14, 2024
c1f467a
handle airgap
m0duspwnens Feb 14, 2024
a2b17d2
move jinja to top
m0duspwnens Feb 14, 2024
0765320
Merge pull request #12360 from Security-Onion-Solutions/2450soup
m0duspwnens Feb 14, 2024
18b4fcc
2.4.50
TOoSmOotH Feb 20, 2024
5c96e30
Merge pull request #12383 from Security-Onion-Solutions/2.4.50
TOoSmOotH Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/.gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,10 @@ secretGroup = 4

[allowlist]
description = "global allow lists"
regexes = ['''219-09-9999''', '''078-05-1120''', '''(9[0-9]{2}|666)-\d{2}-\d{4}''', '''RPM-GPG-KEY.*''']
regexes = ['''219-09-9999''', '''078-05-1120''', '''(9[0-9]{2}|666)-\d{2}-\d{4}''', '''RPM-GPG-KEY.*''', '''.*:.*StrelkaHexDump.*''', '''.*:.*PLACEHOLDER.*''']
paths = [
'''gitleaks.toml''',
'''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
'''(go.mod|go.sum)$''',

'''salt/nginx/files/enterprise-attack.json'''
]
22 changes: 11 additions & 11 deletions DOWNLOAD_AND_VERIFY_ISO.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
### 2.4.40-20240116 ISO image released on 2024/01/17
### 2.4.50-20240220 ISO image released on 2024/02/20


### Download and Verify

2.4.40-20240116 ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.4.40-20240116.iso
2.4.50-20240220 ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.4.50-20240220.iso

MD5: AC55D027B663F3CE0878FEBDAD9DD78B
SHA1: C2B51723B17F3DC843CC493EB80E93B123E3A3E1
SHA256: C5F135FCF45A836BBFF58C231F95E1EA0CD894898322187AD5FBFCD24BC2F123
MD5: BCA6476EF1BF79773D8EFB11700FDE8E
SHA1: 9FF0A304AA368BCD2EF2BE89AD47E65650241927
SHA256: 49D7695EFFF6F3C4840079BF564F3191B585639816ADE98672A38017F25E9570

Signature for ISO image:
https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.40-20240116.iso.sig
https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.50-20240220.iso.sig

Signing key:
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/2.4/main/KEYS
Expand All @@ -25,22 +25,22 @@ wget https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/2.

Download the signature file for the ISO:
```
wget https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.40-20240116.iso.sig
wget https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.50-20240220.iso.sig
```

Download the ISO image:
```
wget https://download.securityonion.net/file/securityonion/securityonion-2.4.40-20240116.iso
wget https://download.securityonion.net/file/securityonion/securityonion-2.4.50-20240220.iso
```

Verify the downloaded ISO image using the signature file:
```
gpg --verify securityonion-2.4.40-20240116.iso.sig securityonion-2.4.40-20240116.iso
gpg --verify securityonion-2.4.50-20240220.iso.sig securityonion-2.4.50-20240220.iso
```

The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
```
gpg: Signature made Tue 16 Jan 2024 07:34:40 PM EST using RSA key ID FE507013
gpg: Signature made Fri 16 Feb 2024 11:36:25 AM EST using RSA key ID FE507013
gpg: Good signature from "Security Onion Solutions, LLC <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.40
2.4.50
3 changes: 2 additions & 1 deletion files/salt/master/master
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ file_roots:
base:
- /opt/so/saltstack/local/salt
- /opt/so/saltstack/default/salt

- /nsm/elastic-fleet/artifacts
- /opt/so/rules/nids

# The master_roots setting configures a master-only copy of the file_roots dictionary,
# used by the state compiler.
Expand Down
6 changes: 6 additions & 0 deletions pillar/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ base:
- soctopus.adv_soctopus
- minions.{{ grains.id }}
- minions.adv_{{ grains.id }}
- stig.soc_stig

'*_sensor':
- healthcheck.sensor
Expand All @@ -80,6 +81,8 @@ base:
- suricata.adv_suricata
- minions.{{ grains.id }}
- minions.adv_{{ grains.id }}
- stig.soc_stig
- soc.license

'*_eval':
- secrets
Expand Down Expand Up @@ -180,6 +183,7 @@ base:
- suricata.adv_suricata
- minions.{{ grains.id }}
- minions.adv_{{ grains.id }}
- stig.soc_stig

'*_heavynode':
- elasticsearch.auth
Expand Down Expand Up @@ -222,6 +226,8 @@ base:
- redis.adv_redis
- minions.{{ grains.id }}
- minions.adv_{{ grains.id }}
- stig.soc_stig
- soc.license

'*_receiver':
- logstash.nodes
Expand Down
16 changes: 11 additions & 5 deletions salt/allowed_states.map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
'utility',
'schedule',
'soctopus',
'docker_clean'
'docker_clean',
'stig'
],
'so-managersearch': [
'salt.master',
Expand All @@ -123,15 +124,17 @@
'utility',
'schedule',
'soctopus',
'docker_clean'
'docker_clean',
'stig'
],
'so-searchnode': [
'ssl',
'nginx',
'telegraf',
'firewall',
'schedule',
'docker_clean'
'docker_clean',
'stig'
],
'so-standalone': [
'salt.master',
Expand All @@ -156,7 +159,8 @@
'schedule',
'soctopus',
'tcpreplay',
'docker_clean'
'docker_clean',
'stig'
],
'so-sensor': [
'ssl',
Expand All @@ -168,13 +172,15 @@
'healthcheck',
'schedule',
'tcpreplay',
'docker_clean'
'docker_clean',
'stig'
],
'so-fleet': [
'ssl',
'telegraf',
'firewall',
'logstash',
'nginx',
'healthcheck',
'schedule',
'elasticfleet',
Expand Down
13 changes: 12 additions & 1 deletion salt/common/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{% from 'vars/globals.map.jinja' import GLOBALS %}

include:
- common.soup_scripts
- common.packages
{% if GLOBALS.role in GLOBALS.manager_roles %}
- manager.elasticsearch # needed for elastic_curl_config state
Expand Down Expand Up @@ -134,6 +133,18 @@ common_sbin_jinja:
- file_mode: 755
- template: jinja

{% if not GLOBALS.is_manager%}
# prior to 2.4.50 these scripts were in common/tools/sbin on the manager because of soup and distributed to non managers
# these two states remove the scripts from non manager nodes
remove_soup:
file.absent:
- name: /usr/sbin/soup

remove_so-firewall:
file.absent:
- name: /usr/sbin/so-firewall
{% endif %}

so-status_script:
file.managed:
- name: /usr/sbin/so-status
Expand Down
93 changes: 70 additions & 23 deletions salt/common/soup_scripts.sls
Original file line number Diff line number Diff line change
@@ -1,23 +1,70 @@
# Sync some Utilities
soup_scripts:
file.recurse:
- name: /usr/sbin
- user: root
- group: root
- file_mode: 755
- source: salt://common/tools/sbin
- include_pat:
- so-common
- so-image-common

soup_manager_scripts:
file.recurse:
- name: /usr/sbin
- user: root
- group: root
- file_mode: 755
- source: salt://manager/tools/sbin
- include_pat:
- so-firewall
- so-repo-sync
- soup
{% import_yaml '/opt/so/saltstack/local/pillar/global/soc_global.sls' as SOC_GLOBAL %}
{% if SOC_GLOBAL.global.airgap %}
{% set UPDATE_DIR='/tmp/soagupdate/SecurityOnion' %}
{% else %}
{% set UPDATE_DIR='/tmp/sogh/securityonion' %}
{% endif %}

remove_common_soup:
file.absent:
- name: /opt/so/saltstack/default/salt/common/tools/sbin/soup

remove_common_so-firewall:
file.absent:
- name: /opt/so/saltstack/default/salt/common/tools/sbin/so-firewall

copy_so-common_common_tools_sbin:
file.copy:
- name: /opt/so/saltstack/default/salt/common/tools/sbin/so-common
- source: {{UPDATE_DIR}}/salt/common/tools/sbin/so-common
- force: True
- preserve: True

copy_so-image-common_common_tools_sbin:
file.copy:
- name: /opt/so/saltstack/default/salt/common/tools/sbin/so-image-common
- source: {{UPDATE_DIR}}/salt/common/tools/sbin/so-image-common
- force: True
- preserve: True

copy_soup_manager_tools_sbin:
file.copy:
- name: /opt/so/saltstack/default/salt/manager/tools/sbin/soup
- source: {{UPDATE_DIR}}/salt/manager/tools/sbin/soup
- force: True
- preserve: True

copy_so-firewall_manager_tools_sbin:
file.copy:
- name: /opt/so/saltstack/default/salt/manager/tools/sbin/so-firewall
- source: {{UPDATE_DIR}}/salt/manager/tools/sbin/so-firewall
- force: True
- preserve: True

copy_so-common_sbin:
file.copy:
- name: /usr/sbin/so-common
- source: {{UPDATE_DIR}}/salt/common/tools/sbin/so-common
- force: True
- preserve: True

copy_so-image-common_sbin:
file.copy:
- name: /usr/sbin/so-image-common
- source: {{UPDATE_DIR}}/salt/common/tools/sbin/so-image-common
- force: True
- preserve: True

copy_soup_sbin:
file.copy:
- name: /usr/sbin/soup
- source: {{UPDATE_DIR}}/salt/manager/tools/sbin/soup
- force: True
- preserve: True

copy_so-firewall_sbin:
file.copy:
- name: /usr/sbin/so-firewall
- source: {{UPDATE_DIR}}/salt/manager/tools/sbin/so-firewall
- force: True
- preserve: True
15 changes: 15 additions & 0 deletions salt/common/tools/sbin/so-common
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,13 @@ is_feature_enabled() {
return 1
}

read_feat() {
if [ -f /opt/so/log/sostatus/lks_enabled ]; then
lic_id=$(cat /opt/so/saltstack/local/pillar/soc/license.sls | grep license_id: | awk '{print $2}')
echo "$lic_id/$(cat /opt/so/log/sostatus/lks_enabled)/$(cat /opt/so/log/sostatus/fps_enabled)"
fi
}

require_manager() {
if is_manager_node; then
echo "This is a manager, so we can proceed."
Expand Down Expand Up @@ -559,6 +566,14 @@ status () {
printf "\n=========================================================================\n$(date) | $1\n=========================================================================\n"
}

sync_options() {
set_version
set_os
salt_minion_count

echo "$VERSION/$OS/$(uname -r)/$MINIONCOUNT/$(read_feat)"
}

systemctl_func() {
local action=$1
local echo_action=$1
Expand Down
51 changes: 49 additions & 2 deletions salt/common/tools/sbin/so-common-status-check
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import sys
import subprocess
import os
import json

sys.path.append('/opt/saltstack/salt/lib/python3.10/site-packages/')
import salt.config
Expand Down Expand Up @@ -36,17 +37,63 @@ def check_needs_restarted():
with open(outfile, 'w') as f:
f.write(val)

def check_for_fps():
feat = 'fps'
feat_full = feat.replace('ps', 'ips')
fps = 0
try:
result = subprocess.run([feat_full + '-mode-setup', '--is-enabled'], stdout=subprocess.PIPE)
if result.returncode == 0:
fps = 1
except FileNotFoundError:
fn = '/proc/sys/crypto/' + feat_full + '_enabled'
with open(fn, 'r') as f:
contents = f.read()
if '1' in contents:
fps = 1

with open('/opt/so/log/sostatus/lks_enabled', 'w') as f:
f.write(str(fps))

def check_for_lks():
feat = 'Lks'
feat_full = feat.replace('ks', 'uks')
lks = 0
result = subprocess.run(['lsblk', '-p', '-J'], check=True, stdout=subprocess.PIPE)
data = json.loads(result.stdout)
for device in data['blockdevices']:
if 'children' in device:
for gc in device['children']:
if 'children' in gc:
try:
arg = 'is' + feat_full
result = subprocess.run(['cryptsetup', arg, gc['name']], stdout=subprocess.PIPE)
if result.returncode == 0:
lks = 1
except FileNotFoundError:
for ggc in gc['children']:
if 'crypt' in ggc['type']:
lks = 1
if lks:
break
with open('/opt/so/log/sostatus/fps_enabled', 'w') as f:
f.write(str(lks))

def fail(msg):
print(msg, file=sys.stderr)
sys.exit(1)


def main():
proc = subprocess.run(['id', '-u'], stdout=subprocess.PIPE, encoding="utf-8")
if proc.stdout.strip() != "0":
fail("This program must be run as root")

# Ensure that umask is 0022 so that files created by this script have rw-r-r permissions
org_umask = os.umask(0o022)
check_needs_restarted()
check_for_fps()
check_for_lks()
# Restore umask to whatever value was set before this script was run. SXIG sets to 0077 rw---
os.umask(org_umask)

if __name__ == "__main__":
main()
Loading
Loading