Giter VIP home page Giter VIP logo

privx-on-aws's Introduction

PrivX - Just-in-time Access Management

Available as Infrastructure as a Code on AWS for fast deployment.

PrivX is a lean and modern privileged access management solution to automate your AWS, Azure and GCP infrastructure access management in one multi-cloud solution. While it offers super great cloud experience, you can also easily connect your on-prem infrastructure to it for a single pane of glass access control and monitoring. This project further simplifies PrivX on-boarding experience with deployment automation using infrastructure as a code tooling.

Build Status Coverage Status Git Hub Community

Inspiration

Having seen how permanent passwords and left-behind and forgotten SSH keys enable access to critical environments years after they were actually created and needed, we started the PrivX project in order to get rid of the passwords and keys โ€“ to get rid of any permanent access altogether. We wanted to build a solution that only grants access when it's needed & on the level needed. Later on this approached was coined Just-in-Time-Access and the method as Zero Standing Privileges (ZSP) by industry analysts while part of the larger Zero Trust trend of always (re-)verifying a user before any access is granted.

PrivX automates the process of granting and revoking access by integrating & fetching identities and roles from your identity management system (LDAP, AD etc) and ensures your engineering and admin staff have one-click access to the right infrastructure resources at the right access level. You will also get full audit trail and monitoring - vital if you are handling sensitive data or for example open access for third parties to your environment.

Learn more about PrivX and get your trial license.

To learn how PrivX works, please check out this video.

SSH experience

RDP experience

Getting Started

The latest version of Infrastructure as a Code is available at master branch of the repository. All development, including new features and bug fixes, take place on the master branch using forking and pull requests as described in contribution guidelines.

Requirements

  1. We are using AWS CDK and TypeScript to code PrivX infrastructure components. You have to configure your environment with node and npm version 10.x or later and install required components.
## with brew on MacOS
brew install node

## then install CDK
npm install -g typescript ts-node aws-cdk
  1. Obtain access to target AWS Account. You shall have ability to create/delete AWS resources.

  2. Obtain subdomain, domain name(s) and configure AWS Route53 HostedZone. If you have a fresh AWS Account or missing domain name, you can request one from AWS.

Deployments

Use AWS CDK command line tools to deploy PrivX to your AWS Account. Please note, the process consists of multiple stages:

##
## 1. clone privx-on-aws repository locally
git clone https://github.com/SSHcom/privx-on-aws
cd privx-on-aws

##
## 2. pre-config deployment process by configure environment and
##    installing dependent components  
export AWS_ACCESS_KEY_ID=Your-Access-Key
export AWS_SECRET_ACCESS_KEY=Your-Secret-Key
export CDK_DEFAULT_ACCOUNT=Your-Account-Id
export CDK_DEFAULT_REGION=eu-west-1
export AWS_DEFAULT_REGION=eu-west-1
npm install

##
## 3. configure and bootstrap target AWS region with AWS CDK.
##    Please note, the process requires domain name here.
##    the corresponding hosted zone must be properly configured otherwise
##    deployment fails.
cdk bootstrap aws://${CDK_DEFAULT_ACCOUNT}/${CDK_DEFAULT_REGION} \
  -c domain=example.com

##
## 4. deploy PrivX, you need to define a few variables here
##    subdomain   unique name of your privx instance. 
##                DO NOT USE any non-alphabet characters including 
##                punctuation in the subdomain name
##
##    cidr        allocate unique class A network `cidr` block for AWS VPC
##                default value 10.0.0.0/16 fits to majority of deployments
##
##    email       address to deliver CloudWatch alerts
##
##    sshkey      AWS SSH key pair to access PrivX instance for debugging 
##                purpose, keep empty to disable ssh access 
##                See more about ssh key from AWS documentation
##                https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html
##
cdk deploy privx-on-aws \
  -c cidr=10.0.0.0/16 \
  -c subdomain=privx \
  -c domain=example.com \
  -c [email protected] \
  -c sshkey=aws-keypair-name

In few minutes, your own instance of PrivX solution is available. Please check our playbook or raise GitHub issue if you have any troubles with deployment process. The deployment build entire PrivX architecture in your AWS account.

architecture

