Skip to content

Commit 7edac92

Browse files
Merge branch 'release-1.44.70'
* release-1.44.70: Bumping version to 1.44.70 Update changelog based on model updates Update `configure set` to validate configuration keys and values (#10163)
2 parents dd9997e + 842ea57 commit 7edac92

File tree

9 files changed

+298
-4
lines changed

9 files changed

+298
-4
lines changed

.changes/1.44.70.json

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
[
2+
{
3+
"category": "``acm``",
4+
"description": "Adds support for searching for ACM certificates using the new SearchCertificates API.",
5+
"type": "api-change"
6+
},
7+
{
8+
"category": "``cloudfront``",
9+
"description": "This release adds bring your own IP (BYOIP) IPv6 support to CloudFront's CreateAnycastIpList and UpdateAnycastIpList API through the IpamCidrConfigs field.",
10+
"type": "api-change"
11+
},
12+
{
13+
"category": "``dataexchange``",
14+
"description": "Support Tags for AWS Data Exchange resource Assets",
15+
"type": "api-change"
16+
},
17+
{
18+
"category": "``datazone``",
19+
"description": "Adds environmentConfigurationName field to CreateEnvironmentInput and UpdateEnvironmentInput, so that Domain Owners can now recover orphaned environments by recreating deleted configurations with the same name, and will auto-recover orphaned environments",
20+
"type": "api-change"
21+
},
22+
{
23+
"category": "``devops-agent``",
24+
"description": "AWS DevOps Agent service General Availability release.",
25+
"type": "api-change"
26+
},
27+
{
28+
"category": "``dms``",
29+
"description": "To successfully connect to the IBM DB2 LUW database server, you may need to specify additional security parameters that are passed to the JDBC driver. These parameters are EncryptionAlgorithm and SecurityMechanism. Both parameters accept integer values.",
30+
"type": "api-change"
31+
},
32+
{
33+
"category": "``ec2``",
34+
"description": "This release updates the examples in the documentation for DescribeRegions and DescribeAvailabilityZones.",
35+
"type": "api-change"
36+
},
37+
{
38+
"category": "``endpoint-rules``",
39+
"description": "Update endpoint-rules command to latest version",
40+
"type": "api-change"
41+
},
42+
{
43+
"category": "``geo-maps``",
44+
"description": "This release expands map customization options with adjustable contour line density, dark mode support for Hybrid and Satellite views, enhanced traffic information across multiple map styles, and transit and truck travel modes for Monochrome and Hybrid map styles.",
45+
"type": "api-change"
46+
},
47+
{
48+
"category": "``kinesisanalyticsv2``",
49+
"description": "Support for Flink 2.2 in Managed Service for Apache Flink",
50+
"type": "api-change"
51+
},
52+
{
53+
"category": "``mailmanager``",
54+
"description": "Amazon SES Mail Manager now supports optional TLS policy for accepting unencrypted connections and mTLS authentication for ingress endpoints with configurable trust stores. Two new rule actions are available, Bounce for sending non-delivery reports and Lambda invocation for custom email processing.",
55+
"type": "api-change"
56+
},
57+
{
58+
"category": "``marketplace-agreement``",
59+
"description": "This release adds 8 new APIs for AWS Marketplace sellers. 4 APIs for Cancellations (Send, List, Get, Cancel action on AgreementCancellationRequest), 3 APIs for Billing Adjustments (BatchCreate, List, Get action on BillingAdjustmentRequest), and 1 API to List Invoices (ListAgreementInvoiceLineItems)",
60+
"type": "api-change"
61+
},
62+
{
63+
"category": "``observabilityadmin``",
64+
"description": "This release adds the Bedrock and Security Hub resource types for Omnia Enablement launch for March 31.",
65+
"type": "api-change"
66+
},
67+
{
68+
"category": "``odb``",
69+
"description": "Adds support for EC2 Placement Group integration with ODB Network. The GetOdbNetwork and ListOdbNetworks API responses now include the ec2PlacementGroupIds field.",
70+
"type": "api-change"
71+
},
72+
{
73+
"category": "``opensearch``",
74+
"description": "Support RegisterCapability, GetCapability, DeregisterCapability API for AI Assistant feature management for OpenSearch UI Applications",
75+
"type": "api-change"
76+
},
77+
{
78+
"category": "``organizations``",
79+
"description": "Added Path field to Account and OrganizationalUnit objects in AWS Organizations API responses.",
80+
"type": "api-change"
81+
},
82+
{
83+
"category": "``partnercentral-selling``",
84+
"description": "Adding EURO Currency for MRR Amount",
85+
"type": "api-change"
86+
},
87+
{
88+
"category": "``pinpoint-sms-voice-v2``",
89+
"description": "This release adds RCS for Business messaging and Notify support. RCS lets you create and manage agents, send and receive messages in the US and Canada via SendTextMessage API, and configure SMS fallback. Notify lets you send templated OTP messages globally in minutes with no phone number required.",
90+
"type": "api-change"
91+
},
92+
{
93+
"category": "``quicksight``",
94+
"description": "Adds StartAutomationJob and DescribeAutomationJob APIs for automation jobs. Adds three custom permission capabilities that allow admins to control whether users can manage Spaces and chat agents. Adds an OAuthClientCredentials structure to provide OAuth 2.0 client credentials inline to data sources.",
95+
"type": "api-change"
96+
},
97+
{
98+
"category": "``s3``",
99+
"description": "Add Bucket Metrics configuration support to directory buckets",
100+
"type": "api-change"
101+
},
102+
{
103+
"category": "``s3control``",
104+
"description": "Adding an optional auditContext parameter to S3 Access Grants credential vending API GetDataAccess to enable job-level audit correlation in S3 CloudTrail logs",
105+
"type": "api-change"
106+
},
107+
{
108+
"category": "``s3tables``",
109+
"description": "S3 Tables now supports nested types when creating tables. Users can define complex column schemas using struct, list, and map types. These types can be composed together to model complex, hierarchical data structures within table schemas.",
110+
"type": "api-change"
111+
},
112+
{
113+
"category": "``securityagent``",
114+
"description": "AWS Security Agent is a service that proactively secures applications throughout the development lifecycle with automated security reviews and on-demand penetration testing.",
115+
"type": "api-change"
116+
},
117+
{
118+
"category": "``sustainability``",
119+
"description": "This is the first release of the AWS Sustainability SDK, which enables customers to access their sustainability impact data via API.",
120+
"type": "api-change"
121+
},
122+
{
123+
"category": "Configuration",
124+
"description": "Update ``configure set`` command to return an error when newline or carriage-return characters are specified in the value.",
125+
"type": "bugfix"
126+
}
127+
]

CHANGELOG.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22
CHANGELOG
33
=========
44

5+
1.44.70
6+
=======
7+
8+
* api-change:``acm``: Adds support for searching for ACM certificates using the new SearchCertificates API.
9+
* api-change:``cloudfront``: This release adds bring your own IP (BYOIP) IPv6 support to CloudFront's CreateAnycastIpList and UpdateAnycastIpList API through the IpamCidrConfigs field.
10+
* api-change:``dataexchange``: Support Tags for AWS Data Exchange resource Assets
11+
* api-change:``datazone``: Adds environmentConfigurationName field to CreateEnvironmentInput and UpdateEnvironmentInput, so that Domain Owners can now recover orphaned environments by recreating deleted configurations with the same name, and will auto-recover orphaned environments
12+
* api-change:``devops-agent``: AWS DevOps Agent service General Availability release.
13+
* api-change:``dms``: To successfully connect to the IBM DB2 LUW database server, you may need to specify additional security parameters that are passed to the JDBC driver. These parameters are EncryptionAlgorithm and SecurityMechanism. Both parameters accept integer values.
14+
* api-change:``ec2``: This release updates the examples in the documentation for DescribeRegions and DescribeAvailabilityZones.
15+
* api-change:``endpoint-rules``: Update endpoint-rules command to latest version
16+
* api-change:``geo-maps``: This release expands map customization options with adjustable contour line density, dark mode support for Hybrid and Satellite views, enhanced traffic information across multiple map styles, and transit and truck travel modes for Monochrome and Hybrid map styles.
17+
* api-change:``kinesisanalyticsv2``: Support for Flink 2.2 in Managed Service for Apache Flink
18+
* api-change:``mailmanager``: Amazon SES Mail Manager now supports optional TLS policy for accepting unencrypted connections and mTLS authentication for ingress endpoints with configurable trust stores. Two new rule actions are available, Bounce for sending non-delivery reports and Lambda invocation for custom email processing.
19+
* api-change:``marketplace-agreement``: This release adds 8 new APIs for AWS Marketplace sellers. 4 APIs for Cancellations (Send, List, Get, Cancel action on AgreementCancellationRequest), 3 APIs for Billing Adjustments (BatchCreate, List, Get action on BillingAdjustmentRequest), and 1 API to List Invoices (ListAgreementInvoiceLineItems)
20+
* api-change:``observabilityadmin``: This release adds the Bedrock and Security Hub resource types for Omnia Enablement launch for March 31.
21+
* api-change:``odb``: Adds support for EC2 Placement Group integration with ODB Network. The GetOdbNetwork and ListOdbNetworks API responses now include the ec2PlacementGroupIds field.
22+
* api-change:``opensearch``: Support RegisterCapability, GetCapability, DeregisterCapability API for AI Assistant feature management for OpenSearch UI Applications
23+
* api-change:``organizations``: Added Path field to Account and OrganizationalUnit objects in AWS Organizations API responses.
24+
* api-change:``partnercentral-selling``: Adding EURO Currency for MRR Amount
25+
* api-change:``pinpoint-sms-voice-v2``: This release adds RCS for Business messaging and Notify support. RCS lets you create and manage agents, send and receive messages in the US and Canada via SendTextMessage API, and configure SMS fallback. Notify lets you send templated OTP messages globally in minutes with no phone number required.
26+
* api-change:``quicksight``: Adds StartAutomationJob and DescribeAutomationJob APIs for automation jobs. Adds three custom permission capabilities that allow admins to control whether users can manage Spaces and chat agents. Adds an OAuthClientCredentials structure to provide OAuth 2.0 client credentials inline to data sources.
27+
* api-change:``s3``: Add Bucket Metrics configuration support to directory buckets
28+
* api-change:``s3control``: Adding an optional auditContext parameter to S3 Access Grants credential vending API GetDataAccess to enable job-level audit correlation in S3 CloudTrail logs
29+
* api-change:``s3tables``: S3 Tables now supports nested types when creating tables. Users can define complex column schemas using struct, list, and map types. These types can be composed together to model complex, hierarchical data structures within table schemas.
30+
* api-change:``securityagent``: AWS Security Agent is a service that proactively secures applications throughout the development lifecycle with automated security reviews and on-demand penetration testing.
31+
* api-change:``sustainability``: This is the first release of the AWS Sustainability SDK, which enables customers to access their sustainability impact data via API.
32+
* bugfix:Configuration: Update ``configure set`` command to return an error when newline or carriage-return characters are specified in the value.
33+
34+
535
1.44.69
636
=======
737

awscli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import os
2020

21-
__version__ = '1.44.69'
21+
__version__ = '1.44.70'
2222

2323
#
2424
# Get our data path to be added to botocore's search path

awscli/customizations/configure/writer.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ class ConfigFileWriter(object):
2424
r'(?P<value>.*)$'
2525
)
2626

