@codyswann/lisa 4.79.1 → 4.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all/copy-overwrite/scripts/lisa-gates.mjs +101 -34
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +1 -1
- package/dist/cli/doctor-skip-jobs-migration.d.ts.map +1 -1
- package/dist/cli/doctor-skip-jobs-migration.js +9 -0
- package/dist/cli/doctor-skip-jobs-migration.js.map +1 -1
- package/dist/cli/ui-ci-quality-jobs-compute.d.ts.map +1 -1
- package/dist/cli/ui-ci-quality-jobs-compute.js +48 -13
- package/dist/cli/ui-ci-quality-jobs-compute.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +14 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +12 -7
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/plugins/lisa/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa-agy/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa-agy/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa-copilot/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa-copilot/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa-cursor/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa-cursor/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa-devin/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa-devin/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/src/base/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/src/base/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/scripts/check-required-check-promotions.mjs +110 -3
- package/scripts/two-channel-couplings.json +1 -1
package/package.json
CHANGED
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"qs": "^6.16.0"
|
|
190
190
|
},
|
|
191
191
|
"name": "@codyswann/lisa",
|
|
192
|
-
"version": "4.
|
|
192
|
+
"version": "4.80.0",
|
|
193
193
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
194
194
|
"main": "dist/index.js",
|
|
195
195
|
"exports": {
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"test": "tests"
|
|
346
346
|
},
|
|
347
347
|
"types": "./dist/index.d.ts",
|
|
348
|
-
"lisaReleaseCommit": "
|
|
349
|
-
"gitHead": "
|
|
350
|
-
"lisaReleaseTag": "v4.
|
|
348
|
+
"lisaReleaseCommit": "756a01cb990889569814d47c5f250926622abdce",
|
|
349
|
+
"gitHead": "756a01cb990889569814d47c5f250926622abdce",
|
|
350
|
+
"lisaReleaseTag": "v4.80.0"
|
|
351
351
|
}
|
|
@@ -55,8 +55,13 @@ two bundles declaring the same stages overwrite each other in the shared
|
|
|
55
55
|
malformed. The name is the only place the owner can be recorded.
|
|
56
56
|
|
|
57
57
|
`default` cannot be namespaced. The script claims it only when nothing else
|
|
58
|
-
owns it
|
|
59
|
-
|
|
58
|
+
owns it. Otherwise it still writes every named profile and verifies them as a
|
|
59
|
+
normal run would (the default stage, or every stage under
|
|
60
|
+
`LISA_AWS_VERIFY_ALL_PROFILES=1`), leaves `[default]` untouched, and exits
|
|
61
|
+
non-zero naming the current owner and the named profiles to use instead (for example `AWS_PROFILE=<project>-agent-dev`);
|
|
62
|
+
`LISA_AWS_CLAIM_DEFAULT_PROFILE=1` takes `[default]` over deliberately. When the
|
|
63
|
+
owner is long-lived keys under `[default]` in `~/.aws/credentials`, the message
|
|
64
|
+
also says that claiming would not remove them.
|
|
60
65
|
|
|
61
66
|
Readiness is an account check, not a liveness check. `sts:GetCallerIdentity`
|
|
62
67
|
succeeding proves the credentials work, not that they reached the intended
|
|
@@ -335,9 +335,11 @@ a name carrying the owner prevents it.
|
|
|
335
335
|
|
|
336
336
|
\`default\` is the one name that cannot be namespaced. The setup script writes
|
|
337
337
|
it for this project only when nothing else already owns it; if another Lisa
|
|
338
|
-
project or the operator's own configuration holds it, the script
|
|
339
|
-
|
|
340
|
-
\`
|
|
338
|
+
project or the operator's own configuration holds it, the script still writes
|
|
339
|
+
every named profile and verifies them as a normal run would, leaves
|
|
340
|
+
\`[default]\` untouched, and exits non-zero saying so rather than repointing
|
|
341
|
+
every unqualified \`aws\` command. Use the named profiles it lists, or pass
|
|
342
|
+
\`LISA_AWS_CLAIM_DEFAULT_PROFILE=1\` to take \`[default]\` over deliberately.
|
|
341
343
|
|
|
342
344
|
Production and shared profiles are observer-only. Production repair remains a
|
|
343
345
|
human-driven local-workstation operation.
|
|
@@ -598,12 +598,22 @@ if [ -n "$legacy_sections" ]; then
|
|
|
598
598
|
fi
|
|
599
599
|
fi
|
|
600
600
|
|
|
601
|
+
# Decided here, enforced at the end. Refusing `[default]` must not also refuse
|
|
602
|
+
# the named profiles: they are namespaced, carry no collision risk, and are the
|
|
603
|
+
# remedy the refusal points the operator at. Refusing before writing them told
|
|
604
|
+
# the operator to use profiles that did not exist, leaving the takeover override
|
|
605
|
+
# as the only real path — the outcome this guard exists to discourage. So every
|
|
606
|
+
# named profile is written and verified first, `[default]` alone is left
|
|
607
|
+
# untouched, and the run still exits non-zero: what the operator asked for
|
|
608
|
+
# (a ready workstation with this project's default) did not happen, and a
|
|
609
|
+
# caller that continued on success would run unqualified `aws` commands in the
|
|
610
|
+
# operator's account believing they reached this project's.
|
|
601
611
|
default_owner="$(default_profile_owner)"
|
|
612
|
+
claim_default=1
|
|
602
613
|
case "$default_owner" in
|
|
603
614
|
ours | legacy | unclaimed) ;;
|
|
604
615
|
*)
|
|
605
|
-
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] ||
|
|
606
|
-
"refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. Use the named profiles instead (${profile_names}), or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take it over deliberately."
|
|
616
|
+
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] || claim_default=0
|
|
607
617
|
;;
|
|
608
618
|
esac
|
|
609
619
|
|
|
@@ -629,11 +639,13 @@ while IFS="$(printf '\t')" read -r stage role_arn region; do
|
|
|
629
639
|
done < <(printf '%s' "$profiles_json" | jq -r 'to_entries[] | [.key, .value.roleArn, .value.region] | @tsv')
|
|
630
640
|
|
|
631
641
|
default_profile="${PROFILE_NAMESPACE}-agent-${default_stage}"
|
|
632
|
-
|
|
633
|
-
aws configure set
|
|
634
|
-
aws configure set
|
|
635
|
-
aws configure set
|
|
636
|
-
aws configure set
|
|
642
|
+
if [ "$claim_default" = "1" ]; then
|
|
643
|
+
aws configure set role_arn "$default_role_arn" --profile default
|
|
644
|
+
aws configure set source_profile "$BOOTSTRAP_PROFILE" --profile default
|
|
645
|
+
aws configure set external_id "$external_id" --profile default
|
|
646
|
+
aws configure set role_session_name "$session_name" --profile default
|
|
647
|
+
aws configure set region "$default_region" --profile default
|
|
648
|
+
fi
|
|
637
649
|
|
|
638
650
|
chmod 600 "$credentials_file" "$config_file"
|
|
639
651
|
|
|
@@ -674,4 +686,26 @@ if [ -n "$legacy_names" ]; then
|
|
|
674
686
|
fi
|
|
675
687
|
fi
|
|
676
688
|
|
|
689
|
+
if [ "$claim_default" = "0" ]; then
|
|
690
|
+
if [ "${LISA_AWS_SKIP_VERIFY:-0}" = "1" ]; then
|
|
691
|
+
named_state="were written but not verified (LISA_AWS_SKIP_VERIFY=1)"
|
|
692
|
+
elif [ "${LISA_AWS_VERIFY_ALL_PROFILES:-0}" = "1" ]; then
|
|
693
|
+
named_state="were written and verified"
|
|
694
|
+
else
|
|
695
|
+
# Only the default stage's account is proved without VERIFY_ALL, so the
|
|
696
|
+
# message names exactly that one rather than vouching for all of them.
|
|
697
|
+
named_state="were written; ${default_profile} was verified (set LISA_AWS_VERIFY_ALL_PROFILES=1 to verify every one)"
|
|
698
|
+
fi
|
|
699
|
+
# The trap the override walks into when `[default]` is static keys rather
|
|
700
|
+
# than a config-side profile: claiming rewrites only the config file, so the
|
|
701
|
+
# keys stay, and `[default]` ends up holding a role and an unrelated account's
|
|
702
|
+
# keys at once. Which wins depends on each tool's credential precedence. The
|
|
703
|
+
# key material itself is never echoed.
|
|
704
|
+
static_keys_note=""
|
|
705
|
+
if [ -n "$(profile_setting_value "$credentials_file" "default" "aws_access_key_id")" ]; then
|
|
706
|
+
static_keys_note=" Note: ${credentials_file} holds long-lived access keys under [default]. Claiming rewrites only ${config_file} and does not remove them, so [default] would carry both this project's role and those keys, and which one a tool uses depends on its credential precedence."
|
|
707
|
+
fi
|
|
708
|
+
fail "refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. [default] was left untouched; this project's named profiles ${named_state} (${profile_names}). Use them instead, for example AWS_PROFILE=${default_profile} or --profile ${default_profile}, or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take [default] over deliberately.${static_keys_note}"
|
|
709
|
+
fi
|
|
710
|
+
|
|
677
711
|
echo "remote-agent-aws-setup: ready (${session_name}; namespace=${PROFILE_NAMESPACE} via ${namespace_source}; default=${default_profile} in account ${default_expected_account}; profiles=${profile_names})"
|
|
@@ -53,8 +53,13 @@ two bundles declaring the same stages overwrite each other in the shared
|
|
|
53
53
|
malformed. The name is the only place the owner can be recorded.
|
|
54
54
|
|
|
55
55
|
`default` cannot be namespaced. The script claims it only when nothing else
|
|
56
|
-
owns it
|
|
57
|
-
|
|
56
|
+
owns it. Otherwise it still writes every named profile and verifies them as a
|
|
57
|
+
normal run would (the default stage, or every stage under
|
|
58
|
+
`LISA_AWS_VERIFY_ALL_PROFILES=1`), leaves `[default]` untouched, and exits
|
|
59
|
+
non-zero naming the current owner and the named profiles to use instead (for example `AWS_PROFILE=<project>-agent-dev`);
|
|
60
|
+
`LISA_AWS_CLAIM_DEFAULT_PROFILE=1` takes `[default]` over deliberately. When the
|
|
61
|
+
owner is long-lived keys under `[default]` in `~/.aws/credentials`, the message
|
|
62
|
+
also says that claiming would not remove them.
|
|
58
63
|
|
|
59
64
|
Readiness is an account check, not a liveness check. `sts:GetCallerIdentity`
|
|
60
65
|
succeeding proves the credentials work, not that they reached the intended
|
|
@@ -335,9 +335,11 @@ a name carrying the owner prevents it.
|
|
|
335
335
|
|
|
336
336
|
\`default\` is the one name that cannot be namespaced. The setup script writes
|
|
337
337
|
it for this project only when nothing else already owns it; if another Lisa
|
|
338
|
-
project or the operator's own configuration holds it, the script
|
|
339
|
-
|
|
340
|
-
\`
|
|
338
|
+
project or the operator's own configuration holds it, the script still writes
|
|
339
|
+
every named profile and verifies them as a normal run would, leaves
|
|
340
|
+
\`[default]\` untouched, and exits non-zero saying so rather than repointing
|
|
341
|
+
every unqualified \`aws\` command. Use the named profiles it lists, or pass
|
|
342
|
+
\`LISA_AWS_CLAIM_DEFAULT_PROFILE=1\` to take \`[default]\` over deliberately.
|
|
341
343
|
|
|
342
344
|
Production and shared profiles are observer-only. Production repair remains a
|
|
343
345
|
human-driven local-workstation operation.
|
|
@@ -598,12 +598,22 @@ if [ -n "$legacy_sections" ]; then
|
|
|
598
598
|
fi
|
|
599
599
|
fi
|
|
600
600
|
|
|
601
|
+
# Decided here, enforced at the end. Refusing `[default]` must not also refuse
|
|
602
|
+
# the named profiles: they are namespaced, carry no collision risk, and are the
|
|
603
|
+
# remedy the refusal points the operator at. Refusing before writing them told
|
|
604
|
+
# the operator to use profiles that did not exist, leaving the takeover override
|
|
605
|
+
# as the only real path — the outcome this guard exists to discourage. So every
|
|
606
|
+
# named profile is written and verified first, `[default]` alone is left
|
|
607
|
+
# untouched, and the run still exits non-zero: what the operator asked for
|
|
608
|
+
# (a ready workstation with this project's default) did not happen, and a
|
|
609
|
+
# caller that continued on success would run unqualified `aws` commands in the
|
|
610
|
+
# operator's account believing they reached this project's.
|
|
601
611
|
default_owner="$(default_profile_owner)"
|
|
612
|
+
claim_default=1
|
|
602
613
|
case "$default_owner" in
|
|
603
614
|
ours | legacy | unclaimed) ;;
|
|
604
615
|
*)
|
|
605
|
-
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] ||
|
|
606
|
-
"refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. Use the named profiles instead (${profile_names}), or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take it over deliberately."
|
|
616
|
+
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] || claim_default=0
|
|
607
617
|
;;
|
|
608
618
|
esac
|
|
609
619
|
|
|
@@ -629,11 +639,13 @@ while IFS="$(printf '\t')" read -r stage role_arn region; do
|
|
|
629
639
|
done < <(printf '%s' "$profiles_json" | jq -r 'to_entries[] | [.key, .value.roleArn, .value.region] | @tsv')
|
|
630
640
|
|
|
631
641
|
default_profile="${PROFILE_NAMESPACE}-agent-${default_stage}"
|
|
632
|
-
|
|
633
|
-
aws configure set
|
|
634
|
-
aws configure set
|
|
635
|
-
aws configure set
|
|
636
|
-
aws configure set
|
|
642
|
+
if [ "$claim_default" = "1" ]; then
|
|
643
|
+
aws configure set role_arn "$default_role_arn" --profile default
|
|
644
|
+
aws configure set source_profile "$BOOTSTRAP_PROFILE" --profile default
|
|
645
|
+
aws configure set external_id "$external_id" --profile default
|
|
646
|
+
aws configure set role_session_name "$session_name" --profile default
|
|
647
|
+
aws configure set region "$default_region" --profile default
|
|
648
|
+
fi
|
|
637
649
|
|
|
638
650
|
chmod 600 "$credentials_file" "$config_file"
|
|
639
651
|
|
|
@@ -674,4 +686,26 @@ if [ -n "$legacy_names" ]; then
|
|
|
674
686
|
fi
|
|
675
687
|
fi
|
|
676
688
|
|
|
689
|
+
if [ "$claim_default" = "0" ]; then
|
|
690
|
+
if [ "${LISA_AWS_SKIP_VERIFY:-0}" = "1" ]; then
|
|
691
|
+
named_state="were written but not verified (LISA_AWS_SKIP_VERIFY=1)"
|
|
692
|
+
elif [ "${LISA_AWS_VERIFY_ALL_PROFILES:-0}" = "1" ]; then
|
|
693
|
+
named_state="were written and verified"
|
|
694
|
+
else
|
|
695
|
+
# Only the default stage's account is proved without VERIFY_ALL, so the
|
|
696
|
+
# message names exactly that one rather than vouching for all of them.
|
|
697
|
+
named_state="were written; ${default_profile} was verified (set LISA_AWS_VERIFY_ALL_PROFILES=1 to verify every one)"
|
|
698
|
+
fi
|
|
699
|
+
# The trap the override walks into when `[default]` is static keys rather
|
|
700
|
+
# than a config-side profile: claiming rewrites only the config file, so the
|
|
701
|
+
# keys stay, and `[default]` ends up holding a role and an unrelated account's
|
|
702
|
+
# keys at once. Which wins depends on each tool's credential precedence. The
|
|
703
|
+
# key material itself is never echoed.
|
|
704
|
+
static_keys_note=""
|
|
705
|
+
if [ -n "$(profile_setting_value "$credentials_file" "default" "aws_access_key_id")" ]; then
|
|
706
|
+
static_keys_note=" Note: ${credentials_file} holds long-lived access keys under [default]. Claiming rewrites only ${config_file} and does not remove them, so [default] would carry both this project's role and those keys, and which one a tool uses depends on its credential precedence."
|
|
707
|
+
fi
|
|
708
|
+
fail "refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. [default] was left untouched; this project's named profiles ${named_state} (${profile_names}). Use them instead, for example AWS_PROFILE=${default_profile} or --profile ${default_profile}, or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take [default] over deliberately.${static_keys_note}"
|
|
709
|
+
fi
|
|
710
|
+
|
|
677
711
|
echo "remote-agent-aws-setup: ready (${session_name}; namespace=${PROFILE_NAMESPACE} via ${namespace_source}; default=${default_profile} in account ${default_expected_account}; profiles=${profile_names})"
|
|
@@ -53,8 +53,13 @@ two bundles declaring the same stages overwrite each other in the shared
|
|
|
53
53
|
malformed. The name is the only place the owner can be recorded.
|
|
54
54
|
|
|
55
55
|
`default` cannot be namespaced. The script claims it only when nothing else
|
|
56
|
-
owns it
|
|
57
|
-
|
|
56
|
+
owns it. Otherwise it still writes every named profile and verifies them as a
|
|
57
|
+
normal run would (the default stage, or every stage under
|
|
58
|
+
`LISA_AWS_VERIFY_ALL_PROFILES=1`), leaves `[default]` untouched, and exits
|
|
59
|
+
non-zero naming the current owner and the named profiles to use instead (for example `AWS_PROFILE=<project>-agent-dev`);
|
|
60
|
+
`LISA_AWS_CLAIM_DEFAULT_PROFILE=1` takes `[default]` over deliberately. When the
|
|
61
|
+
owner is long-lived keys under `[default]` in `~/.aws/credentials`, the message
|
|
62
|
+
also says that claiming would not remove them.
|
|
58
63
|
|
|
59
64
|
Readiness is an account check, not a liveness check. `sts:GetCallerIdentity`
|
|
60
65
|
succeeding proves the credentials work, not that they reached the intended
|
|
@@ -335,9 +335,11 @@ a name carrying the owner prevents it.
|
|
|
335
335
|
|
|
336
336
|
\`default\` is the one name that cannot be namespaced. The setup script writes
|
|
337
337
|
it for this project only when nothing else already owns it; if another Lisa
|
|
338
|
-
project or the operator's own configuration holds it, the script
|
|
339
|
-
|
|
340
|
-
\`
|
|
338
|
+
project or the operator's own configuration holds it, the script still writes
|
|
339
|
+
every named profile and verifies them as a normal run would, leaves
|
|
340
|
+
\`[default]\` untouched, and exits non-zero saying so rather than repointing
|
|
341
|
+
every unqualified \`aws\` command. Use the named profiles it lists, or pass
|
|
342
|
+
\`LISA_AWS_CLAIM_DEFAULT_PROFILE=1\` to take \`[default]\` over deliberately.
|
|
341
343
|
|
|
342
344
|
Production and shared profiles are observer-only. Production repair remains a
|
|
343
345
|
human-driven local-workstation operation.
|
|
@@ -598,12 +598,22 @@ if [ -n "$legacy_sections" ]; then
|
|
|
598
598
|
fi
|
|
599
599
|
fi
|
|
600
600
|
|
|
601
|
+
# Decided here, enforced at the end. Refusing `[default]` must not also refuse
|
|
602
|
+
# the named profiles: they are namespaced, carry no collision risk, and are the
|
|
603
|
+
# remedy the refusal points the operator at. Refusing before writing them told
|
|
604
|
+
# the operator to use profiles that did not exist, leaving the takeover override
|
|
605
|
+
# as the only real path — the outcome this guard exists to discourage. So every
|
|
606
|
+
# named profile is written and verified first, `[default]` alone is left
|
|
607
|
+
# untouched, and the run still exits non-zero: what the operator asked for
|
|
608
|
+
# (a ready workstation with this project's default) did not happen, and a
|
|
609
|
+
# caller that continued on success would run unqualified `aws` commands in the
|
|
610
|
+
# operator's account believing they reached this project's.
|
|
601
611
|
default_owner="$(default_profile_owner)"
|
|
612
|
+
claim_default=1
|
|
602
613
|
case "$default_owner" in
|
|
603
614
|
ours | legacy | unclaimed) ;;
|
|
604
615
|
*)
|
|
605
|
-
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] ||
|
|
606
|
-
"refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. Use the named profiles instead (${profile_names}), or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take it over deliberately."
|
|
616
|
+
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] || claim_default=0
|
|
607
617
|
;;
|
|
608
618
|
esac
|
|
609
619
|
|
|
@@ -629,11 +639,13 @@ while IFS="$(printf '\t')" read -r stage role_arn region; do
|
|
|
629
639
|
done < <(printf '%s' "$profiles_json" | jq -r 'to_entries[] | [.key, .value.roleArn, .value.region] | @tsv')
|
|
630
640
|
|
|
631
641
|
default_profile="${PROFILE_NAMESPACE}-agent-${default_stage}"
|
|
632
|
-
|
|
633
|
-
aws configure set
|
|
634
|
-
aws configure set
|
|
635
|
-
aws configure set
|
|
636
|
-
aws configure set
|
|
642
|
+
if [ "$claim_default" = "1" ]; then
|
|
643
|
+
aws configure set role_arn "$default_role_arn" --profile default
|
|
644
|
+
aws configure set source_profile "$BOOTSTRAP_PROFILE" --profile default
|
|
645
|
+
aws configure set external_id "$external_id" --profile default
|
|
646
|
+
aws configure set role_session_name "$session_name" --profile default
|
|
647
|
+
aws configure set region "$default_region" --profile default
|
|
648
|
+
fi
|
|
637
649
|
|
|
638
650
|
chmod 600 "$credentials_file" "$config_file"
|
|
639
651
|
|
|
@@ -674,4 +686,26 @@ if [ -n "$legacy_names" ]; then
|
|
|
674
686
|
fi
|
|
675
687
|
fi
|
|
676
688
|
|
|
689
|
+
if [ "$claim_default" = "0" ]; then
|
|
690
|
+
if [ "${LISA_AWS_SKIP_VERIFY:-0}" = "1" ]; then
|
|
691
|
+
named_state="were written but not verified (LISA_AWS_SKIP_VERIFY=1)"
|
|
692
|
+
elif [ "${LISA_AWS_VERIFY_ALL_PROFILES:-0}" = "1" ]; then
|
|
693
|
+
named_state="were written and verified"
|
|
694
|
+
else
|
|
695
|
+
# Only the default stage's account is proved without VERIFY_ALL, so the
|
|
696
|
+
# message names exactly that one rather than vouching for all of them.
|
|
697
|
+
named_state="were written; ${default_profile} was verified (set LISA_AWS_VERIFY_ALL_PROFILES=1 to verify every one)"
|
|
698
|
+
fi
|
|
699
|
+
# The trap the override walks into when `[default]` is static keys rather
|
|
700
|
+
# than a config-side profile: claiming rewrites only the config file, so the
|
|
701
|
+
# keys stay, and `[default]` ends up holding a role and an unrelated account's
|
|
702
|
+
# keys at once. Which wins depends on each tool's credential precedence. The
|
|
703
|
+
# key material itself is never echoed.
|
|
704
|
+
static_keys_note=""
|
|
705
|
+
if [ -n "$(profile_setting_value "$credentials_file" "default" "aws_access_key_id")" ]; then
|
|
706
|
+
static_keys_note=" Note: ${credentials_file} holds long-lived access keys under [default]. Claiming rewrites only ${config_file} and does not remove them, so [default] would carry both this project's role and those keys, and which one a tool uses depends on its credential precedence."
|
|
707
|
+
fi
|
|
708
|
+
fail "refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. [default] was left untouched; this project's named profiles ${named_state} (${profile_names}). Use them instead, for example AWS_PROFILE=${default_profile} or --profile ${default_profile}, or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take [default] over deliberately.${static_keys_note}"
|
|
709
|
+
fi
|
|
710
|
+
|
|
677
711
|
echo "remote-agent-aws-setup: ready (${session_name}; namespace=${PROFILE_NAMESPACE} via ${namespace_source}; default=${default_profile} in account ${default_expected_account}; profiles=${profile_names})"
|
|
@@ -53,8 +53,13 @@ two bundles declaring the same stages overwrite each other in the shared
|
|
|
53
53
|
malformed. The name is the only place the owner can be recorded.
|
|
54
54
|
|
|
55
55
|
`default` cannot be namespaced. The script claims it only when nothing else
|
|
56
|
-
owns it
|
|
57
|
-
|
|
56
|
+
owns it. Otherwise it still writes every named profile and verifies them as a
|
|
57
|
+
normal run would (the default stage, or every stage under
|
|
58
|
+
`LISA_AWS_VERIFY_ALL_PROFILES=1`), leaves `[default]` untouched, and exits
|
|
59
|
+
non-zero naming the current owner and the named profiles to use instead (for example `AWS_PROFILE=<project>-agent-dev`);
|
|
60
|
+
`LISA_AWS_CLAIM_DEFAULT_PROFILE=1` takes `[default]` over deliberately. When the
|
|
61
|
+
owner is long-lived keys under `[default]` in `~/.aws/credentials`, the message
|
|
62
|
+
also says that claiming would not remove them.
|
|
58
63
|
|
|
59
64
|
Readiness is an account check, not a liveness check. `sts:GetCallerIdentity`
|
|
60
65
|
succeeding proves the credentials work, not that they reached the intended
|
|
@@ -335,9 +335,11 @@ a name carrying the owner prevents it.
|
|
|
335
335
|
|
|
336
336
|
\`default\` is the one name that cannot be namespaced. The setup script writes
|
|
337
337
|
it for this project only when nothing else already owns it; if another Lisa
|
|
338
|
-
project or the operator's own configuration holds it, the script
|
|
339
|
-
|
|
340
|
-
\`
|
|
338
|
+
project or the operator's own configuration holds it, the script still writes
|
|
339
|
+
every named profile and verifies them as a normal run would, leaves
|
|
340
|
+
\`[default]\` untouched, and exits non-zero saying so rather than repointing
|
|
341
|
+
every unqualified \`aws\` command. Use the named profiles it lists, or pass
|
|
342
|
+
\`LISA_AWS_CLAIM_DEFAULT_PROFILE=1\` to take \`[default]\` over deliberately.
|
|
341
343
|
|
|
342
344
|
Production and shared profiles are observer-only. Production repair remains a
|
|
343
345
|
human-driven local-workstation operation.
|
|
@@ -598,12 +598,22 @@ if [ -n "$legacy_sections" ]; then
|
|
|
598
598
|
fi
|
|
599
599
|
fi
|
|
600
600
|
|
|
601
|
+
# Decided here, enforced at the end. Refusing `[default]` must not also refuse
|
|
602
|
+
# the named profiles: they are namespaced, carry no collision risk, and are the
|
|
603
|
+
# remedy the refusal points the operator at. Refusing before writing them told
|
|
604
|
+
# the operator to use profiles that did not exist, leaving the takeover override
|
|
605
|
+
# as the only real path — the outcome this guard exists to discourage. So every
|
|
606
|
+
# named profile is written and verified first, `[default]` alone is left
|
|
607
|
+
# untouched, and the run still exits non-zero: what the operator asked for
|
|
608
|
+
# (a ready workstation with this project's default) did not happen, and a
|
|
609
|
+
# caller that continued on success would run unqualified `aws` commands in the
|
|
610
|
+
# operator's account believing they reached this project's.
|
|
601
611
|
default_owner="$(default_profile_owner)"
|
|
612
|
+
claim_default=1
|
|
602
613
|
case "$default_owner" in
|
|
603
614
|
ours | legacy | unclaimed) ;;
|
|
604
615
|
*)
|
|
605
|
-
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] ||
|
|
606
|
-
"refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. Use the named profiles instead (${profile_names}), or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take it over deliberately."
|
|
616
|
+
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] || claim_default=0
|
|
607
617
|
;;
|
|
608
618
|
esac
|
|
609
619
|
|
|
@@ -629,11 +639,13 @@ while IFS="$(printf '\t')" read -r stage role_arn region; do
|
|
|
629
639
|
done < <(printf '%s' "$profiles_json" | jq -r 'to_entries[] | [.key, .value.roleArn, .value.region] | @tsv')
|
|
630
640
|
|
|
631
641
|
default_profile="${PROFILE_NAMESPACE}-agent-${default_stage}"
|
|
632
|
-
|
|
633
|
-
aws configure set
|
|
634
|
-
aws configure set
|
|
635
|
-
aws configure set
|
|
636
|
-
aws configure set
|
|
642
|
+
if [ "$claim_default" = "1" ]; then
|
|
643
|
+
aws configure set role_arn "$default_role_arn" --profile default
|
|
644
|
+
aws configure set source_profile "$BOOTSTRAP_PROFILE" --profile default
|
|
645
|
+
aws configure set external_id "$external_id" --profile default
|
|
646
|
+
aws configure set role_session_name "$session_name" --profile default
|
|
647
|
+
aws configure set region "$default_region" --profile default
|
|
648
|
+
fi
|
|
637
649
|
|
|
638
650
|
chmod 600 "$credentials_file" "$config_file"
|
|
639
651
|
|
|
@@ -674,4 +686,26 @@ if [ -n "$legacy_names" ]; then
|
|
|
674
686
|
fi
|
|
675
687
|
fi
|
|
676
688
|
|
|
689
|
+
if [ "$claim_default" = "0" ]; then
|
|
690
|
+
if [ "${LISA_AWS_SKIP_VERIFY:-0}" = "1" ]; then
|
|
691
|
+
named_state="were written but not verified (LISA_AWS_SKIP_VERIFY=1)"
|
|
692
|
+
elif [ "${LISA_AWS_VERIFY_ALL_PROFILES:-0}" = "1" ]; then
|
|
693
|
+
named_state="were written and verified"
|
|
694
|
+
else
|
|
695
|
+
# Only the default stage's account is proved without VERIFY_ALL, so the
|
|
696
|
+
# message names exactly that one rather than vouching for all of them.
|
|
697
|
+
named_state="were written; ${default_profile} was verified (set LISA_AWS_VERIFY_ALL_PROFILES=1 to verify every one)"
|
|
698
|
+
fi
|
|
699
|
+
# The trap the override walks into when `[default]` is static keys rather
|
|
700
|
+
# than a config-side profile: claiming rewrites only the config file, so the
|
|
701
|
+
# keys stay, and `[default]` ends up holding a role and an unrelated account's
|
|
702
|
+
# keys at once. Which wins depends on each tool's credential precedence. The
|
|
703
|
+
# key material itself is never echoed.
|
|
704
|
+
static_keys_note=""
|
|
705
|
+
if [ -n "$(profile_setting_value "$credentials_file" "default" "aws_access_key_id")" ]; then
|
|
706
|
+
static_keys_note=" Note: ${credentials_file} holds long-lived access keys under [default]. Claiming rewrites only ${config_file} and does not remove them, so [default] would carry both this project's role and those keys, and which one a tool uses depends on its credential precedence."
|
|
707
|
+
fi
|
|
708
|
+
fail "refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. [default] was left untouched; this project's named profiles ${named_state} (${profile_names}). Use them instead, for example AWS_PROFILE=${default_profile} or --profile ${default_profile}, or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take [default] over deliberately.${static_keys_note}"
|
|
709
|
+
fi
|
|
710
|
+
|
|
677
711
|
echo "remote-agent-aws-setup: ready (${session_name}; namespace=${PROFILE_NAMESPACE} via ${namespace_source}; default=${default_profile} in account ${default_expected_account}; profiles=${profile_names})"
|
|
@@ -53,8 +53,13 @@ two bundles declaring the same stages overwrite each other in the shared
|
|
|
53
53
|
malformed. The name is the only place the owner can be recorded.
|
|
54
54
|
|
|
55
55
|
`default` cannot be namespaced. The script claims it only when nothing else
|
|
56
|
-
owns it
|
|
57
|
-
|
|
56
|
+
owns it. Otherwise it still writes every named profile and verifies them as a
|
|
57
|
+
normal run would (the default stage, or every stage under
|
|
58
|
+
`LISA_AWS_VERIFY_ALL_PROFILES=1`), leaves `[default]` untouched, and exits
|
|
59
|
+
non-zero naming the current owner and the named profiles to use instead (for example `AWS_PROFILE=<project>-agent-dev`);
|
|
60
|
+
`LISA_AWS_CLAIM_DEFAULT_PROFILE=1` takes `[default]` over deliberately. When the
|
|
61
|
+
owner is long-lived keys under `[default]` in `~/.aws/credentials`, the message
|
|
62
|
+
also says that claiming would not remove them.
|
|
58
63
|
|
|
59
64
|
Readiness is an account check, not a liveness check. `sts:GetCallerIdentity`
|
|
60
65
|
succeeding proves the credentials work, not that they reached the intended
|
|
@@ -335,9 +335,11 @@ a name carrying the owner prevents it.
|
|
|
335
335
|
|
|
336
336
|
\`default\` is the one name that cannot be namespaced. The setup script writes
|
|
337
337
|
it for this project only when nothing else already owns it; if another Lisa
|
|
338
|
-
project or the operator's own configuration holds it, the script
|
|
339
|
-
|
|
340
|
-
\`
|
|
338
|
+
project or the operator's own configuration holds it, the script still writes
|
|
339
|
+
every named profile and verifies them as a normal run would, leaves
|
|
340
|
+
\`[default]\` untouched, and exits non-zero saying so rather than repointing
|
|
341
|
+
every unqualified \`aws\` command. Use the named profiles it lists, or pass
|
|
342
|
+
\`LISA_AWS_CLAIM_DEFAULT_PROFILE=1\` to take \`[default]\` over deliberately.
|
|
341
343
|
|
|
342
344
|
Production and shared profiles are observer-only. Production repair remains a
|
|
343
345
|
human-driven local-workstation operation.
|