# Secret Properties

- Package: [Aspire.Hosting.Docker](/reference/api/csharp/aspire.hosting.docker.md)
- Type: [Secret](/reference/api/csharp/aspire.hosting.docker/secret.md)
- Kind: `Properties`
- Members: `4`

Represents a Secret object in a Docker Compose configuration file.

## External

- Name: `External`
- Modifiers: `nullable` `get; set`
- Returns: `bool?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeNodes/Secret.cs)

Indicates whether the secret is managed externally. If set to true, the secret must already exist, as it will not be created or modified.

```csharp
public bool? External { get; set; }
```

## File

- Name: `File`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeNodes/Secret.cs)

Represents the file path associated with the secret. This specifies the location of the file on the host system that will be used as the source for the secret in the container.

```csharp
public string? File { get; set; }
```

## Labels

- Name: `Labels`
- Modifiers: `get; set`
- Returns: `Dictionary<string, string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeNodes/Secret.cs)

Gets or sets a collection of key-value pairs representing metadata or additional information associated with the secret. These labels can be used for categorization, identification, or other purposes as determined by the user.

```csharp
public Dictionary<string, string> Labels { get; set; }
```

## Name

- Name: `Name`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeNodes/Secret.cs)

Gets or sets the name of the secret in the Docker Compose configuration.

```csharp
public string? Name { get; set; }
```
