Skip to main content

Bucket condivisi

Per poter condividere un bucket in cubbit si ha bisogno delle seguenti cose:

  • Account "master" con cui creare il bucket
  • Un account ospite

Procedura

Creazione account ospite (se non già presente)

GUIDA

Creazione del bucket

Con l'account master creare un bucket

è bene salvarsi di valori di: CRN bucket e CRN objet, che ci serviranno per creare le rules

Creazione rules

nella creazione delle rules c'è un bug per cui è impossibile creare una nuova policy custom, ne va prima clonata una di quelle di base (esempio Readonly)

dobbiamo salvare la regola così com'è dopo aver assegnato il nome e poi andarla a modificare

Esempio di regola RW
{
  "syntax_version": "2022-10-07",
  "statement": [
    {
      "effect": "allow",
      "action": [
        "iam:ListUsers"
      ],
      "resource": [
        "*"
      ]
    },
    {
      "effect": "allow",
      "action": [
        "iam:ManageUser",
        "iam:GetUser",
        "iam:CreateKey",
        "iam:ListKeys",
        "iam:ManageKey"
      ],
      "resource": [
        "crn:eu-west-1:iam:00000000-0000-0000-0000-000000000000::c9560b04-b751-41e5-b01a-b3f417f3fa36:user:self"
      ]
    },
    {
      "effect": "allow",
      "action": [
        "iam:GetProject"
      ],
      "resource": [
        "*"
      ]
    },
    {
      "effect": "allow",
      "action": [
        "s3:ListObjects",
        "s3:PutObject",
        "s3:PutObjectAcl",
        "s3:GetObject",
        "s3:GetObjectVersion",
        "s3:GetObjectTagging",
        "s3:GetObjectAcl",
        "s3:GetObjectVersionAcl",
        "s3:GetObjectRetention",
        "s3:GetObjectLegalHold",
        "s3:DeleteObject",
        "s3:DeleteObjectVersion"
      ],
      "resource": [
        "crn:eu-west-1:s3:00000000-0000-0000-0000-000000000000::c9560b04-b751-41e5-b01a-b3f417f3fa36:object:gisfo-app/*"
      ]
    },
    {
      "effect": "allow",
      "action": [
        "s3:PutBucketAcl",
        "s3:ListBucket",
        "s3:ListBucketVersions",
        "s3:GetBucketVersioning",
        "s3:GetEncryptionConfiguration",
        "s3:GetBucketOwnershipControls",
        "s3:GetLifecycleConfiguration",
        "s3:GetBucketObjectLockConfiguration",
        "s3:GetBucketAcl",
        "s3:GetBucketLocation"
      ],
      "resource": [
        "crn:eu-west-1:s3:00000000-0000-0000-0000-000000000000::c9560b04-b751-41e5-b01a-b3f417f3fa36:bucket:gisfo-app"
      ]
    },
    {
      "effect": "allow",
      "action": [
        "s3:CreateBucket",
        "s3:ListAllMyBuckets"
      ],
      "resource": [
        "*"
      ]
    }
  ]
}
Esempio di regola Read Only
{
  "syntax_version": "2022-10-07",
  "statement": [
    {
      "effect": "allow",
      "action": [
        "iam:ListUsers"
      ],
      "resource": [
        "*"
      ]
    },
    {
      "effect": "allow",
      "action": [
        "iam:ManageUser",
        "iam:GetUser",
        "iam:CreateKey",
        "iam:ListKeys",
        "iam:ManageKey"
      ],
      "resource": [
        "crn:eu-west-1:iam:00000000-0000-0000-0000-000000000000::c9560b04-b751-41e5-b01a-b3f417f3fa36:user:self"
      ]
    },
    {
      "effect": "allow",
      "action": [
        "iam:GetProject"
      ],
      "resource": [
        "*"
      ]
    },
    {
      "effect": "allow",
      "action": [
        "s3:ListBucket",
        "s3:ListBucketVersions",
        "s3:GetObject",
        "s3:GetObjectVersion",
        "s3:GetObjectTagging",
        "s3:GetObjectAcl",
        "s3:GetObjectVersionAcl",
        "s3:GetObjectRetention",
        "s3:GetObjectLegalHold",
        "s3:GetBucketVersioning",
        "s3:GetEncryptionConfiguration",
        "s3:GetBucketOwnershipControls",
        "s3:GetLifecycleConfiguration",
        "s3:GetBucketObjectLockConfiguration",
        "s3:GetBucketAcl",
        "s3:GetBucketLocation"
      ],
      "resource": [
        "crn:eu-west-1:s3:00000000-0000-0000-0000-000000000000::c9560b04-b751-41e5-b01a-b3f417f3fa36:bucket:3eye-ortofoto",
        "crn:eu-west-1:s3:00000000-0000-0000-0000-000000000000::c9560b04-b751-41e5-b01a-b3f417f3fa36:object:3eye-ortofoto/*"
      ]
    },
    {
      "effect": "allow",
      "action": [
        "s3:ListAllMyBuckets"
      ],
      "resource": [
        "*"
      ]
    }
  ]
}

La parte che va sostituita con i valori CRN salvati prima è quella delle resource (NB possono esserci N bucket nella lista, non necessariamnte uno come in questi esempi)

Invito utente esterno

va creato l'invito per l'utente guest registrato in precedenza e va assegnata una regola

in ultimo l'utente guest deve confermare il join al progetto che arriverà via mail

è compito dell'account guest creare le API per applicazioni cli