Giter Club home page Giter Club logo

lastkeypair's People

Contributors

aidansteele avatar rupertbg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lastkeypair's Issues

Make voucher key shorter

  • Could be a restricted subset of base64 that is double-clickable
  • Don't need to base32 encode something that is already base64-encoded

Support multi-LKP lambda scenario

Avoiding cross-region dependencies is generally preferable - LKP should support a use-case with the Lambda deployed to multiple regions.

Considerations:

  • KMS key will probably also be deployed to each corresponding region
  • LKP client needs to know which regional APIs and KMS and Lambda ARNs to use
  • Custom authoriser could say "hey, wrong region - use this one instead" and client retries with other deployment? Not sure
  • Maybe the Lambda could be invoked twice - first time simply tells client KMS key ARN it should use, second time works as per usual. Think about security implications

Lkp should be able to return a cert-per-jumphost

Admins will probably want to disable SSH shell login on SSH jumphosts, so a cert without user-pty would be nice. But right now one cert is shared for both the target instance and the intermediate jumphosts. Fix that

Audit trail UI

  • CLI mode
  • Web UI
  • Store data into DynamoDB
  • Maybe have scheduled/manually-triggered reconciliation with CloudTrail (using Athena?)
  • Show "active" sessions

braindump from readme

lkp
  token
    create      # creates a token that can be authenticated by kms
    validate    # validates aforementioned token 
  ssh
    sign        # uses CA key to sign user or host key
    exec        # ask lambda func to sign ssh pubkey
    proxy       # to be used as ssh_config ProxyCommand. maybe allows user@i-<instance>?
  setup         # creates kms key+policy, ssh CA key, uploads lambda zip, everything
    --dry-run   # just emits cfn files, zip, ssh key, etc
    --do-it     # actually performs all the actions
  ec2
    sign        # sends host key to lambda, replaces instance key with signed version
    trustca     # adds 'cert-authority' flag to ~/.ssh/authorized_keys entry
  vouch         # create token to send out-of-bound to person who needs 2-operator login
    --recipient
    --duration
    --host
  lambda        # fulfils the lambda func, is passed fn args in stdin by thin wrapper

Should be able to add extra key=val pairs to encryption context

While the custom authoriser is able to accept/reject a connection to (e.g.) a prod box based on its EC2 tags, it would be nice for this to be logged in CloudTrail. So we should support passing in arbitrary key=val pairs which

  • get logged to CloudTrail by means of inclusion in the encryption context
  • get passed to the custom authoriser
  • don't collide with the existing encryption context (maybe prefix user-submitted keys)
  • demonstrate how an admin can mandate the presence of a key=val pair using conditions in the KMS key policy

ssh exec should be able to determine the IP to connect to

Don't make the user type in the IP address when we can figure it out based on the instance ARN. Considerations:

  • The instance might not have a public IP address, or a routable private IP address. Maybe we can either have the LKP lambda provide a ProxyCommand (or jump host or whatevs) to use or the user can provide their own in their ~/.lkp/config.yml file. Advantage of the Lambda doing it is that the administrator could specify different jump hosts for different instance regions, accounts, etc.

User cert: "principals" UX issues

  • Undocumented golang LkpUserCertAuthorizationRequest.Principals property should be removed.
  • If LkpUserCertAuthorizationResponse.Principals is absent, LKP should populate with RemoteInstanceArn
  • Document the above behaviour

Return Multiple Certificates when Proxying

When using jumpboxes the authoriser should have a way to return different CertificateOptions for each connection in the chain. E.g. the JumpBox will require permit-port-forwarding to work, but maybe it isn't needed for the final connection

Lambda error not visible to user

Lambda got this, but user not told of any error:

Decryption error: AccessDeniedException: The ciphertext refers to a customer master key that does not exist, does not exist in this region, or you are not allowed to access.

Automated E2E test from travis

  • Build app and lambda package
  • Upload zip and update cfn
  • SSH into an instance that just says "success!" and terminates the session
  • Have travis match the output to expected output, like we do for ecs-run-task

Completely transparent execution

Look into whether ProxyCommand, ssh-agent or something can let us transparently do ssh user@ip or even ssh user@instance-id instead of the current lkp ssh exec -- dance

Rework principal type

Right now it's just "user" (and soon to add "host") but we also want to add some kind of "namespace" (e.g. AWS account id) to the encryption context

Windows support

Windows powershell remoting allows authentication using SSL client certificates. We could add support for this

Add example of using EC2 instance tags for authorisation

Support access-control "policies"

Maybe something like JS in (a file on S3|parameter store|an environment variable).

JS would have access to (at least) info about the user and maybe info about the target instance. Could fetch target instance's tags (preferably on-demand)

Some ARN validation

E.g. We know that KMS keys should begin with aws:arn:kms:<region>:<accountid> where regions alway follow a certain format and account IDs are always numeric. Return a nice error message rather than:

2018/09/11 10:35:48 Encryption error: RequestError: send request failed
caused by: Post https://kms.us-east-1a.amazonaws.com/: dial tcp: lookup kms.us-east-1a.amazonaws.com on 10.224.50.10:53: no such host

Which is caused by an accidental us-east-1a as the region.

Support key rotation

When instances do an lkp host setup, it could install both the "active" CA pubkey and an "inactive" one (or more) ready for rotation when the time comes.

Consider supporting multiple keypairs

Maybe we want to use a different keypair per account, or per region, or per whatever. Maybe authoriser lambda could instruct the LKP lambda which keypair CA to use. Related-ish to #29

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.