File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
cookbooks/aws-parallelcluster-platform Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ This file is used to list changes made in each version of the AWS ParallelCluste
77------
88** ENHANCEMENTS**
99- Add support for Ubuntu24.
10+ - Disable unused services like cups and wpa_supplicant from Official ParallelCluster AMIs to improve security.
1011
1112** CHANGES**
1213- On Ubuntu 22.04, install the Nvidia driver with the same compiler version used to compile the kernel.
Original file line number Diff line number Diff line change 2727service 'log4j-cve-2021-44228-hotpatch' do
2828 action %i( disable stop mask )
2929end unless on_docker?
30+
31+ # Disable services if node['cluster']['disable_services'] is provided
32+ if node [ 'cluster' ] [ 'disable_services' ]
33+ node [ 'cluster' ] [ 'disable_services' ] . split ( ) . each do |service_name |
34+ service service_name do
35+ action %i( disable stop mask )
36+ end unless on_docker?
37+ end
38+ end
Original file line number Diff line number Diff line change 11require 'spec_helper'
22
3+ DISABLE_SERVICE_NAME = 'service_name1 service_name_2' . freeze
4+
35describe 'aws-parallelcluster-platform::disable_services' do
46 for_all_oses do |platform , version |
57 context "on #{ platform } #{ version } " do
68 cached ( :chef_run ) do
7- runner ( platform : platform , version : version ) . converge ( described_recipe )
9+ runner = ChefSpec ::Runner . new do |node |
10+ node . override [ 'cluster' ] [ 'disable_services' ] = DISABLE_SERVICE_NAME
11+ end
12+ runner . converge ( described_recipe )
813 end
914
1015 it 'disables DLAMI multi eni helper' do
1823 is_expected . to stop_service ( 'log4j-cve-2021-44228-hotpatch' )
1924 is_expected . to mask_service ( 'log4j-cve-2021-44228-hotpatch' )
2025 end
26+
27+ DISABLE_SERVICE_NAME . split ( ) . each do |service_name |
28+ it "disables #{ service_name } " do
29+ is_expected . to disable_service ( service_name )
30+ is_expected . to stop_service ( service_name )
31+ is_expected . to mask_service ( service_name )
32+ end
33+ end
2134 end
2235 end
2336end
You can’t perform that action at this time.
0 commit comments