Skip to content

Commit d81f5e0

Browse files
committed
Install and upgrade ca-certificates for all OSs and architectures
Prevent Chef/Cinc from using outdated CA certificates Signed-off-by: Luca Carrogu <[email protected]>
1 parent 3f42a59 commit d81f5e0

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ aws-parallelcluster-cookbook CHANGELOG
33

44
This file is used to list changes made in each version of the AWS ParallelCluster cookbook.
55

6+
3.0.1
7+
------
8+
9+
**BUG FIXES**
10+
- Update ca-certificates package during AMI build time and prevent Chef from using outdated/distrusted CA certificates.
11+
612
3.0.0
713
------
814

recipes/default.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
# Validate OS type specified by the user is the same as the OS identified by Ohai
1919
validate_os_type
2020

21+
# Update certificates
22+
include_recipe "aws-parallelcluster::update_certificates"
23+
2124
# Calling user_ulimit will override every existing limit
2225
user_ulimit "*" do
2326
filehandle_limit node['cluster']['filehandle_limit']

recipes/update_certificates.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# frozen_string_literal: true
2+
3+
#
4+
# Cookbook Name:: aws-parallelcluster
5+
# Recipe:: update_certificates
6+
#
7+
# Copyright 2013-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the
10+
# License. A copy of the License is located at
11+
#
12+
# http://aws.amazon.com/apache2.0/
13+
#
14+
# or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
15+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
package 'ca-certificates' do
19+
action :upgrade
20+
end
21+
22+
# Prevent Chef from using outdated/distrusted CA certificates
23+
# https://github.com/chef/chef/issues/12126
24+
if node['platform'] == 'ubuntu'
25+
link '/opt/cinc/embedded/ssl/certs/cacert.pem' do
26+
to '/etc/ssl/certs/ca-certificates.crt'
27+
end
28+
else
29+
link '/opt/cinc/embedded/ssl/certs/cacert.pem' do
30+
to '/etc/ssl/certs/ca-bundle.crt'
31+
end
32+
end

0 commit comments

Comments
 (0)