This sample app is written in next.js, covering both client & backend side integrations.
- run
yarnornpm i - make sure you install aws-cli on your machine from this guide: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
- run
aws configureto connect to aws with your access-key - In Transmit Security Admin Portal - create a new application to get client credentials as specified here
- In
src/utils/config.tsfile (backend config) - configure yourtransmitClientId&transmitClientSecretfrom the previous step, configure yourpolicyStoreIdfrom AWS Verified Permissions and the relevant AWSregion. - run the development server:
npm run dev
# or
yarn devOpen http://localhost:3000 with your browser to see the result.
- Go inside verified-permissions in aws console, create your policy store and create the two separate policies:
// Permitting any user to perform login action to any account
permit (
principal,
action in [Action::"login"],
resource
);
// Permitting specific 'demo-user-id' to perform ‘withdraw’ action in specific resource account, with additional condition on Detection and Response riskScore result
permit (
principal == User::"demo-user-id",
action in [Action::"withdraw"],
resource == Account::"account-demo-user-id"
) when { context.riskScore <= 66 };- Go back to the application, press 'Set User', then press Login/Withdraw buttons to trigger actions and see the authorization result.