Open a Web browser with your fully qualified domain name, e.g. https://privx.example.com.

The login credentials for superuser is available in your AWS Account:

  1. Choose right region
  2. Goto AWS Secrets Manager > Secrets > KeyVault...
  3. Scroll to Secret value section
  4. Click Retrieve secret value

In the final step, please obtain a license code to activate your environment.

Next Steps

Bugs

If you experience any issues with the library, please let us know via GitHub issues. We appreciate detailed and accurate reports that help us to identity and replicate the issue.

  • Specify the configuration of your environment. Include which operating system you use and the versions of runtime environments.

  • Attach logs, screenshots and exceptions, in possible.

  • Reveal the steps you took to reproduce the problem, include code snippet or links to your project.

How To Contribute

The project is Apache 2.0 licensed and accepts contributions via GitHub pull requests:

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

The development requires TypeScript and AWS CDK

npm install -g typescript ts-node aws-cdk
git clone https://github.com/SSHcom/privx-on-aws
cd privx-on-aws

npm install
npm run build
npm run test
npm run lint

License

See LICENSE

privx-on-aws's People

Contributors

dependabot[bot] avatar fogfish avatar izareenssh avatar jjh-ssh avatar jukeks avatar juslop1 avatar misainio avatar misainiossh avatar praveenviswanath avatar

Stargazers

 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  avatar  avatar

privx-on-aws's Issues

InDebt alarms are flaky

The threshold and period is misconfigured. The alarms says

Threshold Crossed: 1 datapoint was received for 4 periods and 3 missing datapoints were treated as [NonBreaching].

It should use 5 min period for InDebts alarms

Error when deploying stack

Hello,

When trying to deploy stack I'm getting an error 'Cannot read property 'split' of undefined

Here is log output:

