audit

Audit trails and implementing SOX/HIPAA/etc, best practices for sensitive data

淺唱寂寞╮ 提交于 2019-12-03 16:08:27
I consider myself to be relatively proficient in terms of application design, but I've never had to work with sensitive data. I've been wondering about what the best practices were for audit trails and how exactly one should implement them. I don't have to do it right now, but it'd be nice to be able to confidently talk with a medical company if they ask me to do some work for them. Let's say we have a "school" database, with 'teachers', 'classes', 'students' all normalized in a many-to-many 'grades' table. What would you log? Every insert/update on the 'grades table'? Only updates (say, a kid

Counting the number of deleted rows in a SQL Server stored procedure

感情迁移 提交于 2019-12-03 09:18:52
In SQL Server 2005, is there a way of deleting rows and being told how many were actually deleted? I could do a select count(*) with the same conditions, but I need this to be utterly trustworthy. My first guess was to use the @@ROWCOUNT variables - but that isn't set, e.g. delete from mytable where datefield = '5-Oct-2008' select @@ROWCOUNT always returns a 0. MSDN suggests the OUTPUT construction, e.g. delete from mytable where datefield = '5-Oct-2008' output datefield into #doomed select count(*) from #doomed this actually fails with a syntax error. Any ideas? wcm Have you tried SET NOCOUNT

How to implement Auditing/versioning of Table Modifications on PostgreSQL

穿精又带淫゛_ 提交于 2019-12-03 08:26:27
We're implementing a New system using Java/Spring/Hibernate on PostgreSQL. This system needs to make a copy of Every Record as soon as a modification/deletion is done on the record(s) in the Tables(s). Later, the Audit Table(s) will be queried by Reports to display the data to the users. I was planning to implement this auditing/versioning feature by having a trigger on the table(s) which would make a copy of the modified row(deleted row) "TO" a TABLE called ENTITY_VERSIONS which would have about 20 columns called col1, col2, col3, col4, etc which would store the columns from the above Table(s

should I use PUT method for update, if I also update a timestamp attribute

给你一囗甜甜゛ 提交于 2019-12-03 03:41:53
问题 To be more precise: According to rest style, it's generally assummed that POST, GET, PUT, and DELETE http methods should be used for CREATE, READ, UPDATE and DELETE (CRUD) operations. In fact, if we stick to the http methods definition the thing might not be so clear In this article it's explained that: In a nutshell: use PUT if and only if you know both the URL where the resource will live, and the entirety of the contents of the resource. Otherwise, use POST. Mainly because PUT is a much

Oracle - Triggers to create a history row on update

断了今生、忘了曾经 提交于 2019-12-03 01:27:14
First, we currently have the behavior that's desired, but it's not trivial to maintain when any changes to the database are needed. I'm looking for anything simpler, more efficient, or easier to maintain (anything that does any of those 3 would be most welcome). When we perform an update, a history row is created that is a copy of the current row, and the current row's values are then updated. The result being that we have a history record of how the row was before it was updated. Reasoning: We have to be compliant with a number of federal rules, and went this route to have a full audit

Identify the action that is deleting all rows in a table

不羁的心 提交于 2019-12-02 19:03:44
问题 There is SQL Server 2012 database that is used by three different applications. In that database there is a table that contains ~500k rows and for some mysterious reason this table gets emptied every now and then. I think this is possibly caused by: A delete query without a where clause A delete query in a loop gone wild I am trying to locate the cause of this issue by reviewing code but no joy. I need an alternate strategy. I think I can use triggers to detect what/why all rows get deleted

should I use PUT method for update, if I also update a timestamp attribute

寵の児 提交于 2019-12-02 17:32:53
To be more precise: According to rest style, it's generally assummed that POST, GET, PUT, and DELETE http methods should be used for CREATE, READ, UPDATE and DELETE (CRUD) operations. In fact, if we stick to the http methods definition the thing might not be so clear In this article it's explained that: In a nutshell: use PUT if and only if you know both the URL where the resource will live, and the entirety of the contents of the resource. Otherwise, use POST. Mainly because PUT is a much more restrictive verb. It takes a complete resource and stores it at the given URL. If there was a

What's the best way to audit log DELETEs?

ぃ、小莉子 提交于 2019-12-02 08:49:35
问题 The user id on your connection string is not a variable and is different from the user id (can be GUID for example) of your program. How do you audit log deletes if your connection string's user id is static? The best place to log insert/update/delete is through triggers. But with static connection string, it's hard to log who delete something. What's the alternative? 回答1: With SQL Server, you could use CONTEXT_INFO to pass info to the trigger. I use this in code (called by web apps) where I

How to find out IP address of a given push event in Gitlab

。_饼干妹妹 提交于 2019-12-02 04:35:54
It's quite easy to impersonate another user in Gitlab. See this topic for more details. It's possible to find out which user performed a push by examining "Activity" log of a repository. But for audit purposes I'd also like to know the IP address from which the push was done. Is it possible in Gitlab CE/EE? Pushes done through HTTP(S) You can examine access logs of nginx ( nginx/gitlab_access.log ): 192.168.21.150 - johndoe [19/Dec/2016:08:05:58 +0100] "POST /TEST/test.git/git-receive-pack HTTP/1.1" 200 52 "-" "git/2.9.2.windows.1 Pushes done through SSH You can examine gitlab-shell logs (

Differentiate between exit and session timeout

試著忘記壹切 提交于 2019-12-01 22:03:23
问题 I have the following requierements: produce audit log when bash session has been terminated by the user (exit) produce audit log when bash session has timed out Those audit logs must be different. I am playing around with the following script trap.sh : export TMOUT=10 function handle-timeout { echo "Timeout" } function handle-exit { echo "Exit" } trap handle-exit EXIT Now if I do: valegon@precision ~ (master) $ bash valegon@precision ~ (master) $ source trap.sh valegon@precision ~ (master) $