-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: add a reason field before PAM account access #6096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { Knex } from "knex"; | ||
|
|
||
| import { TableName } from "../schemas"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ignore comment placement. |
||
|
|
||
| export async function up(knex: Knex): Promise<void> { | ||
| if (await knex.schema.hasTable(TableName.PamSession)) { | ||
| const hasCol = await knex.schema.hasColumn(TableName.PamSession, "reason"); | ||
| if (!hasCol) { | ||
| await knex.schema.alterTable(TableName.PamSession, (t) => { | ||
| t.text("reason").nullable(); | ||
| }); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| export async function down(knex: Knex): Promise<void> { | ||
| if (await knex.schema.hasTable(TableName.PamSession)) { | ||
| const hasCol = await knex.schema.hasColumn(TableName.PamSession, "reason"); | ||
| if (hasCol) { | ||
| await knex.schema.alterTable(TableName.PamSession, (t) => { | ||
| t.dropColumn("reason"); | ||
| }); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| export enum PamAccountPolicyRuleType { | ||
| CommandBlocking = "command-blocking", | ||
| SessionLogMasking = "session-log-masking" | ||
| SessionLogMasking = "session-log-masking", | ||
| RequireReason = "require-reason" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,7 +92,8 @@ export const BasePamAccountSchemaWithResource = BasePamAccountSchema.extend({ | |
| domain: PamDomainsSchema.pick({ id: true, name: true, domainType: true }).nullable().optional(), | ||
| policyName: z.string().nullable().optional(), | ||
| lastRotationMessage: z.string().nullable().optional(), | ||
| rotationStatus: z.string().nullable().optional() | ||
| rotationStatus: z.string().nullable().optional(), | ||
| requireReason: z.boolean().default(false) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is always false on create/update responses since only getById computes it? can we also compute on create and update? since we are returning policy info already |
||
| }); | ||
|
|
||
| export const BaseCreatePamAccountSchema = z.object({ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore comment placement.
Can we limit the amount of text to a maximum? How do you think it is necessary to show the full reason?