Giter Club home page Giter Club logo

context-based-restrictions's Introduction

Tests of IBM Cloud context-based-restrictions (CBR) security feature

This repository holds files for testing context-based restrictions in IBM Cloud.

The overall scenario is shown here. A Python script is deployed as job to IBM Cloud Code Engine. A jobrun, running the script, succeeds - all items in the bucket cbrbucket can be retrieved. With the deployed restrictions in place, running the same script from other environments fails with the access denied (see screenshots below). scenario overview

Access from Code Engine succeeds: access from Code Engine succeeds

Access from another compute environment fails. Access is denied: access from other environment is denied

Python script to list COS buckets and bucket items

The script listFiles.py is based on code samples from the IBM Cloud Object Storage documentation. It takes an API key, the COS instance CRN, and optionally the endpoint URL from environment variables or an .env file. Then, it lists the available storage buckets in the COS instance, thereafter those items / files in the bucket cbrbucket.

You can use the provided Dockerfile to containerize the script. Thereafter, configure it as IBM Cloud Code Engine job by defining environment variables for the same API key, COS instance CRN and endpoint URL data.

Deploy CBR network zone and access rule with Terraform

See the files in terraform. Adapt the file terraform.tfvars to your IBM Cloud API key and the name of the Cloud Object Storage instance.

License

See the LICENSE file.

context-based-restrictions's People

Contributors

data-henrik avatar

Stargazers

 avatar

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.