cdk deploy albertprivxtest18 -c cidr=10.100.0.0/16 -c domain=<mydomain.com> -c [email protected] -c sshkey=test-albert -c name=albertprivxtest18 -vvv --debug
CDK toolkit version: 1.108.0 (build b23f781)
Command line arguments: {
  _: [ 'deploy' ],
  c: [
    'cidr=10.100.0.0/16',
    'domain=<mydomain.com>',
    '[email protected]',
    'sshkey=test-albert',
    'name=albertprivxtest18'
  ],
  context: [
    'cidr=10.100.0.0/16',
    'domain=<mydomain.com>',
    '[email protected]',
    'sshkey=test-albert',
    'name=albertprivxtest18'
  ],
  v: 3,
  verbose: 3,
  debug: true,
  defaultAccount: ############,
  defaultRegion: 'us-east-1',
  lookups: true,
  'ignore-errors': false,
  ignoreErrors: false,
  json: false,
  j: false,
  ec2creds: undefined,
  i: undefined,
  'version-reporting': undefined,
  versionReporting: undefined,
  'path-metadata': true,
  pathMetadata: true,
  'asset-metadata': true,
  assetMetadata: true,
  'role-arn': undefined,
  r: undefined,
  roleArn: undefined,
  staging: true,
  'no-color': false,
  noColor: false,
  fail: false,
  all: false,
  'build-exclude': [],
  E: [],
  buildExclude: [],
  ci: false,
  execute: true,
  force: false,
  f: false,
  parameters: [ {} ],
  'previous-parameters': true,
  previousParameters: true,
  '$0': '/usr/local/bin/cdk',
  STACKS: [ 'albertprivxtest18' ],
  'S-t-a-c-k-s': [ 'albertprivxtest18' ]
}
CLI argument context: cidr=10.100.0.0/16
CLI argument context: domain=<mydomain.com>
CLI argument context: [email protected]
CLI argument context: sshkey=test-albert
CLI argument context: name=albertprivxtest18
cdk.json: {
  "app": "ts-node src/index",
  "requireApproval": "never"
}
cdk.context.json: {
  "availability-zones:account=############:region=us-east-1": [
    "us-east-1a",
    "us-east-1b",
    "us-east-1c",
    "us-east-1d",
    "us-east-1e",
    "us-east-1f"
  ],
  "hosted-zone:account=############:domainName=<mydomain.com>:region=us-east-1": {
    "Id": "/hostedzone/Z06499273BCK97TD82YGA",
    "Name": "<mydomain.com>."
  }
}
merged settings: {
  versionReporting: true,
  pathMetadata: true,
  output: 'cdk.out',
  app: 'ts-node src/index',
  requireApproval: 'never',
  context: {
    cidr: '10.100.0.0/16',
    domain: '<mydomain.com>',
    email: '[email protected]',
    sshkey: 'test-albert',
    name: 'albertprivxtest18'
  },
  debug: true,
  assetMetadata: true,
  toolkitBucket: {},
  staging: true,
  bundlingStacks: [ '*' ],
  lookups: true
}
Determining if we're on an EC2 instance.
Does not look like an EC2 instance.
Toolkit stack: CDKToolkit
Setting "CDK_DEFAULT_REGION" environment variable to us-east-1
Resolving default credentials
Retrieved account ID ############ from disk cache
Setting "CDK_DEFAULT_ACCOUNT" environment variable to ############
context: {
  'availability-zones:account=############:region=us-east-1': [
    'us-east-1a',
    'us-east-1b',
    'us-east-1c',
    'us-east-1d',
    'us-east-1e',
    'us-east-1f'
  ],
  'hosted-zone:account=############:domainName=<mydomain.com>:region=us-east-1': { Id: '/hostedzone/Z06499273BCK97TD82YGA', Name: '<mydomain.com>.' },
  cidr: '10.100.0.0/16',
  domain: '<mydomain.com>',
  email: '[email protected]',
  sshkey: 'test-albert',
  name: 'albertprivxtest18',
  'aws:cdk:enable-path-metadata': true,
  'aws:cdk:enable-asset-metadata': true,
  'aws:cdk:version-reporting': true,
  'aws:cdk:bundling-stacks': [ '*' ]
}
outdir: cdk.out
env: {
  CDK_DEFAULT_REGION: 'us-east-1',
  CDK_DEFAULT_ACCOUNT: '############',
  CDK_DEBUG: 'true',
  CDK_CONTEXT_JSON: '{"availability-zones:account=############:region=us-east-1":["us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e","us-east-1f"],"hosted-zone:account=############:domainName=<mydomain.com>:region=us-east-1":{"Id":"/hostedzone/Z06499273BCK97TD82YGA","Name":"<mydomain.com>."},"cidr":"10.100.0.0/16","domain":"<mydomain.com>","email":"[email protected]","sshkey":"test-albert","name":"albertprivxtest18","aws:cdk:enable-path-metadata":true,"aws:cdk:enable-asset-metadata":true,"aws:cdk:version-reporting":true,"aws:cdk:bundling-stacks":["*"]}',
  CDK_OUTDIR: 'cdk.out',
  CDK_CLI_ASM_VERSION: '7.0.0',
  CDK_CLI_VERSION: '1.108.0'
}
Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined
    at Minimatch.match (/usr/local/lib/node_modules/aws-cdk/node_modules/minimatch/minimatch.js:717:9)
    at minimatch (/usr/local/lib/node_modules/aws-cdk/node_modules/minimatch/minimatch.js:107:42)
    at CloudAssembly.selectStacks (/usr/local/lib/node_modules/aws-cdk/lib/api/cxapp/cloud-assembly.ts:121:13)
    at CdkToolkit.selectStacksForDeploy (/usr/local/lib/node_modules/aws-cdk/lib/cdk-toolkit.ts:385:35)
    at CdkToolkit.deploy (/usr/local/lib/node_modules/aws-cdk/lib/cdk-toolkit.ts:111:20)
    at initCommandLine (/usr/local/lib/node_modules/aws-cdk/bin/cdk.ts:210:9)

thank you,

Albert Sheynkman

Deploy without Domain name

As a DevOps
I want to tryout/deploy PrivX without domain name
So that Route53 configuration is not need at beginning.

Fix Retain Policy of EFS

The default AWS CDK implementation uses RETAIN policy. However, our policy is to clean-up everything after the stack is removed.

Native clients is an optional feature

We spawn an instance to public subnet, it enables out of the box support for native clients. However, native clients is an optional feature. We might disable them and run the instance in private subnet.

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.