All Projects → JordanReiter → let-me-in

JordanReiter / let-me-in

Licence: MIT license
Simple web app for adding/removing EC2 ssh access to an IP

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to let-me-in

Graylog2 Images
Ready to run machine images
Stars: ✭ 234 (+444.19%)
Mutual labels:  aws-ec2
awesome-aws-research
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources for Academic Researchers new to AWS
Stars: ✭ 41 (-4.65%)
Mutual labels:  aws-ec2
aws-map
Make a network graph of an AWS region
Stars: ✭ 79 (+83.72%)
Mutual labels:  security-groups
ami-spec
Acceptance testing your AMIs
Stars: ✭ 47 (+9.3%)
Mutual labels:  aws-ec2
amigen7
Set of tools to provide automation of tasks for creating STIG-partitioned EL7 AMIs
Stars: ✭ 33 (-23.26%)
Mutual labels:  aws-ec2
ec2details
API providing AWS EC2 Instance Type Data
Stars: ✭ 37 (-13.95%)
Mutual labels:  aws-ec2
Chaos Ssm Documents
Collection of AWS SSM Documents to perform Chaos Engineering experiments
Stars: ✭ 225 (+423.26%)
Mutual labels:  aws-ec2
nebula
EC2 Self-Management Portal
Stars: ✭ 30 (-30.23%)
Mutual labels:  aws-ec2
AmbulanceLocator
Ambulance Locator lets the user find nearby ambulances and as well as call the nearby ambulances.
Stars: ✭ 15 (-65.12%)
Mutual labels:  aws-ec2
sgCheckup
sgCheckup generates nmap output based on scanning your AWS Security Groups for unexpected open ports.
Stars: ✭ 77 (+79.07%)
Mutual labels:  security-groups
amazon-cloudwatch-auto-alarms
Automatically create and configure Amazon CloudWatch alarms for EC2 instances, RDS, and AWS Lambda using tags for standard and custom CloudWatch Metrics.
Stars: ✭ 52 (+20.93%)
Mutual labels:  aws-ec2
introspector
A schema and set of tools for using SQL to query cloud infrastructure.
Stars: ✭ 61 (+41.86%)
Mutual labels:  security-groups
T-Watch
Real Time Twitter Sentiment Analysis Product
Stars: ✭ 20 (-53.49%)
Mutual labels:  aws-ec2
React Cnodejs.org
Material UI version of cnodejs.org, the biggest Node.js Chinese community.
Stars: ✭ 242 (+462.79%)
Mutual labels:  aws-ec2
aws-power-toggle
web UI and API for quickly starting and stopping AWS environments
Stars: ✭ 40 (-6.98%)
Mutual labels:  aws-ec2
Installations mac ubuntu windows
Installations for Data Science. Anaconda, RStudio, Spark, TensorFlow, AWS (Amazon Web Services).
Stars: ✭ 231 (+437.21%)
Mutual labels:  aws-ec2
cfn-ami-to-mapping
Generate your CloudFormation RegionMap automatically
Stars: ✭ 34 (-20.93%)
Mutual labels:  aws-ec2
shelvery-aws-backups
Automating EBS RDS EC2 backups on lambda
Stars: ✭ 31 (-27.91%)
Mutual labels:  aws-ec2
ec2-metadata-filter
Enhance the security of the EC2 metadata service. (Obsolete thanks to Instance Metadata Service Version 2, see note in README)
Stars: ✭ 32 (-25.58%)
Mutual labels:  aws-ec2
ecs-autoscale
A framework that runs on AWS Lambda for autoscaling ECS clusters and services
Stars: ✭ 69 (+60.47%)
Mutual labels:  aws-ec2

AWS, Let Me In

build Test coverage contributors Package license

AWS, Let Me In solves the problem of providing SSH access to EC2 instances without having to use either the CLI or the AWS Console website. This is especially useful if you have users who should have SSH access but who don't have any access to administrative functions in AWS.

Let Me In is inspired by the traditional technique of port knocking where users would open a port by visiting other closed ports in a particular sequence. In this setup, visiting a (ideally) password protected page and then clicking on the "Add Access for <ip>" button will add the user's current IP address to a specified security group.

Getting Started

To use this app, install it in the target directory

cd /path/to/dir
git clone https://github.com/JordanReiter/let-me-in.git let-me-in
cd let-me-in
# set up a virtualenv -- strongly recommended!
virtualenv-2.7 . # Python 3 is supported by the app, but mod_wsgi uses Python 2.7 by default
source bin/activate
pip install -r requirements.txt
# if you are using flask_cas for authentication:
pip install flask_cas

AWS, Let me in is a standard WSGI app, so you can use your preferred method of connecting to the app.

Here is a sample configuration using mod_wsgi on Apache httpd:

<VirtualHost *>
    WSGIDaemonProcess let-me-in python-home=/var/www/python-environments/let-me-in
    WSGIScriptAlias /letmein /var/www/python-environments/let-me-in/letmein/letmein.wsgi
    <Directory /var/www/python-environments/let-me-in>
        WSGIProcessGroup let-me-in
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

Settings

The following settings should be provided either as environmental variables or as entries in a .env file located inside of the letmein directory:

  • AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID - required if you have the app installed on a server without an active IAM role. Otherwise, it uses standard boto3, which should work without credentials if an IAM role is correctly configured for the server.
  • SECRET_KEY -- a random sequence of characters to be used as a secret key. I believe this is standard to Flask.
  • GROUPS_WITH_ACCESS -- if you are using group-based authentication, these are the groups that can add IPs to the security group
  • `GROUPS_WITH_ADMIN -- these groups are able to affect other users -- specifically, they are able to clear all IPs saved to the Security group. Note that it only affects security groups for the targeted port and does not include IP ranges with more than one IP address.
  • SECURITY_GROUP -- the security group that is changed by the app. The AWS user associated with the app must have the correct permissions for modifying groups.
  • AUTH_BACKEND -- the authentication backend to use for access to the app. The only secure, active backend currently available is auth.backends.cas.CASAuth.

Authentication Backends

The backends folder includes a base class that can be extended. Any authentication backend you create must implement the following methods:

  • has_access -- true if the user should have access to the page, false if they shouldn't
  • login_required -- should return a decorator that redirects to a login page if the user needs to sign in, or just returns the request if the user should have access
  • logout_url -- returns the url the user should be sent to on logout_url

You can look at both auth/backends/cas.py and auth/backends/noauth.py for code that implements these (and other) functions.

Credits

Thanks to Paulo Poiati and his article on testing flashes <http://blog.paulopoiati.com/2013/02/22/testing-flash-messages-in-flask/>

Thanks to Peter Hansen for the ReverseProxied class <http://flask.pocoo.org/snippets/35/>.


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].