{"id":13602640,"url":"https://github.com/tobilg/lsh","last_synced_at":"2025-09-09T08:49:37.887Z","repository":{"id":61925216,"uuid":"193321675","full_name":"tobilg/lsh","owner":"tobilg","description":"Run interactive shell commands on AWS Lambda","archived":false,"fork":false,"pushed_at":"2022-10-23T15:03:12.000Z","size":80,"stargazers_count":151,"open_issues_count":0,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-24T23:04:22.215Z","etag":null,"topics":["aws","aws-lambda","interactive","shell"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tobilg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-23T08:00:44.000Z","updated_at":"2025-06-06T18:14:27.000Z","dependencies_parsed_at":"2022-10-23T16:45:17.852Z","dependency_job_id":null,"html_url":"https://github.com/tobilg/lsh","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tobilg/lsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Flsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Flsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Flsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Flsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobilg","download_url":"https://codeload.github.com/tobilg/lsh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Flsh/sbom","scorecard":{"id":890914,"data":{"date":"2025-08-11","repo":{"name":"github.com/tobilg/lsh","commit":"6375f6b5b44f544e2cae0215abbfd89f900861e4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T11:48:16.159Z","repository_id":61925216,"created_at":"2025-08-24T11:48:16.159Z","updated_at":"2025-08-24T11:48:16.159Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274268373,"owners_count":25253390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","interactive","shell"],"created_at":"2024-08-01T18:01:32.414Z","updated_at":"2025-09-09T08:49:37.844Z","avatar_url":"https://github.com/tobilg.png","language":"JavaScript","funding_links":[],"categories":["Other Awesome Lists","aws"],"sub_categories":["General Utilities"],"readme":"# lsh - The Lambda shell\n\nRun interactive shell commands on AWS Lambda\n\n[![asciicast](https://asciinema.org/a/3sXv75GuyT3BA79fuLyvJSaa3.svg)](https://asciinema.org/a/3sXv75GuyT3BA79fuLyvJSaa3?autoplay=1\u0026t=0)\n\n## Motivation\n\nThe main motivation for this project was to have a convenient way to\n\n* \"Poke around\" the AWS Lambda environment\n* Be able to have a \"minimal\" shell environment on AWS, without having to use more costly EC2 instances\n* Do some experiments in the AWS Lambda environment, like running Docker containers via [udocker](https://github.com/indigo-dc/udocker)\n\n## Installation\n\nYou can install the Lambda shell (`lsh`) via\n\n```bash\n$ npm i -g lambda-shell\n```\n\n## Usage\n\nAfter the npm installation has finished, just run \n\n```bash\n$ lsh\n```\n\nYou can display the `help` like this:\n\n```text\nλ help\n\n  Commands:\n\n    help [command...]   Provides help for a given command.\n    exit                Exits application.\n    shell               Switch into interactive shell mode.\n    install [options]   Deploy the lsh stack in your AWS account.\n    uninstall           Remove the lsh stack from your AWS account.\n    version             Print version information.\n    config              Print the current Lambda configuration.\n    reset               Reset the current Lambda configuration to the defaults.\n```\n\n### Using credentials\n\nAs `lsh` uses the AWS SDK internally, the same options to specify credentials apply (please refer to the [AWS SDK documentation](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html)). E.g. if you have created a credential file with multiple profiles, and want to use a specific profile, you can use the `AWS_PROFILE` [environment variable](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html) like this:\n\n```bash\n$ AWS_PROFILE=myprofile lsh\n```\n\n### Install stack\n\nBefore you can use `lsh`, you need to install the neccessary stack by issueing the following command:\n\n```text\nλ install\n```\n\nYou can also specify options for the installation of the stack:\n\n```bash\nλ help install\n\n  Usage: install [options]\n\n  Deploy the lsh stack in your AWS account.\n\n  Options:\n\n    --help                                  output usage information\n    -b, --bucket \u003cbucketName\u003e               Name of the S3 bucket.\n    -r, --region \u003cregionName\u003e               Region to which the Lambda function shall be deployed to (default: us-east-1).\n    -m, --memory \u003cmemoryMegabytes\u003e          Amount of memory in meagabytes the Lambda function shall have available (default: 1536).\n    -t, --timeout \u003ctimeoutSeconds\u003e          Timeout in seconds of the Lambda function (default: 60).\n    -e, --efs-ap-arn \u003cefsAccessPointArn\u003e    The ARN of the preconfigured EFS AccessPoint.\n    -f, --efs-fs-arn \u003cefsFileSystemArn\u003e     The ARN of the preconfigured EFS FileSystem.\n    -p, --path \u003cefsMountPath\u003e               The absolute path where the EFS file system shall be mounted (needs to have /mnt/ prefix).\n    -s, --security-group \u003csecurityGroupId\u003e  The ID of the VPC SecurityGroup to use.\n    -n, --subnet \u003csubnetId\u003e                 The ID of the VPC Subnet to use.\n    -i, --iamRoleArn \u003ciamRoleArn\u003e           ARN of the IAM role to be used by the Lambda function. (default: role created by lsh)\n```\n\nFor example, to use a Lambda shell with 3GB of memory with a 900 seconds timeout in the `eu-central-1` region, use \n\n```text\nλ install -m 3076 -t 900 -r eu-central-1\n```\n\n#### Configuration updates\n\nYou can update the Lambda configuration just by running `install` again with different options. This will trigger a CloudFormation stack update. You can then verify the changes by using the `config` command.\n\n### Working with the interactive shell\n\nOnce you installed the stack, you can start working with `lsh`:\n\n```text\nλ shell\n ___       ________  ___  ___     \n|\\  \\     |\\   ____\\|\\  \\|\\  \\    \n\\ \\  \\    \\ \\  \\___|\\ \\  \\\\\\  \\   \n \\ \\  \\    \\ \\_____  \\ \\   __  \\  \n  \\ \\  \\____\\|____|\\  \\ \\  \\ \\  \\ \n   \\ \\_______\\____\\_\\  \\ \\__\\ \\__\\\n    \\|_______|\\_________\\|__|\\|__|\n             \\|_________|         \n                                  \n                                  \nWelcome to interactive mode.\nYou can now directly enter arbitrary shell commands. To exit, type `exit`.\nλ $ \n```\n\nNow, you can use the Lambda shell interactively, e.g. \n\n```text\nλ $ env\nAWS_LAMBDA_FUNCTION_VERSION=$LATEST\nAWS_LAMBDA_LOG_GROUP_NAME=/aws/lambda/lsh\nLAMBDA_TASK_ROOT=/var/task\nLD_LIBRARY_PATH=/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib\nAWS_LAMBDA_LOG_STREAM_NAME=2019/06/23/[$LATEST]0bbb2d3b763b4b92a1027dedf3cbd0e2\nAWS_EXECUTION_ENV=AWS_Lambda_nodejs8.10\nAWS_XRAY_DAEMON_ADDRESS=169.254.79.2:2000\nAWS_LAMBDA_FUNCTION_NAME=lsh\nPATH=/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin:/var/task\nAWS_DEFAULT_REGION=us-east-1\nPWD=/tmp\nLAMBDA_RUNTIME_DIR=/var/runtime\nLANG=en_US.UTF-8\nNODE_PATH=/opt/nodejs/node8/node_modules:/opt/nodejs/node_modules:/var/runtime/node_modules:/var/runtime:/var/task:/var/runtime/node_modules\nAWS_REGION=us-east-1\nTZ=:UTC\nSHLVL=1\n_AWS_XRAY_DAEMON_ADDRESS=169.254.79.2\n_AWS_XRAY_DAEMON_PORT=2000\n_X_AMZN_TRACE_ID=Root=1-5d0fa6a8-a0cb5800d19af40014ac8000;Parent=67cfd29878f54a87;Sampled=0\nAWS_XRAY_CONTEXT_MISSING=LOG_ERROR\n_HANDLER=index.handler\nAWS_LAMBDA_FUNCTION_MEMORY_SIZE=1536\n_=/usr/bin/env\n```\n\n**Hint**\n\nAs `lsh` is invoking the Lambda function via request-response, it's for example not possible to edit files directly in the Lambda environment.\n\n### Show current configuration\n\nTo check the current configuration, you can use \n\n```text\nλ config\n ✓ Memory     128mb\n ✓ Timeout    120s\n ✓ Region     us-east-1\n ✓ S3 Bucket  lsh-j03nfi7agsd\n```\n\nThe configuration can be changed by running `install` again and specifying different settings via the configuration options.\n\n### Reset configuration\n\nTo reset the current configuration to the defaults, you can use\n\n```bash\nλ reset\n ✓ Reset configuration to defaults\nλ config\n ✓ Memory     128mb\n ✓ Timeout    60s\n ✓ Region     us-east-1\n ✓ S3 Bucket  lsh-n45lrkvtabc\n```\n\n### Uninstall stack\n\nTo uninstall the created stack run the following command:\n\n```text\nλ uninstall\n```\n\n## Examples\n\n### Use EFS\n\nTo install `lsh` with EFS support, please create a EFS FileSystem and AccessPoint first, as outlined in [this AWS article](https://aws.amazon.com/blogs/compute/using-amazon-efs-for-aws-lambda-in-your-serverless-applications/). Additionally, you need to lookup your Subnet and SecurityGroup IDs you want to use.Then, you can use the ARNs of the FileSystem and AccessPoint to install `lsh` (use the appropriate values):\n\n```bash\nλ install -p /mnt/efs -e arn:aws:elasticfilesystem:us-east-1:111111111111:access-point/fsap-123456789abcdef -f arn:aws:elasticfilesystem:us-east-1:111111111111:file-system/fs-acbdef123 -n subnet-abcdef123 -s sg-abcdef123\n```\n\nThe installation can take a few minutes in this case. Once it's completed, you can use the mounted EFS FileSystem like this:\n\n```bash\nλ shell\n ___       ________  ___  ___     \n|\\  \\     |\\   ____\\|\\  \\|\\  \\    \n\\ \\  \\    \\ \\  \\___|\\ \\  \\\\\\  \\   \n \\ \\  \\    \\ \\_____  \\ \\   __  \\  \n  \\ \\  \\____\\|____|\\  \\ \\  \\ \\  \\ \n   \\ \\_______\\____\\_\\  \\ \\__\\ \\__\\\n    \\|_______|\\_________\\|__|\\|__|\n             \\|_________|         \n                                  \n                                  \nWelcome to the Lambda shell!\nYou can now directly enter shell commands which will be run in the Lambda environment. To exit, type `exit`.\nλ $ cd /mnt/efs\n\nλ $ pwd\n/mnt/efs\nλ $ echo \"test\" \u003e test.txt\n\nλ $ ls -la\ntotal 12\ndrwxrwxrwx 2 1000 1000 6144 Jul 25 12:10 .\ndrwxr-xr-x 3 root root 4096 Jul 25 12:10 ..\n-rw-rw-r-- 1 1000 1000    5 Jul 25 12:10 test.txt\nλ $ cat test.txt\ntest\nλ $ rm test.txt\n\nλ $ ls -la\ntotal 8\ndrwxrwxrwx 2 1000 1000 6144 Jul 25 12:17 .\ndrwxr-xr-x 3 root root 4096 Jul 25 12:10 ..\nλ $ \n```\n\n### Download aws-cli\n\n```bash\nλ shell \n ___       ________  ___  ___     \n|\\  \\     |\\   ____\\|\\  \\|\\  \\    \n\\ \\  \\    \\ \\  \\___|\\ \\  \\\\\\  \\   \n \\ \\  \\    \\ \\_____  \\ \\   __  \\  \n  \\ \\  \\____\\|____|\\  \\ \\  \\ \\  \\ \n   \\ \\_______\\____\\_\\  \\ \\__\\ \\__\\\n    \\|_______|\\_________\\|__|\\|__|\n             \\|_________|         \n                                  \n                                  \nWelcome to the Lambda shell!\nYou can now directly enter shell commands which will be run in the Lambda environment. To exit, type `exit`.\nλ $ curl \"https://s3.amazonaws.com/aws-cli/awscli-bundle.zip\" -o \"awscli-bundle.zip\"\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100 11.6M  100 11.6M    0     0  78.0M      0 --:--:-- --:--:-- --:--:-- 78.0M\nλ $ unzip awscli-bundle.zip\nArchive:  awscli-bundle.zip\n  inflating: awscli-bundle/install   \n  inflating: awscli-bundle/packages/argparse-1.2.1.tar.gz  \n  inflating: awscli-bundle/packages/rsa-3.4.2.tar.gz  \n  inflating: awscli-bundle/packages/ordereddict-1.1.tar.gz  \n  inflating: awscli-bundle/packages/simplejson-3.3.0.tar.gz  \n  inflating: awscli-bundle/packages/urllib3-1.25.3.tar.gz  \n  inflating: awscli-bundle/packages/python-dateutil-2.6.1.tar.gz  \n  inflating: awscli-bundle/packages/s3transfer-0.2.1.tar.gz  \n  inflating: awscli-bundle/packages/six-1.12.0.tar.gz  \n  inflating: awscli-bundle/packages/python-dateutil-2.8.0.tar.gz  \n  inflating: awscli-bundle/packages/virtualenv-15.1.0.tar.gz  \n  inflating: awscli-bundle/packages/jmespath-0.9.4.tar.gz  \n  inflating: awscli-bundle/packages/urllib3-1.22.tar.gz  \n  inflating: awscli-bundle/packages/botocore-1.12.175.tar.gz  \n  inflating: awscli-bundle/packages/colorama-0.3.9.tar.gz  \n  inflating: awscli-bundle/packages/PyYAML-3.13.tar.gz  \n  inflating: awscli-bundle/packages/pyasn1-0.4.5.tar.gz  \n  inflating: awscli-bundle/packages/docutils-0.14.tar.gz  \n  inflating: awscli-bundle/packages/PyYAML-5.1.tar.gz  \n  inflating: awscli-bundle/packages/futures-3.2.0.tar.gz  \n  inflating: awscli-bundle/packages/awscli-1.16.185.tar.gz  \n  inflating: awscli-bundle/packages/setup/setuptools_scm-1.15.7.tar.gz  \nλ $ ./awscli-bundle/install -b /tmp/bin/aws\nRunning cmd: /usr/bin/python virtualenv.py --no-download --python /usr/bin/python /tmp/.local/lib/aws\nRunning cmd: /tmp/.local/lib/aws/bin/pip install --no-cache-dir --no-index --find-links file:///tmp/awscli-bundle/packages/setup setuptools_scm-1.15.7.tar.gz\nRunning cmd: /tmp/.local/lib/aws/bin/pip install --no-cache-dir --no-index --find-links file:///tmp/awscli-bundle/packages awscli-1.16.185.tar.gz\nYou can now run: /tmp/bin/aws --version\nλ $ /tmp/bin/aws --version\naws-cli/1.16.185 Python/2.7.16 Linux/4.14.123-95.109.amzn2.x86_64 exec-env/AWS_Lambda_nodejs8.10 botocore/1.12.175\nλ $ \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobilg%2Flsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobilg%2Flsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobilg%2Flsh/lists"}