27+
def _validate_no_newlines_or_carriage_returns(
28+
self,
29+
value,
30+
label='value',
31+
msg_override=None,
32+
):
33+
if isinstance(value, str) and ('\n' in value or '\r' in value):
34+
err_msg = msg_override if msg_override is not None else (
35+
f"Invalid {label}: newline "
36+
f"characters and carriage returns are not allowed: {value!r}"
37+
)
38+
raise ValueError(err_msg)
39+
2740
def update_config(self, new_values, config_filename):
2841
"""Update config file with new values.
2942
@@ -52,6 +65,38 @@ def update_config(self, new_values, config_filename):
5265
5366
"""
5467
section_name = new_values.pop('__section__', 'default')
68+
self._validate_no_newlines_or_carriage_returns(
69+
section_name,
70+
'section name'
71+
)
72+
for k, v in new_values.items():
73+
self._validate_no_newlines_or_carriage_returns(k, 'key')
74+
if not isinstance(v, dict):
75+
# Override error msg to prevent
76+
# leaking sensitive config values to stderr.
77+
self._validate_no_newlines_or_carriage_returns(
78+
v,
79+
'value',
80+
msg_override=(
81+
f"Invalid value for key {k}: "
82+
f"newline characters and carriage "
83+
f"returns are not allowed."
84+
)
85+
)
86+
else:
87+
for sk, sv in v.items():
88+
# Override error msg to prevent
89+
# leaking sensitive config values to stderr.
90+
self._validate_no_newlines_or_carriage_returns(sk, 'key')
91+
self._validate_no_newlines_or_carriage_returns(
92+
sv,
93+
'value',
94+
msg_override = (
95+
f"Invalid value for key {k}: "
96+
f"newline characters and carriage "
97+
f"returns are not allowed."
98+
)
99+
)
55100
if not os.path.isfile(config_filename):
56101
self._create_file(config_filename)
57102
self._write_new_section(section_name, new_values, config_filename)

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# The short X.Y version.
5353
version = '1.44.'
5454
# The full version, including alpha/beta/rc tags.
55-
release = '1.44.69'
55+
release = '1.44.70'
5656

