Code Monkey home page Code Monkey logo

arca's Introduction

arca

A chest or strong box used in ancient times as a receptacle for money or valuables.

Get certificate from Conjur server

openssl s_client -showcerts -connect localhost:443 < /dev/null 2> /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > conjur_cert.pem

Initialize the environment

arca init

Clone the origin project

arca create <projectname>

Show make rules

make help

Build the go source

make clean build

Add Conjur Policy

Login as admin:

conjur logon --self-signed -a prima -p CyberArk_2023! -b https://ec2-34-204-42-151.compute-1.amazonaws.com -l admin
make policy

Login as new host:

conjur logon --self-signed -a prima -b https://ec2-34-204-42-151.compute-1.amazonaws.com -l host/originApplication/560732129735/originApplication
# Accept certificate, replace rc files. Then, copy the cert to the cert directory.
cp ~/conjur-prima.pem ./cert/conjur-dev.pem

Set secrets:

conjur set-secret -i originApplication/connectionstring -v connectionstring
conjur set-secret -i originApplication/username -v username
conjur set-secret -i originApplication/password -v password

Connection string:

prima.cvrj95nytzmd.us-west-2.rds.amazonaws.com

Username:

postgres

Password:

odijfa-TrHa0C0a3PoQSXAd0OPS

Check policy:

make check

Build and deploy the lambda

make lambda
make apply

View Conjur user info

conjur whoami && conjur list > list.txt && ../bin/tree

Add Function URL

In AWS -> Lambda, go to Configuration -> Function URL and Create function URL.

Links

Initialize Go Module

cd <appName>/src/main
go mod init github.com/jimnewpower/arca
go mod tidy

cd <appName>/src/<appName>
go mod init primalimited.com/origin

go get github.com/aws/aws-lambda-go/lambda
go get github.com/cyberark/conjur-api-go/conjurapi
go get github.com/cyberark/conjur-api-go/conjurapi/authn
go get github.com/lib/pq

Build

cd <appName>/src/<appName>
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ../../bin/origin origin.go
chmod u+x ../../bin/origin
cd ../..

rm -rf archive
mkdir archive
cd archive
cp ../bin/origin .
cp ../cert/conjur-dev.pem .
zip origin.zip origin conjur-dev.pem
rm origin conjur-dev.pem
less origin.zip
cd ..

arca's People

Contributors

jimnewpower avatar

Watchers

 avatar

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.