[1/3] Issue #360: Anonymize image files

Submitted by Harshavardhan Unnibhavi on June 22, 2019, 9:37 a.m.

Details

Message ID 20190622093732.9024-1-hvubfoss@gmail.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Harshavardhan Unnibhavi June 22, 2019, 9:37 a.m.
This commit adds the anonymize action to the CRIT tool to generate anonymised images from real ones

Signed-off-by: Harshavardhan Unnibhavi <hvubfoss@gmail.com>
---
 lib/py/cli.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/py/cli.py b/lib/py/cli.py
index abaf0720..d3242f08 100755
--- a/lib/py/cli.py
+++ b/lib/py/cli.py
@@ -272,6 +272,9 @@  def explore_rss(opts):
 			print('%-24s%s' % (pstr, vstr))
 
 
+def anonymize(opts):
+	pass
+
 
 explorers = { 'ps': explore_ps, 'fds': explore_fds, 'mems': explore_mems, 'rss': explore_rss }
 
@@ -329,6 +332,17 @@  def main():
 	show_parser.add_argument('--nopl', help = 'do not show entry payload (if exists)', action = 'store_true')
 	show_parser.set_defaults(func=decode, pretty=True, out=None)
 
+	# Anonymize
+	anon_parser = subparsers.add_parser('anonymize',
+			help = "anonymize binary images to remove certain information")
+	anon_parser.add_argument('-i',
+				'--in',
+				help = 'path to directory containing images that are not anonymized')
+	anon_parser.add_argument('-o',
+				'--out',
+				help = 'path to directory where the anonymized images must be stored')
+	anon_parser.set_defaults(func=anonymize)
+
 	opts = vars(parser.parse_args())
 
 	if not opts:

Comments

Radostin Stoyanov June 24, 2019, 3:06 p.m.
Hi Harshavardhan,

Thank you for working on this project idea. I have added inline some 
suggestions that might be helpful.

On 22/06/2019 10:37, Harshavardhan Unnibhavi wrote:
> This commit adds the anonymize action to the CRIT tool to generate anonymised images from real ones
>
> Signed-off-by: Harshavardhan Unnibhavi <hvubfoss@gmail.com>
Could you please change the commit message to indicate the component 
that is being modified (e.g. "crit: Add anonymize option"), wrap the 
body at 72 characters, and add a brief explanation of why this option is 
needed (e.g. Image files may contain sensitive data which is not 
acceptable to be included when reporting a BUG.).

There is an excellent article about writing good commit messages:

https://chris.beams.io/posts/git-commit

> ---
>   lib/py/cli.py | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/lib/py/cli.py b/lib/py/cli.py
> index abaf0720..d3242f08 100755
> --- a/lib/py/cli.py
> +++ b/lib/py/cli.py
> @@ -272,6 +272,9 @@ def explore_rss(opts):
>   			print('%-24s%s' % (pstr, vstr))
>   
>   
> +def anonymize(opts):
> +	pass
> +
>   
>   explorers = { 'ps': explore_ps, 'fds': explore_fds, 'mems': explore_mems, 'rss': explore_rss }
>   
> @@ -329,6 +332,17 @@ def main():
>   	show_parser.add_argument('--nopl', help = 'do not show entry payload (if exists)', action = 'store_true')
>   	show_parser.set_defaults(func=decode, pretty=True, out=None)
>   
> +	# Anonymize
> +	anon_parser = subparsers.add_parser('anonymize',
> +			help = "anonymize binary images to remove certain information")
> +	anon_parser.add_argument('-i',
> +				'--in',
> +				help = 'path to directory containing images that are not anonymized')
> +	anon_parser.add_argument('-o',
> +				'--out',
> +				help = 'path to directory where the anonymized images must be stored')
> +	anon_parser.set_defaults(func=anonymize)
> +
>   	opts = vars(parser.parse_args())
>   
>   	if not opts:
Harshavardhan Unnibhavi June 25, 2019, 1:25 p.m.
On Mon, Jun 24, 2019 at 8:36 PM Radostin Stoyanov <rstoyanov1@gmail.com> wrote:
>
> Hi Harshavardhan,
>
> Thank you for working on this project idea. I have added inline some
> suggestions that might be helpful.
>
> On 22/06/2019 10:37, Harshavardhan Unnibhavi wrote:
> > This commit adds the anonymize action to the CRIT tool to generate anonymised images from real ones
> >
> > Signed-off-by: Harshavardhan Unnibhavi <hvubfoss@gmail.com>
> Could you please change the commit message to indicate the component
> that is being modified (e.g. "crit: Add anonymize option"), wrap the
> body at 72 characters, and add a brief explanation of why this option is
> needed (e.g. Image files may contain sensitive data which is not
> acceptable to be included when reporting a BUG.).
>
> There is an excellent article about writing good commit messages:
>
> https://chris.beams.io/posts/git-commit
Cool I will check it out!
>
> > ---
> >   lib/py/cli.py | 14 ++++++++++++++
> >   1 file changed, 14 insertions(+)
> >
> > diff --git a/lib/py/cli.py b/lib/py/cli.py
> > index abaf0720..d3242f08 100755
> > --- a/lib/py/cli.py
> > +++ b/lib/py/cli.py
> > @@ -272,6 +272,9 @@ def explore_rss(opts):
> >                       print('%-24s%s' % (pstr, vstr))
> >
> >
> > +def anonymize(opts):
> > +     pass
> > +
> >
> >   explorers = { 'ps': explore_ps, 'fds': explore_fds, 'mems': explore_mems, 'rss': explore_rss }
> >
> > @@ -329,6 +332,17 @@ def main():
> >       show_parser.add_argument('--nopl', help = 'do not show entry payload (if exists)', action = 'store_true')
> >       show_parser.set_defaults(func=decode, pretty=True, out=None)
> >
> > +     # Anonymize
> > +     anon_parser = subparsers.add_parser('anonymize',
> > +                     help = "anonymize binary images to remove certain information")
> > +     anon_parser.add_argument('-i',
> > +                             '--in',
> > +                             help = 'path to directory containing images that are not anonymized')
> > +     anon_parser.add_argument('-o',
> > +                             '--out',
> > +                             help = 'path to directory where the anonymized images must be stored')
> > +     anon_parser.set_defaults(func=anonymize)
> > +
> >       opts = vars(parser.parse_args())
> >
> >       if not opts: