{"id":13572450,"url":"https://github.com/kickstarter/build-ubuntu-ami","last_synced_at":"2025-04-04T10:30:32.998Z","repository":{"id":3546735,"uuid":"4607128","full_name":"kickstarter/build-ubuntu-ami","owner":"kickstarter","description":"Create custom Ubuntu AMIs the hard (secure) way","archived":true,"fork":false,"pushed_at":"2015-11-20T15:19:32.000Z","size":45,"stargazers_count":65,"open_issues_count":4,"forks_count":26,"subscribers_count":122,"default_branch":"master","last_synced_at":"2024-10-31T13:26:04.648Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/kickstarter.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":"2012-06-09T12:38:12.000Z","updated_at":"2023-12-17T03:24:17.000Z","dependencies_parsed_at":"2022-09-06T04:40:31.723Z","dependency_job_id":null,"html_url":"https://github.com/kickstarter/build-ubuntu-ami","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fbuild-ubuntu-ami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fbuild-ubuntu-ami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fbuild-ubuntu-ami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fbuild-ubuntu-ami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kickstarter","download_url":"https://codeload.github.com/kickstarter/build-ubuntu-ami/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223123756,"owners_count":17091169,"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","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":[],"created_at":"2024-08-01T14:01:23.481Z","updated_at":"2024-11-05T05:31:22.209Z","avatar_url":"https://github.com/kickstarter.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Looking for maintainers\n\nI'm no longer maintaining this project. If you're interested in maintaining it, please post a comment [on this issue](https://github.com/kickstarter/build-ubuntu-ami/issues/25).\n\n# Create custom Ubuntu AMIs the hard (secure) way\n\n`build-ubuntu-ami` is a simple tool for making secure, custom Ubuntu images for Amazon EC2 from your local computer.\n\n## Why the hard way?\n\nBooting and logging in to a system offers many opportunities to leak secret credentials (even if you [delete them](http://alestic.com/2009/09/ec2-public-ebs-danger)). Creating an AMI from a pristine image rather than a running root volume obviates the need to remove leaked credentials.\n\nThis program is based on Eric Hammond's blog post [Creating Public AMIs Securely for EC2](http://alestic.com/2011/06/ec2-ami-security), and his shell script [alestic-git-build-ami](https://github.com/alestic/alestic-git/blob/master/bin/alestic-git-build-ami).\n\nFor convenience, this script does not need an AWS EC2 private key \u0026 cert for credentials. It uses the AWS Access Key ID and Secret Access Key instead.\n\n## Install\n\n    # Using rubygems\n    gem install build-ubuntu-ami\n\n## Configuration\n\n`build-ubuntu-ami` relies on Fog. You will need to configure a `~/.fog` file, like so:\n\n```yaml\n:default:\n  :aws_access_key_id: A..your key here...Z\n  :aws_secret_access_key: A..........your key here...............Z\n```\n\n## Basic Usage\n\nif you have not registered an SSH keypair named 'default' with AWS, you will need to supply a `-k` argument.\n\nSee [examples](https://github.com/kickstarter/build-ubuntu-ami/tree/master/examples) of custom build scripts.\n\n    # Create a custom AMI from my_script.sh\n    build-ubuntu-ami my_script.sh\n\n    # Show options\n    build-ubuntu-ami -h\n\n    # Example output\n    $ build-ubuntu-ami -k aaron-rsa -g aaron-test -b demoami custom.sh\n    Configuration:\n      region: us-east-1\n      flavor: m1.small\n      brand: demoami\n      size: 20\n      codename: lucid\n      key_name: aaron-rsa\n      group: aaron-test\n      arch: amd64\n      canonical ami: ami-0baf7662\n      kernel: aki-427d952b\n      description: demoami-lucid-amd64-20120609-0938\n    Launching server...\n    Launched i-dcf145a5; ec2-23-20-92-209.compute-1.amazonaws.com; waiting for it to be available.\n    Attaching volume vol-597aef37\n    waiting for user_data to complete and server to shut down...\n    Follow along by running:\n      ssh -l ubuntu ec2-23-20-92-209.compute-1.amazonaws.com 'tail -f /var/log/user.log'\n    Detaching volume\n    Waiting for volume to detach...\n    Taking snapshot demoami-lucid-amd64-20120609-0938 root volume from vol-597aef37\n    Creating snapshot snap-a4b6e8db\n    Registered imageId ami-abcdef01\n    Deleting vol-597aef37\n    Terminating i-dcf145a5\n\n## How it works\n\nbuild-ubuntu-ami uses the ruby [fog](http://fog.io) library to:\n\n1. Boot an EC2 instance from the Canonical Ubuntu AMI\n2. Download and mount a copy of the Canonical Ubuntu root volume image\n3. Run your custom script in a chrooted environment on that image\n4. Attach an new EBS volume\n5. Copy the customized boot image to the EBS volume\n6. Register an AMI using the customized EBS volume as the root volume.\n\nSince you never booted or logged in to the customized EBS volume, there is reduced risk of leaking confidential information.\n\n## Troubleshooting\n\nIf you're running into an issue where you need to run CLI commands, its helpful\nto ssh to the instance and enter into the chroot environment. Do the following:\n\n   $ cd /mnt/$IMAGE_NAME\n   $ sudo chroot . /bin/bash\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkickstarter%2Fbuild-ubuntu-ami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkickstarter%2Fbuild-ubuntu-ami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkickstarter%2Fbuild-ubuntu-ami/lists"}