id: aws-code-env info: name: AWS Cloud Environment Validation author: princechaddha severity: info description: | Checks if AWS CLI is set up and all necessary tools are installed on the environment. reference: - https://aws.amazon.com/cli/ metadata: max-request: 2 tags: cloud,devops,aws,amazone,aws-cloud-config variables: region: "us-east-1" flow: code(1) && code(2) self-contained: true code: - engine: - sh - bash source: | aws sts get-caller-identity --output json matchers: - type: word internal: true words: - '"UserId"' extractors: - type: json name: account internal: true json: - '.Account' - engine: - sh - bash source: | jq --version >/dev/null 2>&1 && echo "jq is installed." || echo "jq is not installed." matchers: - type: word words: - "jq is installed" extractors: - type: dsl dsl: - '"AWS CLI is properly configured for account \"" + account + "\" and all the necessary tools required are installed"' # digest: 4b0a00483046022100c79a6583acb05a00dfa742962972031f8c42ae9ce85aabc1c9edb1ae7ebd9368022100b98762cb406a952a4115e28bb639f0d16d02e0b737012da638e3bf3f5d73f5f5:922c64590222798bb761d5b6d8e72950