Coder Social home page Coder Social logo

balena-aws-lambda's People

Contributors

balena-ci avatar chrisys avatar davidtucker avatar kb2ma 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

Watchers

 avatar  avatar  avatar

balena-aws-lambda's Issues

Risk: over-authorization of AWS IoT policy

We are a security research team and we recently discovered that there is an over-authorization security issue with this project's IoT policy.
The affected file is as following:

1. balena-aws-lambda/policy.json

Won't run due to obsolete dependencies and usage

I was unable to run the project locally due to outdated dependencies and usage. I have not yet tried to run on AWS as a Lambda function. I was able to work around these issues to the point that I could create a thing with its certificates and policies, as well as generate the environment variables in balenaCloud. Below are the problems I encountered.

Use of resin-sdk
resin-sdk has been replaced with balena-sdk. Updated package.json and use in resin-integrator/index.js. Also in that file, updated how environment variables are set to use resin.models.device.envVar.set()

Use of promisifyAll()
Both resin-integrator/index.js and resin-aws/index.js use Promise.promisifyAll(). However, promisifyAll() fails because the libraries to update already include functions that end with "Async". I used a different suffix to work around the problem, but there may be a better way.

Other issues

  • updated nodejs version in .env
  • updated URL for AWS root CA

Failure with cloud function when account uses 2FA

When a device attempts to provision via the server side code, the server code first uses the balena API to validate that the device UUID is valid. The first step in validation is to login to the user's account with their email address and password. However if 2FA is enabled, this attempt fails with an error like,

Error: BalenaRequestError: Request error: Unauthorized

The solution is to login here with an API key token, via the sdk auth.loginWithToken() function.

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.