mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-02 07:50:00 -08:00
Translated ['.github/pull_request_template.md', 'src/pentesting-cloud/az
This commit is contained in:
@@ -2,39 +2,34 @@
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
## Basic Information
|
||||
## Informazioni di base
|
||||
|
||||
DigitalOcean Functions, also known as "DO Functions," is a serverless computing platform that lets you **run code without having to worry about the underlying infrastructure**. With DO Functions, you can write and deploy your code as "functions" that can be **triggered** via **API**, **HTTP requests** (if enabled) or **cron**. These functions are executed in a fully managed environment, so you **don't need to worry** about scaling, security, or maintenance.
|
||||
DigitalOcean Functions, conosciuto anche come "DO Functions," è una piattaforma di computing serverless che ti consente di **eseguire codice senza dover preoccuparti dell'infrastruttura sottostante**. Con DO Functions, puoi scrivere e distribuire il tuo codice come "funzioni" che possono essere **attivate** tramite **API**, **richieste HTTP** (se abilitate) o **cron**. Queste funzioni vengono eseguite in un ambiente completamente gestito, quindi **non devi preoccuparti** di scalabilità, sicurezza o manutenzione.
|
||||
|
||||
In DO, to create a function first you need to **create a namespace** which will be **grouping functions**.\
|
||||
Inside the namespace you can then create a function.
|
||||
In DO, per creare una funzione devi prima **creare uno spazio dei nomi** che sarà **un gruppo di funzioni**.\
|
||||
All'interno dello spazio dei nomi puoi quindi creare una funzione.
|
||||
|
||||
### Triggers
|
||||
|
||||
The way **to trigger a function via REST API** (always enabled, it's the method the cli uses) is by triggering a request with an **authentication token** like:
|
||||
### Attivatori
|
||||
|
||||
Il modo **per attivare una funzione tramite REST API** (sempre abilitato, è il metodo utilizzato dal cli) è attivare una richiesta con un **token di autenticazione** come:
|
||||
```bash
|
||||
curl -X POST "https://faas-lon1-129376a7.doserverless.co/api/v1/namespaces/fn-c100c012-65bf-4040-1230-2183764b7c23/actions/functionname?blocking=true&result=true" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Basic MGU0NTczZGQtNjNiYS00MjZlLWI2YjctODk0N2MyYTA2NGQ4OkhwVEllQ2t4djNZN2x6YjJiRmFGc1FERXBySVlWa1lEbUxtRE1aRTludXA1UUNlU2VpV0ZGNjNqWnVhYVdrTFg="
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Basic MGU0NTczZGQtNjNiYS00MjZlLWI2YjctODk0N2MyYTA2NGQ4OkhwVEllQ2t4djNZN2x6YjJiRmFGc1FERXBySVlWa1lEbUxtRE1aRTludXA1UUNlU2VpV0ZGNjNqWnVhYVdrTFg="
|
||||
```
|
||||
|
||||
To see how is the **`doctl`** cli tool getting this token (so you can replicate it), the **following command shows the complete network trace:**
|
||||
|
||||
Per vedere come lo strumento cli **`doctl`** ottiene questo token (in modo da poterlo replicare), il **seguente comando mostra l'intera traccia di rete:**
|
||||
```bash
|
||||
doctl serverless connect --trace
|
||||
```
|
||||
|
||||
**When HTTP trigger is enabled**, a web function can be invoked through these **HTTP methods GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS**.
|
||||
**Quando il trigger HTTP è abilitato**, una funzione web può essere invocata attraverso questi **metodi HTTP GET, POST, PUT, PATCH, DELETE, HEAD e OPTIONS**.
|
||||
|
||||
> [!CAUTION]
|
||||
> In DO functions, **environment variables cannot be encrypted** (at the time of this writing).\
|
||||
> I couldn't find any way to read them from the CLI but from the console it's straight forward.
|
||||
> Nelle funzioni DO, **le variabili di ambiente non possono essere criptate** (al momento della scrittura di questo documento).\
|
||||
> Non sono riuscito a trovare alcun modo per leggerle dalla CLI, ma dalla console è semplice.
|
||||
|
||||
**Functions URLs** look like this: `https://<random>.doserverless.co/api/v1/web/<namespace-id>/default/<function-name>`
|
||||
|
||||
### Enumeration
|
||||
**Gli URL delle funzioni** sembrano così: `https://<random>.doserverless.co/api/v1/web/<namespace-id>/default/<function-name>`
|
||||
|
||||
### Enumerazione
|
||||
```bash
|
||||
# Namespace
|
||||
doctl serverless namespaces list
|
||||
@@ -53,12 +48,7 @@ doctl serverless activations result <activation-id> # get only the response resu
|
||||
|
||||
# I couldn't find any way to get the env variables form the CLI
|
||||
```
|
||||
|
||||
> [!CAUTION]
|
||||
> There **isn't metadata endpoint** from the Functions sandbox.
|
||||
> Non **c'è un endpoint di metadata** dal sandbox delle Functions.
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user