Skip to content

Commit

Permalink
add all fields, waiting for integration pr to be merged
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanSh committed Nov 12, 2023
1 parent 2f4c8e0 commit 7c8290f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,6 @@ export const AzureCredentialsForm = ({
{setupFormat === AZURE_ARM_TEMPLATE_CREDENTIAL_TYPE && (
<ArmTemplateSetup hasArmTemplateUrl={hasArmTemplateUrl} input={input} />
)}
{/* {setupFormat === AZURE_MANUAL_CREDENTIAL_TYPE && (*/}
{/* <ManualSetup integrationLink={integrationLink} />*/}
{/* )}*/}
{setupFormat === AZURE_MANUAL_CREDENTIAL_TYPE && (
<>
<AzureCredentialTypeSelector
Expand All @@ -370,17 +367,36 @@ export const AzureCredentialsForm = ({
);
}}
/>
{/* <EuiSpacer size="m" />*/}
{/* {group.info}*/}
{/* <EuiSpacer size="m" />*/}
{/* <ReadDocumentation url={integrationLink} />*/}
<EuiSpacer size="l" />
<EuiSpacer size="m" />
<AzureInputVarFields
fields={fields}
onChange={(key, value) => {
updatePolicy(getPosturePolicy(newPolicy, input.type, { [key]: { value } }));
}}
/>
<EuiSpacer size="m" />
{group.info}
<EuiSpacer size="m" />
<EuiText color="subdued" size="s">
<FormattedMessage
id="xpack.csp.azureIntegration.manualCredentialType.documentaion"
defaultMessage="Read the {documentation} for more details"
values={{
documentation: (
<EuiLink
href={ARM_TEMPLATE_EXTERNAL_DOC_URL}
target="_blank"
rel="noopener nofollow noreferrer"
data-test-subj="externalLink"
>
{i18n.translate('xpack.csp.azureIntegration.documentationLinkText', {
defaultMessage: 'documentation',
})}
</EuiLink>
),
}}
/>
</EuiText>
</>
)}
<EuiSpacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ export const getAzureCredentialsFormManualOptions = (): Array<{

export const getInputVarsFields = (input: NewPackagePolicyInput, fields: AzureCredentialsFields) =>
// Object.entries(input.streams[0].vars || {})
Object.entries({ 'azure.credentials.client_id': { value: '' } } || {})
Object.entries(
{
'azure.credentials.tenant_id': { value: '' },
'azure.credentials.client_id': { value: '' },
'azure.credentials.client_secret': { value: '' },
'azure.credentials.client_certificate_path': { value: '' },
'azure.credentials.client_certificate_password': { value: '' },
'azure.credentials.client_username': { value: '' },
'azure.credentials.client_password': { value: '' },
} || {}
)
.filter(([id]) => id in fields)
.map(([id, inputVar]) => {
const field = fields[id];
Expand All @@ -50,14 +60,12 @@ export const getInputVarsFields = (input: NewPackagePolicyInput, fields: AzureCr

export const DEFAULT_AZURE_MANUAL_CREDENTIALS_TYPE = 'service_principal_with_client_secret';

const TemporaryKeysDescription = (
const ManagedIdentityDescription = (
<div>
<EuiText color={'subdued'} size="s">
<FormattedMessage
id="xpack.csp.awsIntegration.temporaryKeysDescription"
defaultMessage="You can configure temporary security credentials in AWS to last for a specified duration. They
consist of an access key ID, a secret access key, and a security token, which is typically
found using GetSessionToken."
id="xpack.csp.azureIntegration.managedIdentityDescription"
defaultMessage="Ensure the agent is deployed on a resource that supports managed identities (e.g., Azure Virtual). No explicit credentials need to be provided; Azure handles the authentication."
/>
</EuiText>
</div>
Expand All @@ -70,7 +78,6 @@ export const getAzureCredentialsFormOptions = (): AzureOptions => ({
fields: {},
},
service_principal_with_client_secret: {
info: TemporaryKeysDescription,
label: i18n.translate('xpack.csp.awsIntegration.temporaryKeysLabel', {
defaultMessage: 'Service principal with Client Secret',
}),
Expand All @@ -86,7 +93,6 @@ export const getAzureCredentialsFormOptions = (): AzureOptions => ({
},
},
service_principal_with_client_certificate: {
info: TemporaryKeysDescription,
label: i18n.translate('xpack.csp.awsIntegration.temporaryKeysLabel', {
defaultMessage: 'Service principal with Client Certificate',
}),
Expand All @@ -107,7 +113,6 @@ export const getAzureCredentialsFormOptions = (): AzureOptions => ({
},
},
service_principal_with_client_username_and_password: {
info: TemporaryKeysDescription,
label: i18n.translate('xpack.csp.awsIntegration.temporaryKeysLabel', {
defaultMessage: 'Service principal with Client Username and Password',
}),
Expand Down

0 comments on commit 7c8290f

Please sign in to comment.