5757
# The language for content autogenerated by Sphinx. Refer to documentation
5858
# for a list of supported languages.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ universal = 0
33

44
[metadata]
55
requires_dist =
6-
botocore==1.42.79
6+
botocore==1.42.80
77
docutils>=0.18.1,<=0.19
88
s3transfer>=0.16.0,<0.17.0
99
PyYAML>=3.10,<6.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def find_version(*file_paths):
2424

2525

2626
install_requires = [
27-
'botocore==1.42.79',
27+
'botocore==1.42.80',
2828
'docutils>=0.18.1,<=0.19',
2929
's3transfer>=0.16.0,<0.17.0',
3030
'PyYAML>=3.10,<6.1',

tests/functional/configure/test_configure.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,62 @@ def test_can_handle_empty_section(self):
374374
self.get_config_file_contents(),
375375
)
376376

377+
def test_set_rejects_newline_in_value(self):
378+
_, stderr, _ = self.run_cmd(
379+
["configure", "set", "region", "us-east-1\nus-west-2"],
380+
expected_rc=255,
381+
)
382+
self.assertIn("newline", stderr)
383+
# To avoid leaking sensitive values,
384+
# values should not appear in stderr.
385+
self.assertNotIn("us-east-1\nus-west-2", stderr)
386+
387+
def test_set_rejects_carriage_return_in_value(self):
388+
_, stderr, _ = self.run_cmd(
389+
["configure", "set", "region", "us-east-1\rus-west-2"],
390+
expected_rc=255,
391+
)
392+
self.assertIn("newline", stderr)
393+
# To avoid leaking sensitive values,
394+
# values should not appear in stderr.
395+
self.assertNotIn("us-east-1\rus-west-2", stderr)
396+
397+
def test_set_rejects_newline_in_nested_value(self):
398+
_, stderr, _ = self.run_cmd(
399+
["configure", "set", "default.s3.signature_version", "s3v4\nfoo"],
400+
expected_rc=255,
401+
)
402+
self.assertIn("newline", stderr)
403+
# To avoid leaking sensitive values,
404+
# values should not appear in stderr.
405+
self.assertNotIn("s3v4\nfoo", stderr)
406+
407+
def test_newline_injection_does_not_write_injected_key_to_file(self):
408+
# Simulates: aws configure set output $'table\nregion = us-east-1'
409+
# The injected key must not appear anywhere in the config file.
410+
self.set_config_file_contents("[default]\n")
411+
self.run_cmd(
412+
["configure", "set", "output", "table\nregion = us-east-1"],
413+
expected_rc=255,
414+
)
415+
contents = self.get_config_file_contents()
416+
self.assertNotIn("region", contents)
417+
418+
def test_newline_injection_does_not_set_injected_key_in_parsed_config(self):
419+
# Even if the file were somehow written, the injected key must not be
420+
# readable back via 'configure get'.
421+
self.set_config_file_contents("[default]\n")
422+
self.run_cmd(
423+
["configure", "set", "output", "table\nregion = us-east-1"],
424+
expected_rc=255,
425+
)
426+
# Re-create the driver so it re-reads the (unchanged) config file.
427+
self.driver = create_clidriver()
428+
stdout, _, _ = self.run_cmd(
429+
"configure get region", expected_rc=1
430+
)
431+
self.assertEqual(stdout.strip(), "")
432+
377433

