# Create S3 pre-signed URL

Next step is to generate a pre-signed URL so we can upload data to it.

Review the MinIO Python SDK here: <https://docs.min.io/docs/python-client-api-reference.html>

The example code we're going to use is  **get\_presigned\_url.py** from <https://github.com/minio/minio-py/blob/master/examples/get_presigned_url.py>

You'll need Python3, and the minio library

```
$ sudo apt install python3-pip
$ pip3 install minio
```

Edit this python script in your favourite editor.

```
from minio import Minio

client = Minio(
    "minio.yourdomain.com.au:9000",
    access_key="default_username",
    secret_key="default_password",
    secure=True,
)
```

If you're still using the default credentials we set earlier (minioadmin/minioadmin) then enter those here. It's obviously best practice to not use the default credentials.

```
$ python3 get_presigned_url.py
```

If the script executed successfully without errors, you'll have three URLs printed on the screen. We're interested in the second URL as this is what we'll be using to upload our data using UAC. If you don't have a need for the other two URLs and intend to administer objects manually via the web interface, then comment out the other two DELETE/GET URL generation sections.

The name of the object created with this URL is 'my-object'. If you want a custom name, you'll need to edit the python script and change 'my-object' to something else. Likewise, if you want to store data in a different bucket, replace 'my-bucket' with another name. If you were using this in production you'd prompt for the desired values to store client data in specific buckets, with specific names.

You should have a pre-signed URL which looks similar to the following;

```
https://minio.yourdomain.com.au:9000/my-bucket/my-object?response-content-type=application%2Fjson&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=[redacted]
```

You've now generated a pre-signed URL using MinIO's python SDK, and you're ready to upload your UAC collection.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.iblue.team/incident-response-1/unix-like-artifacts-collector-uac/create-s3-pre-signed-url.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
