Giter VIP home page Giter VIP logo

sarlicensecheck's Introduction

SARChecker

This project contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.

  • SARChecker - folder with source code for SARChecker Lambda Function
  • events - Invocation events that you can use to invoke the function.
  • tests - Unit tests for the application code.
  • template.yaml - A template that defines the application's AWS resources.

The application uses several AWS resources, including Lambda functions and an SNS Topic. These resources are defined in the template.yaml file in this project. You can update the template to add AWS resources through the same deployment process that updates your application code.

SARChecker is a basic validation script that is used to validate the Serverless Application Repository applications from within your company are not shared and cannot be shared outside your organization. If SARChecker finds an application that does not follow these rules, it will send a message via SNS. Currently, the setup defines an sms message will be sent from SNS to a phone that is configured.

SARChecker is run on an event, currently configured for every hour. You can use sites like (AWS Docs)[https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html] to set your crontab appropriately.

How SARChecker works

SARChecker uses the serverlessrepo APIs to:

  1. Retrieve a listing of your Serveless Application Repository applications
  2. For each application, it: A. Checks policy to make sure it is not shared for Action:DEPLOY with a Principal of * with no OrgID B. Checks to make sure there is no License URL or SpdxId (these are needed to share the application outside of your organization)

If an application is found to invalidate the policy, an SNS message will be sent to the phone number that is registered from the template.

Configuration

  1. Set the phone number to receive the SNS messages in template.yaml

Change the DefaultValue of the PhoneNumber variable in the Parameters section to be the phone you wish to receive messages on

  1. Set the timeout for the Lambda function in template.yaml

Change the DefaultValue of the Timeoutsetting variable in the Parameters section to be the appropriate timeout for you. This is currently configured for 15 minutes.

Deploy the SARChecker Application

  1. Clone this Repo
  2. Use the sam build to build the application locally (sam build)
  3. Use sam package to build an output template file (sam package --s3-bucket --output-template-file <outputtemplate.yaml>)
  4. Use sam deploy to have the application deployed to your account (sam deploy --template-file <outputtemplate.yaml> --stackname --capabilities CAPABILITY_IAM)

Cleanup the SARChecker Application

aws cloudformation delete-stack --stackname

sarlicensecheck's People

Watchers

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