378434
class TestConfigureHasArgTable(unittest.TestCase):
379435
def test_configure_command_has_arg_table(self):

tests/unit/customizations/configure/test_writer.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,39 @@ def test_appends_newline_on_new_section(self):
369369
'[new-section]\n'
370370
'region = us-west-2\n'
371371
)
372+
373+
def test_newline_in_value_raises(self):
374+
with open(self.config_filename, 'w') as f:
375+
f.write('[default]\nfoo = bar\n')
376+
with self.assertRaises(ValueError):
377+
self.writer.update_config({'foo': 'bad\nvalue'}, self.config_filename)
378+
379+
def test_carriage_return_in_value_raises(self):
380+
with open(self.config_filename, 'w') as f:
381+
f.write('[default]\nfoo = bar\n')
382+
with self.assertRaises(ValueError):
383+
self.writer.update_config({'foo': 'bad\rvalue'}, self.config_filename)
384+
385+
def test_newline_in_key_raises(self):
386+
with open(self.config_filename, 'w') as f:
387+
f.write('[default]\nfoo = bar\n')
388+
with self.assertRaises(ValueError):
389+
self.writer.update_config({'bad\nkey': 'value'}, self.config_filename)
390+
391+
def test_newline_in_section_name_raises(self):
392+
with open(self.config_filename, 'w') as f:
393+
f.write('[default]\nfoo = bar\n')
394+
with self.assertRaises(ValueError):
395+
self.writer.update_config(
396+
{'foo': 'value', '__section__': 'bad\nsection'},
397+
self.config_filename
398+
)
399+
400+
def test_newline_in_nested_value_raises(self):
401+
with open(self.config_filename, 'w') as f:
402+
f.write('[default]\n')
403+
with self.assertRaises(ValueError):
404+
self.writer.update_config(
405+
{'__section__': 'default', 's3': {'key': 'bad\nvalue'}},
406+
self.config_filename
407+
)

0 commit comments

Comments
 (0)