AWS code-library documentation change
Summary
Added resource tagging commands throughout IoT Device Defender and IoT Core examples
Security assessment
Changes only add resource tagging (project/tutorial metadata) for organizational purposes. No security vulnerabilities are addressed, and tagging doesn't enhance security controls. Tags may help resource management but don't alter security posture.
Diff
diff --git a/code-library/latest/ug/bash_2_iot_code_examples.md b/code-library/latest/ug/bash_2_iot_code_examples.md index 65bc5f2ba..b75059c87 100644 --- a//code-library/latest/ug/bash_2_iot_code_examples.md +++ b//code-library/latest/ug/bash_2_iot_code_examples.md @@ -170,0 +171,2 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + aws iam tag-role --role-name "$ROLE_NAME" --tags Key=project,Value=doc-smith Key=tutorial,Value=aws-iot-device-defender-gs 2>&1 || true + @@ -433,0 +436,3 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + # Tag the audit task via IoT service + aws iot tag-resource --resource-arn "arn:aws:iot:$(aws configure get region):${ACCOUNT_ID}:audittask/${TASK_ID}" --tags Key=project,Value=doc-smith Key=tutorial,Value=aws-iot-device-defender-gs 2>&1 || true + @@ -542,0 +548 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + aws iot tag-resource --resource-arn "$MITIGATION_ACTION_ARN" --tags Key=project,Value=doc-smith Key=tutorial,Value=aws-iot-device-defender-gs 2>&1 || true @@ -622 +628 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - SNS_RESULT=$(aws sns create-topic --name "IoTDDNotifications" --output json 2>&1) || true + SNS_RESULT=$(aws sns create-topic --name "IoTDDNotifications" --tags Key=project,Value=doc-smith Key=tutorial,Value=aws-iot-device-defender-gs --output json 2>&1) || true @@ -1046 +1052 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - log_cmd "aws iot create-policy --policy-name $POLICY_NAME --policy-document file://iot-policy.json" + log_cmd "aws iot create-policy --policy-name $POLICY_NAME --policy-document file://iot-policy.json --tags Key=project,Value=doc-smith Key=tutorial,Value=aws-iot-core-gs" @@ -1053,0 +1060,3 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + THING_ARN=$(aws iot describe-thing --thing-name "$THING_NAME" --query 'thingArn' --output text) + aws iot tag-resource --resource-arn "$THING_ARN" --tags Key=project,Value=doc-smith Key=tutorial,Value=aws-iot-core-gs + @@ -1176 +1185 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - log_cmd "aws iot create-policy --policy-name $SHARED_POLICY_NAME --policy-document file://shared-sub-policy.json" + log_cmd "aws iot create-policy --policy-name $SHARED_POLICY_NAME --policy-document file://shared-sub-policy.json --tags Key=project,Value=doc-smith Key=tutorial,Value=aws-iot-core-gs"