Skip to content

Commit b6c92bf

Browse files
committed
Apply technical requirements (R1, R2, R9, R10, R13)
- R1: Add AWS_REGION to region fallback chain - R2: Replace openssl rand with /dev/urandom - R9: Remove Appendix/Generation details from READMEs - R10: Remove internal references - R13: Add REVISION-HISTORY.md
1 parent 5876add commit b6c92bf

10 files changed

Lines changed: 43 additions & 39 deletions

File tree

tuts/092-aws-kms-gs/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,3 @@ $1/month for the customer managed key. Delete the key promptly to avoid charges.
5050
- [Encrypting and decrypting data](https://docs.aws.amazon.com/kms/latest/developerguide/programming-encryption.html)
5151
- [Data keys](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys)
5252
- [Deleting KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html)
53-
54-
---
55-
56-
## Appendix: Generation details
57-
58-
| Field | Value |
59-
|-------|-------|
60-
| Generation date | 2026-04-14 |
61-
| Source script | New, 88 lines |
62-
| Script test result | EXIT 0, 7s, 7 steps, no issues |
63-
| Issues encountered | None |
64-
| Iterations | v1 (direct to publish) |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 092-aws-kms-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/092-aws-kms-gs/aws-kms-gs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fi
1414
export AWS_DEFAULT_REGION="$REGION"
1515
echo "Region: $REGION"
1616

17-
RANDOM_ID=$(openssl rand -hex 4)
17+
RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
1818
ALIAS_NAME="alias/tutorial-key-${RANDOM_ID}"
1919

2020
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 102-amazon-guardduty-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/108-amazon-inspector-gs/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,3 @@ Free 15-day trial for new accounts. After the trial, pricing is based on the num
4747
- [Understanding findings](https://docs.aws.amazon.com/inspector/latest/user/findings-understanding.html)
4848
- [Managing coverage](https://docs.aws.amazon.com/inspector/latest/user/managing-coverage.html)
4949
- [Amazon Inspector pricing](https://aws.amazon.com/inspector/pricing/)
50-
51-
---
52-
53-
## Appendix: Generation details
54-
55-
| Field | Value |
56-
|-------|-------|
57-
| Generation date | 2026-04-14 |
58-
| Source script | New, 86 lines |
59-
| Script test result | EXIT 0, 11s, 5 steps, handled pre-existing enablement |
60-
| Issues encountered | None |
61-
| Iterations | v1 |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 108-amazon-inspector-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/109-aws-securityhub-gs/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,3 @@ Free 30-day trial for new accounts. After the trial, pricing is based on securit
4747
- [Security standards in Security Hub](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards.html)
4848
- [Viewing findings](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-viewing.html)
4949
- [AWS Security Hub pricing](https://aws.amazon.com/security-hub/pricing/)
50-
51-
---
52-
53-
## Appendix: Generation details
54-
55-
| Field | Value |
56-
|-------|-------|
57-
| Generation date | 2026-04-14 |
58-
| Source script | New, 84 lines |
59-
| Script test result | EXIT 0, 12s, 5 steps, fixed get-security-control-definitions call |
60-
| Issues encountered | None |
61-
| Iterations | v1 |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 109-aws-securityhub-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 120-aws-sts-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/120-aws-sts-gs/aws-sts-gs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
WORK_DIR=$(mktemp -d)
33
LOG_FILE="$WORK_DIR/sts-$(date +%Y%m%d-%H%M%S).log"
44
exec > >(tee -a "$LOG_FILE") 2>&1
5-
REGION=${AWS_DEFAULT_REGION:-$(aws configure get region 2>/dev/null)}
5+
REGION=${AWS_DEFAULT_REGION:-${AWS_REGION:-$(aws configure get region 2>/dev/null))}
66
[ -z "$REGION" ] && echo "ERROR: No region" && exit 1
77
export AWS_DEFAULT_REGION="$REGION"
88
echo "Region: $REGION"
9-
RANDOM_ID=$(openssl rand -hex 4)
9+
RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
1010
ROLE_NAME="sts-tut-role-${RANDOM_ID}"
1111
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }
1212
trap 'handle_error $LINENO' ERR

0 commit comments

Comments
 (0)