mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-09 21:14:22 +00:00
chore(m365powershell): manage encryption from plaintext password (#7784)
Co-authored-by: Daniel Barranquero <danielbo2001@gmail.com>
This commit is contained in:
co-authored by
Daniel Barranquero
parent
99164ce93e
commit
36aaec8a55
@@ -195,7 +195,7 @@ export const addCredentialsProvider = async (formData: FormData) => {
|
||||
client_secret: formData.get("client_secret"),
|
||||
tenant_id: formData.get("tenant_id"),
|
||||
user: formData.get("user"),
|
||||
encrypted_password: formData.get("encrypted_password"),
|
||||
password: formData.get("password"),
|
||||
};
|
||||
} else if (providerType === "gcp") {
|
||||
// Static credentials configuration for GCP
|
||||
@@ -298,7 +298,7 @@ export const updateCredentialsProvider = async (
|
||||
client_secret: formData.get("client_secret"),
|
||||
tenant_id: formData.get("tenant_id"),
|
||||
user: formData.get("user"),
|
||||
encrypted_password: formData.get("encrypted_password"),
|
||||
password: formData.get("password"),
|
||||
};
|
||||
} else if (providerType === "gcp") {
|
||||
// Static credentials configuration for GCP
|
||||
|
||||
@@ -86,7 +86,7 @@ export const UpdateViaCredentialsForm = ({
|
||||
client_secret: "",
|
||||
tenant_id: "",
|
||||
user: "",
|
||||
encrypted_password: "",
|
||||
password: "",
|
||||
}
|
||||
: providerType === "gcp"
|
||||
? {
|
||||
@@ -153,8 +153,8 @@ export const UpdateViaCredentialsForm = ({
|
||||
message: errorMessage,
|
||||
});
|
||||
break;
|
||||
case "/data/attributes/secret/encrypted_password":
|
||||
form.setError("encrypted_password", {
|
||||
case "/data/attributes/secret/password":
|
||||
form.setError("password", {
|
||||
type: "server",
|
||||
message: errorMessage,
|
||||
});
|
||||
|
||||
@@ -85,7 +85,7 @@ export const ViaCredentialsForm = ({
|
||||
client_secret: "",
|
||||
tenant_id: "",
|
||||
user: "",
|
||||
encrypted_password: "",
|
||||
password: "",
|
||||
}
|
||||
: providerType === "gcp"
|
||||
? {
|
||||
@@ -152,8 +152,8 @@ export const ViaCredentialsForm = ({
|
||||
message: errorMessage,
|
||||
});
|
||||
break;
|
||||
case "/data/attributes/secret/encrypted_password":
|
||||
form.setError("encrypted_password", {
|
||||
case "/data/attributes/secret/password":
|
||||
form.setError("password", {
|
||||
type: "server",
|
||||
message: errorMessage,
|
||||
});
|
||||
|
||||
@@ -64,14 +64,14 @@ export const M365CredentialsForm = ({
|
||||
/>
|
||||
<CustomInput
|
||||
control={control}
|
||||
name="encrypted_password"
|
||||
name="password"
|
||||
type="password"
|
||||
label="Encrypted Password"
|
||||
label="Password"
|
||||
labelPlacement="inside"
|
||||
placeholder="Enter the Password"
|
||||
variant="bordered"
|
||||
isRequired
|
||||
isInvalid={!!control._formState.errors.encrypted_password}
|
||||
isInvalid={!!control._formState.errors.password}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -224,7 +224,7 @@ export type M365Credentials = {
|
||||
client_secret: string;
|
||||
tenant_id: string;
|
||||
user: string;
|
||||
encrypted_password: string;
|
||||
password: string;
|
||||
secretName: string;
|
||||
providerId: string;
|
||||
};
|
||||
|
||||
@@ -142,7 +142,7 @@ export const addCredentialsFormSchema = (providerType: string) =>
|
||||
.nonempty("Client Secret is required"),
|
||||
tenant_id: z.string().nonempty("Tenant ID is required"),
|
||||
user: z.string().nonempty("User is required"),
|
||||
encrypted_password: z
|
||||
password: z
|
||||
.string()
|
||||
.nonempty("Encrypted Password is required"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user